A place users can post their projects. If you have a small project and would like your own dedicated place to post and have others chat about it then this is your spot.

User avatar
By bbx10node
#55119 Here is my first attempt at using ESP8266 I2S.

When the user presses buttons 0..9 on the web browser application, the ESP8266 plays the corresponding WAV file on the speaker. The audio data comes from WAV files stored in the ESP8266 Flash using SPIFFS. The digital audio goes out the ESP8266 I2C controller into an I2S DAC. The DAC coverts the digital audio to analog which feeds into a 3W amplifier to drive the speaker.

This ESP8266 Arduino application depends on many internal and external libraries. Many thanks to all contributors for sharing. For more details including source code, see the following.

https://github.com/bbx10/SFX-I2S-web-trigger
You do not have the required permissions to view the files attached to this post.
User avatar
By Lythy
#59044 Hi, this is great and has allowed me to get the WAVs to play through a PCM5102 board. I stripped out the web stuff to isolate an issue though, if I try play a WAV repeatedly then sometimes it plays and sometimes not, and after about 10 plays I get a stack overflow.

Would you have any ideas what might cause this?

Exception (29):
epc1=0x40208d8a epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

ctx: cont
sp: 3ffefb30 end: 3ffefd60 offset: 01a0

>>>stack>>>
3ffefcd0: 3ffee180 3ffeec4c 3ffeed40 40208d7d
3ffefce0: 40208eed 00000000 402074b8 3ffeed34
3ffefcf0: 3ffee750 3ffee750 00000000 402090e9
3ffefd00: 3ffee750 3ffeed08 3ffeeb50 40206600
3ffefd10: 00010001 00002b11 00005622 00100002
3ffefd20: feefeffe 00000000 3ffeed08 3ffeed34
3ffefd30: 3fffdad0 00000000 3ffeed2c 402066dc
3ffefd40: 3fffdad0 00000000 3ffeed2c 40207504
3ffefd50: feefeffe feefeffe 3ffeed40 40100718
<<<stack<<<
User avatar
By rbellini
#60251 Happy new year everyone!

I have tried this code on both a Huzzah and a feather Huzzah board - same result.

The code compiles and uploads with no problem. The WAV files uploaded with no problems. The web interface works great. My problem is the sound produced. When I click on a filename, all I hear is a clicking sound.

I noticed that in the picture, there is a resistor, however I can't figure out how it is connected. I did not use one! Everything is connected as defined in the table.

I connected the I2S outputs to a logic analyzer and configured it to decode I2S. I can see the clock and the word select signals. I see the data, however it is not as I expected, mostly all 1's! I did capture a small sample showing a small sample of what appears to be valid data.

Attempting to understand the problem, I stripped out all of what I believed to be unnecessary to demonstrate the I2S output. I added two loops that simply count up by 10 and then down by 10 and change the sample rate to make it easier to view. I use these as the right and left values for i2s_write_sample. See the attached code sample. On the logic analyzer, I expected to see this in the data stream. However, I did not! I saw a short burst of what appeared to be random data and the left and right channels, which should be the same, were not!

By the way, I am having the same problem as Lythy , with the resets after a few loops.

Thank you in advance for any help!

Bob
You do not have the required permissions to view the files attached to this post.
User avatar
By cbartik
#66354
rbellini wrote:My problem is the sound produced. When I click on a filename, all I hear is a clicking sound.


I was at the same point with an Adafruit Huzzah board, and for anyone who may read this, I have found the problem and a solution.

Take a look at the documents provided by Adafruit: https://learn.adafruit.com/adafruit-huz ... /downloads

Specifically, the schematic shows a diode on the RX0 line which is our problem. The diode prevents us from properly using the RX0 as an output pin for I2S.

My simple workaround was to remove the diode and short the pads in its place. If you look at the board layout file, the diode is one of the pair of diodes near the middle of the board, not the pair nearer to the edge. It is the diode on the right. Use a meter to confirm before you de-solder if you have one.

Disclosure: I'm not sure at this point whether I will be able to serially upload code with this diode removed, so do so at your own discretion.

Hope this helps someone!