I already mentioned in another post that I hacked together a CM108 based sound card with a PTT output. Unfortunately there are no pictures of the build-process which involved a lot of hot-glue. But as it worked really well and some friends already wanted to have one I decided to build a more professional version of it. It is based on the reference design of the CM108. The USB connector is a micro-USB one, which has the advantage that everyone has already got the required cables for their smartphones.
When you plug it into a PC with Linux there should appear this message in the syslog:
[14615.660050] usb 1-1: new full-speed USB device number 10 using xhci_hcd [14615.788913] usb 1-1: New USB device found, idVendor=0d8c, idProduct=000c [14615.788916] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0 [14615.788918] usb 1-1: Product: C-Media USB Headphone Set [14615.793739] input: C-Media USB Headphone Set as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.3/0003:0D8C:000C.0004/input/input18 [14615.848339] hid-generic 0003:0D8C:000C.0004: input,hidraw0: USB HID v1.00 Device [C-Media USB Headphone Set ] on usb-0000:00:14.0-1/input3
The last line is particularly interesting. It shows the HID endpoint being registered, which can be used to toggle GPIO pins on the CM108. There is also support for a squelch detection output of the radio that can be connected to GPIO2 and enables software with the needed patches to use the hardware squelch detection, which works more reliable than software based solutions.
To test the PTT function I have written a small test script which you can find on GitHub, but first you have to install the prerequisites.
For Debian, Raspbian and Ubuntu:
apt-get install build-essential libudev-dev
zypper install -t pattern devel_C_C++ zypper in libudev-devel
After that you can clone my github repo:
git clone https://github.com/donothingloop/cm108_ptt.git
And then build the tool:
cd cm108_ptt make
To use the soundcard as a non-root user you have to install the udev rule:
cp 50-cm108.rules /etc/udev/rules.d/ udevadm trigger
Then you can try to run the tool:
You should see the red led turning on and after one second turning off. If you connect your radio, it should transmit for one second.