Question about esp_partition component
Posted: Sat Jan 13, 2024 1:27 am
I have a program that uses an I2S microphone, an I2S amplifier, and a storage medium to hold what's being recorded.
I have a custom board into which I plug a Waveshare esp32-s3 pico board. My custom board has an 8MB flash chip on it. I use stacking headers on the custom board so that I can attach a Waveshare 240x320 LCD display.
Using my 8MB external flash, driven by the spi_flash component, I can record and play back with sample rates up to 96K; it is flawless. On the display, I have an "oscilloscope" presentation of the audio being recorded or played back. Again it works great.
Now, I wanted to use a partition on the esp-32 flash, instead of needing to always mount my custom board between the processor and display. I created a 12MB partition and use the esp_partition component to erase, read, and write to it.
I made a run-time configuration option to switch between external flash or local partition, so everything but the actual read/writes is identical. Switching to partition flash, it gets weird.
On playback from the partition, it does not sound great, kind of like gargling. There is also a steady thumping sound - like tap dancing, and the playback is noticeably faster. The scope display looks O.K. and I don't see anything that looks like a "thump".
I could theorize that the thumping is interference between the CPU fetches and my reading the partition, so I put my functions in IRAM, but it made no difference. As for why it gargles and plays back faster, I'm totally stumped.
Are there any issues or considerations when reading/writing in a partition at fast rates? I've look through the docs, but don't see anything about that. I'm new to the ESP-IDF, so maybe someone more experienced could point me.
I have a custom board into which I plug a Waveshare esp32-s3 pico board. My custom board has an 8MB flash chip on it. I use stacking headers on the custom board so that I can attach a Waveshare 240x320 LCD display.
Using my 8MB external flash, driven by the spi_flash component, I can record and play back with sample rates up to 96K; it is flawless. On the display, I have an "oscilloscope" presentation of the audio being recorded or played back. Again it works great.
Now, I wanted to use a partition on the esp-32 flash, instead of needing to always mount my custom board between the processor and display. I created a 12MB partition and use the esp_partition component to erase, read, and write to it.
I made a run-time configuration option to switch between external flash or local partition, so everything but the actual read/writes is identical. Switching to partition flash, it gets weird.
On playback from the partition, it does not sound great, kind of like gargling. There is also a steady thumping sound - like tap dancing, and the playback is noticeably faster. The scope display looks O.K. and I don't see anything that looks like a "thump".
I could theorize that the thumping is interference between the CPU fetches and my reading the partition, so I put my functions in IRAM, but it made no difference. As for why it gargles and plays back faster, I'm totally stumped.
Are there any issues or considerations when reading/writing in a partition at fast rates? I've look through the docs, but don't see anything about that. I'm new to the ESP-IDF, so maybe someone more experienced could point me.