I2S, WIFI, and analogRead not working

Hello,

I am running into a problem that I cannot seem to solve.

My device is acting as a WIFI server with an interactive webpage loaded to SPIFFS.

I am using I2S to perform high speed sampling of a sensor which is then processed for the user.

I did change the WIFI sleep mode, so that it never sleeps and that allowed me to run both WIFI and I2S correctly.

However, I also require low speed occasional sampling of another sensor, and I cannot seem to make that work.

If I try to disable and then enable the I2s bus with I2S_adc_enable and I2s_adc_disable, it crashes with the following error.

assertion “pxQueue->pcHead != ((void *)0) || pxQueue->u.xSemaphore.xMutexHolder == ((void *)0) || pxQueue->u.xSemaphore.xMutexHolder == xTaskGetCurrentTaskHandle()” failed: file “IDF/components/freertos/queue.c”, line 782, function: xQueueGenericSend

If I try to simply sample with analogRead, the program gets stuck there and never returns.

Any advice or insight would be greatly appreciated.

This question seems about esp-idf and therefore, I’d recommend to ask on Espressif forums.

Thanks.