summaryrefslogtreecommitdiffstats
path: root/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/bluetooth.lua.d/30-bluez-monitor.lua
diff options
context:
space:
mode:
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2021-09-20 14:29:45 +0300
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2021-10-14 15:21:16 +0000
commit1b0d65113b277610135b5599c8810ca7a4e3df4c (patch)
treec3579bbc0795fb8cb26c36505742edd84b383acb /meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/bluetooth.lua.d/30-bluez-monitor.lua
parent3b7fb84007945e5b19c705b24179260cad05ba55 (diff)
meta-agl: split wireplumber to run in multiple instances
The "IC SoundManager" design specifies that there needs to be a session manager running in the host to manage devices and permissions, but all the domain-specific policy and app management needs to run in the IVI container, together with the apps. With this split, we are able to achieve that. In addition to the "host" and "policy" instances, we are also adding a "bluetooth" one, which loads the bluetooth plugin and manages the bluetooth device. This can be moved to the IVI container as well, or elsewhere... it only depends on bluez (so it must run in the same container as bluez). For now, given the absence of an IVI container in the lxc-demo image, all instances are running in the host, but it is trivial to move all the non-host ones to another container later. To compliment pipewire-ic-ipc, this change also adds an "alsa-suspend" lua script that runs in the context of the "host" wireplumber instance and its purpose is to mute pipewire-managed alsa devices when there is a sound playing in the IC container (on another alsa device). Finally, this change also adds V4L2 configuration in the "host" wireplumber instance, which is still disabled (and untested), but you can easily enable it for experimentation by uncommenting the relevant line in host.lua.d/90-enable-all.lua Bug-AGL: SPEC-4027 Signed-off-by: George Kiagiadakis <george.kiagiadakis@collabora.com> Change-Id: I9febc4f3919e7c559a5d7d32bfe7bc95c75934f2 Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/26662 Tested-by: Jenkins Job builder account ci-image-build: Jenkins Job builder account ci-image-boot-test: Jenkins Job builder account Reviewed-by: Naoto YAMAGUCHI <naoto.yamaguchi@aisin.co.jp> Reviewed-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
Diffstat (limited to 'meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/bluetooth.lua.d/30-bluez-monitor.lua')
-rw-r--r--meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/bluetooth.lua.d/30-bluez-monitor.lua107
1 files changed, 107 insertions, 0 deletions
diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/bluetooth.lua.d/30-bluez-monitor.lua b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/bluetooth.lua.d/30-bluez-monitor.lua
new file mode 100644
index 000000000..36fe749bb
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/bluetooth.lua.d/30-bluez-monitor.lua
@@ -0,0 +1,107 @@
+-- Bluez monitor config file --
+
+bluez_monitor = {}
+
+bluez_monitor.properties = {
+ -- 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"] = 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_hf (HFP Hands-Free),
+ -- hfp_ag (HFP Audio Gateway)
+ ["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]",
+
+ -- Enabled A2DP codecs (default: all).
+ --["bluez5.codecs"] = "[ sbc aac ldac aptx aptx_hd ]",
+
+ -- Properties for the A2DP codec configuration
+ --["bluez5.default.rate"] = 48000,
+ --["bluez5.default.channels"] = 2,
+}
+
+bluez_monitor.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 = {
+ -- 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 ]",
+ ["bluez5.auto-connect"] = "[ hfp_hf hsp_hs a2dp_sink ]",
+
+ -- Overload mSBC support for native backend and a specific device.
+ --["bluez5.msbc-support"] = false,
+
+ -- 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",
+ },
+ },
+ {
+ -- Make output hsp/hfp stream nodes go through the Communication endpoint
+ -- Unfortunately we cannot match on "media.class" because this property
+ -- is not known before the node is created
+ matches = {
+ {
+ { "api.bluez5.profile", "equals", "headset-audio-gateway" },
+ { "factory.name", "matches", "*source*" },
+ },
+ },
+ apply_properties = {
+ ["media.role"] = "Communication",
+ },
+ },
+ {
+ -- Make output a2dp stream nodes go through the Multimedia endpoint
+ -- Unfortunately we cannot match on "media.class" because this property
+ -- is not known before the node is created
+ matches = {
+ {
+ { "api.bluez5.profile", "equals", "a2dp-source" },
+ },
+ },
+ apply_properties = {
+ ["media.role"] = "Multimedia",
+ },
+ },
+}
+
+load_monitor("bluez", {
+ properties = bluez_monitor.properties,
+ rules = bluez_monitor.rules,
+})