Skip to content

WIP: bluetooth: Enable swapping A2DP source and sink role

Enable switching from A2DP source to A2DP sink profile and vice-versa, when two devices capable of supporting both (ie. two machines running PulseAudio) are connected.

Now with codec switching in place it is fairly trivial to implement role swapping as it is effectively a codec switch to an endpoint in the other direction.

This MR is more or less a tracking issue, investigating how to best solve this keeping in mind various ideas and open MRs. The code is a proof of concept but suggestions and answers to the questions below are welcome!


  • Code quality: finding an applicable endpoint should be part of the codec iteration/fallback mechanism, attempting every available endpoint in order of decreasing codec and capability quality;
  • The opposite (unselected) profile initially says "unavailable", but this should solely be determined by available source/sink endpoints;
  • The peer sometimes switches to the off profile when swapping roles, this has to be checked (likely incorrectly sending/handling SetConfiguration).
Edited by Marijn Suijten

Merge request reports