diff --git a/src/a2dp-opus.c b/src/a2dp-opus.c index 4631bcb8b..030f1d659 100644 --- a/src/a2dp-opus.c +++ b/src/a2dp-opus.c @@ -52,6 +52,8 @@ static const struct a2dp_bit_mapping a2dp_opus_channels[] = { }; static const struct a2dp_bit_mapping a2dp_opus_rates[] = { + { OPUS_SAMPLING_FREQ_16000, { 16000 } }, + { OPUS_SAMPLING_FREQ_24000, { 24000 } }, { OPUS_SAMPLING_FREQ_48000, { 48000 } }, { 0 } }; @@ -481,7 +483,9 @@ struct a2dp_sep a2dp_opus_source = { .capabilities.opus = { .info = A2DP_VENDOR_INFO_INIT(OPUS_VENDOR_ID, OPUS_CODEC_ID), .sampling_freq = - OPUS_SAMPLING_FREQ_48000, + OPUS_SAMPLING_FREQ_48000 | + OPUS_SAMPLING_FREQ_24000 | + OPUS_SAMPLING_FREQ_16000, .frame_duration = OPUS_FRAME_DURATION_100 | OPUS_FRAME_DURATION_200, @@ -511,7 +515,9 @@ struct a2dp_sep a2dp_opus_sink = { .capabilities.opus = { .info = A2DP_VENDOR_INFO_INIT(OPUS_VENDOR_ID, OPUS_CODEC_ID), .sampling_freq = - OPUS_SAMPLING_FREQ_48000, + OPUS_SAMPLING_FREQ_48000 | + OPUS_SAMPLING_FREQ_24000 | + OPUS_SAMPLING_FREQ_16000, .frame_duration = OPUS_FRAME_DURATION_100 | OPUS_FRAME_DURATION_200, diff --git a/src/bluez.c b/src/bluez.c index eaaca0c36..874f059c3 100644 --- a/src/bluez.c +++ b/src/bluez.c @@ -1693,6 +1693,9 @@ bool bluez_a2dp_set_configuration( pthread_mutex_unlock(&bluez_mutex); + hexdump("A2DP requested configuration blob", + configuration, remote_sep_cfg->caps_size); + if ((rep = g_dbus_connection_send_message_with_reply_sync(config.dbus, msg, G_DBUS_SEND_MESSAGE_FLAGS_NONE, -1, NULL, NULL, error)) == NULL || g_dbus_message_to_gerror(rep, error)) diff --git a/src/shared/a2dp-codecs.h b/src/shared/a2dp-codecs.h index 4e09aadf3..ece9030fa 100644 --- a/src/shared/a2dp-codecs.h +++ b/src/shared/a2dp-codecs.h @@ -694,7 +694,9 @@ typedef struct a2dp_lhdc_v5 { #define OPUS_VENDOR_ID BT_COMPID_GOOGLE #define OPUS_CODEC_ID 0x0001 -#define OPUS_SAMPLING_FREQ_48000 (1 << 0) +#define OPUS_SAMPLING_FREQ_48000 (1 << 2) +#define OPUS_SAMPLING_FREQ_24000 (1 << 1) +#define OPUS_SAMPLING_FREQ_16000 (1 << 0) #define OPUS_FRAME_DURATION_100 (1 << 0) #define OPUS_FRAME_DURATION_200 (1 << 1) @@ -706,15 +708,13 @@ typedef struct a2dp_lhdc_v5 { typedef struct a2dp_opus { a2dp_vendor_info_t info; #if __BYTE_ORDER == __BIG_ENDIAN - uint8_t sampling_freq:1; - uint8_t rfa:2; + uint8_t sampling_freq:3; uint8_t frame_duration:2; uint8_t channel_mode:3; #else uint8_t channel_mode:3; uint8_t frame_duration:2; - uint8_t rfa:2; - uint8_t sampling_freq:1; + uint8_t sampling_freq:3; #endif } __attribute__ ((packed)) a2dp_opus_t;