-
Notifications
You must be signed in to change notification settings - Fork 149
Add an environ flag to load an alternative PortAudio Windows binary compiled without ASIO #498
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
Conversation
Hello @arkrow! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:
|
Thanks for this PR! I was hoping for a more general solution for choosing the DLL/dylib/so, similar to how it was discussed in #130. But before even going down the environment variable path, I would like to know how I know that this works on Linux and I assume that it works on macOS as well and it would be good to know how to make this work on Windows as well. Maybe that would already be enough for selecting a custom DLL? |
I think the most promising approach would be building libportaudio as part of the wheel build process, as mentioned in #130, and accepting ASIO as a flag in package extras as I mentioned in #496. If that can work on all systems without additional prerequisites, that would be the ideal solution. If I can get the solution up and running, I'll open a new PR. Alternatively, as part of the suggested solutions in #130, I've opened a PR (#499) that loads a user-specified PortAudio binary during runtime, which is more general than this PR and has been requested by other users.
That would be difficult to do dynamically (without hard-coding) unless the values is retrieved from somewhere, which is why |
Do you mean hard-coding the absolute path to the DLL? According to https://docs.python.org/3/library/ctypes.html#finding-shared-libraries:
So if you put a correctly named DLL somewhere into the system search path (whatever that means exactly), it should be found, right? In case this hasn't been obvious already: I'm not a Windows user, so you can assume zero knowledge from my side. |
See my comment #496 (comment) This doesn't provide an environment variable, but it involves downloading the appropriate DLL, renaming it and moving it into a specific folder. I think that would still be easy enough for the (few?) people who need ASIO, what do you think? |
In #539, I'll switch to DLLs without ASIO by default. This also adds documentation for how to download and use DLLs with ASIO, if needed. I think this makes this PR obsolete, right? |
Since the default behavior is without ASIO, this PR is now obsolete. Though it's inverse can be considered if both binaries are to be shipped together and enabled conditionally; that might be a good middle-ground for developers depending on ASIO support with this library. That said, the PR will be closed for now. |
This PR provides a very simple and minimal workaround for loading an alternative PortAudio Windows binary compiled without ASIO, to address issue #496. Since this issue only affects Windows, as far as I know, no changes have been made to the other platforms.
An alternative PortAudio binary will need to be added to the
_sounddevice_data
repository (e.g. namedlibportaudio64bit-noasio.dll
). It will then be bundled like the other binaries in the built package and can then be used instead of the default using theos.environ["SD_WIN_DISABLE_ASIO"]
flag.