Posts by chall88


    I was exploring options for game streaming on a RK3399 SBC and LibreELEC was a clear starting point — the V4L2 Request + DRM PRIME hwaccel pipeline is already working and well-tested there. The options I found were script.luna (originally from CoreELEC, using moonlight-embedded, potentially adaptable) and a solution that ran moonlight-qt inside Docker on LibreELEC. The CoreELEC path was decent but moonlight-embedded lacked the DRM PRIME backend that moonlight-qt has — moonlight-qt integrates FFmpeg decode and direct DRM output in a way that moonlight-embedded doesn't. (I was able to add it, but ran into KMS DRM master conflicts with Kodi in the way that can probably be sorted out.) Wanting to squeeze every bit of performance out of decade-old hardware, and not have kodi+docker overhead, I set out to splice LibreELEC and moonlight-qt together: strip Kodi, build Qt6 for the target, and have the box boot straight into moonlight-qt with full rkvdec hardware decode and zero overhead.

    It worked. 1080p60 HEVC @ 20 Mbps, 2.7ms average decode time, 0% frame drops. Working audio and controller. No stutter.

    Due to the nature of SoCs this should be portable across all RK3399 boards with only the U-Boot target needing to change.

    All credit goes to the LibreELEC project and the moonlight-qt project:

    GitHub - LibreELEC/LibreELEC.tv: Just enough OS for KODI
    Just enough OS for KODI. Contribute to LibreELEC/LibreELEC.tv development by creating an account on GitHub.
    github.com
    GitHub - moonlight-stream/moonlight-qt: GameStream client for PCs (Windows, Mac, Linux, and Steam Link)
    GameStream client for PCs (Windows, Mac, Linux, and Steam Link) - moonlight-stream/moonlight-qt
    github.com

    Most of the heavy lifting was done with Claude Code, working through ~25 build failures, mostly around Qt6 host vs. target cross-compilation. I merely gave it the goal and guided it through the problem space with documentation to kept it from going down rabbit holes, and tested the builds.

    I've uploaded the build for my board (RockPro64) along with the build tools and a readme if anyone wants to try it on their own rockpro64 or build it for another rk3399 board The Rock Pi 4 is going for around $60 now, not a bad price for a dedicated game streaming box. There's also an interesting future direction here: Qt6 and moonlight-qt could potentially be integrated into mainline LibreELEC, or the hwaccel backend from this project could be used with the Kodi interface instead of Qt, which is essentially what script.luna did with moonlight-embedded on CoreELEC. Could be a meaningful contribution to the project.

    I have helped moonlight-qt project in the past by helping supply examples of getting HDR going kmsdrm with atomic commits, and will submit what I did with adding the ffmpeg v4l2 drmprime pathway as a backend option to moonlight-embedded before pivoting to moonlight-qt, so moonlight embedded may have that down the road instad of having to bring QT along as an interface.

    Build comes in at 142MB

    Readme
    Fork

    My bluetooth controller isnt working with libreelec on the rockpro64 rk3399. I have tried 3 different chipsets rtl8761bu rtl8821cu and the broadcom BCM20702A0 I'm getting the same behavior across all 3 chipsets. Im starting to think it's not the bluetooth or the controller, but something to do with inputs to the menus in kodi itself.

    The controller does the same things, pairs connects and identifies in all 4 modes. I can see the hci traffic with btmon just fine. The only one that looks to be having issues is the sony profile on the controller. Sometimes however, when I pair the controller, the session crashes to tty until I reboot. That particular crash has persisted across mutliple SD cards and EMMC cards, does not happen with anything else. Its something specific to libreelec and not kodi. It does not happen with kodi on coreelec. Controller tested working with all chipsets in all modes on my arch desktop.


    [ 73.655927] input: 8BitDo Pro 2 as /devices/platform/usb@fe900000/http://fe900000.usb/xhci-hcd.4.aut…05/input/input5

    [ 73.656675] microsoft 0005:045E:02E0.0005: input,hidraw4: BLUETOOTH HID v9.03 Gamepad [8BitDo Pro 2] on e8:48:b8:c8:20:00


    [ 289.569259] input: 8BitDo Pro 2 as /devices/platform/usb@fe900000/http://fe900000.usb/xhci-hcd.4.aut…06/input/input7

    [ 289.569593] hid-generic 0005:2DC8:6006.0006: input,hidraw4: BLUETOOTH HID v1.00 Gamepad [8BitDo Pro 2] on e8:48:b8:c8:20:00


    [ 289.569259] input: 8BitDo Pro 2 as /devices/platform/usb@fe900000/http://fe900000.usb/xhci-hcd.4.aut…06/input/input7

    [ 289.569593] hid-generic 0005:2DC8:6006.0006: input,hidraw4: BLUETOOTH HID v1.00 Gamepad [8BitDo Pro 2] on e8:48:b8:c8:20:00

    [ 440.539721] sony 0005:054C:05C4.0007: unknown main item tag 0x0

    [ 440.550101] sony 0005:054C:05C4.0007: Failed to get calibration data from Dualshock 4

    [ 440.552171] sony 0005:054C:05C4.0007: hidraw4: BLUETOOTH HID v81.00 Gamepad [Wireless Controller] on e8:48:b8:c8:20:00

    [ 440.552180] sony 0005:054C:05C4.0007: failed to claim input

    [ 461.016274] Bluetooth: hci0: Opcode 0x 401 failed: -16


    [ 593.685836] nintendo 0005:057E:2009.0008: hidraw4: BLUETOOTH HID v80.01 Gamepad [Pro Controller] on e8:48:b8:c8:20:00

    [ 595.726409] nintendo 0005:057E:2009.0008: using factory cal for left stick

    [ 595.764407] nintendo 0005:057E:2009.0008: using factory cal for right stick

    [ 595.855313] nintendo 0005:057E:2009.0008: using factory cal for IMU

    [ 596.012268] nintendo 0005:057E:2009.0008: controller MAC = E4:17:D8:3A:84:A2

    [ 596.583591] nintendo 0005:057E:2009.0008: Failed to set home LED default, unregistering home LED

    [ 597.116902] leds 0005:057E:2009.0008:blue:player-5: Setting an LED's brightness failed (-110)

    [ 597.117242] input: Nintendo Switch Pro Controller as /devices/platform/usb@fe900000/http://fe900000.usb/xhci-hcd.4.aut…8/input/input10

    [ 597.117897] input: Nintendo Switch Pro Controller IMU as /devices/platform/usb@fe900000/http://fe900000.usb/xhci-hcd.4.aut…8/input/input11


    I also tested with a bluetooth mouse, and a bluetooth speaker, which seem to work, so this is controller input related and specifically on libreelec

    I ran into this as well

    Its the same behavior on two different bt modules

    One has an issue in taht its a 8821cu, which loads the 8821c firmware which half works. The wifi may or may not work, but the bluetooth seems semi-stable with the wrong firmware. I've seen this issue on at least half a dozen distros though.

    The other is an 8761bu.

    It both cases the bluetooth pairs and correctly identifies the controller in dmesg.
    btmon shows the controller inputs are making it across, but I cant actually control anything iwth the controller, its like the inputs are beind disregarded.

    I have 4 different modes on the controller and they all pair and identify correctly, but I cant actually control anything