mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-11-18 20:42:17 -05:00
fix im um im
This commit is contained in:
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
@@ -9,7 +9,7 @@
|
|||||||
exec ffmpeg -nostdin -f alsa -ar "$ROVER_AUDIO_SAMPLE_RATE" -ac "$ROVER_AUDIO_CHANNELS" -i "$ROVER_AUDIO_INPUT_DEVICE" -c:a libopus -b:a "$ROVER_AUDIO_BITRATE" -f rtsp -rtsp_transport tcp "$ROVER_AUDIO_PUBLISH_URL"
|
exec ffmpeg -nostdin -f alsa -ar "$ROVER_AUDIO_SAMPLE_RATE" -ac "$ROVER_AUDIO_CHANNELS" -i "$ROVER_AUDIO_INPUT_DEVICE" -c:a libopus -b:a "$ROVER_AUDIO_BITRATE" -f rtsp -rtsp_transport tcp "$ROVER_AUDIO_PUBLISH_URL"
|
||||||
- id: aiy
|
- id: aiy
|
||||||
name: Google AIY Voice HAT microphone
|
name: Google AIY Voice HAT microphone
|
||||||
description: Same configurable ALSA route; setup enables the HAT overlay. Reboot once after first enabling its hardware.
|
description: HAT capture with S32_LE input, 20 dB microphone boost, and low-latency Opus settings. Reboot once after first enabling its hardware.
|
||||||
setup: |
|
setup: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
# Capture/playback setup may run concurrently; serialize edits to boot config.
|
# Capture/playback setup may run concurrently; serialize edits to boot config.
|
||||||
@@ -30,8 +30,19 @@
|
|||||||
if [[ "$changed" == 1 ]]; then
|
if [[ "$changed" == 1 ]]; then
|
||||||
echo 'AIY hardware enabled. Reboot the host once before using this sound card.'
|
echo 'AIY hardware enabled. Reboot the host once before using this sound card.'
|
||||||
fi
|
fi
|
||||||
if ! command -v ffmpeg >/dev/null || ! command -v aplay >/dev/null; then
|
if ! command -v ffmpeg >/dev/null || ! command -v arecord >/dev/null; then
|
||||||
apt-get update && apt-get install -y ffmpeg alsa-utils
|
apt-get update && apt-get install -y ffmpeg alsa-utils
|
||||||
fi
|
fi
|
||||||
run: |
|
run: |
|
||||||
exec ffmpeg -nostdin -f alsa -ar "$ROVER_AUDIO_SAMPLE_RATE" -ac "$ROVER_AUDIO_CHANNELS" -i "$ROVER_AUDIO_INPUT_DEVICE" -c:a libopus -b:a "$ROVER_AUDIO_BITRATE" -f rtsp -rtsp_transport tcp "$ROVER_AUDIO_PUBLISH_URL"
|
# Preserve the HAT capture format, gain, and low-cost Opus settings.
|
||||||
|
arecord -D "$ROVER_AUDIO_INPUT_DEVICE" -f S32_LE \
|
||||||
|
-c "$ROVER_AUDIO_CHANNELS" -r "$ROVER_AUDIO_SAMPLE_RATE" \
|
||||||
|
-B "${AUDIO_ALSA_BUFFER_BYTES:-16384}" -F "${AUDIO_ALSA_PERIOD_BYTES:-1024}" -q -t raw |
|
||||||
|
ffmpeg -nostdin -hide_banner -loglevel warning -fflags nobuffer \
|
||||||
|
-rtbufsize 0 -thread_queue_size 4096 -f s32le \
|
||||||
|
-ar "$ROVER_AUDIO_SAMPLE_RATE" -ac "$ROVER_AUDIO_CHANNELS" -i pipe:0 \
|
||||||
|
-af "volume=20dB" -c:a libopus -b:a "$ROVER_AUDIO_BITRATE" \
|
||||||
|
-ar:a "$ROVER_AUDIO_SAMPLE_RATE" -ac:a "$ROVER_AUDIO_CHANNELS" \
|
||||||
|
-application audio -frame_duration 20 -compression_level 0 \
|
||||||
|
-flush_packets 1 -muxdelay 0 -muxpreload 0 \
|
||||||
|
-f rtsp -rtsp_transport tcp "$ROVER_AUDIO_PUBLISH_URL"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
exec ffmpeg -nostdin -rtsp_transport tcp -i "$ROVER_AUDIO_PLAYBACK_URL" -vn "${filters[@]}" -f alsa "$ROVER_AUDIO_OUTPUT_DEVICE"
|
exec ffmpeg -nostdin -rtsp_transport tcp -i "$ROVER_AUDIO_PLAYBACK_URL" -vn "${filters[@]}" -f alsa "$ROVER_AUDIO_OUTPUT_DEVICE"
|
||||||
- id: aiy
|
- id: aiy
|
||||||
name: Google AIY Voice HAT speaker
|
name: Google AIY Voice HAT speaker
|
||||||
description: Enables the HAT hardware; uses the same configured ALSA routing as other devices. Reboot once after initial setup.
|
description: HAT playback with low-latency decoding and 16 kHz mono output through the configured audio route. Reboot once after initial setup.
|
||||||
setup: |
|
setup: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
# Capture/playback setup may run concurrently; serialize edits to boot config.
|
# Capture/playback setup may run concurrently; serialize edits to boot config.
|
||||||
@@ -38,4 +38,9 @@
|
|||||||
run: |
|
run: |
|
||||||
filters=()
|
filters=()
|
||||||
if [ "$ROVER_AUDIO_NORMALIZE" = true ]; then filters=(-af "$ROVER_AUDIO_NORMALIZE_FILTER"); fi
|
if [ "$ROVER_AUDIO_NORMALIZE" = true ]; then filters=(-af "$ROVER_AUDIO_NORMALIZE_FILTER"); fi
|
||||||
exec ffmpeg -nostdin -rtsp_transport tcp -i "$ROVER_AUDIO_PLAYBACK_URL" -vn "${filters[@]}" -f alsa "$ROVER_AUDIO_OUTPUT_DEVICE"
|
# Decode to the same explicit HAT playback format as the previous listener.
|
||||||
|
ffmpeg -nostdin -hide_banner -loglevel warning -fflags nobuffer -flags low_delay \
|
||||||
|
-analyzeduration 200k -probesize 32k -rtsp_transport tcp \
|
||||||
|
-i "$ROVER_AUDIO_PLAYBACK_URL" -vn "${filters[@]}" \
|
||||||
|
-ac 1 -ar 16000 -f s16le pipe:1 |
|
||||||
|
aplay -q -D "$ROVER_AUDIO_OUTPUT_DEVICE" -t raw -f S16_LE -r 16000 -c 1
|
||||||
|
|||||||
@@ -19,7 +19,15 @@
|
|||||||
run: |
|
run: |
|
||||||
camera=$(command -v rpicam-vid || command -v libcamera-vid)
|
camera=$(command -v rpicam-vid || command -v libcamera-vid)
|
||||||
options=()
|
options=()
|
||||||
if [ "$ROVER_VIDEO_INVERTED" = true ]; then options+=(--hflip --vflip); fi
|
if [ "$ROVER_VIDEO_INVERTED" = true ]; then options+=(--rotation 180); fi
|
||||||
if [ -n "$ROVER_VIDEO_SENSOR_MODE" ]; then options+=(--mode "$ROVER_VIDEO_SENSOR_MODE"); fi
|
if [ -n "$ROVER_VIDEO_SENSOR_MODE" ]; then options+=(--mode "$ROVER_VIDEO_SENSOR_MODE"); fi
|
||||||
"$camera" --timeout 0 --nopreview --inline --codec h264 --width "$ROVER_VIDEO_WIDTH" --height "$ROVER_VIDEO_HEIGHT" --framerate "$ROVER_VIDEO_FPS" --bitrate "$ROVER_VIDEO_BITRATE" "${options[@]}" -o - |
|
# Preserve the previous Pi publisher's camera tuning and packet timing.
|
||||||
ffmpeg -nostdin -fflags +genpts -f h264 -i pipe:0 -c:v copy -an -f rtsp -rtsp_transport tcp "$ROVER_VIDEO_PUBLISH_URL"
|
"$camera" --inline --timeout 0 "${options[@]}" \
|
||||||
|
--width "$ROVER_VIDEO_WIDTH" --height "$ROVER_VIDEO_HEIGHT" \
|
||||||
|
--framerate "$ROVER_VIDEO_FPS" --bitrate "$ROVER_VIDEO_BITRATE" \
|
||||||
|
--codec h264 --intra 120 --profile baseline --denoise auto --nopreview \
|
||||||
|
--metering centre --ev 0.1 --awb auto --saturation 0.6 --brightness 0 --output - |
|
||||||
|
ffmpeg -nostdin -hide_banner -loglevel warning -fflags nobuffer \
|
||||||
|
-use_wallclock_as_timestamps 1 -f h264 -i pipe:0 -c:v copy -an \
|
||||||
|
-flush_packets 1 -muxdelay 0 -muxpreload 0 \
|
||||||
|
-f rtsp -rtsp_transport tcp "$ROVER_VIDEO_PUBLISH_URL"
|
||||||
|
|||||||
@@ -28,7 +28,13 @@ pcm.rover_mix {
|
|||||||
type dmix
|
type dmix
|
||||||
ipc_key 70601
|
ipc_key 70601
|
||||||
ipc_key_add_uid true
|
ipc_key_add_uid true
|
||||||
slave { pcm %s format S16_LE rate %d channels %d }
|
# Preserve the previous mixer's explicit ALSA buffer geometry.
|
||||||
|
slave {
|
||||||
|
pcm %s format S16_LE rate %d channels %d
|
||||||
|
period_time 0
|
||||||
|
period_size 1024
|
||||||
|
buffer_size 4096
|
||||||
|
}
|
||||||
}
|
}
|
||||||
`, strconv.Quote(cfg.InputDevice), strconv.Quote(cfg.OutputDevice), cfg.OutputSampleRate, cfg.OutputChannels)
|
`, strconv.Quote(cfg.InputDevice), strconv.Quote(cfg.OutputDevice), cfg.OutputSampleRate, cfg.OutputChannels)
|
||||||
for _, pair := range [][2]string{{"tts", "TTSMaster"}, {"horn", "HornMaster"}, {"forward", "ForwardMaster"}} {
|
for _, pair := range [][2]string{{"tts", "TTSMaster"}, {"horn", "HornMaster"}, {"forward", "ForwardMaster"}} {
|
||||||
|
|||||||
Reference in New Issue
Block a user