pulseaudio/src/modules/bluetooth
Pali Rohár 3397127f00 bluetooth: Add optional heuristic for switching between hsp and a2dp profiles
Not all VOIP applications (specially those which use alsa) set media.role to
phone. This means we need some heuristic to determinate if we want to switch
from a2dp to hsp profile based on number and types of source output (recording)
streams.

And also some people want to use their bluetooth headset (with microphone) as
their default recording device but some do not want to because of low quality.

This patch implements optional heuristic which is disabled by default. It is
disabled by default to not break experience of current pulseaudio users because
heuristic cannot be optimal. Heuristic is implemented in module-bluetooth-policy
module and decide if pulseaudio should switch to a hsp profile or not. It checks
if there is some source output with pass all these conditions:

* does not have set media.role
* does not use peak resample method (which is used by desktop volume programs)
* has assigned client/application (non virtual stream)
* does not record from monitor of sink

And if yes it switch to hsp profile.

By default this heuristic is disabled and can be enabled when loading module
module-bluetooth-policy with specifying parameter auto_switch=2

Because it is disabled by default nobody will be affected by this change unless
manually change auto_switch parameter.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
2017-01-19 03:00:45 +02:00
..
a2dp-codecs.h update FSF addresses to FSF web page 2015-01-14 22:20:40 +02:00
backend-native.c bluetooth: Fix negative array index write 2016-08-17 17:32:10 +02:00
backend-ofono.c update FSF addresses to FSF web page 2015-01-14 22:20:40 +02:00
bluez4-util.c bluetooth: Reorganize code to avoid Coverity NULL dereference warning 2016-08-17 17:32:03 +02:00
bluez4-util.h bluetooth: unify BlueZ 4 and BlueZ 5 profile constant names 2016-08-10 21:37:33 +03:00
bluez5-util.c bluetooth: refactor BlueZ 4 transport state setting 2016-08-10 21:37:33 +03:00
bluez5-util.h bluetooth: unify BlueZ 4 and BlueZ 5 UUID handling 2016-08-10 21:37:33 +03:00
module-bluetooth-discover.c update FSF addresses to FSF web page 2015-01-14 22:20:40 +02:00
module-bluetooth-policy.c bluetooth: Add optional heuristic for switching between hsp and a2dp profiles 2017-01-19 03:00:45 +02:00
module-bluez4-device.c don't assume that pa_asyncq_new() always succeeds 2016-12-20 01:19:06 +02:00
module-bluez4-discover.c bluetooth: Fix dead code 2016-08-16 10:31:44 +02:00
module-bluez5-device.c don't assume that pa_asyncq_new() always succeeds 2016-12-20 01:19:06 +02:00
module-bluez5-discover.c bluetooth: Prevent aborts caused by invalid module arguments 2016-01-15 16:20:53 +05:30
rtp.h update FSF addresses to FSF web page 2015-01-14 22:20:40 +02:00