Hi,
To help test the gmskmodem (especially for people not really used to work with linux), here is a small troubleshooting guide for the gmskmodem for codec2. Part 1: the sender 1/ The basic test: encoding a codec2 file to an audio file gmskmodem -noreceiver -format c -sif myfile.c2 -sof myfile.raw Note that the audio-files are in raw pcm format, i.e. without a PCM header. You can use sox to convert them: sox -c 1 -r 48000 -e signed -2 myfile.raw myfile.wav You can then process myfile.wav with any audio-tool you like 2/ encode and play out directly gmskmodem -noreceiver -format c -sif myfile.c2 -soa hw:1 This will (in this case) play out the audio out of the 2nd audio card of your system. To see what cards are on your device for playback, there are two options - aplay -l - cat /proc/asound/cards Connect a earpiece or headset to the audio-out of your computer / board and you should hear the audio. If you do not, check out mixer settings; either using the linux GUI or using a tool like alsamixer 3/ encode, play out and PTT switch gmskmodem -noreceiver -format c -sif myfile.c2 -soa hw:1 -ptt_cs /dev/ttyS0 Check the control signals of serial device /dev/ttyS0. The control signals (DSR, DTR, CTS, RTS) should go to +5 volt when sending gmskmodem -noreceiver -format c -sif myfile.c2 -soa hw:1 -ptt_tx /dev/ttyS0 Same as above, but now the "TX" lines of the serial device should go to +5V (with some small spikes down when the startbit if being sent) 4/ receive audio over TCP, modulate, play out + drive ptt (terminal 1) gmskmodem -noreceiver -format c -sit 12345 -soa hw:1 -ptt_cs /dev/ttyS0 (terminal 2) cat myfile.x2 | nc 127.0.0.1 12345 To test: tcpdump -n -i lo port 12345 5/ real-time codec2 audio encoding, send over TCP, modulate, play out + drive ptt (terminal 1) gmskmodem -noreceiver -format c -sit 12345 -soa hw:1 -ptt_cs /dev/ttyS0 (terminal 2) rec -r 8000 -t raw -s -b 16 -c 1 - | c2enc 1400 | nc 127.0.0.1 12345 The complete chain Part 2: the receiver 1/ basic test: demodulating files gmskmodem -nosender -format c -rif myfile.raw -rof myfile 2/ test audio-in on computer Sample a piece of audio from the transceiver: rec -r 48000 -s -b 16 -c 2 -d hw:1 test.wav listen to that audio-file with your favorite audio-tool. If it connected to the 9k6 port of your radio, you should get noise. If no audio is presents, check cables, audio-setting, audio mixer setting, squelch setting on the radio, etc/ 3/ demodulate from audio-in gmskmodem -nosender -format c -ria hw:1 -rof myfile -v -v Due to the double "-v" (verbose) this will produce some output when receiving a stream More info: add the option "-d" (dump bitstream). This will only dump a bitstream if a vadid stream is detected. add the option "-dd" (dump more bitstreams). This will also dump the bitstream as of the beginning (so even before a valid header is detected). When receiving a codec2 gmsk stream, the typical repeated "01010" pattern of the sync header should show up. add the option "-da" (dump average audio-level) to get information about the average audio-level per 20 ms of audio. (the value is provided as a 16bit hex-value between brackets). This should give information, - is audio being received - is stream being received (normally, the average audio level when receiving a gmsk stream is noticable different then when receiving noise). 4/ demodulate from audio-in and stream out (terminal 1): gmskmodem -nosender -format c -ria hw:1 -rou 127.0.0.1 12346 -v -v (terminal 2): nc -l -u -p 12346 > testfile.c2 to test: run "tcpdump -n -i lo port 12346" A UDP-stream should be send out when a valid gmsk-stream is received on the audio interface Decode the audio file + play out c2dec 1400 testfile.c2 testfile.raw play -r 8000 -t raw -s -b 16 -c 1 testfile.raw 5/ emodulate from audio-in, stream out, real-time decode + play out (terminal 1): gmskmodem -nosender -format c -ria hw:1 -rou 127.0.0.1 12346 -v -v (terminal 2): nc -l -u -p 12346 | c2dec 1400 - - | play -r 8000 -t raw -s -b 16 -c 1 - To test: "tpcdump -n -i lo port 12346" The final step is combining both the sender and receiver: (terminal 1) gmsksender -format c -ria hw:1 -rou 127.0.0.1 12346 -sit 12345 -soa hw:1 -ptt_cs /dev/ttyS0 -v -v -d (terminal 2): rec -r 8000 -t raw -s -b 16 -c 1 - | c2enc 1400 | nc 127.0.0.1 12345 (terminal 3): nc -l -u -p 12346 | c2dec 1400 - - | play -r 8000 -t raw -s -b 16 -c 1 - 73 Kristoff - ON1ARF ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Freetel-codec2 mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/freetel-codec2
