From a74b48c14a9e713acda7369d00335ce2c1c2ba05 Mon Sep 17 00:00:00 2001 From: xiongweichao Date: Fri, 12 Aug 2022 16:44:48 +0800 Subject: [PATCH] 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 --- .../bluetooth/bluedroid/classic_bt/a2dp_sink/main/bt_app_av.c | 2 ++ .../bluetooth/bluedroid/coex/a2dp_gatts_coex/main/bt_app_av.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/bt_app_av.c b/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/bt_app_av.c index 3238cc3f27..9f161d5392 100644 --- a/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/bt_app_av.c +++ b/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/bt_app_av.c @@ -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], diff --git a/examples/bluetooth/bluedroid/coex/a2dp_gatts_coex/main/bt_app_av.c b/examples/bluetooth/bluedroid/coex/a2dp_gatts_coex/main/bt_app_av.c index f8ee8f811b..151ff86f86 100644 --- a/examples/bluetooth/bluedroid/coex/a2dp_gatts_coex/main/bt_app_av.c +++ b/examples/bluetooth/bluedroid/coex/a2dp_gatts_coex/main/bt_app_av.c @@ -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",