diff --git a/src/config/config.lua b/src/config/config.lua index a6814afde75535484e0e8bc3cde5d0222ba1cc57..a54bafea56b0379ac886a155015d12fb44237b90 100644 --- a/src/config/config.lua +++ b/src/config/config.lua @@ -99,10 +99,6 @@ function enable_audio() }) end -function enable_bluetooth() - load_monitor("bluez5") -end - function enable_endpoints() load_script("static-sessions.lua", { ["audio"] = {}, @@ -112,10 +108,5 @@ function enable_endpoints() load_script("policy-endpoint.lua") end --- split these calls into .lua files in config.lua.d/ --- to get a similar effect as the 'with-audio', 'with-pusleaudio', etc --- flag files that ship with pipewire-media-session enable_access() -enable_audio() -enable_bluetooth() enable_endpoints() diff --git a/src/config/config.lua.d/30-bluez-monitor.lua b/src/config/config.lua.d/30-bluez-monitor.lua new file mode 100644 index 0000000000000000000000000000000000000000..7cb2e53063db64aa70e5dd26a4afb237999b5dd8 --- /dev/null +++ b/src/config/config.lua.d/30-bluez-monitor.lua @@ -0,0 +1,67 @@ +-- Bluez monitor config file -- + +local properties = { + -- MSBC is not expected to work on all headset + adapter combinations. + --["bluez5.msbc-support"] = true, + --["bluez5.sbc-xq-support"] = true, + + -- Enabled headset roles (default: [ hsp_hs hfp_ag ]), this + -- property only applies to native backend. Currently some headsets + -- (Sony WH-1000XM3) are not working with both hsp_ag and hfp_ag + -- enabled, disable either hsp_ag or hfp_ag to work around it. + -- + -- Supported headset roles: hsp_hs (HSP Headset), + -- hsp_ag (HSP Audio Gateway), + -- hfp_ag (HFP Audio Gateway) + --["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_ag ]", + + -- Enabled A2DP codecs (default: all). + --["bluez5.codecs"] = "[ sbc aac ldac aptx aptx_hd ]", +} + +local rules = { + -- An array of matches/actions to evaluate. + { + -- Rules for matching a device or node. It is an array of + -- properties that all need to match the regexp. If any of the + -- matches work, the actions are executed for the object. + matches = { + { + -- This matches all cards. + { "device.name", "matches", "bluez_card.*" }, + }, + }, + -- Apply properties on the matched object. + apply_properties = { + -- ["device.nick"] = "My Device", + }, + }, + { + matches = { + { + -- Matches all sources. + { "node.name", "matches", "bluez_input.*" }, + }, + { + -- Matches all sinks. + { "node.name", "matches", "bluez_output.*" }, + }, + }, + apply_properties = { + --["node.nick"] = "My Node", + --["priority.driver"] = 100, + --["priority.session"] = 100, + --["node.pause-on-idle"] = false, + --["resample.quality"] = 4, + --["channelmix.normalize"] = false, + --["channelmix.mix-lfe"] = false, + }, + }, +} + +function enable_bluetooth() + load_monitor("bluez5", { + properties = properties, + rules = rules, + }) +end diff --git a/src/config/config.lua.d/90-enable-audio-all.lua b/src/config/config.lua.d/90-enable-audio-all.lua new file mode 100644 index 0000000000000000000000000000000000000000..93e75dcf8f8a0949d6a41c4383b229ab3f7c3632 --- /dev/null +++ b/src/config/config.lua.d/90-enable-audio-all.lua @@ -0,0 +1,2 @@ +enable_audio() +enable_bluetooth()