Compare commits

...

8 commits

Author SHA1 Message Date
Jools Wills 0a8a2defb9
Merge 2518994e6c into 6d458aafac 2024-05-09 21:10:36 +02:00
Jools Wills 6d458aafac
Merge pull request #3916 from theofficialgman/master
emulationstation: fix OpenGL version check
2024-05-08 20:40:18 +01:00
theofficialgman a9bdf98195 emulationstation: fix OpenGL version check 2024-05-08 15:28:33 -04:00
Jools Wills 2518994e6c splashscreen - only add --mmal-layer for videocore 2024-01-28 15:09:57 +00:00
Jools Wills 19865c363d splashscreen - remove unneeded check/install in gui_splashscreen 2024-01-28 13:34:36 +00:00
Jools Wills 08f9cc69c6 splashscreen - remove unused is_fkms function 2024-01-28 13:34:36 +00:00
Jools Wills 0c9e4d132f splashscreen - remove insserv dependency and legacy init.d script 2024-01-28 13:34:36 +00:00
Jools Wills 2824bddb87 splashscreen - switch to vlc instead of omxiv / omxplayer
omxiv / omxplayer only works on the Raspberry Pi legacy and fkms drivers.

This change switches to vlc for both utilities, as it supports mmal output on the Raspberry Pi legacy drivers, and drm output on KMS on Raspberry Pi OS (bullseye).

Remove dependencies for omxplayer / omxiv

Switch code to use vlc.

Run asplashscreen as $user (not root).

Remove wait for dbus (no longer needed)

Save vlc pid and Exit vlc before launching emulationstation on KMS
2024-01-28 13:34:36 +00:00
3 changed files with 44 additions and 51 deletions

View file

@ -173,7 +173,10 @@ function build_emulationstation() {
compareVersions $gles_ver lt 2.0 && params+=(-DUSE_GLES1=On)
else
params+=(-DGL=On)
# mesa specific check of OpenGL version
local gl_ver=$(sudo -u $user glxinfo -B | grep -oP 'Max compat profile version:\s\K.*')
# generic fallback check of OpenGL version
[[ -z "$gl_ver" ]] && gl_ver=$(sudo -u $user glxinfo -B | grep -oP "OpenGL version string: \K[^ ]+")
compareVersions $gl_ver gt 2.0 && params+=(-DUSE_GL21=On)
fi
elif isPlatform "gles"; then
@ -259,6 +262,15 @@ fi
TTY=\$(tty)
export TTY="\${TTY:8:1}"
# exit vlc before launching on kms or ES won't be able to open the display (not required on legacy drivers or fkms)
if [[ -d /sys/module/vc4 ]] && grep -q "okay" /proc/device-tree/soc/hvs@7e400000/status 2>/dev/null; then
vlc_pid="/tmp/vlc.pid"
if [[ -f "\$vlc_pid" ]]; then
kill \$(<\$vlc_pid)
rm "\$vlc_pid"
fi
fi
clear
tput civis
"$md_inst/emulationstation.sh" "\$@"

View file

@ -32,9 +32,7 @@ function _video_exts_splashscreen() {
}
function depends_splashscreen() {
local params=(insserv)
isPlatform "32bit" && params+=(omxplayer)
getDepends "${params[@]}"
getDepends vlc
}
function install_bin_splashscreen() {
@ -48,6 +46,7 @@ ConditionPathExists=$md_inst/asplashscreen.sh
[Service]
Type=oneshot
User=$user
ExecStart=$md_inst/asplashscreen.sh
RemainAfterExit=yes
@ -55,8 +54,6 @@ RemainAfterExit=yes
WantedBy=sysinit.target
_EOF_
rp_installModule "omxiv" "_autoupdate_"
gitPullOrClone "$md_inst"
cp "$md_data/asplashscreen.sh" "$md_inst"
@ -66,6 +63,9 @@ _EOF_
iniSet "DATADIR" "$datadir"
iniSet "REGEX_IMAGE" "$(_image_exts_splashscreen)"
iniSet "REGEX_VIDEO" "$(_video_exts_splashscreen)"
if isPlatform "videocore"; then
iniSet "VLC_OPTS" "--mmal-layer 10001"
fi
if [[ ! -f "$configdir/all/$md_id.cfg" ]]; then
iniConfig "=" '"' "$configdir/all/$md_id.cfg"
@ -107,9 +107,6 @@ function disable_splashscreen() {
function configure_splashscreen() {
[[ "$md_mode" == "remove" ]] && return
# remove legacy service
[[ -f "/etc/init.d/asplashscreen" ]] && insserv -r asplashscreen && rm -f /etc/init.d/asplashscreen
disable_plymouth_splashscreen
enable_splashscreen
[[ ! -f /etc/splashscreen.list ]] && default_splashscreen
@ -229,7 +226,7 @@ function preview_splashscreen() {
local path
local file
local omxiv="/opt/retropie/supplementary/omxiv/omxiv"
local vlc="sudo -u $user vlc --intf dummy --quiet --play-and-exit --image-duration 6"
while true; do
local cmd=(dialog --backtitle "$__backtitle" --menu "Choose an option." 22 86 16)
local choice=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
@ -241,13 +238,13 @@ function preview_splashscreen() {
1)
file=$(choose_splashscreen "$path" "image")
[[ -z "$file" ]] && break
$omxiv -b "$file"
$vlc "$file"
;;
2)
file=$(mktemp)
find "$path" -type f ! -regex ".*/\..*" ! -regex ".*LICENSE" ! -regex ".*README.*" ! -regex ".*\.sh" | sort > "$file"
if [[ -s "$file" ]]; then
$omxiv -t 6 -T blend -b --once -f "$file"
tr "\n" "\0" <"$file" | xargs -0 $vlc
else
printMsgs "dialog" "There are no splashscreens installed in $path"
fi
@ -257,7 +254,7 @@ function preview_splashscreen() {
3)
file=$(choose_splashscreen "$path" "video")
[[ -z "$file" ]] && break
omxplayer --no-osd -b --layer 10000 "$file"
$vlc "$file"
;;
esac
done
@ -270,10 +267,6 @@ function download_extra_splashscreen() {
}
function gui_splashscreen() {
if [[ ! -d "$md_inst" ]]; then
rp_callModule splashscreen depends
rp_callModule splashscreen install
fi
local cmd=(dialog --backtitle "$__backtitle" --menu "Choose an option." 22 86 16)
while true; do
local enabled=0

View file

@ -4,27 +4,17 @@ ROOTDIR=""
DATADIR=""
REGEX_VIDEO=""
REGEX_IMAGE=""
VLC_OPTS=""
# Load user settings
. /opt/retropie/configs/all/splashscreen.cfg
is_fkms() {
if grep -q okay /proc/device-tree/soc/v3d@7ec00000/status 2> /dev/null || grep -q okay /proc/device-tree/soc/firmwarekms@7e600000/status 2> /dev/null ; then
return 0
else
return 1
fi
}
do_start () {
local config="/etc/splashscreen.list"
local line
local re="$REGEX_VIDEO\|$REGEX_IMAGE"
local omxiv="/opt/retropie/supplementary/omxiv/omxiv"
local vlc="vlc --intf dummy --quiet --no-video-title-show --play-and-exit "
case "$RANDOMIZE" in
disabled)
line="$(head -1 "$config")"
;;
retropie)
line="$(find "$ROOTDIR/supplementary/splashscreen" -type f | grep "$re" | shuf -n1)"
;;
@ -38,36 +28,34 @@ do_start () {
line="$(cat "$config" | shuf -n1)"
;;
esac
if $(echo "$line" | grep -q "$REGEX_VIDEO"); then
# wait for dbus
while ! pgrep "dbus" >/dev/null; do
sleep 1
done
omxplayer --no-osd -o both -b --layer 10001 "$line"
elif $(echo "$line" | grep -q "$REGEX_IMAGE"); then
if [ "$RANDOMIZE" = "disabled" ]; then
local count=$(wc -l <"$config")
else
local count=1
fi
[ $count -eq 0 ] && count=1
[ $count -gt 12 ] && count=12
# Default duration is 12 seconds, check if configured otherwise
[ -z "$DURATION" ] && DURATION=12
local delay=$((DURATION/count))
if [ "$RANDOMIZE" = "disabled" ]; then
"$omxiv" --once -t $delay -b --layer 10001 -f "$config" >/dev/null 2>&1
else
"$omxiv" --once -t $delay -b --layer 10001 -r "$line" >/dev/null 2>&1
fi
if [ "$RANDOMIZE" = "disabled" ]; then
local count=$(wc -l <"$config")
else
local count=1
fi
[ $count -eq 0 ] && count=1
[ $count -gt 12 ] && count=12
# Default duration is 12 seconds, check if configured otherwise
[ -z "$DURATION" ] && DURATION=12
local delay=$((DURATION/count))
vlc="$vlc --image-duration $delay"
if [ "$RANDOMIZE" = "disabled" ]; then
tr "\n" "\0" <"$config" | xargs -0 $vlc & 2>/dev/null
else
$vlc "$line" & 2>/dev/null
fi
echo $! >/tmp/vlc.pid
exit 0
}
case "$1" in
start|"")
do_start &
do_start
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2