Usually there are plenty of free unused CPU cycles. External hardware, on the other hand, is expensive. So why not save some money and use the CPU?

Besides, I don't think it actually uses substantially more CPU than an external DAC. You'd be feeding a DMA buffer into the I2S peripheral either way. If you precompute the PDM waveform from the audio sample it's essentially free. Using a LUT or even computing it realtime should only take a dozen or so cycles per sample, at 44.1kHz.

Considering that the ESP32-S3 has two cores running at 240MHz, even taking an excessive 500 cycles per sample would only be a 5% CPU load.

You can't do much lookup with sigma-delta modulation but

> has two cores running at 240MHz

Yeah ok that is manageable.

To me the value of the ESP32 has always been the peripherals that substitute for pure CPU usage (although, it's certainly nice that it has the CPU cycles to do interesting things).

You feed in the PCM samples, the I2S peripheral handles the PDM in hardware. So no CPU should be used.

Read the comment I'm replying to.