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

Stutters when fetching chunk on esp32 #112

Open
TShapinsky opened this issue Feb 24, 2022 · 2 comments
Open

Stutters when fetching chunk on esp32 #112

TShapinsky opened this issue Feb 24, 2022 · 2 comments

Comments

@TShapinsky
Copy link

every time Chunk requested %d prints on the monitor there is a tiny audio stutter. Is it possible that chunks aren't being pre-fetched enough? Is too much CPU being used fetching that it messes with the I2S output?

Setup:
Board: ESP32-WROVER-E (8MB PSRAM)
Codec: PCM5102A

@KennyStier
Copy link

Having similar issues
Board: ESP32-A1S
Codec: ES8388

@jdthorpe
Copy link

jdthorpe commented Oct 14, 2022

I wonder if by "stutter" you mean pops / clicks. In my case, the pops were absolutely intolerable (20-30 clicks per minute) and sounded like an old record

After doing some reading on I2S Click problems, I found two solutions mentioned around the internets: (A) adding inline resistors to attenuate the ringing in the I2S traces (or breadboard connectors, in my case) and (B) reducing the slew rate by reducing the output capacity on the GPIO pins. I tried the latter first (b/c I didn't have any room on my breadboard...) by adding the following lines in the appropriate sink file (cspot/bell/src/sinks/...) and the issue almost completely went away (1 click ever 2-3 minutes).

  BELL_LOG(info, "i2s", "Setting pin drive capacity");
  ESP_ERROR_CHECK(
      gpio_set_drive_capability((gpio_num_t)mck, GPIO_DRIVE_CAP_0));
  ESP_ERROR_CHECK(
      gpio_set_drive_capability((gpio_num_t)bck, GPIO_DRIVE_CAP_0));
  ESP_ERROR_CHECK(
      gpio_set_drive_capability((gpio_num_t)ws, GPIO_DRIVE_CAP_0));
  ESP_ERROR_CHECK(
      gpio_set_drive_capability((gpio_num_t)dataOut, GPIO_DRIVE_CAP_0));

I think I'll try the inline resistors at some point, but for now this made a big difference in the audio quality for me...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants