Page 1 of 1

ESP32-S3 I2S DMA Interrupt

Posted: Fri Dec 09, 2022 9:51 am
by bnarit
I'm trying to get started on ESP32-S3 I2S DMA with interrupt.

I have success on ESP32-S3 I2S with polling using i2s_write. However, it doesn't ensure that the tx data is transported orderly. Interrupt would be a better option.

I have tried on ESP32 I2S successfully with DMA and Interrupt. But since the IDF 4.4+ changed the register, for ex, I cannot find any "I2S0.lc_conf", Is there any reference to this?

In IDF4.4 manual, it doesn't show any I2S interrupt example. Have anyone can provide this information or example?

Best Regard
Narit

Re: ESP32-S3 I2S DMA Interrupt

Posted: Sat Dec 10, 2022 2:44 am
by ESP_Sprite
bnarit wrote:
Fri Dec 09, 2022 9:51 am
I have success on ESP32-S3 I2S with polling using i2s_write. However, it doesn't ensure that the tx data is transported orderly. Interrupt would be a better option.
Can you explain what you mean by that? Generally, if you use the driver, there's no need to use interrupts, so I'm wondering what issue you're running into.

Re: ESP32-S3 I2S DMA Interrupt

Posted: Sat Dec 10, 2022 10:53 am
by bnarit
I want to use I2S to periodically generate a synthesis signal, outgoing, with high speed.

Filling the tx buffer from tasking using RTOS is workable, but I believe it is more stable to use the interrupt sending by switching between transmission queues.

RTOS can handle only 10+ ms with good stability. I have tried to reach sub-millisec but the core seems to be panicky.

In my case, the transmission must not be missed. It is not audio but the control signal, so using the interrupt as in the IDF3.x would be more stable.

So I wish we could find some mapping or any register or any example in IDF4.x+ that has I2S DMA+interrupt capability.

Re: ESP32-S3 I2S DMA Interrupt

Posted: Sun Dec 11, 2022 1:58 am
by ESP_Sprite
Honestly, I'd use the driver. Using interrupts isn't really more stable than that, as the driver itself uses that mechanism as well to switch buffers. If you do want to use an interrupt to handle things, you could look into the functions the i2s_hal provides, but I'm not sure if this is inter-operable with the actual driver; you may need to build your own driver from scratch if you go that route.

Re: ESP32-S3 I2S DMA Interrupt

Posted: Sun Dec 11, 2022 3:44 am
by bnarit
Yes, that was my intention.

Thx.

Re: ESP32-S3 I2S DMA Interrupt

Posted: Mon Dec 26, 2022 9:26 am
by bnarit
We have tried the I2S Driver, but is seems to have some glitch.

What we are trying to do is use I2S to control the motor, which requires a constant time loop for feedback control.

We need an interrupt that refills and tricks periodically.

We also reference to I2SOut of FluidNC in ESP32.
Could you please suggest us, How can we implement the interrupt I2S as shown in FluidNC code in ESP32S3?

https://github.com/bdring/FluidNC/blob/ ... I2SOut.cpp