Soundmodem under OpenBSD

This is another program I had tried to get working a few years ago and somebody told me I'd have to buy a TNC and hook it to a serial port. There are still advantages to that approach, mainly not having to run your computer to do packet, but this is good for casual fooling around. Next I have to dig up the program I ran a couple years ago under Linux that worked as a TNC with mailboxes.

As of first getting this page up I don't have a tidy cleaned-up set of patches, all I've got is the code I'm running with lots of old comments, extra output for debugging, changes that weren't necessary, etc. I think there were 2 main areas of changes, both in sound. Since I've been spending so much time getting NTP to work under OpenBSD and written my little simple test recording program, I've learned a thing or two about OpenBSD sound. It's demystified it.

From memory one change was because OpenBSD doesn't have seperate ioctls to flush the read and write sound buffers, you do both at once. The other was setting the soundcard's mode to "record". There may have been more. I'll extract a fresh copy and see what I have to do to get it to compile and run. Most of the work I did on it was weeks ago, I've been buried in NTP but needed a break.

So this is Soundmodem 0.16 by Thomas Sailer, HB9JNX. This link may not stay working but try http://www.baycom.org/~tom/ham/soundmodem/ and if that doesn't work Google it. It has a little GUI (GTK) configuration utility called soundmodemconfig that also has some useful diagnostic tools built into it. There's a scope, a spectrum analyzer and a modem output window with the option to turn off CRC checking on received packets. Very handy if you just want a bunch of packets coming through to test with. Soundmodem can do 300, 1200, and 9600 baud, but I've only used it at 1200. If you think you're having sound card problems you can also test with a wav file as input (requires soundfile).

From what I've seen using it first under FreeBSD, then Linux, then OpenBSD, if you can get soundmodemconfig to display some incoming packets, you've got everything working. Then again I've only used 1200 baud on 2 meters. For plenty of test signals try the APRS frequency of 144.390 MHz. Once you get tired of that try the regular packet frequencies of 145.01,03,05,07,09. When you set up a new configuration in soundmodemconfig it saves a file that soundmodem itself uses (/etc/ax25/soundmodem.conf). Soundmodem itself is just a command line program that you can start with soundmodem & and let it run once you get the details worked out. It's under 0.00% CPU by top on my 3.2 GHz P4. Both soundmodem and soundmodemconfig have man pages.

You don't need ax25 or Linux to run this. Set soundmodem's output to KISS and you'll find when it's running that it makes /dev/soundmodem0 (or 1, etc). Tell xastir or whatever to connect to that as though it's a KISS TNC, just open it the way you'd open a serial port to a real TNC. A few years ago I was running FreeBSD and went to Debian Linux mostly because I wanted ax25 to make Packet work. That was Soundmodem 0.10, and apparently one of the changes is how easy it is to use it.

My soundmodem.conf file looks like this. I haven't used this for transmitting yet. I copied this from the Linux partition and tweaked it a little. You don't have to know what all this stuff is, just thought it might come in handy if you're looking for numbers to plug in.

<?xml version="1.0"?>
<modem><configuration name="test2"><channel name="Channel 0">
<mod mode="afsk" bps="1200" f0="1200" f1="2200" diffenc="0"/><demod 
mode="afsk" bps="1200" f0="1200" f1="2200" diffdec="1"/><pkt 
mode="KISS" ifname="sm0" hwaddr="AB1JX-1" ip="10.0.0.46" netmask="255.255.255.0"
broadcast="10.0.0.255" file="/dev/soundmodem1" unlink="1"/></channel>
<chaccess txdelay="250" slottime="100" ppersist="40" fulldup="0" txtail="20"/
><audio type="soundcard" device="/dev/audio" halfdup="1" 
capturechannelmode="Left" simchan="0 - Ideal channel" snr="10" snrmode="0 - 
White Gaussian" srate="0" file="" repeat="0"/><ptt file="none"/>
</configuration></modem>
If you want a copy without all the HTML escapes, copy off your browser screen or grab this gzipped one or just make your own. The main thing you have to know are the 2 audio frequencies for mark and space (1200 and 2200 hz). 2 meters is brapping away filling up the map below.

So here it is, soundmodemconfig running on OpenBSD

There's nothing to show for soundmodem itself since it has no GUI interface.

And here's Xastir showing a bunch of APRS stations, both digipeated and not. I live in Western Massachusetts and this has been accumulating signals for 4 hours and 38 minutes. You can see Cape Cod off to the right and Long Island at the very bottom. The yellow trapezoid shape is a thunderstorm warning area. These are both small files because they're 16-color GIFs. I have an issue with Xastir's maps because they're too dark to be able to see call signs, so I turned them off. I haven't used it enough to find the best settings. I'm not really into APRS, I just like to look at it once in a while.

Because the path /etc/ax25 (where soundmodem.conf gets stored) doesn't exist under OpenBSD, you have to create it before you can create a new configuration. soundmodemconfig won't do it, and may crash because it can't find it.

When you start soundmodeconfig up the first time you'll have an almost blank screen. Click File -> New -> Configuration and pick a name. Then do File -> New again and you'll see the option to create a new channel. That's where you set stuff.

Here are my initial patches for soundmodem 0.16 to get it working under OpenBSD 4.7 and 5.0. At this point I've only tested them for receiving 2 meter packet here in the US so 1200 baud afsk.

AB1JX / toys/