question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Library uses obsolete Windows function

See original GitHub issue

In the file: https://github.com/melanchall/drywetmidi/blob/71bc4cabe87e8c69cba90a4f2211753cfe838118/DryWetMidi/Devices/Clock/TickGenerator/MidiTimerWinApi.cs

Library uses obsolete Windows function:

public static extern uint timeSetEvent(uint uDelay, uint uResolution, TimeProc lpTimeProc, IntPtr dwUser, uint fuEvent);

https://docs.microsoft.com/en-us/previous-versions/dd757634(v=vs.85) https://docs.microsoft.com/en-us/windows/win32/multimedia/starting-a-single-timer

It would be recommended to replace method with new equivalent before method get deprecated and removed from future versions of Windows. As Windows 10 is a subject to obligatory auto-update, all Windows 10 users will be affected in the future.

More informations on the available Times in C#: https://docs.microsoft.com/en-us/dotnet/api/system.threading.timer?view=net-5.0#remarks

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:13 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
operatortwocommented, Nov 17, 2021

What is Midi-Driver and Midi-Port?

A Midi-Driver is sometimes provided by the manufacturer of a Midi-Hardware for the use of device-specific applications or “to ensure optimal performance”. This drivers are normally downloaded an installed by the user. For example: Yamaha USB-MIDI Driver V3.1.4 for Win 10/8.1/8/7 (64-bit) M-Audio MIDISPORT Windows Driver v6.1.3 (for MIDISPORT 4x4 and MIDISPORT 4x4 Anniversary Edition)

Do you mean plugging hardware devices allows set timer interval down to 1 ms?

No. It seems to be more a special function in some, but not all USB-MIDI drivers. After an application causes the driver to connect to the device, a TimerQueueTimer can be created with an interval of 1 ms (measured), after the connection is closed, a new Timer can not anymore be set to a lower interval than 15.6 ms.

I used a litte application that creates a timer, does a loop count 100 and shows the elapsed milliseconds between all timerticks in a list. Beside this, I used a second application to connect a Midi-device. It didn’t matter which application I used, the change (in the measuring app) always occurred when I selected / deselected a device with one of the drivers mentioned above. (in the second app) I used a MidiLibrarian, a Midi monitor tool, a Midi monitor store app , a free sequencer… Usually the Midi-device can be selected in the ‘Setup’ menu. I also made a short test with DWM, I got fast results between ‘Playback.Start’ and ‘OutputDevice.Dispose’ (always in the case I selected a device with one of the corresponding drivers above)

0reactions
melanchallcommented, Nov 18, 2021

Yes, I know what a device driver is. I thought you mean some special devices and software.

Hmm, very interesting. Maybe driver does some OS level manipulations internally. Thanks for the info!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Obsolete functions
Lists the obsolete functions that have been deprecated and removed from the Microsoft C runtime library (CRT).
Read more >
Deprecated Windows Library Feature
Starting with Windows 8.1, the Windows Library feature has been replaced with the Skydrive, so, by default, after creating the library, it is...
Read more >
Microsoft Windows library files - Wikipedia
The Microsoft Windows operating system supports a form of shared libraries known as "dynamic-link libraries", which are code libraries that can be used...
Read more >
ctypes — A foreign function library for Python
Accessing the standard C library through cdll.msvcrt will use an outdated version of the library that may be incompatible with the one being...
Read more >
Lambda runtimes
Lambda does not block invocations of functions that use deprecated runtime. Function invocations continue indefinitely after the runtime reaches end of support.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found