[pulseaudio-tickets] [Bug 99222] ouput sound is not switched automatically to bluetooth headset

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Mar 13 22:49:33 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=99222

--- Comment #5 from Tanu Kaskinen <tanuk at iki.fi> ---
Sorry for the delayed reply.

> Thanks Tanu for the feedback, I looked at pa_device_init_priority() and
> indeed it seems that the priorities listed there are almost inverted to what
> I would think makes sense (I am curious what the initial reasoning was for
> that).

My guess would be that there was no good reason. The code has not been changed
since it was first written, so the values aren't based on any long experience
of tweaking the priorities to be just right.

> I did create a patch for it, tested it and it seems that this did
> indeed change the priorities for the internal sound device
> ("<alsa_card.pci-0000_00_1f.3>") but not for the bluetooth one
> ("bluez_card.04_52_C7_60_XX_XX>").

How did you check? The sink priority is only visible in "pacmd list-sinks"
output.

> For the latter the port priority stayed
> at '20' [a2dp_sink: High Fidelity Playback (A2DP Sink) (priority 10,
> available: unknown)].

Was that '20' a typo? The priority for the a2dp_sink profile seems to be 10.

Note that there are three different priorities: sink priority, port priority
and profile priority. Only the sink priority has effect on the default device
selection.

I would expect the bluetooth port priorities to be 0, because I don't find any
place in the bluetooth code that would configure the port priorities.

> So after poking at the source for a while I think the
> priority is hardcoded at src/modules/bluetooth/module-bluez5-device.c:1808
> (for A2DP source). For fun and testing I cranked that value up to 100k and
> it did indeed select the bluetooth headphones. It seems that the bluetooth
> module itself just sets the prio for its ports to a low value as 20?!

It sounds like you modified the profile priority. As far as I can tell, that
shouldn't have effect on the sink priorities, and therefore it shouldn't have
effect on the default sink selection either, so I'm very confused about what
really happened.

When doing further tests, please comment out module-default-device-restore from
/etc/pulse/default.pa. It can have surprising effects, and can make it look
like your patch doesn't work. (The module is buggy, I'm working on fixing it.)

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-bugs/attachments/20170313/d101dc87/attachment.html>


More information about the pulseaudio-bugs mailing list