diff --git a/dist/hornverifier b/dist/hornverifier index b180ee7b..52827032 100755 Binary files a/dist/hornverifier and b/dist/hornverifier differ diff --git a/dist/roverd b/dist/roverd index b5dcd369..090cfac0 100755 Binary files a/dist/roverd and b/dist/roverd differ diff --git a/dist/roverd-debian-laptop b/dist/roverd-debian-laptop index ef4aaf12..851006be 100755 Binary files a/dist/roverd-debian-laptop and b/dist/roverd-debian-laptop differ diff --git a/dist/servoverifier b/dist/servoverifier index 14ae5739..9f495f1f 100755 Binary files a/dist/servoverifier and b/dist/servoverifier differ diff --git a/pi/bin/audio-only-publisher.sh b/pi/bin/audio-only-publisher.sh index 5cd0bf08..74fe5422 100644 --- a/pi/bin/audio-only-publisher.sh +++ b/pi/bin/audio-only-publisher.sh @@ -87,6 +87,7 @@ else fi run_pipeline() { + local -a pipeline_statuses=() local ffmpeg_args=( -hide_banner -loglevel warning @@ -146,6 +147,17 @@ run_pipeline() { # latency compared with the old 65,536-byte buffer. arecord -D "${CAPTURE_DEVICE}" -f S32_LE -c "${ROVERD_AUDIO_CAPTURE_CHANNELS}" -r "${ROVERD_AUDIO_CAPTURE_SAMPLE_RATE}" -B "${AUDIO_ALSA_BUFFER_BYTES}" -F "${AUDIO_ALSA_PERIOD_BYTES}" -q -t raw \ | "${FFMPEG_BIN_PATH}" "${ffmpeg_args[@]}" + pipeline_statuses=("${PIPESTATUS[@]}") + + # PIPESTATUS belongs to the pipeline that just finished and is replaced by the next shell + # command. Capture it immediately, then return the publisher failure first because that is + # normally the reason arecord receives a secondary broken pipe. + LAST_ARECORD_STATUS="${pipeline_statuses[0]:-unknown}" + LAST_FFMPEG_STATUS="${pipeline_statuses[1]:-unknown}" + if [[ "${LAST_FFMPEG_STATUS}" != "0" ]]; then + return "${LAST_FFMPEG_STATUS}" + fi + return "${LAST_ARECORD_STATUS}" } trap 'kill 0 2>/dev/null' EXIT INT TERM @@ -154,6 +166,6 @@ while true; do if run_pipeline; then exit 0 fi - echo "Audio-only publisher exited arecord=${PIPESTATUS[0]} ffmpeg=${PIPESTATUS[1]}, restarting in 2s..." >&2 + echo "Audio-only publisher exited arecord=${LAST_ARECORD_STATUS:-unknown} ffmpeg=${LAST_FFMPEG_STATUS:-unknown}, restarting in 2s..." >&2 sleep 2 done diff --git a/pi/systemd/audio-forward-listener.service b/pi/systemd/audio-forward-listener.service index 44cf488e..b578c062 100644 --- a/pi/systemd/audio-forward-listener.service +++ b/pi/systemd/audio-forward-listener.service @@ -1,5 +1,5 @@ [Unit] -Description=Rover Audio Forward Listener (SRT -> ALSA) +Description=Rover Audio Forward Listener (RTSP/TCP -> ALSA) After=network-online.target roverd.service Wants=network-online.target diff --git a/pi/systemd/audio-only-publisher.service b/pi/systemd/audio-only-publisher.service index 20e0da4d..1af0b999 100644 --- a/pi/systemd/audio-only-publisher.service +++ b/pi/systemd/audio-only-publisher.service @@ -1,5 +1,5 @@ [Unit] -Description=Rover Audio Publisher (ALSA -> SRT) +Description=Rover Audio Publisher (ALSA -> RTSP/TCP) After=network-online.target roverd.service Wants=network-online.target diff --git a/pi/systemd/debian-laptop-video-publisher.service b/pi/systemd/debian-laptop-video-publisher.service index 6a9d61a1..a6d76fd6 100644 --- a/pi/systemd/debian-laptop-video-publisher.service +++ b/pi/systemd/debian-laptop-video-publisher.service @@ -1,5 +1,5 @@ [Unit] -Description=Rover Debian Laptop Video Publisher (V4L2 -> SRT) +Description=Rover Debian Laptop Video Publisher (V4L2 -> RTSP/TCP) After=network-online.target roverd.service Wants=network-online.target diff --git a/pi/systemd/video-publisher.service b/pi/systemd/video-publisher.service index d5ad04e8..42f52c3b 100644 --- a/pi/systemd/video-publisher.service +++ b/pi/systemd/video-publisher.service @@ -1,5 +1,5 @@ [Unit] -Description=Rover Video Publisher (libcamera -> SRT) +Description=Rover Video Publisher (libcamera -> RTSP/TCP) After=network-online.target roverd.service Wants=network-online.target