Merge branch 'bugfix/a2dp_sink_reconfig_i2s_clk_fail' into 'master'

bt: Fixed that i2s_channel_disable was not called before calling i2s_channel_reconfig_std_clock in the A2DP sink example, which caused reconfiguring the I2S clock to fail

Closes BT-2680

See merge request espressif/esp-idf!19530
This commit is contained in:
Jiang Jiang Jian 2022-08-16 21:18:43 +08:00
commit 3ff6cf26eb
2 changed files with 4 additions and 0 deletions

View File

@ -313,8 +313,10 @@ static void bt_av_hdl_a2d_evt(uint16_t event, void *p_param)
#ifdef CONFIG_EXAMPLE_A2DP_SINK_OUTPUT_INTERNAL_DAC
i2s_set_clk(0, sample_rate, 16, 2);
#else
i2s_channel_disable(tx_chan);
i2s_std_clk_config_t clk_cfg = I2S_STD_CLK_DEFAULT_CONFIG(sample_rate);
i2s_channel_reconfig_std_clock(tx_chan, &clk_cfg);
i2s_channel_enable(tx_chan);
#endif
ESP_LOGI(BT_AV_TAG, "Configure audio player: %x-%x-%x-%x",
a2d->audio_cfg.mcc.cie.sbc[0],

View File

@ -173,8 +173,10 @@ static void bt_av_hdl_a2d_evt(uint16_t event, void *p_param)
#ifdef CONFIG_EXAMPLE_A2DP_SINK_OUTPUT_INTERNAL_DAC
i2s_set_clk(0, sample_rate, 16, 2);
#else
i2s_channel_disable(tx_chan);
i2s_std_clk_config_t clk_cfg = I2S_STD_CLK_DEFAULT_CONFIG(sample_rate);
i2s_channel_reconfig_std_clock(tx_chan, &clk_cfg);
i2s_channel_enable(tx_chan);
#endif
ESP_LOGI(BT_AV_TAG, "Configure audio player %x-%x-%x-%x",