mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
fine grained virtual audio tests working PyAudio at 48 kHz
This commit is contained in:
parent
8fcf882767
commit
27a43f1cb0
3 changed files with 3 additions and 46 deletions
|
@ -2,30 +2,15 @@
|
||||||
# Run a test using the virtual sound cards, tx sound I/O performed by aplay
|
# Run a test using the virtual sound cards, tx sound I/O performed by aplay
|
||||||
# and arecord at Fs=48000Hz, we pipe to Python utilities
|
# and arecord at Fs=48000Hz, we pipe to Python utilities
|
||||||
|
|
||||||
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
|
|
||||||
}
|
|
||||||
|
|
||||||
check_alsa_loopback
|
|
||||||
|
|
||||||
RX_LOG=$(mktemp)
|
|
||||||
MAX_RUN_TIME=2600
|
MAX_RUN_TIME=2600
|
||||||
|
|
||||||
# make sure all child processes are killed when we exit
|
# make sure all child processes are killed when we exit
|
||||||
trap 'jobs -p | xargs -r kill' EXIT
|
trap 'jobs -p | xargs -r kill' EXIT
|
||||||
|
|
||||||
arecord -r 48000 --device="plughw:CARD=CHAT1,DEV=0" -f S16_LE -d $MAX_RUN_TIME | \
|
arecord -r 48000 --device="plughw:CARD=CHAT1,DEV=0" -f S16_LE -d $MAX_RUN_TIME | \
|
||||||
sox -t .s16 -r 48000 -c 1 - -t .s16 -r 8000 -c 1 - | \
|
|
||||||
python3 test_rx.py --mode datac0 --frames 2 --bursts 5 --debug &
|
python3 test_rx.py --mode datac0 --frames 2 --bursts 5 --debug &
|
||||||
rx_pid=$!
|
rx_pid=$!
|
||||||
sleep 1
|
sleep 1
|
||||||
python3 test_tx.py --mode datac0 --frames 2 --bursts 5 --delay 500 | \
|
python3 test_tx.py --mode datac0 --frames 2 --bursts 5 --delay 500 | \
|
||||||
sox -t .s16 -r 8000 -c 1 - -t .s16 -r 48000 -c 1 - | \
|
|
||||||
aplay -r 48000 --device="plughw:CARD=CHAT1,DEV=1" -f S16_LE
|
aplay -r 48000 --device="plughw:CARD=CHAT1,DEV=1" -f S16_LE
|
||||||
wait ${rx_pid}
|
wait ${rx_pid}
|
||||||
|
|
|
@ -2,28 +2,14 @@
|
||||||
# Run a test using the virtual sound cards, tx sound I/O performed by Python,
|
# Run a test using the virtual sound cards, tx sound I/O performed by Python,
|
||||||
# rx using arecord, Fs=48000Hz
|
# rx using arecord, Fs=48000Hz
|
||||||
|
|
||||||
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
|
|
||||||
}
|
|
||||||
|
|
||||||
check_alsa_loopback
|
|
||||||
|
|
||||||
RX_LOG=$(mktemp)
|
|
||||||
MAX_RUN_TIME=2600
|
MAX_RUN_TIME=2600
|
||||||
|
|
||||||
# make sure all child processes are killed when we exit
|
# make sure all child processes are killed when we exit
|
||||||
trap 'jobs -p | xargs -r kill' EXIT
|
trap 'jobs -p | xargs -r kill' EXIT
|
||||||
|
|
||||||
arecord -r 48000 --device="plughw:CARD=CHAT1,DEV=0" -f S16_LE -d $MAX_RUN_TIME | \
|
arecord -r 48000 --device="plughw:CARD=CHAT1,DEV=0" -f S16_LE -d $MAX_RUN_TIME | \
|
||||||
sox -t .s16 -r 48000 -c 1 - -t .s16 -r 8000 -c 1 - | \
|
python3 test_rx.py --mode datac0 --frames 2 --bursts 5 --debug --timeout 20 &
|
||||||
python3 test_rx.py --mode datac0 --frames 2 --bursts 5 --debug &
|
|
||||||
rx_pid=$!
|
rx_pid=$!
|
||||||
sleep 1
|
sleep 1
|
||||||
python3 test_tx.py --mode datac0 --frames 2 --bursts 5 --delay 500 --audiodev -2
|
python3 test_tx.py --mode datac0 --frames 2 --bursts 5 --delay 2000 --audiodev -2
|
||||||
wait ${rx_pid}
|
wait ${rx_pid}
|
||||||
|
|
|
@ -2,19 +2,6 @@
|
||||||
# Run a test using the virtual sound cards, tx sound I/O performed by aplay,
|
# Run a test using the virtual sound cards, tx sound I/O performed by aplay,
|
||||||
# rx sound I/O by Python, Fs=48000Hz.
|
# rx sound I/O by Python, Fs=48000Hz.
|
||||||
|
|
||||||
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
|
|
||||||
}
|
|
||||||
|
|
||||||
check_alsa_loopback
|
|
||||||
|
|
||||||
RX_LOG=$(mktemp)
|
|
||||||
MAX_RUN_TIME=2600
|
MAX_RUN_TIME=2600
|
||||||
|
|
||||||
# make sure all child processes are killed when we exit
|
# make sure all child processes are killed when we exit
|
||||||
|
@ -23,7 +10,6 @@ trap 'jobs -p | xargs -r kill' EXIT
|
||||||
python3 test_rx.py --mode datac0 --frames 2 --bursts 5 --debug --audiodev -2 &
|
python3 test_rx.py --mode datac0 --frames 2 --bursts 5 --debug --audiodev -2 &
|
||||||
rx_pid=$!
|
rx_pid=$!
|
||||||
sleep 1
|
sleep 1
|
||||||
python3 test_tx.py --mode datac0 --frames 2 --bursts 5 --delay 500 | \
|
python3 test_tx.py --mode datac0 --frames 2 --bursts 5 | \
|
||||||
sox -t .s16 -r 8000 -c 1 - -t .s16 -r 48000 -c 1 - | \
|
|
||||||
aplay -r 48000 --device="plughw:CARD=CHAT1,DEV=1" -f S16_LE
|
aplay -r 48000 --device="plughw:CARD=CHAT1,DEV=1" -f S16_LE
|
||||||
wait ${rx_pid}
|
wait ${rx_pid}
|
||||||
|
|
Loading…
Reference in a new issue