50-bluez-config.lua 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. bluez_monitor.enabled = true
  2. bluez_monitor.properties = {
  3. -- These features do not work on all headsets, so they are enabled
  4. -- by default based on the hardware database. They can also be
  5. -- forced on/off for all devices by the following options:
  6. --["bluez5.enable-sbc-xq"] = true,
  7. --["bluez5.enable-msbc"] = true,
  8. --["bluez5.enable-hw-volume"] = true,
  9. -- See bluez-hardware.conf for the hardware database.
  10. -- Enabled headset roles (default: [ hfp_hf hfp_ag ]), this
  11. -- property only applies to native backend. Currently some headsets
  12. -- (Sony WH-1000XM3) are not working with both hsp_ag and hfp_ag
  13. -- enabled, disable either hsp_ag or hfp_ag to work around it.
  14. --
  15. -- Supported headset roles: hsp_hs (HSP Headset),
  16. -- hsp_ag (HSP Audio Gateway),
  17. -- hfp_hf (HFP Hands-Free),
  18. -- hfp_ag (HFP Audio Gateway)
  19. --["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]",
  20. -- Enabled A2DP codecs (default: all).
  21. --["bluez5.codecs"] = "[ sbc sbc_xq aac ldac aptx aptx_hd aptx_ll aptx_ll_duplex faststream faststream_duplex ]",
  22. -- HFP/HSP backend (default: native).
  23. -- Available values: any, none, hsphfpd, ofono, native
  24. --["bluez5.hfphsp-backend"] = "native",
  25. -- HFP/HSP native backend modem (default: none).
  26. -- Available values: none, any or the modem device string as found in
  27. -- 'Device' property of org.freedesktop.ModemManager1.Modem interface
  28. --["bluez5.hfphsp-backend-native-modem"] = "none",
  29. -- HFP/HSP hardware offload SCO support (default: false).
  30. --["bluez5.hw-offload-sco"] = false,
  31. -- Properties for the A2DP codec configuration
  32. --["bluez5.default.rate"] = 48000,
  33. --["bluez5.default.channels"] = 2,
  34. -- Register dummy AVRCP player, required for AVRCP volume function.
  35. -- Disable if you are running mpris-proxy or equivalent.
  36. --["bluez5.dummy-avrcp-player"] = true,
  37. -- Opus Pro Audio mode settings
  38. --["bluez5.a2dp.opus.pro.channels"] = 3, -- no. channels
  39. --["bluez5.a2dp.opus.pro.coupled-streams"] = 1, -- no. joint stereo pairs, see RFC 7845 Sec. 5.1.1
  40. --["bluez5.a2dp.opus.pro.locations"] = "FL,FR,LFE", -- audio locations
  41. --["bluez5.a2dp.opus.pro.max-bitrate"] = 600000,
  42. --["bluez5.a2dp.opus.pro.frame-dms"] = 50, -- frame duration in 1/10 ms: 25, 50, 100, 200, 400
  43. --["bluez5.a2dp.opus.pro.bidi.channels"] = 1, -- same settings for the return direction
  44. --["bluez5.a2dp.opus.pro.bidi.coupled-streams"] = 0,
  45. --["bluez5.a2dp.opus.pro.bidi.locations"] = "FC",
  46. --["bluez5.a2dp.opus.pro.bidi.max-bitrate"] = 160000,
  47. --["bluez5.a2dp.opus.pro.bidi.frame-dms"] = 400,
  48. -- Enable the logind module, which arbitrates which user will be allowed
  49. -- to have bluetooth audio enabled at any given time (particularly useful
  50. -- if you are using GDM as a display manager, as the gdm user also launches
  51. -- pipewire and wireplumber).
  52. -- This requires access to the D-Bus user session; disable if you are running
  53. -- a system-wide instance of wireplumber.
  54. ["with-logind"] = true,
  55. }
  56. bluez_monitor.rules = {
  57. -- An array of matches/actions to evaluate.
  58. {
  59. -- Rules for matching a device or node. It is an array of
  60. -- properties that all need to match the regexp. If any of the
  61. -- matches work, the actions are executed for the object.
  62. matches = {
  63. {
  64. -- This matches all cards.
  65. { "device.name", "matches", "bluez_card.*" },
  66. },
  67. },
  68. -- Apply properties on the matched object.
  69. apply_properties = {
  70. -- Auto-connect device profiles on start up or when only partial
  71. -- profiles have connected. Disabled by default if the property
  72. -- is not specified.
  73. --["bluez5.auto-connect"] = "[ hfp_hf hsp_hs a2dp_sink hfp_ag hsp_ag a2dp_source ]",
  74. ["bluez5.auto-connect"] = "[ hfp_hf hsp_hs a2dp_sink ]",
  75. -- Hardware volume control (default: [ hfp_ag hsp_ag a2dp_source ])
  76. --["bluez5.hw-volume"] = "[ hfp_hf hsp_hs a2dp_sink hfp_ag hsp_ag a2dp_source ]",
  77. -- LDAC encoding quality
  78. -- Available values: auto (Adaptive Bitrate, default)
  79. -- hq (High Quality, 990/909kbps)
  80. -- sq (Standard Quality, 660/606kbps)
  81. -- mq (Mobile use Quality, 330/303kbps)
  82. --["bluez5.a2dp.ldac.quality"] = "auto",
  83. -- AAC variable bitrate mode
  84. -- Available values: 0 (cbr, default), 1-5 (quality level)
  85. --["bluez5.a2dp.aac.bitratemode"] = 0,
  86. -- Profile connected first
  87. -- Available values: a2dp-sink (default), headset-head-unit
  88. --["device.profile"] = "a2dp-sink",
  89. -- Opus Pro Audio encoding mode: audio, voip, lowdelay
  90. --["bluez5.a2dp.opus.pro.application"] = "audio",
  91. --["bluez5.a2dp.opus.pro.bidi.application"] = "audio",
  92. },
  93. },
  94. {
  95. matches = {
  96. {
  97. -- Matches all sources.
  98. { "node.name", "matches", "bluez_input.*" },
  99. },
  100. {
  101. -- Matches all sinks.
  102. { "node.name", "matches", "bluez_output.*" },
  103. },
  104. },
  105. apply_properties = {
  106. --["node.nick"] = "My Node",
  107. --["priority.driver"] = 100,
  108. --["priority.session"] = 100,
  109. --["node.pause-on-idle"] = false,
  110. --["resample.quality"] = 4,
  111. --["channelmix.normalize"] = false,
  112. --["channelmix.mix-lfe"] = false,
  113. --["session.suspend-timeout-seconds"] = 5, -- 0 disables suspend
  114. --["monitor.channel-volumes"] = false,
  115. -- Media source role, "input" or "playback"
  116. -- Defaults to "playback", playing stream to speakers
  117. -- Set to "input" to use as an input for apps
  118. --["bluez5.media-source-role"] = "input",
  119. },
  120. },
  121. }