meta-pipewire: update to pipewire 0.3.25 and wireplumber master
[AGL/meta-agl.git] / meta-pipewire / recipes-multimedia / wireplumber / wireplumber-config-agl / 30-bluez-monitor.lua
1 -- Bluez monitor config file --
2
3 bluez_monitor = {}
4
5 bluez_monitor.properties = {
6   --["bluez5.sbc-xq-support"] = true,
7
8   -- Enabled headset roles (default: [ hsp_hs hfp_ag ]), this
9   -- property only applies to native backend. Currently some headsets
10   -- (Sony WH-1000XM3) are not working with both hsp_ag and hfp_ag
11   -- enabled, disable either hsp_ag or hfp_ag to work around it.
12   --
13   -- Supported headset roles: hsp_hs (HSP Headset),
14   --                          hsp_ag (HSP Audio Gateway),
15   --                          hfp_hf (HFP Hands-Free),
16   --                          hfp_ag (HFP Audio Gateway)
17   ["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]",
18
19   -- Enabled A2DP codecs (default: all).
20   --["bluez5.codecs"] = "[ sbc aac ldac aptx aptx_hd ]",
21 }
22
23 bluez_monitor.rules = {
24   -- An array of matches/actions to evaluate.
25   {
26     -- Rules for matching a device or node. It is an array of
27     -- properties that all need to match the regexp. If any of the
28     -- matches work, the actions are executed for the object.
29     matches = {
30       {
31         -- This matches all cards.
32         { "device.name", "matches", "bluez_card.*" },
33       },
34     },
35     -- Apply properties on the matched object.
36     apply_properties = {
37       -- Autoconnect device profiles, disabled by default
38       -- if the property is not specified.
39       ["bluez5.reconnect-profiles"]  = "[ hfp_hf hsp_hs a2dp_sink ]",
40
41       -- MSBC is not expected to work on all headset + adapter combinations.
42       --["bluez5.msbc-support"] = false,
43
44       -- LDAC encoding quality
45       -- Available values: auto (Adaptive Bitrate, default)
46       --                   hq   (High Quality, 990/909kbps)
47       --                   sq   (Standard Quality, 660/606kbps)
48       --                   mq   (Mobile use Quality, 330/303kbps)
49       --["bluez5.a2dp.ldac.quality"] = "auto",
50     },
51   },
52   {
53     -- Make output stream nodes go through the Communication endpoint
54     -- Unfortunately we cannot match on "media.class" because this property
55     -- is not known before the node is created
56     matches = {
57       {
58         { "api.bluez5.profile", "equals", "headset-audio-gateway" },
59         { "factory.name", "matches", "*source*" },
60       },
61       {
62         { "api.bluez5.profile", "equals", "a2dp-source" },
63       },
64     },
65     apply_properties = {
66       ["media.role"]  = "Communication",
67     },
68   },
69 }
70
71 function bluez_monitor.enable()
72   load_monitor("bluez", {
73     properties = bluez_monitor.properties,
74     rules = bluez_monitor.rules,
75   })
76 end