Add a ModemManager support to native HFP backend

Merged Frédéric Danis requested to merge fdanis/pipewire:native-hfp-ag-mm into master

There's currently 2 daemons to manage modems, oFono and ModemManager. While oFono takes care of the HSP/HFP AG Bluetooth profiles, ModemManger only handles the modem and the profiles management should be done by another application.

Based on the work done by @dylanvanassche for PulseAudio (see pulseaudio/pulseaudio!693), this MR enhanced the HFP native backend to use the ModemManager if it is present and allows to:

  • accept a call (ATA)
  • reject or hang up a call (AT+CHUP)
  • dial number (ATD<number>;)
  • ring indication (RING)
  • query signal indicators order (AT+CIND=?) and values (AT+CIND?, supported indicators are service status, call, call setup, call held, signal strength, roaming and battery level)
  • indicator (de)activation (AT+BIA)
  • indicator change event (+CIEV)
  • query operator name (AT+COPS)
  • enhanced call reporting (AT+CLIP, +CLIP)
  • enhanced error reporting (AT+CMEE, +CME ERROR:)
  • call list (AT+CLCC)
  • DTMF tone generation during a call (AT+VTS)
  • Subscriber number reporting (AT+CNUM)

The call hold, multiparty call, dial from memory and dial last number are not supported.

Testing tools for this MR
I tested this MR by running PipeWire and WirePlumber on a PinePhone.

  • a Bluetooth HFP device, depending on the device more or less features can be tested, i.e. mostly accepting or rejecting a call and hanging up a call with and headset while most of the commands/features can be tested with a multimedia system in recent car.
    • Pair & connect your HFP device
    • Test each feature of your HFP device
  • nOBEX: provides an HFP client, instructions are explained in detail in their README, all AT commands & responses are printed out with nOBEX
    • Restart bluetooth daemon with --compat flag
    • Run the as root
    • Pair & connect with the (pine)phone (you will need to send some commands to setup SLC, see their README)
    • AT commands can be send/received in nOBEX's hfp_client.

Currently the audio stream is not set up correctly on the PinePhone

Merge request reports