[Bug] default_speaker() returns the wrong bluetooth speaker
See original GitHub issueI use two bluetooth devices with my computer: a speaker and headphones. When I call default_speaker()
while either are connected (and set to default automatically by windows), it returns the headphones - even if they aren’t connected. Trying to play through the returned speaker object throws an error, so it’s clearly not just the wrong name.
The really weird part is it sometimes works flawlessly, letting me switch between speakers, headphones, and analog out without any trouble. I haven’t figured out what’s causing the difference in behavior, but I wanted to note what I’ve found in case someone else runs into the same thing.
Thanks for making this library, it’s been really useful for me so far. I’ll make sure to update this if I figure out anything more.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Thanks, knowing to check into WASAPI narrows it down for me and hopefully I’ll be able to find the issue. I’m actually using soundcard to monitor loopback and run an rgb lighting visualizer cross platform, so I don’t think those simpler APIs are the solution in my case. Soundcard is working really well for my application anyway, but because I keep it running all the time and switch between Linux and windows (both with multiple output devices) I’m doing pretty thorough testing almost by accident lol. I’ll update if I learn anything about the WASAPI behaviour, and thanks again for all your work on this project.
This sounds like a bug in WASAPI. But it’s probably instead some subtle issue in soundcard’s use of WASAPI. I have honestly no idea what is going on, though. That said, Bluetooth audio support on Windows has always been a bit flakey in my experience, and your experiences with the issue half-solving itself on reboot seems to confirm that.
I will say that there are probably more robust ways of “just” playing audio on the default device than using soundcard. If I remember correctly, the WASAPI has a few functions for playing something without selecting an audio device first. But soundcard is specifically about playing/recording from a particular sound card, and thus does not use the simple APIs. Which conversely apparently leads to these connection/disconnection issues.
Sorry I can’t be of much help, there.
But please do let me know if you find out more about this behavior.