From f4fd5f33d1f68ad81da778cdad1478bfc755d8ae Mon Sep 17 00:00:00 2001 From: Florian Pfister Date: Mon, 5 Nov 2018 15:32:13 +0100 Subject: [PATCH] dsp: add SBC support for BT sink mode Update SBC sample frequency and number of channels from IPC library to set AFE port accordingly. Change-Id: Ibca385b0fc0ba4c3122053559b1116bd4c31336d Signed-off-by: Florian Pfister --- dsp/q6afe.c | 4 ++++ include/dsp/apr_audio-v2.h | 18 ++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/dsp/q6afe.c b/dsp/q6afe.c index 0d5721e5305d..2810bebd9829 100644 --- a/dsp/q6afe.c +++ b/dsp/q6afe.c @@ -3541,6 +3541,10 @@ static int q6afe_send_dec_config(u16 port_id, media_type.sample_rate = cfg->data.aac_config.sample_rate; break; + case ASM_MEDIA_FMT_SBC: + media_type.sample_rate = + cfg->data.sbc_config.sample_rate; + break; default: media_type.sample_rate = afe_config.slim_sch.sample_rate; diff --git a/include/dsp/apr_audio-v2.h b/include/dsp/apr_audio-v2.h index eb529dc1e8e6..9ac728185953 100644 --- a/include/dsp/apr_audio-v2.h +++ b/include/dsp/apr_audio-v2.h @@ -4311,9 +4311,23 @@ struct afe_port_media_type_t { * #ASM_MEDIA_FMT_SBC media format. */ struct asm_sbc_dec_cfg_t { - /* All configuration is extracted from the stream */ -} __packed; + uint16_t channels; + /* + * Number of channels present in the SBC stream. + * + * @values + * - 1 -- Mono + * - 2 -- Stereo + */ + uint32_t sample_rate; + /* + * Number of samples per second. + * + * @values 8000, 11025, 12000, 16000, 22050, 24000, 32000, + * 44100, 48000, 64000, 88200, 96000 Hz + */ +} __packed; /* * Payload of the MP3 decoder configuration parameters in the * #ASM_MEDIA_FMT_MP3 media format.