-
Notifications
You must be signed in to change notification settings - Fork 151
WASAPI settings cause exception with other host API devices #55
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Ignoring the settings of other host APIs would raise several problems:
What about something completely new instead of Currently, Another thing that's currently strange, is that I can set WASPI exclusive mode on the input and non-exclusive mode on the output (and vice versa). I don't know if that even makes sense? Is this even possible? I would be open to removing the platform-specific settings from |
WASAPI is unusual because it supports separate client apps for input and output. This suggests independent streams, so maybe one could be shared mode and the other exclusive mode. I have not tried that yet, as I have only been developing Python code for output. With ASIO and WDM-KS, on the other hand, I have experienced failures when I try to use one app for input and another for output to the same device. Exclusive mode is supported for some WASAPI devices, while other WASAPI devices only support shared mode. So WASAPI settings are not necessarily fixed for a platform. I just happen to have a Python module where exclusive mode is desired for all WASAPI devices used (I won't use WASAPI devices that don't support exclusive mode in this module). I posted this PR because I found WASAPI settings a little unintuitive -- not really a problem for me. Please consider my feedback in the evolution of sounddevice settings. Module default settings would work well for platform settings, while stream class settings would work well for device-specific settings. |
Would be nice if you could try that.
Sure, I'm thankful for that and I mentioned my concerns above. Do you agree that ignoring non-matching Do you have a concrete suggestion for a different API for the host API specific settings? |
Yes. Your Python Zen philosophy has been working well.
How about class settings for each host API? Then support all of them in the The reason I would like this is because PortAudio provides five virtual devices for one hardware device on my PC. I know which hardware device I want to use when I write my code, so I want to configure all host APIs in the |
I think I understand most of your suggestion but not everything. Can you please provide some concrete (but still hypothetical) code examples which show the proposed usage? If I understand correctly, you want to pass the settings1 = dict(device=3)
settings2 = dict(device=7, extra_settings=extra_settings)
settings = settings1
sd.play(mydata, fs, **settings) This way, you could collect all your possible combinations of settings but still quickly switch between them. |
I haven't spent enough time reading sounddevice.py to understand it in detail. How are settings from the |
You don't need to understand the current implementation, I'd just like to do some brainstorming how the usage could look like in the future. Let's worry about the implementation afterwards. But since you asked: The All stream classes have a common base class (named |
So I am imaging a common base class with some extra settings specific to each host API. These settings could be read and written using a Since the |
Now I understand your suggestion less than before. |
@hiccup7 Do you want to continue on this? |
sounddevice is working great for me. As I mentioned in the opening post, this issue is a minor annoyance for me. I have worked around it, so I am satisfied. No need to continue on this topic. |
Uh oh!
There was an error while loading. Please reload this page.
This is a minor annoyance. Not worth fixing if it delays the sounddevice release for the next WinPython release.
Problem: With the WDM-KS and ASIO host API devices are used for the same USB external DAC,
sd.default.extra_settings = sd.WasapiSettings(exclusive=False)
andsd.default.extra_settings = sd.WasapiSettings(exclusive=True)
causesd.RawOutputStream()
to raise an exception. Withoutsd.default.extra_settings
, these host APIs play fine.I would like to set
sd.default.extra_settings = sd.WasapiSettings(exclusive=True)
as my normal default. It is not intuitive to me that WASAPI settings should cause an exception for WDM-KS and ASIO host API devices. I expect WDM-KS and ASIO host API devices to ignore WASAPI settings.The text was updated successfully, but these errors were encountered: