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
ESP32-S2 - Media player - I2S - distorted audio #4106
Comments
when you say local, is it local to the esp board? like on an sd card or is it pulling over the network. |
Local as in local to Homeassistant. The board doesn't have an SD card slot. Not sure how I can get a file on the module. |
ok, can you try playing two different bitrate mp3's? one low bitrate (say 128k or less) and another high bitrate or lossless format. |
What I had around was a 128k webradio stream, a 128k file and a 64k file. All show little difference. Might it be related to the fact that the S2 only has one XTensa core and the code is optimized for dual core? IIRC the Arduino framework pins all the Wifi handling to one core and the user code to the other. |
Hello, i can confirm that until the EspHome 2023.2.1 the level is very slow and bad, before i had a loud and clear sound with a MAX98357a for mono version. I have a stereo version who is less affected by this problem because i have a 2x15W external amplifier. The soud is less loud than before, but its usable. The mono is no longuer usable because of poor quality sound and not loud at all. I mean i have a 3w speaker that worked great before with the MAX98357 who has a 3.2W internal amplifier for a 4 Ohm speaker. Something has changed on the level side, sorry i cant help more. |
Problem persists on 2023.4.4 with barebones config:
|
Same problem, help to fix it pls |
Some debugging: Conclusion: The S2 doesn't like high samplerates. |
Indeed changing my mp3s to 32kHz sample rate fixed the disturbed audio. Was easily done with audacity ;-) |
I'm not very deeply in the architecture of ESPHome but one possible reason is a lack of code optimization which has no impact on multicore micros because (at least in the Arduino devkit), Wifi is pinned to one core and the user code runs on the other one. With the S2 being single core, that obviously doesn't work, so Wifi might just eat up the resources.. |
Thanks for your explanation! |
The problem
I have set up an ESPHome media player with 2 MAX98753 with an ESP32-S2. Playback of either MP3 streams or local files is distorted. The first half second plays OK, then the audio stream is interrupted and sounds somewhat slower. I'm no expert but it sounds like I would imagine dropped frames sound.
An identical configuration on an ESP32 DevKit (without any S's) works perfectly fine.
Which version of ESPHome has the issue?
2022.12.8
What type of installation are you using?
Home Assistant Add-on
Which version of Home Assistant has the issue?
2023.1.7
What platform are you using?
ESP32
Board
esp32-s2-saola-1
Component causing the issue
i2s
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
No response
The text was updated successfully, but these errors were encountered: