-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
I2S switches from MSB-first to LSB-first on an ESP32-S3 #11245
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
Comments
I have had a look at the output using a logic analyser, and when it goes all noisy the cause is the data being sent LSB first instead of MSB fir 8000 st. My example.wav file has the first four bytes as 0x52 0x49 0x46 0x46 When it's working I see this on the logic analyser: When it goes all noisy, I see this: (I know the data shown above is the first part of the wav header, but to simplify the repro code I have chosen not to skip that. I know it will cause a little audio glitch at the beginning of the playback while it "plays" the header, but that is irrelevant to this issue. When it's working I hear [glitch][clear audio file], when it's not working I hear [glitch][static]) |
I don't know if this is relevant or not, but from the ESP-IDF docs, I note that the ESP32 vs ESP32-S3 So I guess if we are passing the ESP32 EDIT: Ahh, on further reading, this struct seems to be used by the "new API" only, which I don't think MicroPython uses, so is probably not relevant. So, now I'm out of ideas... Help - anyone? |
OK - I think I have it figured out. In
Currently the ESP32C3, ESP32C6 & ESP32S3 support TDM I had always thought that uninitialised members of a struct in C got set to default values, but it seems that this isn't happening here**. In
** I can't explain this, but if I put debug printf statements in |
This helps avoid the static play on the C3 (S3?). Changes are from micropython#11245 thanks to Mike Alexander
Hi I am having the same problem, has this been merged into micropython yet? |
Can confirm this works |
This may be fixed by 0b145fd |
Confirmed that this update to the new I2S driver fixes the issue without requiring the workaround. |
Fixed by 0b145fd |
Uh oh!
There was an error while loading. Please reload this page.
Using the latest nightly build (v1.19.1-1014-gbde222ce8 (2023-04-11) ) on an ESP32-S3 with SPIRAM, I am sending a wav file that is stored on the onboard filesystem to a PCM5102A DAC via I2S.
When I run the code the first time after power on or reset (soft or hard) the audio is heard clearly.
If I then run the same code again, it is just a mess of static - I can just hear the beat of the music in all the noise though.
The only way to get it working again is to reboot. This happens on I2S0 as well as I2S1, and have tried different pins in case I was clashing with one of the ESP32 pins that has alternative functions.
Also, when rebooting I see the following message:
E (130390) I2S: i2s_driver_uninstall(2047): I2S port 0 has not installed
just before the MPY: soft reboot message
I am not getting this problem on a non-S3 variant.
Code below:
The text was updated successfully, but these errors were encountered: