-
Notifications
You must be signed in to change notification settings - Fork 167
nrzled on rapsberry pi #286
Comments
Can you send a CL to fix the first problem? It needs to be fixed anyhow. The second is a problem with the BCM DMA driver, which is a separate problem. I plan to create the initial support likely on the PCM driver and on the FT232H, because arbitrary DMA on the BCM is tricky. :/ |
I've submitted a pull request for the first issue: #287 I've also tried using 200kHz and changing the hardcoded 200kHz to 800kHz, but in both cases I got an index out of range runtime error. |
This line is overflowing on 32 bit: https://github.com/google/periph/blob/v3.1.0/host/bcm283x/dma.go#L879 |
Thanks! You're right that the calculation is wrong, albeit it's not about an overflow. The equation is Both duration and frequency are fixed points, so it's the fixed point part that needs to be fixed. So yes it should be divided by time.Second. That said, we don't want to round down, we must round up. That's an important additional bug. |
So after fixing that (I guess the rounding isn't needed for the test app), the dma transfer hangs and it seems to break something, since if I kill the go app, the python example from https://github.com/jgarff/rpi_ws281x can no longer correctly control the led, and after a while I run out of available dma channels. I wasn't able to figure out how to reset the channels (except by rebooting the device), and I can't even see which ones are reserved since /sys/module/dma doesn't exist on my version of raspbian. |
Let's still fix this calculation to make iterative progress there. Clearly, there's need for more tests and code cleanup. |
The hang happens in runIO. I commented out ch.startIO and ch.wait so the example app exits, but it still breaks things (the python example doesn't work any more and after a few tries I run out of available channels). |
On what distro are you? I normally test on raspbian stretch lite. |
(not that I tested the DMA support) |
I suspect this was the same issue as #363. We're designing a new API that makes it harder to forget to clean up. |
I'm trying to use the experimental nrzled package on a raspberry pi.
The first problem was that this failed because the returned pin is a pinAlias, so you need to get the real pin. I fixed that.
Then it fails with this error:
nrzled: nrzled: bcm283x-gpio (GPIO18): frequency is too high(800kHz).
Apparently the maximum frequency is 200kHz (https://github.com/google/periph/blob/v3.1.0/host/bcm283x/dma.go#L1163). Why? 800kHz is the default in nrzled and is what the led ring needs.
The text was updated successfully, but these errors were encountered: