Skip to content
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

Pre-compiled portaudio dll (inc. ASIO) causes Python to crash in Windows 10 #275

Open
sparky-10 opened this issue Aug 28, 2020 · 8 comments

Comments

@sparky-10
Copy link

sparky-10 commented Aug 28, 2020

I've installed sounddevice on one Windows 10 machine and can get ASIO to work, which is great. However, when trying to replicate this on another Windows 10 machine the dll causes Python to crash. The only difference in Python is using versions 3.7.3 vs 3.7.6.

I've verified through sd._libname that the portaudio dll being used is C:\ProgramData\Anaconda3\Lib\site-packages\_sounddevice_data\portaudio-binaries\libportaudio64bit.dll. I can replace the dll with other non-ASIO supporting pre-compiled dlls and get sounddevice to run. However, attempting to run with either the dll from the repository, or from wheel versions 0.4.0 or 0.3.14 from https://www.lfd.uci.edu/~gohlke/pythonlibs/#sounddevice causes Python to crash.

So it would seem to be a compatibility issue with the dll and my OS? Could there be another reason? My alternative seems to be going down the route of compiling portaudio with ASIO myself, but I'm hesitant to go there!

@mgeier
Copy link
Member

mgeier commented Sep 5, 2020

I have no idea what's going wrong there ...

The DLL which is distributed together with the sounddevice module is cross-compiled on Linux, while I assume the Gohlke DLL is compiled on Windows. If both show the same error, I kinda have to assume that the problem is somewhere in the PortAudio library code.

You could of course try to compile the DLL on your own, it can't be that complicated, right?

You could also try an older version of the DLL (e.g. from https://github.com/spatialaudio/portaudio-binaries/tree/9f3d08e87b9b4c9a00893dbd7522f5213b3f1b2a).

If the problem persists, you should ask on the PortAudio mailing list: http://portaudio.com/contacts.html (sadly, the instructions seem to be missing currently [UPDATE: instructions have been added in the meantime]).

@sparky-10
Copy link
Author

Thanks for the reply and your help.

I tried the older DLL without success. It looks like I'll have to investigate the compiling myself option.

@sparky-10 sparky-10 reopened this Sep 15, 2020
@mgeier
Copy link
Member

mgeier commented Sep 15, 2020

It looks like I'll have to investigate the compiling myself option.

Please keep us updated here!

@sparky-10
Copy link
Author

sparky-10 commented Sep 15, 2020

The mystery continues!

I have tried compiling a DLL on the machine in question (Visual Studio 2017) using the latest portaudio and ASIO downloads. I can succesfully compile for any combination of audio APIs, but the version including ASIO still fails to run (it compiles, it just doesn't work).

I have contacted the portaudio list to see if I can get anywhere.

@mgeier
Copy link
Member

mgeier commented Sep 15, 2020

@sparky-10
Copy link
Author

Quick update...

Compling PortAudio with the debug printout option allowed me to see where the crash was happening. It was when it found a Jack Audio install, likely broken (it's Windows). Uninstalling Jack fixed the issue.

I don't know if it was the DLL, or a sounddevice call to it causing the crash, but either way it's working now!

@sparky-10
Copy link
Author

It looks from a response on the PortAudio list (and in the link you posted above) that it is the JackRouter ASIO driver that was the issue.

A similar issue looks to have been reported here: jackaudio/jack2#623. Installing the Jack build posted a few days ago further down this thread doesn't cause issues. I believe a new Jack Windows and Mac install is pending, so hopefully issues will be resolved with any new release.

@mgeier
Copy link
Member

mgeier commented Sep 26, 2020

Thanks for the information!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants