From 6bd10752c94e870687c3fb55d3e5475473383e9c Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 1 Apr 2024 17:35:43 +0200 Subject: the video= cmdline option for setting the preferred KMS resolution is flawed. See this report what is basically the problem https://forums.raspberrypi.com/viewtopic.php?t=361921 Try to workaround using modetest to force setting the resolution that way but unfortunately this does not work either - although i somehow made it work at some point. Alas i can't reproduce it anymore. --- roles/streaming/mpv-headless/tasks/main.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'roles/streaming/mpv-headless/tasks') diff --git a/roles/streaming/mpv-headless/tasks/main.yml b/roles/streaming/mpv-headless/tasks/main.yml index 064efeb2..65fa547d 100644 --- a/roles/streaming/mpv-headless/tasks/main.yml +++ b/roles/streaming/mpv-headless/tasks/main.yml @@ -9,6 +9,7 @@ - firmware-linux - ffmpeg - mpv + - libdrm-tests state: present - name: install non-free vaapi drivers @@ -46,7 +47,15 @@ case $(tty) in /dev/tty1) setterm --clear=all --cursor off - sleep inf + args="" + for sysfs_f in /sys/class/drm/card*; do + if [ -e "$sysfs_f/status" ] && [ $(cat "$sysfs_f/status") = "connected" ]; then + connector=$(basename $sysfs_f | sed -E 's/card[0-9]+-//') + args="$args -s $connector:{{ mpv_headless_video_mode | replace('@', '-') }}" + fi + done + exec /usr/bin/modetest -F smpte $args + #sleep inf ;; esac fi -- cgit v1.2.3