Chromium: same page, same machine, idle, Firefox 24.2% of a core against Chromium's 11.4%. The build comes from archive.raspberrypi.com (a "+rpt" version) and is patched for this board's V3D GPU; Debian ships a much older chromium, so the archive matters. The whole userland here is 32-bit armhf on a 64-bit kernel, which Firefox handles worse than Chromium does. --use-gl=egl, --enable-gpu-rasterization, --ignore-gpu-blocklist and --enable-zero-copy are what keep rasterization on the GPU: Chromium's blocklist does not recognise this driver and silently falls back to software without them. pi_kiosk_browser: firefox still works, as the fallback if an update ever regresses. Debug mode also gains xdotool, scrot and --remote-debugging-port=9222 (on 127.0.0.1), because firing XTEST key events at a window lands about half the time and a benchmark you cannot verify the state of is worse than none. pi_squeezeserver gains an absent path, and mediapis.yml derives its state from mediapi_has_squeezeserver, which defaults to false for the whole group. false means "actively remove", not "skip": musicdolphin has been running a Logitech Media Server that no playbook installs and nothing talks to - every squeezelite in the fleet points at pi_squeezelite_squeezeserver (192.168.178.80, the server) - while costing ~30 MB resident and ~47 MB of swap on a 2 GB Pi that also drives the kiosk. The absent path stops it, purges the package, unregisters it from sysdweb, drops the port 80 -> 9000 redirect and deletes its database and logs. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
67 lines
2.9 KiB
Django/Jinja
67 lines
2.9 KiB
Django/Jinja
#!/bin/sh
|
|
# Managed by ansible (pi_kiosk role).
|
|
#
|
|
# Openbox is here for one concrete reason: a browser asks to be full-screen over EWMH,
|
|
# and only a window manager answers that request. With no WM running, --kiosk was
|
|
# silently ignored and the browser fell back to its default window size in the
|
|
# top-left corner of a 1920x1080 screen - black bands down the right edge and along
|
|
# the bottom, looking exactly like an overscan problem and not being one.
|
|
|
|
xset s off
|
|
xset -dpms
|
|
xset s noblank
|
|
|
|
{% if pi_kiosk_browser == 'chromium' %}
|
|
BROWSER=chromium
|
|
|
|
# The first four flags are the difference between compositing on the GPU and
|
|
# rasterizing every frame on the CPU:
|
|
# --use-gl=egl reach V3D through EGL rather than desktop GLX
|
|
# --enable-gpu-rasterization rasterize layer content on the GPU
|
|
# --ignore-gpu-blocklist Chromium's blocklist does not know this driver, and
|
|
# without this it quietly falls back to software
|
|
# --enable-zero-copy hand tiles to the compositor without a CPU copy
|
|
# The rest are about a machine nobody sits in front of: no update checks, no crash
|
|
# bubbles, no keyring prompt, no first-run wizard, no "restore pages?" after a power
|
|
# cut. Anything policy-shaped rather than flag-shaped is in
|
|
# /etc/chromium/policies/managed/.
|
|
BROWSER_ARGS="--use-gl=egl --enable-gpu-rasterization --ignore-gpu-blocklist --enable-zero-copy"
|
|
BROWSER_ARGS="$BROWSER_ARGS --noerrdialogs --disable-infobars --no-first-run"
|
|
BROWSER_ARGS="$BROWSER_ARGS --no-default-browser-check --disable-session-crashed-bubble"
|
|
BROWSER_ARGS="$BROWSER_ARGS --password-store=basic --check-for-update-interval=31536000"
|
|
{% if pi_kiosk_mode == 'debug' %}
|
|
# Debug mode only. Binds to 127.0.0.1, so it is reachable over an ssh tunnel and from
|
|
# nowhere else. Lets the page be driven and measured from a shell - `curl
|
|
# localhost:9222/json` lists the tabs - instead of by poking XTEST key events at a
|
|
# window and hoping they land.
|
|
BROWSER_ARGS="$BROWSER_ARGS --remote-debugging-port=9222"
|
|
{% endif %}
|
|
{% else %}
|
|
BROWSER=firefox
|
|
BROWSER_ARGS=""
|
|
{% endif %}
|
|
|
|
{% if pi_kiosk_mode == 'debug' %}
|
|
# Debug session. The browser is an ordinary window with its chrome (so devtools and the
|
|
# URL bar are reachable) and is *not* relaunched when it exits - quitting it should
|
|
# leave a usable desktop, not fight you for the screen. Openbox is the session leader
|
|
# instead: when it exits (root menu -> Exit) the X session ends and .bash_profile
|
|
# starts a fresh one. Right-click the desktop for a terminal.
|
|
# shellcheck disable=SC2086 # BROWSER_ARGS is a word list on purpose
|
|
$BROWSER $BROWSER_ARGS "{{ pi_kiosk_url }}" &
|
|
|
|
exec openbox
|
|
{% else %}
|
|
openbox &
|
|
|
|
unclutter -idle 0.5 -root &
|
|
|
|
# The loop is what takes the place of a WM's "keep something on screen" job: Openbox
|
|
# manages the window, but nothing else would bring the browser back if it died.
|
|
while true; do
|
|
# shellcheck disable=SC2086
|
|
$BROWSER --kiosk $BROWSER_ARGS "{{ pi_kiosk_url }}"
|
|
sleep 2
|
|
done
|
|
{% endif %}
|