diff options
author | Christian Pointner <equinox@spreadspace.org> | 2024-05-06 21:49:31 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2024-05-06 21:49:31 +0200 |
commit | e1db354c54015bf9fb28b2179fbe739ee07ee7fa (patch) | |
tree | 7f6f827f48a4db926728a6d41c5a93fbea31c71f | |
parent | zimablade is now zimaplayer (diff) |
some preliminary tests with mpv-headless on raspberry pi
-rw-r--r-- | chaos-at-home/ch-cm4-test.yml | 9 | ||||
-rw-r--r-- | inventory/host_vars/ch-cm4-test.yml | 40 | ||||
-rw-r--r-- | roles/streaming/mpv-headless/defaults/main.yml | 2 | ||||
-rw-r--r-- | roles/streaming/mpv-headless/tasks/main.yml | 20 |
4 files changed, 48 insertions, 23 deletions
diff --git a/chaos-at-home/ch-cm4-test.yml b/chaos-at-home/ch-cm4-test.yml index 5ed9c0a6..ac23b9a2 100644 --- a/chaos-at-home/ch-cm4-test.yml +++ b/chaos-at-home/ch-cm4-test.yml @@ -8,7 +8,8 @@ - role: core/zsh - role: core/ntp -- name: Payload Setup - hosts: ch-cm4-test - roles: - - role: streaming/browser-kiosk +# - name: Payload Setup +# hosts: ch-cm4-test +# roles: +# - role: streaming/browser-kiosk +# - role: streaming/mpv-headless diff --git a/inventory/host_vars/ch-cm4-test.yml b/inventory/host_vars/ch-cm4-test.yml index 7c862cad..cf345748 100644 --- a/inventory/host_vars/ch-cm4-test.yml +++ b/inventory/host_vars/ch-cm4-test.yml @@ -24,29 +24,43 @@ network: # line: 'dtoverlay=disable-wifi' # ## Waveshare CM4-DUAL-ETH-BASE -# raspios_boot_config: -# - regexp: '^#?dtparam=i2c_vc' -# line: 'dtparam=i2c_vc=on' -# - regexp: '^#?dtoverlay=i2c-rtc' -# line: 'dtoverlay=i2c-rtc,pcf85063a,i2c_csi_dsi' -# - regexp: '^#?dtoverlay=i2c-fan' -# line: 'dtoverlay=i2c-fan,emc2301,i2c_csi_dsi' -# - regexp: '^#?dtoverlay=disable-bt' -# line: 'dtoverlay=disable-bt' -# - regexp: '^#?dtoverlay=disable-wifi' -# line: 'dtoverlay=disable-wifi' - -## TuringPi v2.4 raspios_boot_config: + - regexp: '^#?dtparam=i2c_vc' + line: 'dtparam=i2c_vc=on' + - regexp: '^#?dtoverlay=i2c-rtc' + line: 'dtoverlay=i2c-rtc,pcf85063a,i2c_csi_dsi' + - regexp: '^#?dtoverlay=i2c-fan' + line: 'dtoverlay=i2c-fan,emc2301,i2c_csi_dsi' - regexp: '^#?dtoverlay=disable-bt' line: 'dtoverlay=disable-bt' - regexp: '^#?dtoverlay=disable-wifi' line: 'dtoverlay=disable-wifi' +## TuringPi v2.4 +#raspios_boot_config: +# - regexp: '^#?dtoverlay=disable-bt' +# line: 'dtoverlay=disable-bt' +# - regexp: '^#?dtoverlay=disable-wifi' +# line: 'dtoverlay=disable-wifi' + base_entropy_generator: rngd +base_modules_blacklist: "{{ base_modules_blacklist_all_but_sound }}" + +sshd_allowusers_host: + - player + + browser_kiosk_xinit_commands_extra: | xrandr --output HDMI-1 --mode 1920x1080 --rate 50 browser_kiosk_url: "https://updatefaker.com/w98/index.html" + + + +mpv_headless_audio_device: "alsa/hdmi" +mpv_headless_video_mode: "1920x1080@60" +mpv_headless_hwdec: v4l2m2m-copy + +mpv_headless_ssh_keys: "{{ users.equinox.ssh }}" diff --git a/roles/streaming/mpv-headless/defaults/main.yml b/roles/streaming/mpv-headless/defaults/main.yml index 847dc2aa..d7790d09 100644 --- a/roles/streaming/mpv-headless/defaults/main.yml +++ b/roles/streaming/mpv-headless/defaults/main.yml @@ -5,5 +5,7 @@ mpv_headless_audio_device: "alsa/hdmi" mpv_headless_video_mode: "1920x1080@50" +mpv_headless_hwdec: vaapi + # mpv_headless_ssh_keys: # - ssh-ed25519 ... diff --git a/roles/streaming/mpv-headless/tasks/main.yml b/roles/streaming/mpv-headless/tasks/main.yml index 027c1c69..ad244299 100644 --- a/roles/streaming/mpv-headless/tasks/main.yml +++ b/roles/streaming/mpv-headless/tasks/main.yml @@ -3,17 +3,25 @@ apt: name: - alsa-utils + - ffmpeg + - mpv + - socat + state: present + +- name: install intel/vaapi specific packages + when: "'raspios' not in group_names" + apt: + name: - intel-gpu-tools - vainfo - va-driver-all - firmware-linux - - ffmpeg - - mpv - - socat state: present -- name: install non-free vaapi drivers - when: "'non-free' in (apt_repo_components | default([])) " +- name: install non-free vaapi drivers for intel + when: + - "'raspios' not in group_names" + - "'non-free' in (apt_repo_components | default([])) " apt: name: - i965-va-driver-shaders @@ -55,7 +63,7 @@ case $(tty) in /dev/tty1) setterm --clear=all --cursor off --background black - exec mpv --osd-level=0 --no-osc --audio-device='{{ mpv_headless_audio_device }}' --vo=gpu --hwdec=vaapi --gpu-context=drm --drm-mode='{{ mpv_headless_video_mode }}' --force-window=immediate --input-ipc-server=/var/lib/player/ctl.sock --idle + exec mpv --osd-level=0 --no-osc --audio-device='{{ mpv_headless_audio_device }}' --vo=gpu --hwdec={{ mpv_headless_hwdec }} --gpu-context=drm --drm-mode='{{ mpv_headless_video_mode }}' --force-window=immediate --input-ipc-server=/var/lib/player/ctl.sock --idle ;; esac fi |