Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DAC play wav file on second core
Just some food for thought.

I assume that playing a wav file requires a fair bit of time critical CPU and isn't the best thing to try to do with threading.

Is it possible that the paying of a wav file via the dac be cleaved off on to the second core that way sound can be played at the same time as running the main process??
Playing wav actually does not require much processing time.
Wav playing is implemented using ESP32 I2S peripheral which feeds DAC using DMA.
Wav playing (as well as write_timed) is controlled by the background freeRTOS task which only reads the input file or buffer and writes it to the i2S buffer, synchronized by I2S semaphore.

Currently, the wav task runs on the same core as MicroPython. It could be run from the other core, but I don't think it is necessary as it doesn't have to do much processing.

Forum Jump:

Users browsing this thread: 1 Guest(s)