KeppySoftware / OmniMIDI

A software MIDI synthesizer for professional use.
https://keppysoftware.github.io/
Other
374 stars 39 forks source link

"It looks like something unregistered the x86/x64 version of the driver..." #191

Closed lewisakura closed 3 years ago

lewisakura commented 3 years ago

Problem Identical for #188, except I am running the latest OmniMIDI.

Regardless of what I try, OmniMIDI's drivers will not stay registered, and I cannot use OmniMIDI at all.

Steps to reproduce

  1. Open the configurator
  2. See error

Expected behavior OmniMIDI's drivers would stay registered and OmniMIDI would be usable.

Screenshots/Videos

Environment

Additional context I have tried both accepting the configurator's offer and using Extensions > OmniMIDI register tool > Register the driver but neither work.

KaleidonKep99 commented 3 years ago

Is the driver available in device manager? image

lewisakura commented 3 years ago

Yep. But for reference, in PFA, it does not show up, WinMM patched or not.

Also, when inspecting the properties of the device...

KaleidonKep99 commented 3 years ago

Yep. photo 1 But for reference, in PFA, it does not show up, WinMM patched or not. photo 2

Also, when inspecting the properties of the device... photo 3

The last screenshot is completely normal, since it's supposed to be a dummy device to make Windows register the user-mode driver to the Drivers32 key.

It seems like you might have a registry problem, where OmniMIDI is reading the wrong settings from its registry key.

I suggest doing a clean install of the driver, from "Tools" > "Delete OmniMIDI's user data". image

lewisakura commented 3 years ago

The last screenshot is completely normal, since it's supposed to be a dummy device to make Windows register the user-mode driver to the Drivers32 key.

Ah, gotcha.

It seems like you might have a registry problem, where OmniMIDI is reading the wrong settings from its registry key.

I suggest doing a clean install of the driver, from "Tools" > "Delete OmniMIDI's user data".

Funnily enough, that actually was one of the things I tried, but it didn't seem to do anything, really. It re-ran the installer, but all of the user data and whatnot still seemed to be there (my soundfont lists were still there). Even after a reboot, it didn't work. Could it be that this doesn't work correctly in a non-elevated environment? My user account itself doesn't have admin privileges but there is another account on the system that does which is what I am using.

KaleidonKep99 commented 3 years ago

Oh so you offload all the admin permissions to a secondary account? I'll test in a VM to see how OM behaves on my end.

lewisakura commented 3 years ago

Yeah, security reasons mainly. Can't be blowing up everything now.

KaleidonKep99 commented 3 years ago

I see what the issue is.

When the setup is elevated, it's actually running on the admin account, it's not running on the local one that requested admin privileges.

I'll fix it asap.

KaleidonKep99 commented 3 years ago

It should work now, try using "Tools" > "Delete OmniMIDI's user data" again.

lewisakura commented 3 years ago

Doesn't seem to be working unfortunately after updating. SoundFont list is preserved and I'm still getting the registration warnings.

KaleidonKep99 commented 3 years ago

Does the driver work on patched applications at least?

lewisakura commented 3 years ago

I will take that as a no.

Text form of information ``` Faulting application name: PFA-1.1.0-x86_64.exe, version: 0.0.0.0, time stamp: 0x539377b0 Faulting module name: OmniMIDI.dll, version: 13.8.4.0, time stamp: 0x60b91f20 Exception code: 0xc0000409 Fault offset: 0x000000000005408c Faulting process ID: 0x388c Faulting application start time: 0x01d758a8574b5e2e Faulting application path: E:\Stuff\Piano From Above\PFA-1.1.0-x86_64.exe Faulting module path: C:\WINDOWS\system32\OmniMIDI.dll Report ID: 19a11266-d48e-4504-9dc4-3cbf673732ca Faulting package full name: Faulting package-relative application ID: ```
lewisakura commented 3 years ago

From a debug session, it appears there's a null pointer being passed to RegCloseKey() which causes the crash. Unfortunately this disassembly isn't very useful to me, maybe it'll be more useful to you?

PFA-1.1.0-x86_64.dmp.zip

KaleidonKep99 commented 3 years ago

It's still not writing the proper registry keys... Ok now that you are on 18.3.4, try this: image

If it still doesn't work, then use regedit to manually delete the OmniMIDI key from HKEY_CURRENT_USER\SOFTWARE\, then run the setup again.

lewisakura commented 3 years ago

I'm afraid not. I deleted both mine and the administrator's OmniMIDI keys and unfortunately it didn't work. Tried running PFA as administrator to see if it would help but to no avail.

KaleidonKep99 commented 3 years ago

Ok now it should work, try using that option in the configurator again. (It seems to work on my Windows 8.1 VM with the same environment, limited user with separate admin account)

lewisakura commented 3 years ago

🎉

Seems to still struggle on unpatched apps, but patched ones are perfect.

KaleidonKep99 commented 3 years ago

🎉

Seems to still struggle on unpatched apps, but patched ones are perfect.

I don't know why it's having issues on unpatched apps, but that might not be OmniMIDI's fault, but rather Windows' PnP system. I'll look into it, and see if I can reproduce that issue as well.

KaleidonKep99 commented 3 years ago

Closed for inactivity.

lewisakura commented 3 years ago

This issue still seems to be showing up in 14.x. Same unregistered driver notification, same issues on unpatched apps.

I'm trying to use Embers, and even after attempting both WinMM patches, OmniMIDI will not function, which is a bit of a showstopper for me.

KaleidonKep99 commented 3 years ago

This issue still seems to be showing up in 14.x. Same unregistered driver notification, same issues on unpatched apps.

I'm trying to use Embers, and even after attempting both WinMM patches, OmniMIDI will not function, which is a bit of a showstopper for me.

Here's something you could try, but it's a bit cumbersome to do...

Steps:

  1. Go to Device Manager, and uninstall the "OmniMIDI for Windows NT" device.
  2. After that, trigger a complete reinstall of the driver by opening the configurator, and by going to "Tools > Reinstall OmniMIDI with default settings".
  3. Once the setup opens, quit it.
  4. Go to the Control Panel and uninstall OmniMIDI.
  5. Restart the computer.
  6. Reinstall OmniMIDI again, then restart.

Tell me if that changes anything.

lewisakura commented 3 years ago

Hmm, okay.

I've gone through all the steps and now the configurator isn't complaining about drivers being unregistered, however most apps still don't recognize OmniMIDI as an output unless they're patched with WinMM (e.g., Piano From Above works fine since it was patched but Embers still doesn't recognize it).

KaleidonKep99 commented 3 years ago

Now try running the troubleshooter (Run the first two steps), then restart and try using OM again.

lewisakura commented 3 years ago

OmniMIDI isn't recognized as an output still, unfortunately.

KaleidonKep99 commented 3 years ago

Restart your PC once again, then run this and send a screenshot. TestAppMIDI.zip

lewisakura commented 3 years ago

OmniMIDI.dll only shows up as midi10.

KaleidonKep99 commented 3 years ago

Ok. Can you enable the debug log, and re-run the testing tool I sent? It should create a log with the same name as the tool, once it's done running.

lewisakura commented 3 years ago

I assume you mean this one: In which case, it did not appear to create a log file in the logs folder.

KaleidonKep99 commented 3 years ago

Uhm ok. Try this beta build of OmniMIDI.

OmniMIDISetup.zip

lewisakura commented 3 years ago

Still no success. Running the beta build, rebooted, tried launching my MIDI app. Only patched PFA works.

KaleidonKep99 commented 3 years ago

Ok ok. Try this.

The configurator will complain about the driver not being registered. Let it register the driver then restart.

OmniMIDISetup.zip

lewisakura commented 3 years ago

Installed that version, ran the configurator, let it re-register the drivers, and then rebooted. Embers and REAPER (which I will add to my tests now) still can't find OmniMIDI. Patched PFA works as usual.

OmniMIDI also does not show up in the test app you sent me earlier, and no longer shows up as midi10.

KaleidonKep99 commented 3 years ago

midi10?????? That's not how it's supposed to work... Weird. Try this!

After installing this version, open the configurator, then go to "Extensions > OmniMIDI register tool > Unregister the driver". Once the driver is unregistered, register it again by going to "Extensions > OmniMIDI register tool > Register the driver".

OmniMIDISetup.zip

KaleidonKep99 commented 3 years ago

After a deep analysis of the PnP system, and some research on obscure Chinese and Russian forums, I've finally understood how the MIDI registration system works.

The user-mode MIDI drivers need to register themselves using the PnP system, and that was something I already addressed a few releases ago, to fix the unregistering issue that arose in Windows 10 2004+. What I didn't understand yet is that the driver needs to search for an available midiX key, and then it'll have to query Windows to take over it. The main issue with this approach is that the midiX value is very limited in size. You can only have 10 devices, including the default midi one that handles all the hardware MIDI devices through wdmaud.drv. Those hardware MIDI devices can be USB pianos or synthesizers, MIDI controllers etc... Software MIDI drivers, both in the user and kernel space, need to register themselves using an ID ranging from midi1 to midi9 (and not midi31 like I thought, anything above midi9 is ignored), and if the user runs out of slots, the driver won't be able to register itself.

I updated the registration system in the latest release of OmniMIDI to reflect these findings.

lewisakura commented 3 years ago

Do you want me to grab PR47?

lewisakura commented 3 years ago

Well I'm glad to say that PR47 fixed it. :) Had a bit of a moment during the troubleshooter step (errored the first time saying it didn't have any slots to register to, running it a second time fixed it), but other than that it works flawlessly.

KaleidonKep99 commented 3 years ago

I'm glad to hear that! I'll see if I can convince LyricWulf into adding KDMAPI support to Embers.

lewisakura commented 3 years ago

Good luck, and thanks for the great driver as always!