Libreelec: pinctrl for GPIO

Hello Community,

i’m using the Rock Pi 4B as a mediacentre with Libreelec version 10.0.
As i’m new to linux-scripting and SBC’s i have some questions.
Since Radxa has done a lot of work to get mainline kernel support, is it still needed to install libmraa to use the gpio’s or can they be controlled through pinctrl?
I’m planing to add the power managment hat from waveshare to cut the powersupply from the mains voltage, the tv will power on and off through hdmi cec when the rock pi powers on and off.

Kind regards
ketamon

I thought pinctrl was hardware level and used by the DTB for normal runnings and settings whilst mraa and userspace tools gpiod (sysfs still exists) for cec libcec is prob your best bet (think it might be the only bet)

In the radxa github there is mraa and on majaro a patch is needed Zero cannot connect to wifi
gpiod never tried same with libcec but been meaning to have a go as been wondering with a voice ai you can switch sources and then back to original on a voice command.

Could be wrong but pinctrl is where its defined but use is through mraa or gpiod.

I actually used gpiod to verify our device tree overlay implementation for Zero 2. You can see that from the very bottom of this page. I also have some additional info regarding gpiod here.

Now the question is how can you get gpiod onto LibreELEC.

2 Likes

You would have to add them as packages and build your own image I guess

But that is when I am out of here and my depth :slight_smile:

Pinctrl is kind of both (softtware and hardware) to my understanding, but it is not as practical as gipod or mraa as far i was able to find out.

Hdmi CEC as for now works out of the box with Libreelec, altough some little configuration is needed.

I came to the conclusion to use buster, since it has other benefits for my specific use-case. I can programm the embedded arduino thorugh buster much more efficently, since i don’t need to build an addon for kodi and adding packages is straight forward.

I think i overestimated my competence a little tiny bit, maybe i will tinker around a little bit more in the future to fully use the lightweight of Libreelec.

Thanks @stuartiannaylor and @RadxaYuntian for very fast answers and giudance :slight_smile:

Great thing about Linux is often there are many ways you can provide a solution but also can just add to confusion.

You can run Kodi without a desktop on minimal distro, but likely you will need to do some googling kodi-x11.
https://forum.kodi.tv/showthread.php?tid=231955
Mesa even Wayland have evolved much since then and maybe you can find more recent info.

I remember have some problems with Arm but wow far too long ago to remember what.


You can also rigg a desktop to autologon and start an app so that it looks like its not there and run kodi that way.

Packages in libreElec actually don’t look that bad sort of buildroot / yocto like where learning curve is steep but likely once you done it once its actually very easy.
You are prob better posting on Libreelec if they have any packagebld tutorials for libreelec noobs.

There are no guides (deliberately) but LE users can install the system-tools add-on from the LE add-on repo; this installs libgpiod to the persistent /storage area.

1 Like

I thought about compiling minimal armbian, but wasn’t sure if i could use a gui. Thanks for making clear that it shouldn’t be a problem, if i go that route :slight_smile:

I installed the system-tools and i get the expected output from gpioinfo executed over ssh, i just need to figure the pinnumbers out but it should be straight forward. For example gpio4 D2 (naming scheme from Radxa) should be gpiochip3 line 25 (libgpiod). I will test my assumptions with the multimeter to make sure i don’t break the board and add a quick refernce table to this thread if it works.
Thank you for giving me a possible direction :slight_smile: