diff --git a/tools/smoke-test.sh b/tools/smoke-test.sh index feb6ca9..d8e28ea 100755 --- a/tools/smoke-test.sh +++ b/tools/smoke-test.sh @@ -78,12 +78,16 @@ wait_for() { # can wedge its event queue, after which nothing gets linked. wait_for '\[default' LOGS="$XDG_RUNTIME_DIR" -# Two minutes of silence as a regular file: older pw-cat (PipeWire 1.4) -# silently exits when reading raw audio from /dev/zero. -head -c 23040000 /dev/zero > "$LOGS/silence.raw" -pw-cat --playback --raw --rate 48000 --channels 2 --format s16 \ - -P '{ application.name = "Test Player" media.name = "Smoke test tone" }' \ - "$LOGS/silence.raw" >"$LOGS/play.log" 2>&1 & PIDS="$PIDS $!" +# Two minutes of stereo s16 48 kHz silence as a WAV file (header written by +# hand: no python/sox needed). Reading raw audio from /dev/zero made older +# pw-cat (PipeWire 1.4) exit without creating a stream. +le32() { printf "\\$(printf %03o $(($1 & 255)))\\$(printf %03o $(($1 >> 8 & 255)))\\$(printf %03o $(($1 >> 16 & 255)))\\$(printf %03o $(($1 >> 24 & 255)))"; } +DATA=23040000 +{ printf 'RIFF'; le32 $((DATA + 36)); printf 'WAVEfmt '; le32 16 + printf '\001\000\002\000'; le32 48000; le32 192000; printf '\004\000\020\000' + printf 'data'; le32 $DATA; head -c $DATA /dev/zero; } > "$LOGS/silence.wav" +{ pw-play -P '{ application.name = "Test Player" media.name = "Smoke test tone" }' \ + "$LOGS/silence.wav"; echo "pw-play exited with $?"; } >"$LOGS/play.log" 2>&1 & PIDS="$PIDS $!" pw-cat --record --raw --rate 48000 --channels 1 --format s16 \ -P '{ application.name = "Test Recorder" media.name = "Mic capture" }' \ /dev/null >"$LOGS/record.log" 2>&1 & PIDS="$PIDS $!" @@ -116,7 +120,7 @@ step 'Test Player | .*-> Test Speakers' move "${STREAM:-0}" test_speakers if [ "$fail" != 0 ]; then echo "### diagnostics" - echo "--- pw-cat playback:"; cat "$LOGS/play.log" + echo "--- pw-play playback:"; cat "$LOGS/play.log" echo "--- pw-cat record:"; cat "$LOGS/record.log" echo "--- wireplumber (warnings/errors):" grep -E '^[EWC] ' "$LOGS/wireplumber.log" | grep -viE 'rtkit|d-?bus|bluez|camera|session bus|system bus' | tail -40