Skip to content
forked from twilly/cm108

Send media to radio transceiver with CM108 interface

License

Notifications You must be signed in to change notification settings

pkharvey/pttplay

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pttplay

cosplay.sh is a command line tool that takes a media file (or pipe) and plays its audio content to a radio transceiver with a CM108 PTT interface. It can be used for automatic ident, allstar nodes, repeater control, etc. Default PTT delay and GPIO number are chosen to work well with the BF-888S and the commonly found homebrew CM108 mod with an NPN transistor to drive the PTT. Transmit will be postponed until the channel is clear by reading the COS signal from the radio transceiver. GPL-3.0 license.

cosrecord.sh is a command line tool that waits for an incoming radio transmission by monitoring the COS signal, starts recording mono audio at 44100 kHz on signal acquisition, then terminates when signal acquisition is lost. GPL-3.0 license.

cm108 is a command line GPIO tool for CMedia CM108 and CM119 audio devices. It's a small adaptation of Dire Wolf's cm108 driver to compile with very few dependencies and to take options to set GPIO pins. GPL-2.0 license.

hidapitester is a command line program to access HID API functions. It is required to read the COS status line, which will be wired to VOL DN pin as commonly used for homebrew USB audio interfaces. GPL-3.0 license.

Building

$ nix-build --expr 'let pkgs = import <nixpkgs> {}; in pkgs.callPackage ./default.nix {}'

Installing

TODO

Using

Print help and attached devices

$ result/bin/cosplay.sh
$ result/bin/cosrecord.sh

Usage example

With files

$ result/bin/cosplay.sh hw:2 /dev/hidraw3 callsign.mp3
$ result/bin/cosrecord.sh hw:2 /dev/hidraw2 outfile.wav

With pipes

$ cat callsign.wav | result/bin/cosplay.sh hw:2 /dev/hidraw3 -
$ result/bin/cosrecord.sh hw:2 /dev/hidraw3 - | cat >outpiped.wav

New buffer feature in this version

You can now buffer stdin to a temporary file. This has the desired effect of waiting to receive the entire audio stream first before turning on PTT in use cases where audio is piped around and occasionally blocks for input.

$ cat callsign.wav | ./result/bin/cosplay.sh -b hw:2 /dev/hidraw2 -

Limitations

  • COS must be wired to VOL DN. Other combinations not tested. The string comparison with gethidreport() may need to be adjusted if COS is wired differently.

About

Send media to radio transceiver with CM108 interface

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 63.3%
  • C++ 25.6%
  • Shell 6.5%
  • Makefile 2.4%
  • Nix 2.2%