## Template WirePlumber Bluetooth configuration

wireplumber.settings = {
  ## Whether to store state on the filesystem.
  # bluetooth.use-persistent-storage = true

  ## Whether to use headset profile in the presence of an input stream.
  # bluetooth.autoswitch-to-headset-profile = true
}

monitor.bluez.properties = {
  ## The properties used when constructing the 'api.bluez5.enum.dbus' plugin

  ## Enabled roles (default: [ a2dp_sink a2dp_source bap_sink bap_source hfp_hf hfp_ag ])
  ##
  ## Currently some headsets (Sony WH-1000XM3) are not working with
  ## both hsp_ag and hfp_ag enabled, so by default we enable only HFP.
  ##
  ## Supported roles: hsp_hs (HSP Headset),
  ##                  hsp_ag (HSP Audio Gateway),
  ##                  hfp_hf (HFP Hands-Free),
  ##                  hfp_ag (HFP Audio Gateway)
  ##                  a2dp_sink (A2DP Audio Sink)
  ##                  a2dp_source (A2DP Audio Source)
  ##                  bap_sink (LE Audio Basic Audio Profile Sink)
  ##                  bap_source (LE Audio Basic Audio Profile Source)
  # bluez5.roles = [ a2dp_sink a2dp_source bap_sink bap_source hsp_hs hsp_ag hfp_hf hfp_ag ]

  ## Enabled A2DP codecs (default: all).
  # bluez5.codecs = [ sbc sbc_xq aac ldac aptx aptx_hd aptx_ll aptx_ll_duplex faststream faststream_duplex ]

  ## These features do not work on all headsets, so they are enabled
  ## by default based on the hardware database. They can also be
  ## forced on/off for all devices by the following options:
  # bluez5.enable-sbc-xq = true
  # bluez5.enable-msbc = true
  # bluez5.enable-hw-volume = true

  ## HFP/HSP backend (default: native).
  ## Available values: any, none, hsphfpd, ofono, native
  # bluez5.hfphsp-backend = "native"

  ## HFP/HSP native backend modem (default: none).
  ## Available values: none, any or the modem device string as found in
  ## 'Device' property of org.freedesktop.ModemManager1.Modem interface
  # bluez5.hfphsp-backend-native-modem = "none"

  ## HFP/HSP hardware offload SCO support (default: false).
  ## Using this feature requires a custom WirePlumber script that
  ## handles audio routing in a platform-specific way. See
  ## tests/examples/bt-pinephone.lua for an example.
  # bluez5.hw-offload-sco = false

  ## Properties for the A2DP codec configuration
  # bluez5.default.rate = 48000
  # bluez5.default.channels = 2

  ## Register dummy AVRCP player. Some devices have wrongly functioning
  ## volume or playback controls if this is not enabled. Default: false
  # bluez5.dummy-avrcp-player = true

  ## Opus Pro Audio mode settings
  # bluez5.a2dp.opus.pro.channels = 3
  # bluez5.a2dp.opus.pro.coupled-streams = 1
  # bluez5.a2dp.opus.pro.locations = [ FL,FR,LFE ]
  # bluez5.a2dp.opus.pro.max-bitrate = 600000
  # bluez5.a2dp.opus.pro.frame-dms = 50
  # bluez5.a2dp.opus.pro.bidi.channels = 1
  # bluez5.a2dp.opus.pro.bidi.coupled-streams = 0
  # bluez5.a2dp.opus.pro.bidi.locations = [ FC ]
  # bluez5.a2dp.opus.pro.bidi.max-bitrate = 160000
  # bluez5.a2dp.opus.pro.bidi.frame-dms = 400
}

monitor.bluez-midi.properties = {
  ## The properties used when constructing the 'api.bluez5.midi.enum' plugin
}

monitor.bluez-midi.servers = [
  ## List of MIDI server node names. Each node name given will create a new instance
  ## of a BLE MIDI service. Typical BLE MIDI instruments have on service instance,
  ## so adding more than one here may confuse some clients. The node property matching
  ## rules below apply also to these servers.

  # "bluez_midi.server"
]

monitor.bluez.rules = [
  ## The list of monitor rules

  ## This rule example allows changing properties on all Bluetooth devices.
  # {
  #   matches = [
  #     {
  #       ## This matches all bluetooth devices.
  #       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
  #
  #       ## Opus Pro Audio encoding mode: audio, voip, lowdelay
  #       bluez5.a2dp.opus.pro.application = "audio"
  #       bluez5.a2dp.opus.pro.bidi.application = "audio"
  #     }
  #   }
  # }

  ## 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"
  #     }
  #   }
  # }
]

monitor.bluez-midi.rules = [
  ## The list of MIDI monitor rules

  ## This rule example allows changing properties on all Bluetooth MIDI nodes.
  # {
  #   matches = [
  #     ## Matches all bluez midi nodes.
  #     {
  #       ## Matches all sources.
  #       node.name = "~bluez_midi.*"
  #     }
  #   ]
  #   actions = {
  #     update-props = {
  #       node.nick = "My Node"
  #       priority.driver = 100
  #       priority.session = 100
  #       node.pause-on-idle = false
  #       session.suspend-timeout-seconds = 5
  #       node.latency-offset-msec = 0
  #     }
  #   }
  # }
]
