-
Notifications
You must be signed in to change notification settings - Fork 146
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
Clarify exception for samplerate mismatch with WASAPI shared mode #52
Comments
The relevant part of the error message ("Invalid device") comes directly from the PortAudio library. You should probably move your request there: https://app.assembla.com/spaces/portaudio/tickets/. |
We could, however, try to improve the |
In the case of WASAPI shared mode, how about if |
This would be too much of a hack for my taste. A proper solution can only be done in PortAudio itself. @hiccup7 You should create an issue there! |
I agree that PortAudio is the best and cleanest place to make this change. However, I don't have the experience of C coding to have an intelligent response if the PortAudio team objects. I also don't have the ability to compile the PortAudio source code to report back my testing results. I submitted this issue here because I see sounddevice users are confused about WASAPI failures. This was the only practical solution I could think of to help these sounddevice users (and prevent unnecessary sounddevice issues posted). My experience with my USB external DAC is that sounddevice works using the WDM-KS and WASAPI shared mode host APIs, while PyAudio from the following site does not: |
@hiccup7 No excuses! You should tell the PortAudio people, don't be shy! If you need help, feel free to ask me (note, however, that I have no clue about Windows). BTW, I just tried using the wrong samplerate with JACK, and there the error message is -- as it should be:
If you add an issue for PortAudio, I might add a special WASAPI error message to the
This was one of the reasons why I created the
I won't do that anytime soon. "beta" normally means feature completeness, and I'm not sure that's reached yet. Also it implies some kind of release schedule, which I don't have.
To come anywhere near 1.0, we would at least need:
If you think "alpha" is misleading in the current situation, I'm willing to completely remove the "development status" information. I'm not sure how useful this is anyway. I think the activity and stars on Github are much more informative than some arbitrarily chosen "development status". |
See my positive review of sounddevice in this thread: winpython/winpython#428 |
@hiccup7 Thanks for your support! I've removed the "development status" in d684d34. Anything else to do regarding winpython/winpython#428? |
How about a new release of sounddevice on PyPI with the updated PortAudio version in the wheels? Then users who have a bad experience with WASAPI exclusive mode or other issues understand they need to update. |
Sure, will do. I'm just waiting for confirmation if the 32-bit DLL and the Mac dylib work (including on OSX 10.6). |
Notice in winpython/winpython#428 that the developer has agreed to add sounddevice in the next build. |
WinPython is Windows only. Now that you have confirmation of the Windows 32-bit DLL, it would be good to do a release before the next WinPython release. |
@hiccup7 When is the deadline for the WinPython release? |
See winpython/winpython#422 for WinPython test builds. |
I will not contact them, but if you tell me a concrete deadline, I can try to make the next release until then. But I'm making no promises. TBH, I don't care which DLLs they use, I'm sure they know better than me. |
Your DLLs are a great service to the Python community because it causes sounddevice to be cross-platform and serve more users. My great experience with sounddevice caused Gohlke to support it and WinPython to include it. Your DLLs continue to offer the advantage of letting the user replace it manually in the _sounddevice_data folder. I don't understand the details, but Gohlke's DLLs may avoid problems with mismatches between the MS C Runtime library used for the DLL compile vs. the one used by different Python versions. Maybe you avoided this problem already by using CFFI's ABI in-line mode. |
I'm glad that my DLLs are useful to somebody. I didn't realize that Gohlke has different DLLs for each Python version. As long as people don't complain about my DLLs, I'll keep them as they are, but should there be problems, I can switch to Gohlke's DLLs and release different wheels for each Python version. Or someone else takes over the Windows maintenance, which would be even better. |
@hiccup7 Is there anything left to do in this issue? |
When using WASAPI shared mode in Windows, it is necessary to match the samplerate in sounddevice
and Control Panel > Sound > device > Properties > Advanced tab > Default Format.
In sounddevice v0.3.5, a samplerate mismatch throws an exception "sounddevice.PortAudioError: Error opening RawOutputStream: Invalid device".
I propose to instead detect the mismatch to the device default samplerate and clarify the exception message. This will better help users understand and fix this type of problem. Often, they will want to change the Windows setting.
The text was updated successfully, but these errors were encountered: