plan44/plan44-feed

p44-ledchain for OpenWrt with I2S and DMA.

jagspaul opened this issue ยท 6 comments

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

@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!

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.

[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

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

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 ๐Ÿ™„