summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2024-04-01 17:35:43 +0200
committerChristian Pointner <equinox@spreadspace.org>2024-04-01 17:35:43 +0200
commit6bd10752c94e870687c3fb55d3e5475473383e9c (patch)
treeab2907ff8eb17f336b552ac5f9a8984389549a89
parentadd streaming/mpv-headless role (needs more testing) (diff)
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.
-rw-r--r--inventory/host_vars/ele-tarvos.yml2
-rw-r--r--roles/streaming/mpv-headless/tasks/main.yml11
2 files changed, 11 insertions, 2 deletions
diff --git a/inventory/host_vars/ele-tarvos.yml b/inventory/host_vars/ele-tarvos.yml
index ebdc1bde..424ae493 100644
--- a/inventory/host_vars/ele-tarvos.yml
+++ b/inventory/host_vars/ele-tarvos.yml
@@ -23,7 +23,7 @@ install:
mountpoint: /home
kernel_cmdline:
- "consoleblank=0"
- - "video=1920x1080@25"
+# - "video=1920x1080@25"
network:
nameservers: "{{ network_zones.lan.dns }}"
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