In my spare time, I’m still playing around with RSCW, the Morse code decoder program. One of the hurdles that I’ve finally overcome (Praise God!) was how to send sound to the decoder. It turns out to be pretty simple, it just took me a few tries to get it right.

You see, by default, RSCW has several examples and options for sound input. Since it is an older program, it was written back when Linux kernel still used /dev/dsp and /dev/audio, back when everyone was using OSS and only a few had switched to ALSA sound. I don’t think PulseAudio was even a thing, yet…. It could also use input from programs such as sox, converting wave files to raw sound data, or use it’s own noise and CW generator.

Obviously, it would not be practical to record audio and then use sox to convert it and send it over to RSCW, nor would it be helpful to generate my own Morse code with the noise program, since I want to get live feeds from my HAM radio. I don’t want to downgrade my Linux kernel or OS to go back to the old method of sound card control, and to be honest, I’m not sure I really could without wiping my current setup.

Fortunately, there was a much simpler answer: arecord. Arecord is a “command-line sound recorder and player for ALSA soundcard driver”. In essence, it allows you to create recordings of anything being played or input into your sound system from the command line. The great thing is, as it has command line support, I can actually pipe it directly into RSCW rather than record the audio.

So, as a test, I jumped onto Morsecode.world’s translator page, which can generate Morse code from your input, and pasted information from the PulseAudio Wikipedia into the text field. This started playing Morse code over my speakers, to which I then used arecord to pipe to RSCW! Here was the output:

alaskalinuxuser@alaskalinuxuser-OptiPlex-790:/etc$ arecord | rscw -w 20 --track
RSCW 20 wpm mode track 1 - 3999 Hz ( rscw -h for help)
Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono
S A SOUND SERVER THAT PROVIDES REALBTTIME0 LOW LATENCY TGIAKEAK 5 MILLISECONDS OR LESSTQ AUDIO PERFORMANCE AND0 SINCE JACK20 SUPPORTS EFFICIENT LOAD B^CAborted by signal Interrupt…
alaskalinuxuser@alaskalinuxuser-OptiPlex-790:/etc$

The command is pretty basic:

arecord | rscw -w 20 --track

Of course there are more options that you could use, for both arecord or RSCW. Of interest is that you can use arecord to send just one specific input/output rather than everything or the default. You can list the available options with arecord -L:

alaskalinuxuser@alaskalinuxuser-OptiPlex-790:/etc$ arecord -L
default
Playback/recording through the PulseAudio sound server
null
Discard all samples (playback) or generate zero samples (capture)
pulse
PulseAudio Sound Server
sysdefault:CARD=PCH
HDA Intel PCH, ALC269VB Analog
Default Audio Device
front:CARD=PCH,DEV=0
HDA Intel PCH, ALC269VB Analog
Front speakers
dmix:CARD=PCH,DEV=0
HDA Intel PCH, ALC269VB Analog
Direct sample mixing device
dsnoop:CARD=PCH,DEV=0
HDA Intel PCH, ALC269VB Analog
Direct sample snooping device
hw:CARD=PCH,DEV=0
HDA Intel PCH, ALC269VB Analog
Direct hardware device without any conversions
plughw:CARD=PCH,DEV=0
HDA Intel PCH, ALC269VB Analog
Hardware device with all software conversions

Now that I can accept input, now I just need to play around some more and see what I can do for speed settings for RSCW. It currently requires that you choose a speed, as it is not programmed to detect the speed of the signal. A Telegram user told me I should try “Fldigi”, so I’m going to take a look at that as well.

Linux – keep it simple.

2 Replies to “Piping audio into RSCW”

  1. You also might look at the multimon-ng decoder, which is actively maintained. The system doesn’t like links in comments, but the software is available in the EliasOenal github repo.
    It is also in the Guix package system, so I should be able to get you a full build archive including all dependencies except your running kernel.
    (BTW, the Linux kernel is not simple – measured in ASCII source, it is seven times larger than the KJV Bible, and is a monolithic kernel design.)
    Gnu+Linux, keeping us free.

Leave a Reply

Your email address will not be published. Required fields are marked *