0001 Added Simple SBC XQ From Soundexpert Org Blog
0001 Added Simple SBC XQ From Soundexpert Org Blog
---
src/bluealsa.h | 3 +++
src/bluez.c | 17 +++++++++++++++--
src/main.c | 6 ++++++
3 files changed, 24 insertions(+), 2 deletions(-)
/* The number of seconds for keeping A2DP transport alive after PCM has
* been closed. One might set this value to negative number for
infinite
diff --git a/src/bluez.c b/src/bluez.c
index 6d17a6e..d3d5b6c 100644
--- a/src/bluez.c
+++ b/src/bluez.c
@@ -207,8 +207,20 @@ static void
bluez_endpoint_select_configuration(GDBusMethodInvocation *inv, void
a2dp_sbc_t *cap = capabilities;
unsigned int cap_chm = cap->channel_mode;
unsigned int cap_freq = cap->frequency;
-
- if ((cap->channel_mode = bluez_a2dp_codec_select_channel_mode(codec,
cap_chm)) == 0) {
+ size_t i;
+
+
+ if (config.a2dp.force_sbcxq) {
+ for (i = 0; i < codec->channels_size; i++)
+ if (codec->channels[i].mode == BLUEZ_A2DP_CHM_DUAL_CHANNEL &&
+ cap_chm & codec->channels[i].value)
+ cap->channel_mode = codec->channels[i].value;
+ if (cap->channel_mode == 0) {
+ error("SBC dual channel mode not supported: %#x", cap_chm);
+ goto fail;
+ }
+ }
+ else if ((cap->channel_mode = bluez_a2dp_codec_select_channel_mode(codec,
cap_chm)) == 0) {
error("No supported channel modes: %#x", cap_chm);
goto fail;
}
@@ -250,6 +262,7 @@ static void
bluez_endpoint_select_configuration(GDBusMethodInvocation *inv, void
}