Teensy 4.1 Audio Board and ESP32 I2S Audio

slippen

Member
Hi,

I'm using https://github.com/JayShoe/esp32_T4_bt_music_receiver to combine Teensy 4.1 with Audio Board and ESP32. ESP32 uses Pins 3-5 on Teensy 4.1 and everything works fine until Bluetooth Playback is paused. After a few seconds the ESP32 stops I2S audio data and a few seconds after that teensy is getting slower and slower until it stops working. (no reaction on buttons e.g. or Serial out). After resuming playback teensy is responding again.

Any I2S experts with ideas what might happen?

Kind regards
Franz
 
Hi Franz,

Are you using the Teensy as the Master? Since it stops working when the ESP32 is paused, do you think maybe the clocks stop? Do you think the Teensy is expecting the clock and the ESP32 stops sending it? Then if the clocks stop then Teensy just buffers the data and eventually runs out of memory?

I think this repo is using newer code from Alex6679. I think you want one of these examples. Everything worked on all of them last time I checked.
https://github.com/JayShoe/ESP32_I2S_Teensy4

There are a few different examples in there where either the Teensy or the ESP32 is master... And I think the best one is when Teensy is the master, not sure which example it is but it should be clear when you check the code.

EDIT: On second thought it's possible that the best example was ESP is the master, because it's on SAI2 so Teensy can have SAI2 as slave and SAI1 as master. Then Alex's code does resampling so it works on the SAI1.... (so cool). Check the examples there and let me know how you make out.

Jay
 
Hi,

at the example https://github.com/JayShoe/esp32_T4_bt_music_receiver of JayShoe the Teensy input I2S slave and the ESP32 is master. I also think that the ESP32 does something to the clock lines, when it is paused. I think it would not be a problem if the bit and word clock of the ESP32 would keep running and the data would just be 0 during the ESP32 is paused. By the way, how did you pause the ESP32? I always let it run and pause the playback at the notebook.

@Jay: I had a look at the Teensy4.ino file of you example:
Code:
bool dither = false;
bool noiseshaping = false;
float attenuation = 100;
int32_t minHalfFilterLength=80;
int32_t maxHalfFilterLength=1;
AsyncAudioInput<AsyncAudioInputI2S2_16bitslave> i2sSlaveInput(dither, noiseshaping, attenuation, minHalfFilterLength, maxHalfFilterLength);
It is not a problem but maxHalfFilterLength overules minHalfFilterLength and the interpolation filter therefore only has a total length of 3. So it is really short and the resampling quality is consequently quite low. But if you set the values on purpose, then it's fine of course.

Alex
 
Hi,

I did some more testing.

Example 4: Works fine for me
Example 5: Works, but with a lot of distortion - not audiable at all
Example 6: Works, but hangs if i pause playblack of bluetooth audio. I tried diffrent ways (command per I2C, command per phone, command per button on esp) to pause playback - but all triggering A2DP sink.

Kind regards
Franz
 
Hi,

my speaker made fine music > 100 hours than i had some noices when using bluetooth from esp32. Line In from a different mixer worked still fine. After two hours the esp32 bluetooth stopped working. I know this is not the right forum but i have no idea where i may get help. A spare esp32 did on bluetooth as well. All voltages seem to be fine and esp32 can still be programmed (but bluetooth) is gone. Any ideas what may happen or where i can start my search?

Kind regards
Franz
 
Back
Top