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

Davide Del Vento davide.del.vento at gmail.com
Sat Aug 15 19:36:16 MDT 2020


Versions:


davide at buzzicone:/tmp$ lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 18.04.5 LTS
Release:    18.04
Codename:    bionic
davide at buzzicone:/tmp$
davide at buzzicone:/tmp$ pulseaudio --version
pulseaudio 11.1
davide at buzzicone:/tmp$ cw --version
cw version 3.5.1davide at buzzicone:/tmp$ padsp --version
Illegal option --
(Davide: irrelevant stuff removed)
davide at buzzicone:/tmp$ padsp -v
Illegal option -v
(Davide: irrelevant stuff removed)
davide at buzzicone:/tmp$


The following make a single bip

davide at buzzicone:/tmp$ echo 'test string' | cw
cw: PulseAudio output not available (device: ( default ))
cw: OSS output not available (device: /dev/audio)
test string
davide at buzzicone:/tmp$
davide at buzzicone:/tmp$ padsp echo 'test' | cw
cw: PulseAudio output not available (device: ( default ))
cw: OSS output not available (device: /dev/audio)
test
davide at buzzicone:/tmp$

File workaround:

davide at buzzicone:/tmp$ cat somefile.txt
foo
bar
baz
four
five
six
seven
eight
nine
ten
eleven
twelve
thirteen
four
five
six
seven
eight
nine
twenty
one
two
three
davide at buzzicone:/tmp$ padsp cw -f somefile.txt
cw: PulseAudio output not available (device: ( default ))
cw: OSS output not available (device: /dev/audio)
foo
bar
baz
four
five
six
seven
eight
nine
ten
eleven
twelve     <----------------- up to here is printed immediately
thirteen
four
five
six
seven
eight
nine
twenty
one
two
three

The latter case seems to work as you said, namely 12 lines ("up to
here is printed immediately") are printed immediately, and then it
starts to beep in what it sounds like Morse code. While that is going,
each letter is printed at a time, in a way that sounds to this
untrained operator like each letter is printed after its corresponding
Morse code is sound.

Hope this helps.
Davide

PS:

Question #1: how about a file with the appropriate number of empty lines?

Question #2: do people still learn Morse code these days that more
efficient and simple-to-implement electronic (digital) communications
are available over a channel able to transmit sound? I mean, besides
as a hobby, obviously.... I see some use of the maritime signal flags
as a backup in case the electronics is broken, but Morse?

On Sat, Aug 15, 2020 at 7:05 PM Jed S. Baer <blug at jbaer.cotse.net> wrote:
>
> 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
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety


More information about the LUG mailing list