Parent: c1493c32d7da270329d0ac2ca02117b905c04362
Author: Pauli Virtanen <pav@iki.fi>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2025-11-17 18:47:59
Tree: f0f56315556542e98742ed3c317a3e152143886a
shared/bap: fix channel allocation logic in bt_bap_select() bt_bap_select() does not correctly determine the need for multi-stream configurations 6,7,8,9,11(i), as its result depends on whether Audio Locations is read before or after the PACs, doesn't work with general location bits, etc. Fix the procedure to be simpler: create streams for all locations, up to a specific number of channels. By default, limit to max 2 channels per direction for compatibility (BAP doesn't have explicit AC with larger channel counts.) Also simplify the code. Ignore lpac Locations when selecting: the value mostly makes sense for Unicast Server role, but Client and Server cannot use the same value as only a few bits can be set. As Client, we should be able to configure any Location bits. The sound server can simply ignore our suggested channel allocation if really needed, or use SetConfiguration() API to build custom configurations.
Diffstat
| M | profiles/audio/bap.c | | | 3 | ++- |
| M | src/shared/bap.c | | | 203 | ++++++++++++++++++++++++++++++++++++++++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| M | src/shared/bap.h | | | 7 | ++++- - - |
3 files changed, 103 insertions(+), 110 deletions(-)