ws2812-pio-rp1 Kernel Driver seems not functional on RPi5

  • Dear LibreELEC team. First of all, thank you for your wonderful OS. I'm running Kodi on a Raspberry 5. And I have a request: I'm trying to get HyperHDR working on Libreelec with a ws2812. The ws2812-pio-rp1 kernel module loads successfully but does not actually control WS2812/SK6812 LEDs on Raspberry Pi 5. I see a dependency on rp1-pio is not there.

    If possible, please include the rp1-pio.ko kernel module in LibreELEC builds for Raspberry Pi 5.

    Tested Versions

    • LibreELEC 12.2 stable (kernel 6.12.40) - NOT working
    • LibreELEC nightly (kernel 6.12.55) - NOT working
    • Raspberry Pi OS Trixie (kernel 6.12.47) - WORKING

    Test Setup

    /flash/config.txt

    Code
    dtoverlay=ws2812-pio,gpio=18,num_leds=210,rgbw

    Device is created

    Code
    ls -l /dev/leds0
    crw------- 1 root root 236, 0 Jun 26 10:44 /dev/leds0

    Driver loads

    Code
    dmesg | grep ws2812
    [2.939] ws2812-pio-rp1 ws2812_pio@12: Instantiated 210 LEDs on GPIO 18 as /dev/leds0

    But writing to device does nothing

    Code
    printf '\xFF\x00\x00\x00' > /dev/leds0  

    on Raspian I see the first LED light up with the exact same command.

    Verification

    The exact same hardware, dtoverlay config, and test commands work perfectly on Raspberry Pi OS but fail on LibreELEC with identical kernel module version. LibreELEC compiles rp1-pio as builtin, but it never actually initializes at boot. The ws2812-pio-rp1 module loads but has no working PIO controller to communicate with.

    Libreelec 12.2:


    Raspbian:


    Thank you for your support with this!

  • Please provide a full log: ssh in, run "pastekodi" and post the URL.

    I don't have any WS2812 LEDs here so can't test with real hardware, but just adding the dtoverlay with default settings shows both the rp1-pio and ws2812-pio-rp1 drivers being successfully loaded:

    Code
    rpi5:~ # dmesg | grep rp1
    [    1.978635] rp1 0002:01:00.0: bar0 len 0x4000, start 0x1f00410000, end 0x1f00413fff, flags, 0x40200
    [    1.987721] rp1 0002:01:00.0: bar1 len 0x400000, start 0x1f00000000, end 0x1f003fffff, flags, 0x40200
    [    1.996988] rp1 0002:01:00.0: enabling device (0000 -> 0002)
    [    2.003186] rp1 0002:01:00.0: chip_id 0x20001927
    [    2.395815] genirq: irq_chip rp1_irq_chip did not update eff. affinity mask of irq 161
    [    2.712353] rp1-firmware rp1_firmware: RP1 Firmware version eb39cfd516f8c90628aa9d91f52370aade5d0a55
    [    2.722320] rp1-pio 1f00178000.pio: Created instance as pio0
    [   12.224635] /axi/pcie@1000120000/rp1/spi@50000/wm5102@0: Fixed dependency cycle(s) with /axi/pcie@1000120000/rp1/spi@50000/wm5102@0/ldo1
    [   12.422735] ws2812-pio-rp1 ws2812_pio@4: Instantiated 60 LEDs on GPIO 4 as /dev/leds0

    ```BTW: We can't build rp1-pio as a module as that would result in the RPi5 DPI DRM driver being built as a module instead of builtin to the kernel - which means DPI displays wouldn't have display output during boot. If building rpi1-pio as builtin indeed is the culprit then that's a bug in the rp1-pio or ws2812-pio-rp1 driver and should be reported as an issue on the RPi kernel repo.

    so long,

    Hias

  • Thank you for looking into this! Full diagnostic log: here.

    It's interesting that (root) writes to /dev/leds0 produce no hardware output (LEDs don't light up), nothing in the log. Before I raise any issues upstream, one question I wanted to run by you, If I run:

    cat /sys/class/ws2812-pio-rp1/leds0/uevent

    on both environments, the MAJOR numer is different:

    • Libreelec: MAJOR=236 MINOR=0
    • Raspbian: MAJOR=509 MINOR=0

    The character device is registered with completely different major numbers. Could this mean LibreELEC might be using a different version of the ws2812-pio-rp1 driver. (Is it built on https://github.com/raspberrypi/linux? ) - EDIT: Yes seems so!

    Thanks for the insights!

    Edited 2 times, last by joop (October 29, 2025 at 6:04 AM).

  • Thanks for the log!

    The log shows you have hyperhdr running, better stop that to ensure it's not accessing the /dev/leds0 device node.

    Also you seem to have some "99-com.rules" udev rules - what do you set up there?

    We're building the kernel straight from the RPi kernel repo - only with modified config. AFAICT everything should be in place in our kernel so I have no idea what could be causing the issue. As the ws2812 driver doesn't log any errors/warnings it's hard to tell what the issue may be.

    Device major/minor numbers shouldn't matter at all, they are dynamically allocated nowadays.

    Before opening an issue on the RPi kernel repo better triple-check that it's not some configuration/setup issue on your side, eg try with a plain LE installation on a separate SD card with just the dtoverlay added - and nothing more. Also maybe try asking on the RPi forum first, the Interfacing section might be a good place.

    so long,

    Hias

  • Code
    cat /etc/udev/rules.d/99-com.rules 
    SUBSYSTEM=="*-pio", GROUP="gpio", MODE="0660"

    After removing it, I can manipulate the LED colours by doing a printf '\xFF\x00\x00' > /dev/leds0.

    Thank you for looking along! HyperHDR doesn´'t work yet, but that is something else. My regards and thanks again!