Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jagspaul opened this issue Jul 21, 2023 · 6 comments
Open

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

jagspaul opened this issue Jul 21, 2023 · 6 comments

Comments

@jagspaul
Copy link

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
Copy link
Owner

plan44 commented Jul 21, 2023

@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
Copy link
Author

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
Copy link
Author

[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
Copy link
Owner

plan44 commented Jul 22, 2023

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
Copy link
Owner

plan44 commented Jul 22, 2023

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
Copy link
Author

jagspaul commented Jul 24, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants