LOLIN S2 mini i2s issue

Hello!

I’m having some trouble with I2S on the S2 mini. Setup:

Supervisor 2023.07.1
Operating System 10.3
Frontend 20230705.1 - latest

ESPHome 2023.6.5

(All working great, other stuff has been a breeze).

I picked up a UDA1334A DAC to have a play around with and attached it to an S2 mini. Config:

esp32:
  board: lolin_s2_mini
  framework:
    type: arduino

i2s_audio:
  i2s_lrclk_pin: GPIO36
  i2s_bclk_pin: GPIO40
  

media_player:
  - platform: i2s_audio
    name: "Speaker01"
    dac_type: external
    i2s_dout_pin: GPIO38
    mode: stereo

Wiring correct, and obviously I’ve got power/GND too. It’ll play an MP3, but audio is extremely stuttery. Similar symptoms as the post by elik745i here, though I’ve not had the programming issues. I’ve tried using alternate GPIO pins on the S2; same result. Tried forcing LSB/MSB too, with no effect.

Hooking up an older WROOM based devkit V1 to the same DAC works like a charm with similar config and pin numbers changed to suit, so it looks like there’s something weird about the i2s implementation on the S2. It’s not a big deal as I can use a different module for I2S, but I’d be interested to work through it.

Any pointers for what I can look at or tweak?

Many thanks!