atctwo / watch-II

Firmware for my custom smart-ish-watch, mark II
MIT License
1 stars 0 forks source link

music player: performance under certain conditions #24

Closed atctwo closed 3 years ago

atctwo commented 4 years ago

I'm experimenting with the music player app, using an I2S amplifier (max98357a), and there are some differences in the sound reproduction and watch system functioning depending on how the audio task is configured.

Core Priority Task Delay Audio Quality TFT watch main loop
1 2 0 Perfect breaks doesn't execute
1 2 1 mostly ok breaks executes
0 max - 2 1 really bad works doesn't execute
0 max - 2 0 really bad works doesn't execute

I'm probably not going to get it working on core 0, so I will probably implement some system where the ESP soft resets once you exit playback. I've tried to reinit the screen after exiting, but that doesn't work. I wonder if the screen dies because the main loop is suspended while writing to the screen? I should also consider if I can update the screen from the audio loop.

atctwo commented 4 years ago

If the task is run on core 1, and it doesn't delay ever, and the main watch task is delayed for 20 ticks before the audio task is started (to give it time to update the tft), then the tft stays on. When the audio task is deleted, the tft breaks (but the watch continues to function as normal). reinitalising the tft after deleting the audio task doesn't do anything.

atctwo commented 4 years ago

the esp has to be hard reset for the screen to start working again. the screen won't work if the esp crashes or is reset using ESP.reset(). Maybe this is a hardware issue?

atctwo commented 4 years ago

the screen dies when the I2S driver is installed when AudioOutputI2S is instantiated. it doesn't seem to affect the SD, only the tft.

atctwo commented 3 years ago

update: i had to rewite the whole circuit twice and now it isn't working at all. when i use a test program, and use a logic analyser, it looks like DOUT is exactly the same as LRC.

atctwo commented 3 years ago

I left it for a while, and now DOUT looks fine. I used a simple ESP8266Audio sketch to test it and it works fine. c8a0b80de915461a865ac26fd11ce17cd334b9b9 switched from using ESP8266Audio to ESP32-audioI2S, and now audio playback works pretty well