Let you key a radio through a CM108 sound card's PTT line

Dire Wolf, Graywolf and others key a radio through a CM108-family sound
card (a Digirig, an AIOC) by setting a GPIO pin through its hidraw
device, which only root can open otherwise. Dire Wolf's own rule gives
it to the audio group, which most Arch users aren't in, and shouldn't
need to be. udev/70-hampack-cm108.rules tags those devices uaccess
instead, so whoever is at the desktop can use them, as they can the
sound card. It matches the devices Dire Wolf 1.8 treats as
CM108-compatible, and no other C-Media devices.

update.sh installs it in /etc/udev/rules.d when it changes, and reloads
and re-applies udev's rules; hampackremove removes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
David Young
2026-11-28 13:54:42 -07:00
co-authored by Claude Opus 5.5
parent fee5ce341a
commit 5f15ff3821
10 changed files with 112 additions and 4 deletions
+20
View File
@@ -156,3 +156,23 @@ check_radio() {
done
no_problems
}
@test "udev rules: udevadm accepts HamPack's, if it's there to ask" {
[ -x /usr/bin/udevadm ] || skip "no udevadm"
/usr/bin/udevadm verify --no-summary "$REPO"/udev/*.rules
}
@test "udev rules: the CM108 rule matches each device Dire Wolf treats as CM108-compatible" {
local rules="$REPO/udev/70-hampack-cm108.rules" device vid pid
for device in 0d8c:0008 0d8c:000f 0d8c:0012 0d8c:0013 0d8c:0139 0d8c:013a 0d8c:013c 0c76:1605 0c76:1607 0c76:160b 1209:7388; do
vid="${device%:*}" pid="${device#*:}"
grep "ATTRS{idVendor}==\"$vid\"" "$rules" | grep -oE 'idProduct}=="[^"]+"' | cut -d'"' -f2 | tr '|' '\n' |
while read -r pattern; do [[ "$pid" == $pattern ]] && echo match; done | grep -q match ||
PROBLEMS+=("$device isn't matched")
done
# and not other C-Media devices, such as headsets
grep "0d8c" "$rules" | grep -oE 'idProduct}=="[^"]+"' | cut -d'"' -f2 | tr '|' '\n' |
while read -r pattern; do [[ 0014 == $pattern || 0001 == $pattern ]] && echo "matches 0014 or 0001"; done | grep -q . &&
PROBLEMS+=("matches C-Media devices that aren't CM108-compatible")
no_problems
}