[lug] The "cw" program doesn't work well with pulseaudio on Mint 19.3

Jed S. Baer blug at jbaer.cotse.net
Sat Aug 15 19:05:39 MDT 2020


Hi Everyone.

As part of my sporadic efforts at learning morse code, I've been using the
cw program, which works better for me that the other things that are
available. I wrote a little script to generate various sequences to work on
for the "receive" part of using morse. Worked great on Mint 17.3.

After upgrading to 19.3, it doesn't work so well. I've no doubt that
something changed in pulseaudio, and so I'm invoking the Poettering effect.

I'm wondering whether this trouble exists on other recent distros,
deb-based or otherwise, with pulseaudio v 11.1. (I know the problem also
exists in Mint 18, but I don't know what version of pulse is in that.)

The test is pretty simple.
 - $ echo 'test string' | cw

If you get a single beep or chirp, rather than proper morse code, then the
problem exists.

What I get from that is a single beep, or a sort of chirp which might be
all the cw beeps mashed together. Also, you should see these errors:
cw: PulseAudio output not available (device: ( default ))
cw: OSS output not available (device: /dev/audio

cw will also echo the string you send to it.

For sound output, cw is falling back to using alsa, so the same effect can
be had, without the errors, by using "cw -s a". This actually is serviced
by the pulseaudio alsa module, not directly by alsa.

It's possible to sort of get the sound to work right by using the "padsp"
command, which wraps whatever command you give it inside a thing which
emulates OSS, which makes cw happy. But, when doing that, the echo of the
text for which morse code is being sounded is not synchronized to the tone
generation. And, it works only when using a file as input, as in:
 - $ padsp cw -f somefile.txt
but not
 - $ padsp echo 'test' | cw

The test for this would use as somefile.txt  a file containing at least 20
lines, with one word on each line, in the above command. What I get is
several lines spit out, just as the first morse beeps start sounding. What
it used to do was echo the first line and make the beeps, then proceed to
the second, etc. Possibly, it even displayed only one word at a time,
synchronized to the sound output.

As for the error saying that pulseaudio output is not available, I can only
say that the daemon is running, and other sound works fine, e.g. vlc, mpd,
audacity.

There is no /dev/audio or /dev/dsp on my system. /dev/snd is a directory -
didn't that used to be a device file?

If anyone can do some testing, I'm curious to know if this works,
particularly if cw works with pulse directly, on which distributions,
having pulseaudio at version 11.

TIA.

-- 
All operating systems suck, but Linux just sucks less
 - Linus Torvalds


More information about the LUG mailing list