mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-06 10:38:08 +02:00
bluez.lua: use default rules if none are defined
This commit is contained in:
parent
ed79e9a4d0
commit
56087777f6
2 changed files with 91 additions and 71 deletions
|
|
@ -83,78 +83,91 @@ wireplumber.settings = {
|
|||
|
||||
## The list of monitor rules
|
||||
monitor.bluetooth = [
|
||||
{
|
||||
## 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 = "~bluez_card.*"
|
||||
}
|
||||
]
|
||||
actions = {
|
||||
update-props = {
|
||||
## Auto-connect device profiles on start up or when only partial
|
||||
## profiles have connected. Disabled by default if the property
|
||||
## is not specified.
|
||||
## Example: bluez5.auto-connect = "[ hfp_hf hsp_hs a2dp_sink hfp_ag hsp_ag a2dp_source ]"
|
||||
bluez5.auto-connect = "[ hfp_hf hsp_hs a2dp_sink ]"
|
||||
## The following are the default rules applied if none overrides them.
|
||||
# {
|
||||
# matches = [
|
||||
# {
|
||||
# device.name = "~bluez_card.*"
|
||||
# }
|
||||
# ]
|
||||
# actions = {
|
||||
# update-props = {
|
||||
# bluez5.auto-connect = "[ hfp_hf hsp_hs a2dp_sink ]"
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
|
||||
## Hardware volume control (default: [ hfp_ag hsp_ag a2dp_source ])
|
||||
# bluez5.hw-volume = "[ hfp_hf hsp_hs a2dp_sink hfp_ag hsp_ag a2dp_source ]"
|
||||
## This rule example allows changing properties on all Bluetooth devices.
|
||||
# {
|
||||
# matches = [
|
||||
# {
|
||||
# ## This matches all cards.
|
||||
# device.name = "~bluez_card.*"
|
||||
# }
|
||||
# ]
|
||||
# actions = {
|
||||
# update-props = {
|
||||
# ## Auto-connect device profiles on start up or when only partial
|
||||
# ## profiles have connected. Disabled by default if the property
|
||||
# ## is not specified.
|
||||
# bluez5.auto-connect = "[ hfp_hf hsp_hs a2dp_sink hfp_ag hsp_ag a2dp_source ]"
|
||||
#
|
||||
# ## Hardware volume control (default: [ hfp_ag hsp_ag a2dp_source ])
|
||||
# bluez5.hw-volume = "[ hfp_hf hsp_hs a2dp_sink hfp_ag hsp_ag a2dp_source ]"
|
||||
#
|
||||
# ## LDAC encoding quality
|
||||
# ## Available values: auto (Adaptive Bitrate, default)
|
||||
# ## hq (High Quality, 990/909kbps)
|
||||
# ## sq (Standard Quality, 660/606kbps)
|
||||
# ## mq (Mobile use Quality, 330/303kbps)
|
||||
# bluez5.a2dp.ldac.quality = "auto"
|
||||
#
|
||||
# ## AAC variable bitrate mode
|
||||
# ## Available values: 0 (cbr, default), 1-5 (quality level)
|
||||
# bluez5.a2dp.aac.bitratemode = 0
|
||||
#
|
||||
# ## Profile connected first
|
||||
# ## Available values: a2dp-sink (default), headset-head-unit
|
||||
# device.profile = "a2dp-sink"
|
||||
#
|
||||
# ## Opus Pro Audio encoding mode: audio, voip, lowdelay
|
||||
# bluez5.a2dp.opus.pro.application = "audio"
|
||||
# bluez5.a2dp.opus.pro.bidi.application = "audio"
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
|
||||
## LDAC encoding quality
|
||||
## Available values: auto (Adaptive Bitrate, default)
|
||||
## hq (High Quality, 990/909kbps)
|
||||
## sq (Standard Quality, 660/606kbps)
|
||||
## mq (Mobile use Quality, 330/303kbps)
|
||||
# bluez5.a2dp.ldac.quality = "auto"
|
||||
|
||||
## AAC variable bitrate mode
|
||||
## Available values: 0 (cbr, default), 1-5 (quality level)
|
||||
# bluez5.a2dp.aac.bitratemode = 0
|
||||
|
||||
## Profile connected first
|
||||
## Available values: a2dp-sink (default), headset-head-unit
|
||||
# device.profile = "a2dp-sink"
|
||||
|
||||
## Opus Pro Audio encoding mode: audio, voip, lowdelay
|
||||
# bluez5.a2dp.opus.pro.application = "audio"
|
||||
# bluez5.a2dp.opus.pro.bidi.application = "audio"
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
matches = [
|
||||
{
|
||||
## Matches all sources.
|
||||
node.name = "~bluez_input.*"
|
||||
}
|
||||
{
|
||||
## Matches all sinks.
|
||||
node.name = "~bluez_output.*"
|
||||
}
|
||||
]
|
||||
actions = {
|
||||
update-props = {
|
||||
# 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
|
||||
# session.suspend-timeout-seconds = 5
|
||||
# monitor.channel-volumes = false
|
||||
|
||||
## Media source role, "input" or "playback"
|
||||
## Defaults to "playback", playing stream to speakers
|
||||
## Set to "input" to use as an input for apps
|
||||
# bluez5.media-source-role = "input"
|
||||
}
|
||||
}
|
||||
}
|
||||
## This rule example allows changing properties on all Bluetooth nodes.
|
||||
# {
|
||||
# matches = [
|
||||
# {
|
||||
# ## Matches all sources.
|
||||
# node.name = "~bluez_input.*"
|
||||
# }
|
||||
# {
|
||||
# ## Matches all sinks.
|
||||
# node.name = "~bluez_output.*"
|
||||
# }
|
||||
# ]
|
||||
# actions = {
|
||||
# update-props = {
|
||||
# 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
|
||||
# session.suspend-timeout-seconds = 5
|
||||
# monitor.channel-volumes = false
|
||||
#
|
||||
# ## Media source role, "input" or "playback"
|
||||
# ## Defaults to "playback", playing stream to speakers
|
||||
# ## Set to "input" to use as an input for apps
|
||||
# bluez5.media-source-role = "input"
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
]
|
||||
|
||||
## The list of monitor MIDI rules
|
||||
|
|
|
|||
|
|
@ -32,6 +32,10 @@ nodes_om = ObjectManager {
|
|||
}
|
||||
}
|
||||
|
||||
function applyDefaultDeviceProperties (properties)
|
||||
properties["bluez5.auto-connect"] = "[ hfp_hf hsp_hs a2dp_sink ]"
|
||||
end
|
||||
|
||||
function setOffloadActive(device, value)
|
||||
local pod = Pod.Object {
|
||||
"Spa:Pod:Object:Param:Props", "Props", bluetoothOffloadActive = value
|
||||
|
|
@ -340,7 +344,10 @@ function createDevice(parent, id, type, factory, properties)
|
|||
properties["api.bluez5.id"] = id
|
||||
|
||||
-- apply properties from bluetooth.conf
|
||||
cutils.evaluateRulesApplyProperties (properties, "monitor.bluetooth")
|
||||
local applied = cutils.evaluateRulesApplyProperties (properties, "monitor.bluetooth")
|
||||
if not applied then
|
||||
applyDefaultDeviceProperties (properties)
|
||||
end
|
||||
|
||||
-- create the device
|
||||
device = SpaDevice(factory, properties)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue