hydrogen-music / hydrogen

The advanced drum machine for Linux, macOS, and Windows
http://www.hydrogen-music.org
GNU General Public License v2.0
1.05k stars 173 forks source link

Hydrogen crashing on startup. #873

Closed Zday89 closed 4 years ago

Zday89 commented 4 years ago

Hydrogen version * : 0.9.7 - 1.0.0-Beta2 Operating system + version : Windows 10 64 bit Audio driver + version : NA


Hydrogen previously worked great, but seemingly at random it stopped. I get the splash screen and then it crashes. This happens on versions 0.9.7 through 1.0.0-beta2. I've checked the Windows event viewer and it says libportaudio-2.dll is the faulting module. I temporarily fixed this issue and got it started by downloading PortAudio.dll from the portaudio website and replaced libportaudio-2.dll with that file. That allowed me to open and use Hydrogen, but only on version 0.9.7. This did not work with 1.0.0 at all. It did, however, make some features buggy. For example, I tried to save an audio library and the program crashed and now it will not open anymore, this time with the faulting module "libhydrogen-core-0.9.7.dll."

Now I can't use the program at all. Even after uninstalling completely using Revo Uninstaller to clear any registry values and leftover files. Hydrogen 0.9.6 alpha1 appears to work with no modification after installing.

Here's the windows event log for a crash using a clean install of version 1.0.0-beta2:

Faulting application name: hydrogen.exe, version: 0.0.0.0, time stamp: 0x5e7a7416
Faulting module name: libportaudio-2.dll, version: 0.0.0.0, time stamp: 0x5c8ec46f
Exception code: 0x40000015
Fault offset: 0x000000000001f9f6
Faulting process id: 0x31c4
Faulting application start time: 0x01d62bac89b815c3
Faulting application path: C:\Program Files\Hydrogen\hydrogen.exe
Faulting module path: C:\Program Files\Hydrogen\libportaudio-2.dll
Report Id: 9fe0553e-b5a7-4b06-a51d-da0992677e65
Faulting package full name: 
Faulting package-relative application ID: 
cme commented 4 years ago

Are you able to try removing or renaming the file .hydrogen\hydrogen.conf in your user home directory? If the config file ends up containing invalid audio configuration, it's possible that would cause Hydrogen to crash on startup (and not give you the opportunity to try different settings).

Zday89 commented 4 years ago

Are you able to try removing or renaming the file .hydrogen\hydrogen.conf in your user home directory? If the config file ends up containing invalid audio configuration, it's possible that would cause Hydrogen to crash on startup (and not give you the opportunity to try different settings).

I've completely removed all files associated with Hydrogen and reinstalled with no luck. I did just try renaming that specific file though and I'm still crashing on 1.0.0 with the faulting file still being libportaudio-2.dll. When I try to launch Hydrogen without the .conf file it just creates a new one then crashes after the splash screen.

cme commented 4 years ago

Wow! This is a weird one! If you don't mind, would you be able to capture the debug output and post it somewhere? You should be able to get it with something like:

"C:\Program Files\Hydrogen\hydrogen.exe" -V Debug > C:\debug.txt"

from a command prompt.

elpescado commented 4 years ago

Hi,

I'd advise against swapping dlls. They might or might not be compatible and might actually make matters worse.

Zday89 commented 4 years ago

Wow! This is a weird one! If you don't mind, would you be able to capture the debug output and post it somewhere? You should be able to get it with something like:

"C:\Program Files\Hydrogen\hydrogen.exe" -V Debug > C:\debug.txt"

from a command prompt.

Yeah I thought it's pretty strange too. Here's the output file from running the debug command. debug.txt

cme commented 4 years ago

Okay, so it's definitely in initialising libportaudio.dll that it's failing. In your removing hydrogen completely, did you remove both 0.9.7 and 1.0.0-beta2 completely, including those dlls? Could there be an old one left in C:\Windows\System or C:\Windows\System32?

I'm trying to work out some sequence of events that might cause a failure like this and the only thing that comes to mind is that libportaudio.dll is broken. I'd like to attempt to try and reproduce this (as well as hopefully help you get past it!) so I've tried looking on portaudio.com but cannot actually find any Windows binaries there to download, only sources!

Zday89 commented 4 years ago

Okay, so it's definitely in initialising libportaudio.dll that it's failing. In your removing hydrogen completely, did you remove both 0.9.7 and 1.0.0-beta2 completely, including those dlls? Could there be an old one left in C:\Windows\System or C:\Windows\System32?

I'm trying to work out some sequence of events that might cause a failure like this and the only thing that comes to mind is that libportaudio.dll is broken. I'd like to attempt to try and reproduce this (as well as hopefully help you get past it!) so I've tried looking on portaudio.com but cannot actually find any Windows binaries there to download, only sources!

I just completely removed both Hydrogen 1.0.0-beta2 and Hydrogen 0.9.6 alpha1, checked both the system32 and system folders for any leftover libportaudio.dll files and didn't find any in there. I then ran a full system search for libportaudio and only found one in my LMMS folder and I moved my .hydrogen folder to my desktop so it shouldn't interfere with anything. I then restarted and installed Hydrogen 1.0.0-beta2 64bit and it didn't seem to do anything new. Immediate crash on the splash screen and what appears to be an identical debug.txt output.

I can't seem to find the page I downloaded the libportaudio.dll from but it was from the official libportaudio website. They do have an archive page where you can download it from though. But the problems with hydrogen were happening well before I downloaded that dll file. The only thing I can think that may have started this is I installed voicemeeter banana. I can't say that's definitely what did it but that's the only thing that I can recall installing between hydrogen working and not working. I've since removed voicemeeter though and that didn't seem to help the situation at all.

elpescado commented 4 years ago

Again, I recommend against replacing dll files. C++ does not define standard ABI, so binaries produced by different toolchains (compilers etc) or even different versions of the same toolchain may not be compatible. It's best to use libraries built with the same compiler as Hydrogen itself.

Windows builds of Hydrogen are cross-compiled using mxe and use libraries provided by that project: https://github.com/mxe/mxe/blob/master/src/portaudio.mk

elpescado commented 4 years ago

BTW. It's possible to use PortAudio on Linux/Mac. It's disabled by default because all relevant audio APIs (ALSA/Jack/PulseAudio/CoreAudio) are supported directly.

cme commented 4 years ago

@Zday89 Out of interest, is your LMMS using PortAudio (SDL is the default rather than PortAudio) and if not, does it work when changed to use PortAudio?

It looks like there's other issues around PortAudio on other applications too: https://sourceforge.net/p/butt/bugs/26/

Zday89 commented 4 years ago

@Zday89 Out of interest, is your LMMS using PortAudio (SDL is the default rather than PortAudio) and if not, does it work when changed to use PortAudio?

It looks like there's other issues around PortAudio on other applications too: https://sourceforge.net/p/butt/bugs/26/

Honestly I'm not completely sure. I've spent the past couple days reformatting the main SSD on my PC and reinstalling everything so I no longer have LMMS installed. I had a couple of other issues going on with other programs and I decided reformatting would be the easiest course of action after a virus scan came back with nothing.

One of the first programs I reinstalled on my fresh Windows 10 install is Hydrogen 1.0.0 Beta-2 just to see if reformatting fixed it and I somehow am getting apparently the same issue. I try to launch Hydrogen and I see the splash screen and it crashes. I'm totally at a loss as to why Hydrogen would work on my PC then suddenly would stop.

One other interesting thing is I installed the same version of Hydrogen on my laptop which is an Acer Aspire VX 15 and the 1.0.0 beta-2 64 bit works totally fine.

Zday89 commented 4 years ago

So in a last ditch effort to figure out this problem along with other problems, I started removing hardware from my PC and upon removing my Elgato HD 60 Pro capture card, Hydrogen 1.0.0 beta-2 is working just fine. I'm not sure what correlation there is between the two but that seems to have fixed my problem... Somehow... If anybody wants any more info, tell me how to get it and I'll be happy to provide any kind of logs or info about what was going on. Seems like a very strange bug.

Edit: I put the Elgato capture card back in to be 100% sure that's the culprit and Hydrogen is back to not starting. I suspect it's something either with the PCIe slot or the Elgato itself. Maybe a BIOS configuration regarding that PCIe slot but I can't say for sure.

Just for the sake of being thorough, my full PC specs are: Motherboard: Asrock Steel Legend BM450m CPU: AMD Ryzen 7 3700x RAM: 4x8gb Corsair Dominator Platinum 3200mhz (Clocked at 2133mhz as my Motherboard doesn't support RAM overclocking on all 4 dimms) GPU: EVGA RTX 2080 FTW3 Hydrocopper PSU: Corsair RM750i

I have my PCIe slots configured as: Elgato in the top PCIE1 (PCIe 2.0 x1 slot) is used for PCI Express x1 lane width cards. GPU in the 2nd PCIE2 (PCIe 3.0 x16 slot) is used for PCI Express x16 lane width graphics cards.

Hopefully this sheds some light on what's going on.

elpescado commented 4 years ago

What's that capture card? Does it pretend to be a sound card? Maybe Hydrogen tries to use it as output device and as it isn't ordinary sound card, Hydrogen gets confused and crashes.

Zday89 commented 4 years ago

What's that capture card? Does it pretend to be a sound card? Maybe Hydrogen tries to use it as output device and as it isn't ordinary sound card, Hydrogen gets confused and crashes.

That's an interesting point. I hadn't thought of that.

It's mainly for capturing and streaming video / audio from games consoles. Has a single HDMI in and a single HDMI out. Here's a link to the product from the website so you can get specifics about it but basically captures the HDMI input, encodes it and either saves it to your computer or streams it out using software and sends the HDMI signal out to a monitor or TV while you're playing.

https://www.elgato.com/en/gaming/game-capture-hd60-pro

cme commented 4 years ago

What's that capture card? Does it pretend to be a sound card? Maybe Hydrogen tries to use it as output device and as it isn't ordinary sound card, Hydrogen gets confused and crashes.

Hydrogen only ever uses the default output stream of PortAudio. H2's interface to PortAudio is really fairly trivial and seems to robustly handle error conditions, so I think it's more likely that the issue is with PortAudio being confused. PortAudio defines an API to query available devices and capabilities but Hydrogen doesn't query that.

LMMS at least exposes selection of output streams when using PortAudio so that might provide some useful diagnostic information, or indeed maybe a debug build of the PortAudio DLL.

cme commented 4 years ago

Hi @Zday89 , would you be willing to give this another go at debugging -- if I supply an instrumented version of Hydrogen with extra debug info?

cme commented 4 years ago

Extra-debug-tracing Windows installers are here:

https://drive.google.com/drive/folders/1AEEldmPZD7-aM0u4iVOG3e1GbbUc_cy-?usp=sharing

Zday89 commented 4 years ago

Extra-debug-tracing Windows installers are here:

https://drive.google.com/drive/folders/1AEEldmPZD7-aM0u4iVOG3e1GbbUc_cy-?usp=sharing

No problem. I've uninstalled the 1.0.0 Beta2 and installed the 64 bit debugging version and put the Elgato capture card back in. Just let me know what you need me to do and I'll be happy to do it. I know some basic command line stuff but not a whole lot so I might need a little walking through this.

cme commented 4 years ago

Great, thanks! This version just outputs more debugging information than the usual one, so all you need to do is the same as before:

"C:\Program Files\Hydrogen\hydrogen.exe" -V Debug > Desktop\debug.txt

and copy back the debug.txt please :)

Zday89 commented 4 years ago

Great, thanks! This version just outputs more debugging information than the usual one, so all you need to do is the same as before:

"C:\Program Files\Hydrogen\hydrogen.exe" -V Debug > Desktop\debug.txt

and copy back the debug.txt please :)

Thanks! Here's the output for the debug,txt

https://pastebin.com/aAYWDkKL

Zday89 commented 4 years ago

I'm sure this is probably obvious but it may also be worth mentioning that Hydrogen starts up fine if I go into my device manager and disable the Elgato there as well. Disabling the Elgato audio device in the "audio inputs and outputs" or "Elgato Sound Capture" in "Sound, Video and Game Controllers" doesn't do anything but disabling "Elgato Capture HD60 Pro" in "Sound, Video and Game Controllers" allows Hydrogen to start.

cme commented 4 years ago

Great, thanks! This is... interesting. It's crashing in the very first portaudio call just to initialise the library. I was hoping that the issue would be more visible to Hydrogen so that we could work around it, but it looks like it's deep within PortAudio after all. Yeesh.

I'll have to take another approach and look into PortAudio itself. Thanks so much for your help!

Zday89 commented 4 years ago

Great, thanks! This is... interesting. It's crashing in the very first portaudio call just to initialise the library. I was hoping that the issue would be more visible to Hydrogen so that we could work around it, but it looks like it's deep within PortAudio after all. Yeesh.

I'll have to take another approach and look into PortAudio itself. Thanks so much for your help!

No problem at all, glad to help! If there's anything else you want me to try, just let me know. Fortunately now that I've found out just disabling the Elgato in my Device manager allows me to use Hydrogen the problem isn't nearly as much of a pain but that's still just a band-aid solution. Thanks for looking into it!

cme commented 4 years ago

No problem at all, glad to help! If there's anything else you want me to try, just let me know. Fortunately now that I've found out just disabling the Elgato in my Device manager allows me to use Hydrogen the problem isn't nearly as much of a pain but that's still just a band-aid solution. Thanks for looking into it!

I've got a build of Hydrogen with a custom PortAudio DLL with tracing output enabled that should give a pretty good idea of where it's failing in the initialisation process. If you wouldn't mind giving that a go and reporting the results, that would be great! Thanks :)

https://drive.google.com/file/d/1-sfcv1tspp7zobIVOhckO6PYCJF3twcg/view?usp=sharing

Zday89 commented 4 years ago

No problem at all, glad to help! If there's anything else you want me to try, just let me know. Fortunately now that I've found out just disabling the Elgato in my Device manager allows me to use Hydrogen the problem isn't nearly as much of a pain but that's still just a band-aid solution. Thanks for looking into it!

I've got a build of Hydrogen with a custom PortAudio DLL with tracing output enabled that should give a pretty good idea of where it's failing in the initialisation process. If you wouldn't mind giving that a go and reporting the results, that would be great! Thanks :)

https://drive.google.com/file/d/1-sfcv1tspp7zobIVOhckO6PYCJF3twcg/view?usp=sharing

Alright I installed that and gave it a try and some different stuff happened. When trying to open the program I now get a dialog box. Here's a screenshot of what that said:

https://imgur.com/a/BukPInZ

When I selected "abort" here's the debug.txt output: https://pastebin.com/SNwFwKqk When I selected "Ignore" here's the debug.txt output: https://pastebin.com/gJj6fnSs

When I hit ignore, Hydrogen started up and seems to function without any problem but I haven't fully tested it. All I know is it launched and samples play no problem.

cme commented 4 years ago

Great! Thanks, that's brilliant, that confirms two things for me.

The issue is Portaudio making unwarranted assumptions about wdmks device topologies, which for Hydrogens purposes we can just disable that API in the Portaudio shipped with H2.

It also confirms that part of the fix for Portaudio is to just remove that failing assertion :D

mauser commented 4 years ago

@Zday89 : I've add two new files to the rc1 release here in github, labeled rc1-1. This is an updated version of rc1 which should fix your portaudio issue. It would be great if you could try them and see if they fix your problem.

Zday89 commented 4 years ago

@Zday89 : I've add two new files to the rc1 release here in github, labeled rc1-1. This is an updated version of rc1 which should fix your portaudio issue. It would be great if you could try them and see if they fix your problem.

Just tried out both the 64 and 32 bit versions and both give me a System Error when trying to launch the program. The error says: "The code execution cannot proceed because libssp-0.dll was not found. Reinstalling the program may fix this problem."

Completely uninstalling previous versions with Revo Uninstaller and reinstalling Hydrogen didn't fix it.

mauser commented 4 years ago

@Zday89 : I've add two new files to the rc1 release here in github, labeled rc1-1. This is an updated version of rc1 which should fix your portaudio issue. It would be great if you could try them and see if they fix your problem.

Just tried out both the 64 and 32 bit versions and both give me a System Error when trying to launch the program. The error says: "The code execution cannot proceed because libssp-0.dll was not found. Reinstalling the program may fix this problem."

Completely uninstalling previous versions with Revo Uninstaller and reinstalling Hydrogen didn't fix it.

Ok, thanks for your help! I've added libssp to the dependencies and re-build the packages. You can find now a new file "Hydrogen-1.0.0-rc1-2" on the releases page. Please try again, maybe we got all dependencies now :)

Zday89 commented 4 years ago

@Zday89 : I've add two new files to the rc1 release here in github, labeled rc1-1. This is an updated version of rc1 which should fix your portaudio issue. It would be great if you could try them and see if they fix your problem.

Just tried out both the 64 and 32 bit versions and both give me a System Error when trying to launch the program. The error says: "The code execution cannot proceed because libssp-0.dll was not found. Reinstalling the program may fix this problem." Completely uninstalling previous versions with Revo Uninstaller and reinstalling Hydrogen didn't fix it.

Ok, thanks for your help! I've added libssp to the dependencies and re-build the packages. You can find now a new file "Hydrogen-1.0.0-rc1-2" on the releases page. Please try again, maybe we got all dependencies now :)

That seems to have done the trick! Hydrogen started with no issues and seems to be working just fine now. Thanks!

mauser commented 4 years ago

Great, thanks a lot for your patience!