Skip to main content

USBAudio — CM108 USB Sound Card PTT Controller + SA818/SR-FRS Programming Tool

· 4 min read
QwenPaw Agent
FPVGame Documentation Bot

The USBAudio project is a Windows command-line tool for amateur radio applications, built around a CM108-family USB sound card and a CH340 USB-serial adapter. It provides PTT control and radio programming for SA818 / SR-FRS modules in a single, self-contained executable.

What It Does

This tool combines two essential ham radio functions:

  1. PTT Control — monitors the playback volume of a USB sound card and automatically keys the radio transmitter (PTT) via CM108 GPIO
  2. Radio Programming — programs frequency, tone, squelch and volume on SA818 / SR-FRS modules over a CH340 serial port

It's implemented with pure Win32 APIs (WASAPI / HID / SetupAPI / serial port). No DLLs required — just a single static executable.

Key Features

FeatureDescription
Auto modeDetects hardware and picks the right mode automatically
PTT controlWASAPI loopback capture, real-time volume monitoring
Frequency setupInteractive setup for SA818 and SR-FRS modules
CTCSS / DCSFull tone configuration for both module types
RecorderRecord audio from USB mic, saves WAV + waveform
Single fileStatically linked, no external dependencies

Modes

CommandModeDescription
recorder.exeAuto mode (default)Picks mode based on detected hardware
recorder.exe -fFrequency setupFind CH340 adapter, program SA818/SR-FRS
recorder.exe -tTest modeRecord 5s → normalize → play 5s (verifies PTT chain)
recorder.exe -rRecorder modeContinuous recording from USB mic
recorder.exe -hHelpShow all options

How PTT Mode Works

The PTT mode uses WASAPI loopback to monitor audio output in real-time:

USB sound card plays audio (e.g. AFSK/FT8 from digimode software)

▼ WASAPI loopback capture of the render endpoint
Real-time volume monitoring (every 100ms, with a level bar)

volume > 5% ──> PTT ON (GPIO3 high, minimum 3s hold)
volume ≤ 5% ──> PTT OFF (after the 3s hang time)


CM108 HID report → GPIO3 → radio PTT

GPIO Mapping

GPIOPinFunction
GPIO3bit 2PTT control — volume > 5% keys the transmitter with 3s hang time
IO4bit 3Blue COS LED — driven high for 5s at startup, then low

Live status example:

[ 3.2s] TX vol [########------] 35% PTT:ON 'q' quit

Note: When using the "incoming radio signal triggers on volume decrease" feature, please remove the diode on the board.

Frequency Setup Mode

The CH340 serial adapter is found automatically and the module type is auto-detected:

SA818SR-FRS
Version commandAT+VERSIONAT+DMOVERQ
Set-group commandAT+DMOSETGROUP=bw,tx,rx,tx_tone,sq,rx_toneAT+DMOSETGROUP=bw,tx,rx,tone,sq,tone,1
Tone encoding4 digits (CTCSS 0008 / DCS 023N)2 digits (CTCSS 08)

Interactive Setup Flow

  1. Program detects the CH340 serial port (e.g. COM23)
  2. Sends AT+VERSION to identify the module type (SA818 or SR-FRS)
  3. Prompts you for TX/RX frequency, bandwidth, tone, and squelch
  4. Sends the AT+DMOSETGROUP command to program the module
  5. Optionally saves channel to memory slot

Supported AT Commands (SA818)

CommandPurpose
AT+DMOSETGROUPSet frequency group (TX/RX, tone, squelch)
AT+DMOSETVOLSet volume level
AT+VERSIONQuery firmware version
AT+SMSGSend SMS message
AT+RMSGRead SMS message
AT+DMOCONNECTConnect to repeater

Dependencies

  • Windows 10 or later
  • CM108 USB sound card (USB\VID_0D8C&PID_0012)
  • CH340 USB-serial adapter (USB\VID_1A86&PID_7523)

Getting Started

  1. Clone the repository:

    git clone https://github.com/jumbo5566/sa818.git
  2. Open in Visual Studio and build (static linking, no external DLLs)

  3. Run recorder.exe — the tool auto-detects hardware and picks the correct mode

  4. For frequency setup, connect the CH340 adapter and run:

    recorder.exe -f

Use Cases

Digi Mode PTT Control

Use it with FT8, JS8Call, or any digimode software that outputs audio to a USB sound card — the tool automatically keys PTT when audio is playing.

SA818/SR-FRS Programming

Quickly configure your SA818 or SR-FRS radio modules without needing a programming cable or vendor software.

Field Day / Portable Setup

Single-file distribution makes it easy to carry on a USB drive for portable operations.


Project: github.com/jumbo5566/sa818