-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 Audio not fully working (devel branch) #21205
Comments
Will investigate in a couple of days |
Meanwhile @rug1024 could try the following things (with
|
On executing i2srec the device instantly crashed and does not reboot anymore. |
Okay, I have found my INMP441 and could fix the crashes with |
Can you guys describe your configuration (especially template) when the crash happens? Also the output of command |
The crashes in
The i2sstream does not start the mic at the moment and crashes without starting it by hand with But I still only get garbage MP3 data from the encoder ... which I do not understand yet. |
After more bugfixing I have the driver working including MP3 streaming, but the INMP441 is a special animal, that seems to need an unusual I2S configuration. ATM this microphone produces garbled/distorted sound, but at least it works somehow. I have found more infos in other projects, but need to test this myself. The good thing is, that the new driver is very flexible and can be extented quite easily to reflect very different configurations with one firmware image. You can already exchange the connected microphone (i.e. from Standard to PDM), reconfigure it and use it without reflashing the ESP32. |
Great news! Thanks for the effort! |
Interesting point about the different behavior of different SOC's. I will have to check this too as currently the INMP441 is connected to a S3. In theory it should not matter, but I would not be too surprised to find the same. My PDM micro is a cheap clone of this: But is not extensively tested by me so far. Initial impression is good. |
INMP441 works here now for MP3 audio recording and streaming on the S3 without distortion and the expected (mediocre) sound quality. Please allow some time for testing and code refactoring as we need some new variables in the driver setting. |
Great news! Ordered myself 2 of these PDM Mics for testing (like the JST-SH plug). |
@Staars |
Current state of changes here: There are more refactoring steps ahead, but with the next PR I would like to change as few things as possible.
Out of the box this should work with an PDM microphone.
|
Forget the current docs, the aim for the new driver was to configure "everything" at runtime. So things like PDM, left/right, mono/stereo, ... do not need a different firmware. You will be even able to swap out the microphone to a total different type later or back and forth without reflashing. |
I tried to compile with Gitpod using your fork, unfortunately this does not work very well. |
Then please head over to Discord and find me there or use Tasmotas compiling-development channel. |
Tested with M5stack core 2 and i2rec works. saytime does work too. |
@Staars Can we close this? Everything I tested is working. |
i currently focus on other things, but after a short test on 2 esp32s3 devices i2splay does only produce some noise while it works on an esp32. i2ssay and i2stime works on all devices, so the i2s channel seems to be ok. i have a couple of problems with core 3 with several devices such that i will stay at core2 for some more weeks. |
@gemu2015 not related to i2s but parallel display do work with core 3.0.0 and uDisplay driver. EDIT: RGB Display is working. Don't have a parallel display to test. |
Unfortunately I don't have any PAR8/PAR16 display... So I can't help |
I was trying to get I2S audio to work with small 8Ω speaker connected to a board having a MAX98357A. Configured the I2S gpios for BCLK, WS and DOUT to match, and left the SD and GAIN pins unconnected, as indicated on the external DAC wiring suggestions in the docs. The board schematics indicate that GAIN is pulled down, and SD connected directly to the ESP32-S3, no pull-up/down, so unconfigured would be floating. No luck with commands As MAX98357A specs says that SD_MODE pulled low means shutdown, I decided to config the ESP32-S3 pin as Not knowing much about I2S audio, I'm wondering if this suggestion should just be made part of the docs, or if there are complications needing extra considerations. |
@sfromis imho mentioning |
Did a small test getting a WebRadio MP3 stream to play. Got a few seconds of garbled sound first, but then normal audio. Next step was interrupting it with the command
Last message in a loop until I killed it (power off). First set of time stamps from my terminal program. (Found how to stop the stream, just the command |
I ordered some cheap I2S stuff („the usual suspects from Ali“) to be able to do more tests myself. The webradio does work now much more robust than with core 2.x, but you will always run into trouble with non optimal network conditions - which may happen outside your home. Hopefully I can do more tests in the next 1-2 weeks to confirm, what works and how to configure it. |
I'm indeed experiencing Next step is trying to get the microphone to work. Schematics shows that my board has a MEMS microphone, ICS-43434 with this pinout:
No select pin in Tasmota gpio configs, I let it be for now. And my Tasmota template includes:
This means that I have a At boot, I have these messages:
Is error code 0 an error? Where it gets "annoying" is when doing a test with
Any noob errors? |
Your microphone seems to need "standard mode", which requires Error code 0 means no error. Is this a S3? You may try your luck with full duplex mode, which would share BCLK1 and WS1 for DIN1 and DOUT1. |
Yes, same S3 Bling from UnexpectedMaker as when testing audio output. As it has completely separate I2S pins for amplifier and microphone, it does not sound like full duplex makes sense? Anyway, tried setting Trying to record after having set |
Yes, duplex can not work with the Bling. I now have a setup with microphone and output (INMP441 and PCM5102) which works, but I already found a few things and glitches to change in the future. |
Yes, I was using latest development at that time. I saw no change after the fix for building for ESP32-S3, again crashing. Now, few days later, I've refreshed the source as of yesterday, 20240525-195146, and updated. The same
My template tries to have the MEMS microphone on I2S 2, with the amplifier on I2S 1. These pins (except for "boring" Button/SPI/neopixel pins):
It did not help removing the amplifier, with only the microphone as I2S 1. An additional test shows that the I2SPlay command no longer produced any sound, after having added the microphone on I2S 2. Worked when only having I2S 1, but I did notice that the I2SStop command did not succeed, instead giving And my older issue about loop/crash trying the
I did double-check my timestamps for both source download and build. |
Okay, thanks for testing.
I will take a look at the issue for i2splay preventing a start of other command. I did not touch this section of the driver yet myself. The crash of the ESP32-S3 is completely unclear to me as I have a S3 here as testing device working happily. |
The general approach around updates of defaults for user-configurable values is that the currently configured values are not affected by the change of defaults, unless the user chooses to do a device reset, to get all back to the defaults. Or by removing the No improvement with At least no more a crash with |
i again did a short audio mp3play test with core3 on a plain esp32 4M with the following issues:
|
@s-hadinger please review
as stated in the espressif docs "i2s_channel_preload_data" may never be called when channel is already started which it is in this case the noise after each sound (about 3 seconds) comes from
the break is needed, otherwise isRunning() is called once again which caused the delay with noise, same problem with web radio main loop |
The issue is probably something different. I had/have the same problems as gemu. After enabling |
Great news. Thank you @ all for your work. Hope that ESP32 S2 will also work again too. |
Changed framework is now available and active in branch development |
@Jason2866 |
@gemu2015 Which device MCU do you have/use? Can't reproduce the issue with the devices i have (with the change i2s isr IRAM safe). |
i get the error with an esp32 and esp32-s3 test device compiled with the latest dev the results are exactly the same on both devices. |
As a test, I let this run for a few minutes, without seeing any crashes, on an Unexpected Maker Bling! with ESP32-S3, and latest dev built yesterday. While there was a bit of "crackling" a fraction of a second at end of each "hello", nothing to break the silence between each time.
|
@gemu2015 Last changes merged which where already in the pipline. The major issue was the ISR problem! |
no more crashes with this version, but audio power off is missing after mp3play, |
I know this issue has been closed, but audio-streaming from ESP to Browser it is still not working. |
@rug1024 Please open a new issue. Providing exactly all data which are asked in the template. Additionally your exact setup (wiring) GPIOs and options set. |
I2S streaming is working without any issues on my S2 with an INMP441. As described in the docs the server must be started with And please, please, please ... no more additions to this closed issue 😀 (opening a new one is the way to go). |
Follow up of #16074 (reply in thread)
Did some short tests.- I2S micro not working (INMP441)- mp3 stream not workingCrahes happened too.EDIT: Working now with ESP32, ESP32-S3.
ESP32-S3 i2s play issue left.Migration status: Completed.
S3 was not supported before.@s-hadinger @gemu2015
The text was updated successfully, but these errors were encountered: