Files
RTSP-Streamer/deploy/sway/config
Levi Woodard be1b53ae04 Restart without reboot; retrievable logs incl. mpv exit reasons
Two related gaps on the headless kiosk: no way to restart the wall short
of a full reboot, and no way to see why a stream keeps flapping (the
daemon's stderr goes to sway on tty1, and mpv's stderr was discarded).

Restart in place:
- `rtsp-streamer restart` sends a control-socket command; the daemon
  tears down its mpv children and syscall.Exec's the on-disk binary.
  Same PID, same parent (sway), same env — keeps WAYLAND_DISPLAY/
  SWAYSOCK and comes back up on the new binary, no reboot. Handles the
  os.Executable() "(deleted)" sentinel from make install's rename.
- sway config now launches the daemon in a relaunch loop, so a crash (or
  the restart) auto-recovers instead of leaving a black screen.
- `make deploy` now does `install` + `restart` instead of restarting
  getty@tty1 (which left stale duplicate sessions and forced reboots).

Retrievable logs:
- New internal/logbuf ring; the daemon tees slog output into it and
  serves the tail over the socket via `rtsp-streamer logs [-n N]` —
  readable over SSH, no file wrangling, no reboot.
- Capture the tail of each mpv's stderr and log its last line when the
  process exits, so "mpv exited, will restart" now carries the reason
  (connection refused, unsupported codec, 401, ...). This is the
  diagnostic for a single tile going unhealthy repeatedly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 10:03:25 -05:00

40 lines
1.7 KiB
Plaintext

# rtsp-streamer kiosk sway config
#
# Installed to /etc/rtsp-streamer/sway/config. sway is started on tty1 by the
# autologin shell (see deploy/install.sh) and this config launches the video
# wall daemon. The daemon inherits WAYLAND_DISPLAY and SWAYSOCK from sway, so
# it can position mpv windows over the sway IPC.
### Appearance — a black, chromeless canvas for video tiles ###
output * bg #000000 solid_color
default_border none
default_floating_border none
titlebar_border_thickness 0
gaps inner 0
gaps outer 0
smart_borders no
focus_follows_mouse no
# Hide the pointer almost immediately; there is no keyboard/mouse on the TV.
seat * hide_cursor 1
# Every mpv window should map borderless and floating so the daemon can place
# it at an exact pixel rectangle. The daemon also sets this, belt-and-braces.
for_window [app_id="mpv"] floating enable, border none
### Prevent the TV from blanking ###
# We do NOT run swayidle, so sway will not blank the output on its own. If your
# panel still sleeps, uncomment a keep-alive loop in a systemd timer instead.
### Launch the wall (supervised) ###
# Run the daemon in a relaunch loop so it recovers on its own: if the daemon
# ever crashes it comes straight back, and `rtsp-streamer restart` (in-place
# re-exec) needs no help from here. The loop also means a clean daemon exit
# reappears within ~2s instead of leaving a black screen until reboot.
exec sh -c 'while :; do rtsp-streamer daemon --log info; sleep 2; done'
### Emergency escape hatches (handy while setting up over a keyboard) ###
# Super+Return opens a terminal if one is installed; Super+Shift+Q exits sway.
bindsym Mod4+Return exec (foot || alacritty || xterm) 2>/dev/null
bindsym Mod4+Shift+q exit