I looked through the esp-idf sources to figure out exactly what it doesn't like. It's complaining that the handle I'm passing to `i2s_channel_init_pdm_rx_mode()` is not allocated in internal RAM. But the thing is, I get that from `i2s_new_channel()`, which ends up calling `heap_caps_calloc(1, sizeof(struct i2s_channel_obj_t), I2S_MEM_ALLOC_CAPS);`, which should be defined as `(MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT)`.
So I don’t know why this isn't working.
This is in the Arduino 3.2.0-RC1, which uses ESP-IDF verison: v5.4-561-gbcb3c32d3a-dirty, which logs line numbers a few off from where I find the calls in the v5.4 tag of esp-idf on github. But that's what I looked through to find out this is what it was complaining about.
It occurred to me maybe it had something to do with the version of arduino-esp32. I checked back to 3.1.1, and although the channel is still allocated in external memory, it does not get the "user context not in internal RAM" error. That error starts with arduino-esp32 v3.1.2.
It's the same as this issue:
https://github.com/espressif/arduino-esp32/issues/11058, which was closed as a duplicate, but it doesn't say a duplicate of what.