Piping audio into RSCW

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

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
Playback/recording through the PulseAudio sound server
Discard all samples (playback) or generate zero samples (capture)
PulseAudio Sound Server
HDA Intel PCH, ALC269VB Analog
Default Audio Device
HDA Intel PCH, ALC269VB Analog
Front speakers
HDA Intel PCH, ALC269VB Analog
Direct sample mixing device
HDA Intel PCH, ALC269VB Analog
Direct sample snooping device
HDA Intel PCH, ALC269VB Analog
Direct hardware device without any conversions
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.

Updating RSCW to work with GTK 2.0

As I get further and further down the rabbit hole of HAM radio, I started looking at Morse Code (CW) decoders. As it turns out, being just a licensed technician, I can only do limited voice communications on certain bands, all of which are above 10 meters (28 MHz). Below that, however, I can only use CW. Of course, I don’t happen to know Morse Code by heart.

While learning Morse Code is ultimately the goal, in the interim, I was hoping to find a way to “listen” to others and have a decoder to help me translate. There are a lot of great programs out there for this. However, there is a very limited number of Linux programs available. In fact, I could only find one: RSCW.

RSCW looks like a very nifty tool. But it was written a long time ago, back when GTK 1.2 was the normal method of building GUI’s on Linux. Now GTK is up to version 3.0. Unfortunately, the source code for RSCW just doesn’t build on any modern machine.

So, since it was licensed under the GPL 2.0, and all the source code was available, I took the liberty of editing it to work with GTK 2.0. Granted, we are up to GTK 3.0 now days, but that was too big of a leap in the programming. To modernize it to GTK 3.0 would just about require a complete re-write, and my programming skills are somewhat weak. But, it only took a few edits to update it to GTK 2.0, and 2.0 is still available in the Ubuntu repositories, so it worked out great on my home computer.

I did email the original author to let him know, but I haven’t heard back from him yet. However, if you want the GTK 2.0 version, you can get it on my Gitlab, and you can check the edits I made there as well.

Linux – keep it simple.