tvoverbeek
Posts: 89
Joined: Mon Feb 04, 2013 9:50 am
Location: Fieberbrunn, Austria

[SOLVED] Raspbian Stretch; Using PCM for WS281x LEDs does not work any more

Sun Sep 03, 2017 7:24 pm

I am using the following library https://github.com/jgarff/rpi_ws281x to control WS281x LEDs (e.g. Pimoroni's original Unicorn HAT). You can use PWM (the default), PCM or SPI.
This worked nicely under Jessie.
Under Stretch only PWM and SPI work. Programming the PCM via DMA does not seem to work any more under Stretch. Strange hangs occur, SD card sometimes goes Read-Only.
Something is interfering with the PCM channel. Any pointers? Anything to do with the use of ALSA instead of pulse audio?
Pointers and hints appreciated.

Ton van Overbeek
PS I am the original author of the PCM and SPI support of this library.
----------------------------
Turned out to be a missing aligned(4) attribute for the pcm structure. This caused the gcc compiler in Stretch (6.0.3) to generate byte by byte access to the pcm registers instead of 32 bit access.
The older gcc in Jessie just produced 32 bit access code in spite of the missing attribute.

tvoverbeek
Posts: 89
Joined: Mon Feb 04, 2013 9:50 am
Location: Fieberbrunn, Austria

Re: [SOLVED] Raspbian Stretch; Using PCM for WS281x LEDs does not work any more

Wed Sep 13, 2017 11:31 am

Problem solved. See edited original post above.

Return to “Raspbian”

Who is online

Users browsing this forum: No registered users and 12 guests