1. 03 Apr, 2021 1 commit
    • Igor Kovalenko's avatar
      bluetooth: prioritize native backend HFP HF connection · 1f204a13
      Igor Kovalenko authored
      Bluez prepends newly registered profile to a list of supported profiles,
      and new peer profile connections are attempted in reverse order of profile
      Currently native backend would register HFP AG profile before HSP AG profile.
      When peer supports both HFP HF and HSP HS profiles, this registration order
      causes extra HSP HS connection attempt before native backend would reject it
      to make sure peer is reconnected with HFP HF profile.
      Reorder HSP AG profile registration before HFP AG to make sure peer supporting
      both profiles connects with HFP HF profile first.
      Part-of: <!534>
  2. 27 Mar, 2021 5 commits
  3. 26 Mar, 2021 1 commit
    • Marijn Suijten's avatar
      bluetooth: Only use hardware volume callbacks for peer attenuation · 02027518
      Marijn Suijten authored
      Setting these callbacks adds the HW_{VOLUME,MUTE}_CTRL flag even when
      PulseAudio is solely responsible for performing attenuation whilst only
      keeping the peer posted on changes.  For this case the hardware callback
      is not registered at all but instead a hook is attached to catch
      PA_CORE_HOOK_{SINK,SOURCE}_VOLUME_CHANGED.  Only when the peer performs
      attenuation (the peer is in HeadSet/HandsFree role) are the callbacks
      used, without touching PA software volume at all.  A future change could
      potentially use software volume to compensate for the extremely coarse
      16 steps of volume control in HSP and HFP, and to allow volume over
      Part-of: <!519>
  4. 25 Mar, 2021 1 commit
  5. 23 Mar, 2021 2 commits
  6. 17 Mar, 2021 1 commit
    • Marijn Suijten's avatar
      bluetooth: Set up hardware gain control if init volume is received late · 8db4dff2
      Marijn Suijten authored
      Originally written for A2DP this rework of that patch enables late-bound
      hardware volume control on HFP and HSP.  As per the specification the
      headphones (where gain control for both speaker and microphone could
      happen in hardware on the peer) are supposed to send initial values for
      these before the SCO connection is created; these `AT+VG[MS]` commands
      are also used to determine support for it.  PA uses this information in
      `add_{sink,source}` to attach hardware volume callbacks, _if_ it is
      supported.  Otherwise PA performs the attenuation in software.
      Unfortunately headphones like the WH-1000XM3's connect to A2DP
      initially and only send `AT+VGS` (microphone hardware gain is not
      supported) _during_ SCO connection when the user switches to the HFP
      profile afterwards; the callbacks set up dynamically in
      `rfcomm_io_callback` are written after the sink and source have been
      created (`add_{sink,source}`), leaving them without hardware volume
      callbacks and with software volume when adjusted on the PA side.  (The
      headphones can still send volume updates resulting in abrupt changes if
      software and peer volume differ.  Furthermore the same attenuation is
      applied twice - once in PA software, once on the peer).
      To solve this problem we simply check whether the callbacks have been
      attached whenever the peer sends a volume change, and if not attach the
      callbacks to the sink/source and reset software volume.
      Fixes: d510ddc7 ("bluetooth: Perform software attenuation until HF/HS reports gain control")
      Part-of: <!528>
  7. 16 Mar, 2021 3 commits
  8. 15 Mar, 2021 6 commits
  9. 08 Mar, 2021 1 commit
  10. 07 Mar, 2021 1 commit
  11. 06 Mar, 2021 3 commits
  12. 05 Mar, 2021 1 commit
    • Igor Kovalenko's avatar
      bluetooth: correct rfcomm command and reply formatting · 046ce91c
      Igor Kovalenko authored
      The format of COMMAND line sent from HS to AG is COMMAND<cr>
      The format of RESPONSE line sent from AG to HS is <cr><lf>RESPONSE<cr><lf>
      Split rfcomm_write into rfcomm_write_command and rfcomm_write_response to handle
      line formatting correctly.
      Part-of: <!520>
  13. 03 Mar, 2021 1 commit
  14. 01 Mar, 2021 13 commits