From 0298e9d6ae1346d6005b334b92a43c4046d16768 Mon Sep 17 00:00:00 2001 From: yangfeng Date: Thu, 25 Jun 2026 11:42:14 +0800 Subject: [PATCH] feat(bt/example): Support I2S output of esp32s31 in A2DP sink stream example --- .../bluedroid/classic_bt/a2dp_sink_stream/README.md | 10 +++++++++- .../a2dp_sink_stream/sdkconfig.defaults.esp32s31 | 5 ++++- .../classic_bt/a2dp_sink_stream_aac/README.md | 10 +++++++++- .../a2dp_sink_stream_aac/sdkconfig.defaults.esp32s31 | 5 ++++- 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/examples/bluetooth/bluedroid/classic_bt/a2dp_sink_stream/README.md b/examples/bluetooth/bluedroid/classic_bt/a2dp_sink_stream/README.md index 65eed2e5d41..9285e4cb760 100644 --- a/examples/bluetooth/bluedroid/classic_bt/a2dp_sink_stream/README.md +++ b/examples/bluetooth/bluedroid/classic_bt/a2dp_sink_stream/README.md @@ -50,7 +50,15 @@ If the internal DAC is selected, analog audio will be available on GPIO25 and GP #### ESP32-S31 -The default output is idle. If I2S is used, it can be configured through menuconfig. Currently, DAC is not supported. +The default output is I2S. If I2S is used, it can be configured through menuconfig. The default I2S connections are shown below: + +| ESP pin | I2S signal | +| :-------- | :----------- | +| GPIO3 | LRCK | +| GPIO4 | DATA | +| GPIO2 | BCK | + +Currently, DAC is not supported. ### Configure the project diff --git a/examples/bluetooth/bluedroid/classic_bt/a2dp_sink_stream/sdkconfig.defaults.esp32s31 b/examples/bluetooth/bluedroid/classic_bt/a2dp_sink_stream/sdkconfig.defaults.esp32s31 index 9a77739a3d4..76b30b33b95 100644 --- a/examples/bluetooth/bluedroid/classic_bt/a2dp_sink_stream/sdkconfig.defaults.esp32s31 +++ b/examples/bluetooth/bluedroid/classic_bt/a2dp_sink_stream/sdkconfig.defaults.esp32s31 @@ -1,2 +1,5 @@ CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE=y -CONFIG_EXAMPLE_A2DP_SINK_OUTPUT_IDLE=y +CONFIG_EXAMPLE_A2DP_SINK_OUTPUT_EXTERNAL_I2S=y +CONFIG_EXAMPLE_I2S_BCK_PIN=2 +CONFIG_EXAMPLE_I2S_LRCK_PIN=3 +CONFIG_EXAMPLE_I2S_DATA_PIN=4 diff --git a/examples/bluetooth/bluedroid/classic_bt/a2dp_sink_stream_aac/README.md b/examples/bluetooth/bluedroid/classic_bt/a2dp_sink_stream_aac/README.md index 5089aa70461..b7677198539 100644 --- a/examples/bluetooth/bluedroid/classic_bt/a2dp_sink_stream_aac/README.md +++ b/examples/bluetooth/bluedroid/classic_bt/a2dp_sink_stream_aac/README.md @@ -39,7 +39,15 @@ If the internal DAC is selected, analog audio will be available on GPIO25 and GP #### ESP32-S31 -The default output is idle. If I2S is used, it can be configured through menuconfig. Currently, DAC is not supported. +The default output is I2S. If I2S is used, it can be configured through menuconfig. The default I2S connections are shown below: + +| ESP pin | I2S signal | +| :-------- | :----------- | +| GPIO3 | LRCK | +| GPIO4 | DATA | +| GPIO2 | BCK | + +Currently, DAC is not supported. ### Configure the project diff --git a/examples/bluetooth/bluedroid/classic_bt/a2dp_sink_stream_aac/sdkconfig.defaults.esp32s31 b/examples/bluetooth/bluedroid/classic_bt/a2dp_sink_stream_aac/sdkconfig.defaults.esp32s31 index 9a77739a3d4..76b30b33b95 100644 --- a/examples/bluetooth/bluedroid/classic_bt/a2dp_sink_stream_aac/sdkconfig.defaults.esp32s31 +++ b/examples/bluetooth/bluedroid/classic_bt/a2dp_sink_stream_aac/sdkconfig.defaults.esp32s31 @@ -1,2 +1,5 @@ CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE=y -CONFIG_EXAMPLE_A2DP_SINK_OUTPUT_IDLE=y +CONFIG_EXAMPLE_A2DP_SINK_OUTPUT_EXTERNAL_I2S=y +CONFIG_EXAMPLE_I2S_BCK_PIN=2 +CONFIG_EXAMPLE_I2S_LRCK_PIN=3 +CONFIG_EXAMPLE_I2S_DATA_PIN=4