mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
switch-on-connect: Don't switch to Bluetooth computers
Do not automatically switch if the bluetooth card represets a remote device with a computer form-factor. If the user is connecting two computers over Bluetooth they most likely want to use a non-audio feature like file transfer or network sharing. Automatic audio switching in these cases creates a very poor user experience. If the user actually wants to stream audio they can manually select the Bluetooth audio sink or source.
This commit is contained in:
parent
da243cf1c7
commit
b819942968
1 changed files with 20 additions and 0 deletions
|
|
@ -92,6 +92,16 @@ static pa_hook_result_t sink_put_hook_callback(pa_core *c, pa_sink *sink, void*
|
|||
return PA_HOOK_OK;
|
||||
}
|
||||
|
||||
/* Don't switch to computers implementing Bluetooth audio profiles */
|
||||
s = pa_proplist_gets(sink->proplist, PA_PROP_DEVICE_BUS);
|
||||
if (pa_safe_streq(s, "bluetooth")) {
|
||||
s = pa_proplist_gets(sink->proplist, PA_PROP_DEVICE_FORM_FACTOR);
|
||||
if (pa_safe_streq(s, "computer")) {
|
||||
pa_log_debug("Refusing to switch to Bluetooth sink on a computer");
|
||||
return PA_HOOK_OK;
|
||||
}
|
||||
}
|
||||
|
||||
/* Ignore virtual sinks if not configured otherwise on the command line */
|
||||
if (u->ignore_virtual && !(sink->flags & PA_SINK_HARDWARE)) {
|
||||
pa_log_debug("Refusing to switch to virtual sink");
|
||||
|
|
@ -152,6 +162,16 @@ static pa_hook_result_t source_put_hook_callback(pa_core *c, pa_source *source,
|
|||
return PA_HOOK_OK;
|
||||
}
|
||||
|
||||
/* Don't switch to computers implementing Bluetooth audio profiles */
|
||||
s = pa_proplist_gets(source->proplist, PA_PROP_DEVICE_BUS);
|
||||
if (pa_safe_streq(s, "bluetooth")) {
|
||||
s = pa_proplist_gets(source->proplist, PA_PROP_DEVICE_FORM_FACTOR);
|
||||
if (pa_safe_streq(s, "computer")) {
|
||||
pa_log_debug("Refusing to switch to Bluetooth source on a computer");
|
||||
return PA_HOOK_OK;
|
||||
}
|
||||
}
|
||||
|
||||
/* Ignore virtual sources if not configured otherwise on the command line */
|
||||
if (u->ignore_virtual && !(source->flags & PA_SOURCE_HARDWARE)) {
|
||||
pa_log_debug("Refusing to switch to virtual source");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue