diff --git a/projects/ArchR/packages/ui/emulationstation/sources/es_settings b/projects/ArchR/packages/ui/emulationstation/sources/es_settings index 6dae2d01d6..7b7e36d23b 100755 --- a/projects/ArchR/packages/ui/emulationstation/sources/es_settings +++ b/projects/ArchR/packages/ui/emulationstation/sources/es_settings @@ -10,8 +10,15 @@ export SDL_AUDIODRIVER=pulseaudio TZ=$(get_setting system.timezone) echo -n "TIMEZONE=${TZ}" > /storage/.cache/timezone +# es_settings is ExecStartPre for emustation.service, so it runs on every ES +# (re)start. Restarting tz-data is synchronous and blocks the ES relaunch +# (a visible chunk of the "Restart EmulationStation" black screen), yet it +# only matters when the timezone changed. Skip it otherwise. +PREV_TZ="$(cat /storage/.cache/system_timezone 2>/dev/null)" echo -n "${TZ}" >/storage/.cache/system_timezone -systemctl restart tz-data.service +if [ "${TZ}" != "${PREV_TZ}" ]; then + systemctl restart tz-data.service +fi MYLOCALE=$(get_setting system.language) if [[ -n "${MYLOCALE}" ]] diff --git a/projects/ArchR/packages/ui/emulationstation/system.d/emustation.service b/projects/ArchR/packages/ui/emulationstation/system.d/emustation.service index baa977733e..e8cd50d74d 100644 --- a/projects/ArchR/packages/ui/emulationstation/system.d/emustation.service +++ b/projects/ArchR/packages/ui/emulationstation/system.d/emustation.service @@ -19,8 +19,12 @@ ExecStartPre=/usr/bin/es_settings ExecStart=/usr/bin/emulationstation --log-path /var/log --no-splash KillMode=process TimeoutStopSec=3 +# RestartSec is pure dead time on a user-initiated "Restart EmulationStation" +# (and after a crash). StartLimitIntervalSec/StartLimitBurst above already +# stop a crash-loop from flooding, so keep just enough debounce to avoid a +# tight loop. Restart=always -RestartSec=2 +RestartSec=1 [Install] WantedBy=archr.target