Don't interrupt bluetooth audio when muted

Started writing it as a bug report, but figured it’d post it here first:

SUMMARY
If you’re using a multi-point bluetooth headset (so a bluetooth device that is connected to two devices at once) there’s the obv problem of audio mixing on the headset. many headsets seem to just only be able to play one of the two sources. But if the bluetooth device in plasma is muted. it should never disrupt playback on the bluetooth device

STEPS TO REPRODUCE

  1. Connect your bluetooth headset to two devices (in my case for example an android phone and my plasma laptop
  2. Play music on the android device (I heard the music on my headset)
  3. Set the bluetooth device in the plasma audio widget to be muted
  4. Start music on the plasma laptop (I hear my headset stutter as it’s trying to also play both at the same time)

OBSERVED RESULT
It shouldn’t be sending anything to my bluetooth headset, but it is. it’s sending ‘no audio’ but that’s causing my headset to stutter even though it’s just receiving nothing basically.

EXPECTED RESULT
It should send nothing at all when it’s muted. So as to never interupt the audio on the headset.

yes you could argue that this is the fault of my headset, but I’m pretty sure the same thing happened with my Samsung buds.

The headset i’m currently using is a Repeat audio Prince

That would break stuff. As you well know, sending silence is not the same as sending nothing. Things expect to be sent silence when they’re sent silence, and nothing when nothing, and not the other way around.

Maybe this is just a problem with your headset and can’t be fixed, but if it can be fixed, bluez is likely the place to do it.

One thing you might like to try is force-disabling hardware volume control. You can use bluez5.enable-hw-volume = false in your wireplumber config file, to test it. The idea here is, instead of “send a thing which is not the thing the user told you to send” we go with “work properly when the user sends that”

That’s just a test, don’t leave it like that, it’ll make the change globally and you don’t want that. You can apply it just to that headset later, if you need to.

If it turns out that your headset needs this, it can be added to bluez’s quirks list so it will ‘just work’ in future and for others.

Thank you so much for helping me btw!

So I changed this in my nixos config. Switched. and then rebooted just in case.

services.pipewire = {
                enable = true;
                alsa.enable = true;
                alsa.support32Bit = true;
                pulse.enable = true;
                wireplumber.enable = true;
                wireplumber.extraConfig."10-bluez" = {
                  "bluez5.enable-hw-volume" = false;
                };
              };

I feel like I’m not noticing a difference. my headset is still starting to stutter when I start playing music on my pc and have the headset set to mute.

Is there a way to verbose see output from bluez5 or something? to see if t’s losing packets or whatever. I don’t know if that could have anything to do with it or if it’s just my headset. When i find my galaxy Buds again, I’ll try those as well.