Ssbd
Ssbd (SSB daemon) is voice keyer for use in hamradio. It's written as part of Tucnak, contest log for VHF contests, but is possible to use ssbd with arbitrary other program. Primary site is http://tucnak.nagano.cz/ssbd.html, mirror is http://www.penguin.cz/~ziav/tucnak/ssbd.html.
Features
- Play audio files of several file formats (WAV, AIFF, AU, VOC ...) and encodings (PCM, logarithmic PCM, ADPCM, GSM)
- Record traffic on band in RX state. Store it into WAV with several encodings (above). Recommended is GSM encoding - 24 hours, 8kHz takes less than 200MB.
- Mono, stereo or 4-channel operations.
- Support macros in file names - you can involve here date, time and some other variables.
- Uses UDP for communication with main program. You can run these programs on different computers.
- Most of parameters is adjustable by main program over UDP.
- When recording all directories are created automatically.
- Doesn't realize TRX keying - this is done by cwdaemon.
- Licensed under terms of GPL.
Requirements
Program require two libraries. First is Glib version 1.2. Second library is libsndfile. Version probably doesn't matter, I use current last release, version 1.0.5.
Download
Here.Recommended wiring
This is only example. You can use other wiring if you want. Here is same circuit in PostScript and here is schematics created in gschem.
Macros
You can use these macros:
- ~ (tilde only at begin of string) - home directory of user (environment variable $HOME)
- $S - serial number of sample in printf format %05d
- $C - received callsign
And all macros known for strftime (see man 3 strftime), example of some usable macros:
- %% - A literal '%' character
- %d - Day of the month (00-31)
- %H - Hour (00-23)
- %m - Month (01-12)
- %M - Minute (00-59)
- %S - Second (00-61)
- %y - Year without century (00-99)
- %Y - Year including century (1970-2038?)
Arguments
Here are commandline arguments:
- -d - Print debug messages to stderr
- --debug=file - Print debug messages to file
- -h - Print help summary
- -k - Try to kill existing ssbd on localhost (127.0.0.1)
- --kill=IP - Try to kill existing ssbd host IP
- -n - Don't fork to background. This option forces -d
- -p - Set other UDP port than 7890
- -v, --version - Print version informations and exist
Program Interface (API)
This chapter is usable only for developers or experienced users who want to debug behavior of ssbd.
Normally, program listen on UDP port 7890 on all network interfaces. In one packet can be more than one command lines separated by CRLF or LF. (Characters 13,10 or 10 in decimal). Command line begins with command. It's exactly one character descripting the action. The rest of command line is argument. There is no space between command and argument!
Some command can reply to main program. Format of reply is described below.
Commands are:
- a - Abort. Stop playing or recording. No args.
- c - Channels. Set number of channels for recording. Argument is number of channels written in decimal. Number depends on your soundcard driver and libsndfile, normally is 1 or 2, maybe 4.
- d - DSP name. Set path to DSP, default value is /dev/dsp.
- e - Echo request. Ssbd remembers IP and port of sender and send 'e' and argument back to sender when playing of sample is finished.
- f - Format of sample. Set format of recorded sample. Format can be decimal or hexadecimal (recommended). See libsndfile API for more information.
- k - Kill. Request to kill this process.
- p - Play. Play sample file passed in argument. You can use macros above, but it's mostly useless. Better is involve macros such as operator's callsign in main program. Format, channels and samplerate is taken from file.
- r - Record. Record sample with format, channels and samplerat given before. Argument is template of recorded file. You can use macros above.
- s - Samplerate. Set rate of sample in recorded files. Argument is in Hz in decimal.
Replies:
- ! - Error. Argument is in free human readable format. Main program can show this on screen.
- e - Echo reply. See Echo request above.
- K - Kill reply. Argument is PID (decimal) of exited process.