beyondscreen/node-rpi-ws281x-native

Change DMA from 5 to 10

Opened this issue · 5 comments

In the 3B+ it seems DMA 5 is shared with sd card operations. The new accepted behaviour is to use DMA 10.

@tsuckow do you have any reference for this? I am always completely confused when it comes to DMA numbers and never found any reference of their usage..

@usefulthink As far as I understand, he is correct. This is from jgarff's rpi_ws281x lib:

Important warning about DMA channels
You must make sure that the DMA channel you choose to use for the LEDs is not already in use by the operating system.
For example, using DMA channel 5 will cause filesystem corruption on the Raspberry Pi 3 Model B.
The default DMA channel (10) should be safe for the Raspberry Pi 3 Model B, but this may change in future software releases.

The thing is, everything I found so far were single data-points, like the one you quoted. And that is true for a specific OS-release on a specific device. What I would love to find is something more general, like an overview of how dma-numbers are used so we can ideally select one dynamically.

Also: the change from 5 to 10 came based on this issue, so it's not like that any choice will be without problem for everyone.

Not sure how to proceed here.

I did find a reference somewhere implying there is a proper way to reserve a dma controller for use, the number would potentially change each run. But I didn't find concrete code. I would also say that should be done in the native library and not in this wrapper.

FYI there's an alternative way to change the DMA channel per your needs. BR//KHH