-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FlexASIO 1.4 Causes Polyphone to crash on startup #47
Comments
Sorry to hear that, that's definitely not supposed to happen. Can you see if you can get a log out of FlexASIO when the crash occurs? Not sure it will be able to write one depending on how early it crashes, but if it does it would really help troubleshooting the problem. |
Hello Etienne,
Thank your for your prompt reply. That's actually a brilliant logging mechanism! I wish Polyphone had something like that. Just to be clear FlexASIO itself doesn't crash, Polyphone does once FlexASIO is installed. I created the FlexASIO log file in my user directory and ran PolyPhone with FlexASIO installed and got the crash. I also included the last DLL call before the crash according to MS Visual Studio Debugger. I hope this helps. Let me know if I can do anything else to assist and I will try my best.
This is the log information from FlexASIO:
---BEGIN FlexASIO log after Polyphone crash-------
2019-06-10T16:01:58.8988290-04:00 3396 4116 Logfile opened: "C:\\Users\\arvind\\FlexASIO.log"
2019-06-10T16:01:58.8988290-04:00 3396 4116 Log time source: GetSystemTimeAsFileTime
2019-06-10T16:01:58.8988290-04:00 3396 4116 Host process: D:\Program Files\Polyphone\polyphone.exe
2019-06-10T16:01:58.8988290-04:00 3396 4116 FlexASIO RelWithDebInfo x64 flexasio-1.4 built on 2019-02-03T17:07:14Z
2019-06-10T16:01:58.8988290-04:00 3396 4116 --- ENTERING CONTEXT: CFlexASIO()
2019-06-10T16:01:58.8988290-04:00 3396 4116 --- EXITING CONTEXT: CFlexASIO() [OK]
2019-06-10T16:01:58.8988290-04:00 3396 4116 --- ENTERING CONTEXT: init()
2019-06-10T16:01:58.8988290-04:00 3396 4116 Attempting to load configuration file: "C:\\Users\\arvind\\FlexASIO.toml"
2019-06-10T16:01:58.8988290-04:00 3396 4116 Unable to open configuration file: ios_base::failbit set: iostream stream error
2019-06-10T16:01:58.8988290-04:00 3396 4116 [PortAudio] PortAudio version: PortAudio V19-devel (built May 14 2015 17:02:09)
2019-06-10T16:01:58.8988290-04:00 3396 4116 [PortAudio] Enabling PortAudio debug output redirection
2019-06-10T16:01:58.8988290-04:00 3396 4116 Initializing PortAudio
2019-06-10T16:01:58.9398314-04:00 3396 4116 --- ENTERING CONTEXT: CFlexASIO()
2019-06-10T16:01:58.9398314-04:00 3396 4116 --- EXITING CONTEXT: CFlexASIO() [OK]
2019-06-10T16:01:58.9398314-04:00 3396 4116 --- ENTERING CONTEXT: init()
2019-06-10T16:01:58.9398314-04:00 3396 4116 Attempting to load configuration file: "C:\\Users\\arvind\\FlexASIO.toml"
2019-06-10T16:01:58.9398314-04:00 3396 4116 Unable to open configuration file: ios_base::failbit set: iostream stream error
2019-06-10T16:01:58.9398314-04:00 3396 4116 [PortAudio] PortAudio version: PortAudio V19-devel (built May 14 2015 17:02:09)
2019-06-10T16:01:58.9398314-04:00 3396 4116 [PortAudio] Enabling PortAudio debug output redirection
2019-06-10T16:02:03.4570897-04:00 3396 4116 Closing logfile
---END FlexASIO log after Polyphone crash-------
This is the crash report from Polyphone (from Windows)
---BEGIN Polyphone Windows Crash Information-------------
Problem signature:
Problem Event Name: APPCRASH
Application Name: polyphone.exe
Application Version: 0.0.0.0
Application Timestamp: 5c1c0c0c
Fault Module Name: ucrtbase.DLL
Fault Module Version: 10.0.14393.2630
Fault Module Timestamp: 5bbec6c9
Exception Code: 40000015
Exception Offset: 000000000006e84f
OS Version: 6.1.7601.2.1.0.256.1
Locale ID: 1033
Additional Information 1: 08b6
Additional Information 2: 08b6a46ab460746a8a44f771584ade43
Additional Information 3: c94f
Additional Information 4: c94f95a31b44118b6821b66c06426a90
---END Polyphone Windows Crash Information----------------
MS Visual C Debugger shows the last DLL loaded in the Polyphone crash to be
"polyphone.exe' (Win32): Loaded 'D:\Program Files\FlexASIO\x64\FlexASIO.dll'. Symbols loaded"
Thank again for your prompt response and thanks for the great piece of software.
Sincerely,Arvind
|
Okay, I was able to reproduce this using Polyphone 2.0 32-bit, with the same log. For some reason, in 64-bit Polyphone does not crash but it doesn't show FlexASIO in the list of devices either - it only lists ASIO4ALL and ASIO2WASAPI on my system. I obtained a stack trace from WinDbg:
Suspicious, I looked at the loaded module list, and the relevant modules are:
Oooh. Okay, I see. Jeez, that's messed up. Basically, the problem is that Polyphone itself already uses PortAudio directly (just like FlexASIO), and the PortAudio DLL that Polyphone is bundled with has the exact same name as the PortAudio DLL that FlexASIO is bundled with. It looks like Windows will not load a DLL with the same basename twice, and will reuse the one that's already loaded (even if the dependent modules are in completely different locations). Which means that when FlexASIO get loaded, instead of using:
It ends up using the DLL that Polyphone already loaded, which is:
Now at this point we're already in deep trouble, because the Polyphone PortAudio DLL might not be compatible with FlexASIO, and might not have the same features enabled. It doesn't end there, though. The PortAudio DLL that Polyphone is bundled with has ASIO support enabled; in fact that's precisely how Polyphone accesses ASIO drivers. So, Polyphone initializes PortAudio, which initializes FlexASIO. FlexASIO accidentally reuses Polyphone's PortAudio DLL, attempts to initialize that instance of PortAudio again. Which results in PortAudio initializing ASIO drivers again, thus initializing FlexASIO again. At this point we get a reentrant call into FlexASIO's initialization logic, which is an insane situation and, unsurprisingly, everything quickly explodes from there. This hypothesis is completely consistent with the FlexASIO log, which very clearly shows a reentrant Okay, so, I can see two action items here. One is for me, the other is for you:
|
It looks like the cleanest way to make FlexASIO immune from this problem is to use a Windows feature known as Side-by-Side Assemblies: https://en.wikipedia.org/wiki/Side-by-side_assembly Looks promising. I'll look into that more deeply when I have some time. |
That's a brilliant piece of deductive detective work if I ever saw one! Thank you so very much for the detailed explanation of your investigation. I never though of using Olly, I'm spread all over the place right now. Trying to get some stuff off the ground in several areas but that's no excuse on my part. It seems us developers who dig deep are cursed by the same "feature" bugs of the OSes we work on :-) Your level of support is about 100 times better than commercial vendors but that's what happens when a person is doing something they love. I can relate!
I use Polyphone for sound font conversions mostly. I'm into Music as well and I have and addiction to sound fonts :-) Some programs don't support .sf2 sound fonts and I prefer to compose my music as a score where the instruments in my composer are directly tied to the instruments in the sound font I am using. So to ensure I get the same sounds I have found myself delving more and more into getting audio programs into a tool chain that suits my creative bent.
I also do a lot of R&D into all sorts of things so I accumulate a lot of tools in a lot of different disciplines.
You'd probably cringe if you knew the Frankenstein amalgamation of software I'm running. I add and test each with everything to make sure they're well behaved and stay away from ones that aren't. However as you know software is the most complicated creation of man by far and massively complex systems can't be tested in all possible configurations.
I use FlexASIO as a quick ASIO layer that can provide an ASIO driver interface to programs that require it for optimal performance or require it to work properly. For instance with Ardour5 WINSAPI was giving terrible feedback from my microphone (studio quality with Phantom power, works beautifully everywhere else) during recording. However the minute I installed FlexASIO and used it as the sound driver it stopped. It could be some quirk in Ardour's sound monitoring code or maybe a setting I changed in frustration while trying to solve it that didn't take until a restart however it worked.
I'm quite content to wait until you figure out a fix (if you can) for FlexASIO. I'm learning Arour right now (just got it yesterday in fact) and I'm hoping against hope I can make it my composition DAW of choice. Initially it was a rocky road but once I installed FlexASIO everything started to move along. If worst comes to worst I suppose I could install Polyphone in a Linux/Windows VM and convert my sound font's there when I need to.
Thanks again for all of your effort. Feel free to contact me if you think I can be of any assistance in providing more information, or you wish to bounce any ideas of of me. I'll do my best to help out in whatever little way I can. It was a pleasure to hear the details of your investigation. I've learned something for my own toolbox as well!
PS: It's interesting you don't get the crash in 64bit Polyphone. I get it in Polyphone 32/64 for ver 2.01 and 1.9. Possibly it is something to do with my software load-out.
Sincerely,Arvind
|
Looks like you hit upon the road to the solution. Good hunting good sir. I look forward to testing when you get a chance to work your magic. I see DLL hell still exists in 2019..albeit in a more refined version to stress developers :-)
|
This should be fixed in FlexASIO 1.5. |
FYI, unfortunately this issue is back starting from FlexASIO 1.8 due to a PortAudio change that went unnoticed and broke the fix. This is being tracked in #182. (Although to be clear the new issue might not affect Polyphone if it's still using the old PortAudio DLL name.) |
…and it is fixed again via #182 in FlexASIO 1.10. |
Hello,
First off I have to thank the developer for this wonderful driver! It works really well for me with all of the software I have used with it thus far. Also it allows me to actually be able to use Ardour on Windows without horrible feedback from monitoring.
I've only been a user for a day or so but I had an issue with FlexASIO 1.4 being installed and Polyphone crashing on startup. I didn't know it was related to FlexASIO until I launched the MS Debugger on the Polyphone crash and traced the DLL tree finding the FlexASIO dll being loaded. I uninstalled FlexASIO and Polyphone started working again.
My OS is: Win7/64Bit
Crash Interaction occurs with: 64bit and 32bit versions of Polyphone 2.0 and 1.9
MS crash debug information point to
Fault Module Name: ucrtbase.DLL
I tried repairing all versions of MS Visual C Runtimes both 32bit and 64bit on my machine as that dll is related to the MS Visual C Runtimes but it still didn't fix the problem. I also did several reboots and application uninstalls/re installs of Polyphone.
I hope this post helps the developer sort it out. Thanks again for a wonderful contribution.
The text was updated successfully, but these errors were encountered: