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. --- inventory/host_vars/ele-tarvos.yml | 2 +- roles/streaming/mpv-headless/tasks/main.yml | 11 ++++++++++- 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 -- cgit v1.2.3