bluez.lua: always hide sco-source nodes from applications

Since the loopback bluetooth source node is meant to be always used by
applications, this change hides the actual bluez sco-source node by marking
them as internal. This avoids showing 2 input devices in pavucontrol per BT
device if HSP/HFP profile is enabled.
This commit is contained in:
Julian Bouzas 2024-01-29 12:11:45 -05:00
parent cc4549134a
commit 9cdb8f3110

View file

@ -279,6 +279,11 @@ function createNode(parent, id, type, factory, properties)
properties["node.autoconnect"] = true
end
-- hide the sco-source node because we use the loopback source instead
if factory == "api.bluez5.sco.source" then
properties["api.bluez5.internal"] = true
end
-- apply properties from bluetooth.conf
cutils.evaluateRulesApplyProperties (properties, "monitor.bluez.rules")
@ -410,7 +415,7 @@ function CreateDeviceLoopbackSource (dev_name, dec_desc, dev_id)
["bluez5.loopback"] = true,
["filter.smart"] = true,
["filter.smart.target"] = Json.Object {
["media.class"] = "Audio/Source",
["factory.name"] = "api.bluez5.sco.source",
["device.api"] = "bluez5",
["bluez5.loopback"] = false,
["device.id"] = dev_id