From 970063987a9c8fe6cf1b70acc44b9b97379fb0a0 Mon Sep 17 00:00:00 2001 From: legop3 Date: Tue, 17 Nov 2026 21:06:47 -0500 Subject: [PATCH] profile cleanups --- rover/profiles/audioCapture.yaml | 11 ++--------- rover/profiles/audioPlayback.yaml | 11 ++--------- rover/profiles/video.yaml | 20 +++++--------------- 3 files changed, 9 insertions(+), 33 deletions(-) diff --git a/rover/profiles/audioCapture.yaml b/rover/profiles/audioCapture.yaml index d19ef2b8..23e0d313 100644 --- a/rover/profiles/audioCapture.yaml +++ b/rover/profiles/audioCapture.yaml @@ -2,9 +2,7 @@ name: ALSA microphone description: Uses the configured audio input device through roverd's ALSA conversion route. setup: | - if ! command -v ffmpeg >/dev/null || ! command -v arecord >/dev/null; then - apt-get update && apt-get install -y ffmpeg alsa-utils - fi + apt-get update && apt-get install -y ffmpeg alsa-utils run: | sample_rate=48000 channels=2 @@ -20,9 +18,6 @@ description: HAT capture with S32_LE input, 20 dB microphone boost, and low-latency Opus settings. Reboot once after first enabling its hardware. setup: | set -euo pipefail - # Capture/playback setup may run concurrently; serialize edits to boot config. - exec 9>/var/lock/roverd-aiy.lock - flock 9 boot=/boot/firmware/config.txt [[ -f "$boot" ]] || boot=/boot/config.txt [[ -f "$boot" ]] || { echo 'AIY setup needs a Raspberry Pi boot config.txt' >&2; exit 1; } @@ -38,9 +33,7 @@ if [[ "$changed" == 1 ]]; then echo 'AIY hardware enabled. Reboot the host once before using this sound card.' fi - if ! command -v ffmpeg >/dev/null || ! command -v arecord >/dev/null; then - apt-get update && apt-get install -y ffmpeg alsa-utils - fi + apt-get update && apt-get install -y ffmpeg alsa-utils run: | sample_rate=48000 channels=2 diff --git a/rover/profiles/audioPlayback.yaml b/rover/profiles/audioPlayback.yaml index 2551ba17..fb0c8b24 100644 --- a/rover/profiles/audioPlayback.yaml +++ b/rover/profiles/audioPlayback.yaml @@ -2,9 +2,7 @@ name: ALSA speaker description: Uses the configured output alongside TTS and horn with independent volume controls. setup: | - if ! command -v ffmpeg >/dev/null || ! command -v aplay >/dev/null; then - apt-get update && apt-get install -y ffmpeg alsa-utils - fi + apt-get update && apt-get install -y ffmpeg alsa-utils run: | normalize=true normalize_filter='dynaudnorm=f=75:g=15:m=10:p=0.9,alimiter=limit=0.85:level=disabled' @@ -19,9 +17,6 @@ description: HAT playback with low-latency decoding and 16 kHz mono output through the configured audio route. Reboot once after initial setup. setup: | set -euo pipefail - # Capture/playback setup may run concurrently; serialize edits to boot config. - exec 9>/var/lock/roverd-aiy.lock - flock 9 boot=/boot/firmware/config.txt [[ -f "$boot" ]] || boot=/boot/config.txt [[ -f "$boot" ]] || { echo 'AIY setup needs a Raspberry Pi boot config.txt' >&2; exit 1; } @@ -37,9 +32,7 @@ if [[ "$changed" == 1 ]]; then echo 'AIY hardware enabled. Reboot the host once before using this sound card.' fi - if ! command -v ffmpeg >/dev/null || ! command -v aplay >/dev/null; then - apt-get update && apt-get install -y ffmpeg alsa-utils - fi + apt-get update && apt-get install -y ffmpeg alsa-utils run: | normalize=true normalize_filter='dynaudnorm=f=75:g=15:m=10:p=0.9,alimiter=limit=0.85:level=disabled' diff --git a/rover/profiles/video.yaml b/rover/profiles/video.yaml index 6f3f8c15..933e3ae9 100644 --- a/rover/profiles/video.yaml +++ b/rover/profiles/video.yaml @@ -2,7 +2,7 @@ name: V4L2 camera description: USB or other Linux V4L2 camera, encoded with software H.264. setup: | - command -v ffmpeg >/dev/null || { apt-get update && apt-get install -y ffmpeg; } + apt-get update && apt-get install -y ffmpeg run: | device=/dev/video0 input_format=mjpeg @@ -23,26 +23,16 @@ -g "$fps" -keyint_min "$fps" -sc_threshold 0 -flush_packets 1 -muxdelay 0 -muxpreload 0 \ -f rtsp -rtsp_transport tcp "$ROVER_VIDEO_PUBLISH_URL" - id: rpicam - name: Raspberry Pi CSI camera - description: rpicam/libcamera H.264 output, republished through ffmpeg. + name: Pi Zero 2 W Camera v2 + description: Inverted Camera Module v2 on a Pi Zero 2 W, with H.264 republished through ffmpeg. setup: | - command -v ffmpeg >/dev/null || { apt-get update && apt-get install -y ffmpeg; } - if ! command -v rpicam-vid >/dev/null && ! command -v libcamera-vid >/dev/null; then - apt-get update - apt-get install -y rpicam-apps - fi + apt-get update && apt-get install -y ffmpeg rpicam-apps run: | width=640 height=480 fps=30 bitrate=2000000 - inverted=true - sensor_mode=1296:972 - camera=$(command -v rpicam-vid || command -v libcamera-vid) - options=() - if [ "$inverted" = true ]; then options+=(--rotation 180); fi - if [ -n "$sensor_mode" ]; then options+=(--mode "$sensor_mode"); fi - "$camera" --inline --timeout 0 "${options[@]}" \ + rpicam-vid --inline --timeout 0 --rotation 180 --mode 1296:972 \ --width "$width" --height "$height" \ --framerate "$fps" --bitrate "$bitrate" \ --codec h264 --intra 120 --profile baseline --denoise auto --nopreview \