diff --git a/src/daemon/media-session.d/bluez-monitor.conf b/src/daemon/media-session.d/bluez-monitor.conf index b194da81d..b1e31e1e0 100644 --- a/src/daemon/media-session.d/bluez-monitor.conf +++ b/src/daemon/media-session.d/bluez-monitor.conf @@ -1,9 +1,10 @@ # Bluez monitor config file for PipeWire version @VERSION@ # properties = { - # Enable mSBC support for ofono backend and hsphfpd backend, - # disabled by default. Be aware that mSBC is not expected to - # work on all headset + adapter combinations. + # Enable mSBC support, disabled by default. Be aware that + # mSBC is not expected to work on all headset + adapter combinations. + # This can be overloaded for a specific device and native backend + # in rules section. #bluez5.msbc-support = false #bluez5.sbc-xq-support = false @@ -51,7 +52,7 @@ rules = [ #] bluez5.reconnect-profiles = [ hfp_hf hsp_hs a2dp_sink ] - # Enable mSBC support for native backend, disabled by default. + # Overload mSBC support for native backend and a specific device. #bluez5.msbc-support = false # LDAC encoding quality diff --git a/src/examples/media-session/bluez-monitor.c b/src/examples/media-session/bluez-monitor.c index 83c47b869..4b0292c99 100644 --- a/src/examples/media-session/bluez-monitor.c +++ b/src/examples/media-session/bluez-monitor.c @@ -395,7 +395,7 @@ static struct device *bluez5_create_device(struct impl *impl, uint32_t id, struct spa_handle *handle; int res; void *iface; - const char *rules; + const char *rules, *str; pw_log_debug("new device %u", id); @@ -421,6 +421,12 @@ static struct device *bluez5_create_device(struct impl *impl, uint32_t id, if ((rules = pw_properties_get(impl->conf, "rules")) != NULL) sm_media_session_match_rules(rules, strlen(rules), device->props); + /* Propagate the msbc-support global property if it exists and is not + * overloaded by a device specific one */ + if ((str = pw_properties_get(impl->props, "bluez5.msbc-support")) != NULL && + pw_properties_get(device->props, "bluez5.msbc-support") == NULL) + pw_properties_set(device->props, "bluez5.msbc-support", str); + handle = pw_context_load_spa_handle(context, info->factory_name, &device->props->dict);