I am trying to configure the Raspberry pi in order to work with the Minimodem software, which is software modem that uses FSK modulation and demodulation to transmit information over audio signals.
I have bought an external USB sound card to emitt the signals through the speakers and receive them using a microphone.
I have used the same configuration in Ubuntu, and for get it working is as simple as going to the sound control interface and select which input and output do you want to use. (headphones and microphone from the external sound card).
I am experiencing some problems in order to do the same in Raspbian.
The system has detected the external sound card without problems:
pi@raspberrypi ~ $ lsusb
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 005: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter
As can be seen, the last device is the usb sound card.
If I run amixer, I get two results depending if I am root or not:
pi@raspberrypi ~ $ amixer
Simple mixer control 'Master',0
Capabilities: pvolume pswitch pswitch-joined penum
Playback channels: Front Left - Front Right
Limits: Playback 0 - 65536
Mono:
Front Left: Playback 65536 [100%] [on]
Front Right: Playback 65536 [100%] [on]
Simple mixer control 'Capture',0
Capabilities: cvolume cswitch cswitch-joined penum
Capture channels: Front Left - Front Right
Limits: Capture 0 - 65536
Front Left: Capture 65536 [100%] [on]
Front Right: Capture 65536 [100%] [on]
Root:
[code]
pi@raspberrypi ~ $ sudo amixer
Simple mixer control 'Headphone',0
Capabilities: pvolume pswitch pswitch-joined penum
Playback channels: Front Left - Front Right
Limits: Playback 0 - 151
Mono:
Front Left: Playback 151 [100%] [0.06dB] [on]
Front Right: Playback 151 [100%] [0.06dB] [on]
Simple mixer control 'Mic',0
Capabilities: pvolume pvolume-joined cvolume cvolume-joined pswitch pswitch-joined cswitch cswitch-joined penum
Playback channels: Mono
Capture channels: Mono
Limits: Playback 0 - 32 Capture 0 - 16
Mono: Playback 32 [100%] [47.81dB] [on] Capture 16 [100%] [23.81dB] [on]
Simple mixer control 'Auto Gain Control',0
Capabilities: pswitch pswitch-joined penum
Playback channels: Mono
Mono: Playback [on]
Then if I try to test the speakers with a sound I get an error, but if the second time I try it works like a charm!
pi@raspberrypi ~ $ aplay /usr/share/scratch/Media/Sounds/Vocals/Singer1.wav
Playing WAVE '/usr/share/scratch/Media/Sounds/Vocals/Singer1.wav' : Signed 16 bit Little Endian, Rate 11025 Hz, Mono
pi@raspberrypi ~ $ sudo aplay /usr/share/scratch/Media/Sounds/Vocals/Singer1.wav
ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
aplay: main:682: audio open error: Device or resource busy
pi@raspberrypi ~ $ sudo aplay /usr/share/scratch/Media/Sounds/Vocals/Singer1.wavPlaying WAVE '/usr/share/scratch/Media/Sounds/Vocals/Singer1.wav' : Signed 16 bit Little Endian, Rate 11025 Hz, Mono
I am able to record sound and reproduce it:
pi@raspberrypi ~ $ sudo arecord -D plughw:0,0 -f cd test.wav
Recording WAVE 'maldd.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
^CAborted by signal Interrupt...
pi@raspberrypi ~ $ sudo aplay test.wav
Playing WAVE 'maldd.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
Obtaining a quite good quality.
Then, if I try to use Minimodem with the tranmission mode enabled I get the next errror:
pi@raspberrypi ~ $ sudo minimodem --tx 50
E: Cannot create PulseAudio stream: Connection refused
For fix it I have to restart the pulseaudio server:
sudo pulseaudio -D
But if I try to run Minimodem in the reception mode (using microphone) then does not work.
After some tests I think that the Raspberry is not capable to emit sounds and demodulate the signals at the same time, because when I try to emit sounds and at the same time record them, the sound output does not work pretty well.
Any suggestion would be appreciated.