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_ad_dac example has gaps in playback (IDFGH-7862) #9389

Closed
PilnyTomas opened this issue Jul 19, 2022 · 3 comments
Closed

i2s_ad_dac example has gaps in playback (IDFGH-7862) #9389

PilnyTomas opened this issue Jul 19, 2022 · 3 comments
Assignees
Labels
Resolution: Done Issue is done internally Status: Awaiting triage Status: Done Issue is done internally

Comments

@PilnyTomas
Copy link

PilnyTomas commented Jul 19, 2022

Environment

  • Development Kit: [ESP32-DevKitC]
  • Kit version (for WroverKit/PicoKit/DevKitC): [v4]
  • Module or chip used: [ESP32-WROOM-32D]
  • IDF version: Tried on v4.4.1-581-gee2029c38a and v5.0-dev-4257-g508661b03e
  • Build System: [idf.py]
  • Compiler version: 8.4.0
  • Operating System: [Linux]
  • Using an IDE?: [No]
  • Power Supply: [USB, directly from computer - no hubs inbetween]

Problem Description

Audio playback is laggy.
There seems to be approx 64.4ms period of playback followed by approx the same length (64.4ms) period of silence - this pattern repeats and the resulting audio is horribly unusable, laggy / chopped.

Expected Behavior

Clear audio without pauses, lags, gaps,...

Actual Behavior

Gaps in playback

Steps to reproduce

  1. Setup example https://github.com/espressif/esp-idf/tree/release/v4.4/examples/peripherals/i2s/i2s_adc_dac
  2. Listen
  3. Record on an oscilloscope

In the pictures, channel 2 is ADC output, and channel 3 is amplifier output

playback period
lag period

Relates to Arduino-ESP32 issue espressif/arduino-esp32#5938

@espressif-bot espressif-bot added the Status: Opened Issue is new label Jul 19, 2022
@github-actions github-actions bot changed the title i2s_ad_dac example has gaps in playback i2s_ad_dac example has gaps in playback (IDFGH-7862) Jul 19, 2022
@PilnyTomas
Copy link
Author

Uploading some more pictures - audio file playback - both DAC channels

Overview
audio file playback

Closeup - gap period
both DAC channels pic 1

Closeup - playback period
both DAC channels pic 2

@Alvin1Zhang Alvin1Zhang pinned this issue Sep 22, 2022
@espressif-bot espressif-bot added Status: Selected for Development Issue is selected for development and removed Status: Opened Issue is new labels Sep 22, 2022
@Alvin1Zhang Alvin1Zhang unpinned this issue Sep 22, 2022
@L-KAYA
Copy link
Collaborator

L-KAYA commented Sep 23, 2022

The issue can be fixed by changing the I2S configuration from

        .dma_buf_count = 2,
        .dma_buf_len = 1024,

to

        .dma_buf_count = 6,
        .dma_buf_len = 256,

The fix is on the way.

@PilnyTomas
Copy link
Author

Hi @L-KAYA, I just tested the example with the new settings and can confirm that the resulting audio is clear and without gaps.

@espressif-bot espressif-bot added Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: Selected for Development Issue is selected for development Resolution: NA Issue resolution is unavailable labels Sep 26, 2022
antmak pushed a commit to antmak/dev-idf that referenced this issue Sep 28, 2022
espressif-bot pushed a commit that referenced this issue Sep 29, 2022
espressif-bot pushed a commit that referenced this issue Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Awaiting triage Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

4 participants