question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] default_speaker() returns the wrong bluetooth speaker

See original GitHub issue

I 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:open
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
shawnc722commented, Feb 17, 2021

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.

0reactions
bastibecommented, Feb 17, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sound Coming Out of the Wrong Speaker on Your PC? Try ...
Right-click on the sound icon in the bottom-right corner of the screen, then select Sound Options (or, if you're on Windows 7, search...
Read more >
Bluetooth Troubleshooting - System76 Support
The first thing to check is toggling airplane mode which will sometimes get Bluetooth functioning again. Next, make sure Bluetooth is enabled ......
Read more >
[SOLVED] Windows 10 Bluetooth Audio Stuttering Issues
Try these fixes: · Fix 1: Run the Bluetooth troubleshooter. Windows has built-in troubleshooters to fix some common errors. · Fix 2: Disable...
Read more >
PulseAudio/Troubleshooting - ArchWiki
Getting debug output from pulseaudio. It can be useful to stop the pulseaudio.socket and pulseaudio.service user units, and start manually ...
Read more >
How to Fix Bluetooth Pairing Problems - Techlicious
If your headphones or speaker were previously paired with another phone, laptop or tablet, turn off that other device or Bluetooth. And if...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found