FreeDATA/test/001_highsnr_stdio_audio
dj2ls 8159e9b1ab moved codec2 to tnc folder
preparation for migration to codec2 module for the entire TNC
2021-12-19 15:14:52 +01:00
..
README.md added cmd line arument to list audiodev by number, test_tx.py and test_rx.py working OK with virtual audio card, updated README.md with latest examples 2021-12-14 12:35:19 +10:30
test_callback_rx.py initial callback test 2021-12-19 15:04:35 +01:00
test_multimode_rx.py moved codec2 to tnc folder 2021-12-19 15:14:52 +01:00
test_multimode_tx.py moved codec2 to tnc folder 2021-12-19 15:14:52 +01:00
test_pa.py test program to get experience with Pyaudio 2021-12-16 18:33:07 +10:30
test_rx.py moved codec2 to tnc folder 2021-12-19 15:14:52 +01:00
test_tx.py moved codec2 to tnc folder 2021-12-19 15:14:52 +01:00
test_virtual1.sh test_virtual2.sh pasing most of the time 2021-12-16 17:53:11 +10:30
test_virtual1a.sh fine grained virtual audio tests working PyAudio at 48 kHz 2021-12-16 17:44:07 +10:30
test_virtual1b.sh fine grained virtual audio tests working PyAudio at 48 kHz 2021-12-16 17:44:07 +10:30
test_virtual1c.sh fine grained virtual audio tests working PyAudio at 48 kHz 2021-12-16 17:44:07 +10:30
test_virtual2.sh test_virtual2.sh pasing most of the time 2021-12-16 17:53:11 +10:30
test_virtual3.sh initial callback test 2021-12-19 15:04:35 +01:00
test_virtual_mm.sh adding resampler to MM tests. still occasional fails on virtual card Pyaudio tests 2021-12-16 21:40:30 +10:30

001_HIGHSNR_STDIO_AUDIO TEST SUITE

  1. Install
    sudo apt update
    sudo apt upgrade
    sudo apt install git cmake build-essential python3-pip portaudio19-dev python3-pyaudio
    pip3 install crcengine
    pip3 install threading
    
  2. Install codec2, and set up the libcodec2.so shared library path, for example
    export LD_LIBRARY_PATH=${HOME}/codec2/build_linux/src
    

STDIO tests

Pipes are used to move audio samples from the Tx to Rx:

python3 test_tx.py --mode datac1 --delay 500 --frames 2 --bursts 1 | python3 test_rx.py --mode datac1 --frames 2 --bursts 1

AUDIO test via virtual audio devices

  1. Create virtual audio devices. Note: This command needs to be run again after every reboot

    sudo modprobe snd-aloop index=1,2 enable=1,1 pcm_substreams=1,1 id=CHAT1,CHAT2 
    
  2. Check if devices have been created

     aplay -l
    
     Karte 0: Intel [HDA Intel], Gerät 0: Generic Analog [Generic Analog]
       Sub-Geräte: 1/1
       Sub-Gerät #0: subdevice #0
     Karte 1: CHAT1 [Loopback], Gerät 0: Loopback PCM [Loopback PCM]
       Sub-Geräte: 1/1
       Sub-Gerät #0: subdevice #0
     Karte 1: CHAT1 [Loopback], Gerät 1: Loopback PCM [Loopback PCM]
       Sub-Geräte: 1/1
       Sub-Gerät #0: subdevice #0
     Karte 2: CHAT2 [Loopback], Gerät 0: Loopback PCM [Loopback PCM]
       Sub-Geräte: 1/1
       Sub-Gerät #0: subdevice #0
     Karte 2: CHAT2 [Loopback], Gerät 1: Loopback PCM [Loopback PCM]
       Sub-Geräte: 1/1
       Sub-Gerät #0: subdevice #0
    
  3. Determine the audio device number you would like to use:

    python3 test_rx.py --list
    <snip>
    audiodev:  0 HDA Intel PCH: ALC269VC Analog (hw:0,0)
    audiodev:  1 HDA Intel PCH: HDMI 0 (hw:0,3)
    audiodev:  2 HDA Intel PCH: HDMI 1 (hw:0,7)
    audiodev:  3 HDA Intel PCH: HDMI 2 (hw:0,8)
    audiodev:  4 Loopback: PCM (hw:1,0)
    audiodev:  5 Loopback: PCM (hw:1,1)
    audiodev:  6 Loopback: PCM (hw:2,0)
    audiodev:  7 Loopback: PCM (hw:2,1)
    

    In this case we choose audiodev 4 for the RX and 5 for the Tx.

  4. Start the Rx first, then Tx in separate consoles:

    python3 test_rx.py --mode datac0 --frames 2 --bursts 1 --audiodev 4 --debug
    python3 test_tx.py --mode datac0 --frames 2 --bursts 1 --audiodev 5