FreeDATA/test/001_highsnr_stdio_audio/test_virtual_mm.sh

33 lines
762 B
Bash
Raw Normal View History

2021-12-14 22:07:01 +00:00
#!/bin/bash -x
# Run a test using the virtual sound cards
function check_alsa_loopback {
lsmod | grep snd_aloop >> /dev/null
if [ $? -eq 1 ]; then
echo "ALSA loopback device not present. Please install with:"
echo
echo " sudo modprobe snd-aloop index=1,2 enable=1,1 pcm_substreams=1,1 id=CHAT1,CHAT2"
exit 1
fi
}
2021-12-15 06:13:47 +00:00
myInterruptHandler()
{
exit 1
}
2021-12-14 22:07:01 +00:00
check_alsa_loopback
RX_LOG=$(mktemp)
2021-12-15 06:13:47 +00:00
trap myInterruptHandler SIGINT
2021-12-14 22:07:01 +00:00
# make sure all child processes are killed when we exit
trap 'jobs -p | xargs -r kill' EXIT
2021-12-15 06:13:47 +00:00
python3 test_multimode_rx.py --timeout 60 --framesperburst 2 --bursts 2 --audiodev -2 &
2021-12-14 22:07:01 +00:00
rx_pid=$!
sleep 1
2021-12-15 06:13:47 +00:00
python3 test_multimode_tx.py --framesperburst 2 --bursts 2 --audiodev -2 --delay 500
2021-12-14 22:07:01 +00:00
wait ${rx_pid}