Use 48kHz SBC instead of 44.1

custom
jacqueline 1 year ago
parent d6355ea7c9
commit 35a822fe60
  1. 4
      lib/bt/host/bluedroid/btc/profile/std/a2dp/bta_av_co.c
  2. 4
      lib/bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp_source.c
  3. 2
      src/audio/bt_audio_output.cpp

@ -70,7 +70,7 @@ const UINT8 bta_av_co_cp_scmst[BTA_AV_CP_INFO_LEN] = "\x02\x02\x00";
/* SBC SRC codec capabilities */ /* SBC SRC codec capabilities */
const tA2D_SBC_CIE bta_av_co_sbc_caps = { const tA2D_SBC_CIE bta_av_co_sbc_caps = {
(A2D_SBC_IE_SAMP_FREQ_44), /* samp_freq */ (A2D_SBC_IE_SAMP_FREQ_44 | A2D_SBC_IE_SAMP_FREQ_48), /* samp_freq */
(A2D_SBC_IE_CH_MD_MONO | A2D_SBC_IE_CH_MD_STEREO | A2D_SBC_IE_CH_MD_JOINT | A2D_SBC_IE_CH_MD_DUAL), /* ch_mode */ (A2D_SBC_IE_CH_MD_MONO | A2D_SBC_IE_CH_MD_STEREO | A2D_SBC_IE_CH_MD_JOINT | A2D_SBC_IE_CH_MD_DUAL), /* ch_mode */
(A2D_SBC_IE_BLOCKS_16 | A2D_SBC_IE_BLOCKS_12 | A2D_SBC_IE_BLOCKS_8 | A2D_SBC_IE_BLOCKS_4), /* block_len */ (A2D_SBC_IE_BLOCKS_16 | A2D_SBC_IE_BLOCKS_12 | A2D_SBC_IE_BLOCKS_8 | A2D_SBC_IE_BLOCKS_4), /* block_len */
(A2D_SBC_IE_SUBBAND_4 | A2D_SBC_IE_SUBBAND_8), /* num_subbands */ (A2D_SBC_IE_SUBBAND_4 | A2D_SBC_IE_SUBBAND_8), /* num_subbands */
@ -91,7 +91,7 @@ const tA2D_SBC_CIE bta_av_co_sbc_sink_caps = {
}; };
#if !defined(BTC_AV_SBC_DEFAULT_SAMP_FREQ) #if !defined(BTC_AV_SBC_DEFAULT_SAMP_FREQ)
#define BTC_AV_SBC_DEFAULT_SAMP_FREQ A2D_SBC_IE_SAMP_FREQ_44 #define BTC_AV_SBC_DEFAULT_SAMP_FREQ A2D_SBC_IE_SAMP_FREQ_48
#endif #endif
/* Default SBC codec configuration */ /* Default SBC codec configuration */

@ -441,8 +441,8 @@ void btc_a2dp_source_setup_codec(void)
osi_mutex_global_lock(); osi_mutex_global_lock();
/* for now hardcode 44.1 khz 16 bit stereo PCM format */ /* for now hardcode 48 khz 16 bit stereo PCM format */
media_feeding.cfg.pcm.sampling_freq = 44100; media_feeding.cfg.pcm.sampling_freq = 48000;
media_feeding.cfg.pcm.bit_per_sample = 16; media_feeding.cfg.pcm.bit_per_sample = 16;
media_feeding.cfg.pcm.num_channel = 2; media_feeding.cfg.pcm.num_channel = 2;
media_feeding.format = BTC_AV_CODEC_PCM; media_feeding.format = BTC_AV_CODEC_PCM;

@ -83,7 +83,7 @@ auto BluetoothAudioOutput::PrepareFormat(const Format& orig) -> Format {
// ESP-IDF's current Bluetooth implementation currently handles SBC encoding, // ESP-IDF's current Bluetooth implementation currently handles SBC encoding,
// but requires a fixed input format. // but requires a fixed input format.
return Format{ return Format{
.sample_rate = 44100, .sample_rate = 48000,
.num_channels = 2, .num_channels = 2,
.bits_per_sample = 16, .bits_per_sample = 16,
}; };

Loading…
Cancel
Save