[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1014017: soundmodem: Fails to build with HID support <linux/hidraw.h>



Package: soundmodem
Version: 0.20-6.5
Severity: normal
Tags: patch
X-Debbugs-Cc: n2ygk@weca.org

Dear Maintainer,

I tried to configure soundmodem to use a CM119B-based USB sound device which
is embedded in a DINAH kit: https://hamprojects.info/dinah/ which uses one of the
HID pins for PTT. soundmodemconfig failed to open /dev/hidraw0.

Upon reading the code I discovered two issues:

1. HAVE_LINUX_HIDRAW_H was not #defined.
2. The test for C-Media controller product IDs only went up to 0x0008 while the
   version of the CM119B is 0x0012.

The fix is in the attached patch file and has also been submitted upstream:

https://gitlab.com/tsailer/soundmodem/-/merge_requests/3

1. Fixes configure.ac to look for <linux/hidraw.h>
2. Extends the test for the controller product ID.

The altered soundmodem.conf file demonstrates the settings with gpio="2" for CM119B
signal GPI03.

-- System Information:
Debian Release: 11.2
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-11-amd64 (SMP w/2 CPU threads)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages soundmodem depends on:
ii  libasound2           1.2.4-1.1
ii  libatk1.0-0          2.36.0-2
ii  libaudiofile1        0.3.6-5
ii  libc6                2.31-13+deb11u2
ii  libgdk-pixbuf-2.0-0  2.42.2+dfsg-1
ii  libglib2.0-0         2.66.8-1
ii  libgtk2.0-0          2.24.33-2
ii  libhamlib4           4.0-7
ii  libpango-1.0-0       1.46.2-3
ii  libxml2              2.9.10+dfsg-6.7+deb11u2

soundmodem recommends no packages.

soundmodem suggests no packages.

-- Configuration Files:
/etc/ax25/soundmodem.conf changed:
<?xml version="1.0"?>
<modem>
  <configuration name="sm0">
    <chaccess txdelay="150" slottime="100" ppersist="40" fulldup="0" txtail="10"/>
    <audio type="alsa" device="plughw:1,0" halfdup="0" capturechannelmode="Mono"/>
    <ptt file="/dev/hidraw0" hamlib_model="" hamlib_params="" gpio="2"/>
    <channel name="Channel 0">
      <mod mode="afsk" bps="1200" f0="1200" f1="2200" diffenc="1"/>
      <demod mode="afsk" bps="1200" f0="1200" f1="2200" diffdec="1"/>
      <pkt mode="MKISS" ifname="sm0" hwaddr="" ip="10.0.0.1" netmask="255.255.255.0" broadcast="10.0.0.255"/>
    </channel>
  </configuration>
</modem>


-- no debconf information
diff --git a/configure.ac b/configure.ac
index b9ccd87..a54600d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -52,7 +52,7 @@ AC_CHECK_LIB(posix4,sched_setscheduler)
 AC_CHECK_LIB(uuid,GUID_NULL)
 AC_CHECK_FUNCS(getopt_long,,[AC_LIBOBJ([getopt]) AC_LIBOBJ([getopt1])])
 AC_CHECK_HEADERS(sys/audioio.h stropts.h sys/conf.h sys/soundcard.h sys/ioctl.h time.h inttypes.h net/if_arp.h)
-AC_CHECK_HEADERS(pty.h getopt.h syslog.h sched.h linux/sockios.h sys/ioccom.h linux/ppdev.h)
+AC_CHECK_HEADERS(pty.h getopt.h syslog.h sched.h linux/sockios.h sys/ioccom.h linux/ppdev.h linux/hidraw.h)
 AC_CHECK_HEADERS(sys/socket.h linux/if.h,,,
 [[
 #if HAVE_SYS_SOCKET_H
diff --git a/soundcard/ptt.c b/soundcard/ptt.c
index 1b168e1..377d374 100644
--- a/soundcard/ptt.c
+++ b/soundcard/ptt.c
@@ -271,7 +271,7 @@ int pttinit(struct pttio *state, const char *params[])
 		  (
 		    (hiddevinfo.vendor == 0x0d8c	// CM108/109/119
 			&& hiddevinfo.product >= 0x0008
-			&& hiddevinfo.product <= 0x000f
+			&& hiddevinfo.product <= 0x0012
 		    )
 		    ||
 		    (hiddevinfo.vendor == 0x0c76 &&	// SSS1621/23

Reply to: