plan44 / plan44-feed

OpenWrt feed containing plan44 packages
29 stars 9 forks source link

p44-ledchain for OpenWrt with I2S and DMA. #6

Open jagspaul opened 1 year ago

jagspaul commented 1 year ago

Thanks for your great project p44-ledchain for OpenWrt. However I want something different. As you told p44-ledchain based on PWM bus and MT7688 does not support DMA over PWM, So your module is limited to 1K pixels on each PWM. But I want large capacity pixels support by Omega2 board, and for this DMA is essential. I believe I2S bus has DMA and if you build p44-ledchain driver on I2S bus we can have driver with DMA support.

Thanks & regards jags

plan44 commented 1 year ago

@jagspaul yes, i2s does have DMA, and the needed bit rate (at least 2.8 Mhz to create proper ws28xx timing) is in the same ballpark as for 48kHz audio (1.5 MHz), so that should be possible.

[...] So your module is limited to 1K pixels on each PWM.

Not really, the current limit is 2k for buffer size and frame rate reasons, and could be set higher at the cost of reduced framerate.

But even the theoretical maximal framerate (assuming zero overhead) goes down with the number of leds in a chain.

At 1k LEDs, it's already down to ~40Hz, so if you want to replace 4 PWMs with 1k LEDs each with the single i2s (4k LEDs), you'd get a max frame rate of ~10Hz 😞

So yes, i2s with DMA would be nice to have, but doing a DMA based kernel driver is not something I'm fluent in 😉 . Whoever wants to do that based on p44-ledchain is welcome, of course!

jagspaul commented 1 year ago

Thanks for your reply. some one has build I2S DMA driver on ESP32 chip. And using a serial in parallel out shift register each port virtually made 8 led bus. I am sending the link for reference. Hope this cam help to make large capacity pixel driver on p44-ledchain.

https://github.com/hpwit/I2SClocklessVirtualLedDriver

I really need p44-ledchain 8K pixels driver.

jagspaul commented 1 year ago

[At 1k LEDs, it's already down to ~40Hz, so if you want to replace 4 PWMs with 1k LEDs each with the single i2s (4k LEDs), you'd get a max frame rate of ~10Hz 😞]

Can I get 2K LED @20 Hz frame rate? regarding 4 PWMs, I have Omega2 board and only 2 PWM available. Can you suggest anything which gives 4 PWM to use.

If I get 4 PWMs and each 2K leds @20 Hz, It may gives me 8K pixels drivers.

jags

plan44 commented 1 year ago

Can I get 2K LED @20 Hz frame rate?

That's the theoretical maximum, but there is some overhead (interrupt latency, bit packing restrictions into 64bit runs) that will reduce the effective rate below 20Hz.

regarding 4 PWMs, I have Omega2 board and only 2 PWM available. Can you suggest anything which gives 4 PWM to use.

Using an Omega2S instead, which has all 4 PWMs exposed.

plan44 commented 1 year ago

some one has build I2S DMA driver on ESP32 chip.

The principle is simple. What takes time in doing such a driver is understanding the details of the actual chip, which is completely different in the MT7688 than in the ESP32. Furthermore, the MT7688 has a very meagre datasheet, it just lists bits and registers, with little context. And finally, one needs to know how to do a proper linux driver using DMA (haven't done that so far, so: would need to invest a lot into learning this)

And using a serial in parallel out shift register each port virtually made 8 led bus. I am sending the link for reference. Hope this can help to make large capacity pixel driver on p44-ledchain.

https://github.com/hpwit/I2SClocklessVirtualLedDriver

That would indeed make a I2S driver worth considering! For one output, I2S does not give much more than the PWM solution, however when it can drive 8 or 16 outputs simultaneously, that's another story 😄

I really need p44-ledchain 8K pixels driver.

Still, my day has 24h only, and with all the other things on my todo list I don't know yet if and when I'll find time to look into this 🙄

jagspaul commented 1 year ago

Hello, Thanks for your reply. I understand everything you say.

Now I started thinking in a different way and I explain it to you.

My requirement is to make an ethernet artnet based RGB led controller (ws2811) with 8K - 16K leds support. I already have tried with the ESP32 controller but able to manage 4K leds @25fps only. This limitation due to low capacity ethernet of ESP32.

So I thought to use omega 2 as it has high speed ethernet but no success because of the low end led driver.

Now I want to build it with a combination of both omega 2 + ESP32. Omega 2 will handle ethernet artnet and the led driver will be taken care of by ESP32. Omea 2 will send RGB frames to ESP32 through a 25Mz SPI bus.

In this connection I need your valuable suggestions and help.

jags

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Virus-free.www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sat, Jul 22, 2023 at 5:53 PM Lukas Zeller @.***> wrote:

some one has build I2S DMA driver on ESP32 chip.

The principle is simple. What takes time in doing such a driver is understanding the details of the actual chip, which is completely different in the MT7688 than in the ESP32. Furthermore, the MT7688 has a very meagre datasheet, it just lists bits and registers, with little context. And finally, one needs to know how to do a proper linux driver using DMA (haven't done that so far, so: would need to invest a lot into learning this)

And using a serial in parallel out shift register each port virtually made 8 led bus. I am sending the link for reference. Hope this can help to make large capacity pixel driver on p44-ledchain.

https://github.com/hpwit/I2SClocklessVirtualLedDriver

That would indeed make a I2S driver worth considering! For one output, I2S does not give much more than the PWM solution, however when it can drive 8 or 16 outputs simultaneously, that's another story 😄

I really need p44-ledchain 8K pixels driver.

Still, my day has 24h only, and with all the other things on my todo list I don't know yet if and when I'll find time to look into this 🙄

— Reply to this email directly, view it on GitHub https://github.com/plan44/plan44-feed/issues/6#issuecomment-1646571707, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAD5AG2QGUALSIA2XZPPHADXRPA5HANCNFSM6AAAAAA2SRFIG4 . You are receiving this because you were mentioned.Message ID: @.***>