Current (Lakka-v5.x) cec-mini-kb.service is always restarted even if it is failed.
If CEC unsupported HDMI display is connected, the framerate hiccups is happened by each cec-mini-kb.service restarts.
It needs to control the cec-mini-kb.service starting.
Idea for fix
At first, please refer systemd.service manual.
https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html
Give "cec-mini-kb.service" to depend "retroarch.service".
When the systemd detects "retroarch.service" was normally started, it starts "cec-mini-kb.service".
The "cec-mini-kb.service" is started 1 time only.
Changing detail
retroarch.service
Change service type to "notify".
retroarch
Notifies "Ready" to systemd via sd_notify() when initialize is done.
cec-mini-kb package
Update package revision.
cec-mini-kb.service
(a) Give "After=retroarch.service" and "Requires=retroarch.service" dependencies in [Unit] section.
(b) Change to "WantedBy=retroarch.service" from "WantedBy=multi-user.target" in [Install] section.
(c) Remove "RestartSec=2" and creplace "Restart=no" from "Restart=always" in [Service] section.
By (a) and (b), the systemd starts "cec-mini-kb.service" after "retroarch.service" is activated.
By (c), the systemd only start s "cec-mini-kb.service" 1 time.
Limitation:
When HDMI display is not recognized or not connected in Lakka booting,
"cec-mini-kb.service" is failed after reconnect HDMI display.
Request:
I placed "sd_notify()" into rarch_main() on retroarch.
Please let me know more good place.
This pull request concerns with issue #1981
Current (Lakka-v5.x) cec-mini-kb.service is always restarted even if it is failed. If CEC unsupported HDMI display is connected, the framerate hiccups is happened by each cec-mini-kb.service restarts. It needs to control the cec-mini-kb.service starting.
Idea for fix
At first, please refer systemd.service manual. https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html Give "cec-mini-kb.service" to depend "retroarch.service". When the systemd detects "retroarch.service" was normally started, it starts "cec-mini-kb.service". The "cec-mini-kb.service" is started 1 time only.
Changing detail
Limitation:
Request:
I placed "sd_notify()" into rarch_main() on retroarch. Please let me know more good place.
Thanks ASAI, Shigeaki