Solved RPI OS 64 bit - kodi/retroarch - cec issue
#1
Hi Guys,

i am typing here a little bit of a summary of my latest adventure with Raspberrypi OS64 bit, Kodi and Retroarch (+ moonlight/sunshine).
I hope this can be of some help to others, plus i have a little question about CEC.

Let's start with the "why"...
I wanted to have Kodi but i wanted to have more OS than what you get with Libreelec (which i have been using and i consider a great option)
I initially opted for archarm and used it for a while and also this was good and a lot of fun but my lack of time and dedication brought the occasional angry wife/son complaining about "you broke it again!"
I have recently switched to raspberrypi OS 64 bit, seemed updated & stable enough to keep the family happy plus i wanted to have moonlight so that i could stream my steam games on it

then the "how"
Integrating Kodi was easy, i don't know if i am using the cleanest way but i :
- autologin into console as per this archwiki link
and
- set a cronjob to run kodi on boot like this:
crontab -e:
# m h  dom mon dow   command
@reboot kodi-standalone

Installing moonlight-qt was quite straightforward (as per their github page) with maybe the exception of not having raspi-config and opting for pipewire instead of pulseaudio)
I also installed Retroarch and compiled most of the available libretro-cores with success (see also this other forum thread )

What i wanted now was to have a simple keybind that would allow me to switch between Kodi and Retroarch (and Moonlight)
I made a little script, which is working fine, or at least it does what it should:
Code:
 1 #!/bin/bash                                                                                                                                                                                                                                                                
nohup sh -c 'sleep 15s && /usr/local/bin/retroarch && /usr/bin/kodi-standalone' &
/usr/bin/kodi-send -a "Quit"

The only issue is that when i return to Kodi after having played with Retroarch i get no CEC and my TV remote doesn't communicate any more with Kodi
In the log i can see:
Code:
2024-12-02 13:29:54.389 T:2384     info <general>: Register - new cec device registered on cec->/dev/cec0: CEC Adapter (0000:0000)
2024-12-02 13:29:54.396 T:2384     info <general>: Register - new cec device registered on cec->/dev/cec1: CEC Adapter (0000:0000)

and then a series of:
Code:
2024-12-02 13:30:04.395 T:2397    error <general>: OpenConnection - could not opening a connection to the CEC adapter
2024-12-02 13:30:24.398 T:2397     info <general>: Skipped 1 duplicate messages..
2024-12-02 13:30:24.398 T:2397    error <general>: OpenConnection - could not opening a connection to the CEC adapter
2024-12-02 13:30:44.402 T:2397     info <general>: Skipped 1 duplicate messages..
2024-12-02 13:30:44.402 T:2397    error <general>: OpenConnection - could not opening a connection to the CEC adapter
2024-12-02 13:31:04.406 T:2397     info <general>: Skipped 1 duplicate messages..

full log

Is there anyone that could point me in the right direction on how to get CEC also on Kodi when i return to it after playing with Retroarch?

thanks a lot

M
Reply
#2
i took a different path and instead of launching kodi with a cron job i switched to systemd unit
i then setup a retroarch unit that makes sure that kodi is killed, starts retroarch and when done with retroarch re-starts Kodi

I guess both units could be improved.. but they seem to work so far...

i will mark this as solved

M

retroarch.service:
[Unit]
Description=Reference frontend for the libretro API
Conflicts=kodi-standalone.service

[Service]
ExecStartPre=/usr/bin/killall --exact --wait kodi.bin
ExecStart=/usr/local/bin/retroarch
ExecStopPost=/bin/systemctl --user start kodi-standalone.service


kodi-standalone.service:
[Unit]
Description=Kodi Standalone

[Service]
ExecStart=/usr/bin/kodi-standalone
ExecStop=/usr/bin/killall --exact --wait kodi.bin

[Install]
WantedBy=default.target
Reply

Logout Mark Read Team Forum Stats Members Help
RPI OS 64 bit - kodi/retroarch - cec issue0
This forum uses Lukasz Tkacz MyBB addons.