Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I2S to Internal DAC is Broken in 4.1 (IDFGH-4658) #6470

Closed
ducalex opened this issue Jan 27, 2021 · 4 comments
Closed

I2S to Internal DAC is Broken in 4.1 (IDFGH-4658) #6470

ducalex opened this issue Jan 27, 2021 · 4 comments
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally

Comments

@ducalex
Copy link

ducalex commented Jan 27, 2021

Environment

  • Development Kit: None
  • Kit version: None
  • Module or chip used: ESP32-WROVER-IB
  • IDF version: v4.1
  • Build System: idf.py (cmake)
  • Compiler version: (crosstool-NG esp-2020r2) 8.2.0
  • Operating System: Windows
  • (Windows only) environment type: ESP Command Prompt|Plain Command Prompt
  • Using an IDE?: No
  • Power Supply: USB

Problem Description

I2S to internal DAC produces no audio.

  • Code is working on 3.1, 3.2, 3.3.4, and 4.0.2.
  • Code is not working on 3.3.0, 4.0, 4.1 and 4.2.
  • Code works on 4.1 if I backport the i2s.c from 4.0.2.

Expected Behavior

Audio to be playing through GPIO 25 and 26 or at least an error.

Actual Behavior

No audio, no error.

Steps to reproduce

The issue was fixed in 3.3.1 and 4.0.1 I believe, but the fix never made its way to 4.1 (and possibly 4.2).

Please refer to these two forums issues that describe the problem and provide a code example to reproduce:

Debug Logs

None, there is no special error or warning or debug.

Other items if possible

@ducalex ducalex changed the title I2S to Internal DAC is Broken in 4.1/4.2 I2S to Internal DAC is Broken in 4.1 Jan 27, 2021
@github-actions github-actions bot changed the title I2S to Internal DAC is Broken in 4.1 I2S to Internal DAC is Broken in 4.1 (IDFGH-4658) Jan 27, 2021
@cfint
Copy link

cfint commented Feb 3, 2022

I traced the breaking change to this commit 8c76a3c. With the following change applied to v4.1, the A2DP audio sink with internal DAC works again.

diff --git a/components/soc/src/hal/i2s_hal.c b/components/soc/src/hal/i2s_hal.c
index 6639525ea8..e21856bd34 100644
--- a/components/soc/src/hal/i2s_hal.c
+++ b/components/soc/src/hal/i2s_hal.c
@@ -194,7 +194,7 @@ void i2s_hal_config_param(i2s_hal_context_t *hal, const i2s_config_t *i2s_config
     i2s_ll_set_rx_pdm_en(hal->dev, 0);
     i2s_ll_set_tx_pdm_en(hal->dev, 0);
 #endif
-    if (i2s_config->communication_format & I2S_COMM_FORMAT_I2S || i2s_config->communication_format & I2S_COMM_FORMAT_I2S_MSB || i2s_config->communication_format & I2S_COMM_FORMAT_I2S_LSB) {
+    if (i2s_config->communication_format & I2S_COMM_FORMAT_I2S|| i2s_config->communication_format & I2S_COMM_FORMAT_I2S_LSB) {
         i2s_ll_set_tx_short_sync(hal->dev, 0);
         i2s_ll_set_rx_short_sync(hal->dev, 0);
         i2s_ll_set_tx_msb_shift(hal->dev, 1);

@espressif-bot espressif-bot added the Status: In Progress Work is in progress label Feb 21, 2022
@karawin
Copy link

karawin commented Feb 21, 2022

Not playing on 4.4
A pity!

@L-KAYA
Copy link
Collaborator

L-KAYA commented Mar 30, 2022

Not playing on 4.4 A pity!

@karawin On v4.4, setting communication mode to I2S_COMM_FORMAT_STAND_MSB instead of I2S_COMM_FORMAT_STAND_I2S might help.

For the failure on v4.1, there will be a fix soon.

@espressif-bot espressif-bot added Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally and removed Status: In Progress Work is in progress labels Apr 18, 2022
espressif-bot pushed a commit that referenced this issue Apr 18, 2022
@Alvin1Zhang
Copy link
Collaborator

Thanks for reporting and sharing the updates, fix on release/4.1 is available at 387fb06, feel free to reopen. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

6 participants