SimpleUSB/USB Radio Not Working

I got a non-radio node set up and was trying to add a radio after the fact, adding a USB sound card (I’ll admit a really cheap one I had lying around) and a USB to COM control cable gives me these devices listed:

 lsusb
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 003: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC
Bus 002 Device 002: ID 8086:0808 Intel Corp. USB PnP Sound Device
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd QEMU Tablet
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

The UART and USB PnP sound devices seem fine, but when I try to configure SimpleUSB:

Please enter your selection now: 2
Device 50555 is selected, the associated USB device string  was not found
Device 50555 is selected, the associated USB device string  was not found

Auto device detection doesn’t seem to be working, and all of our docs are ASL2, leaving me at a bit of a loss in closing the gap, any basic steps I can start with here?

cat /proc/asound/cards
 0 [Device         ]: USB-Audio - USB PnP Sound Device
                      C-Media Electronics Inc. USB PnP Sound Device at usb-0000:02:1b.0-1, full speed
# dmesg | grep -i usb
[    0.487716] pci 0000:00:01.2: quirk_usb_early_handoff+0x0/0x750 took 44902 usecs
[    0.555226] pci 0000:02:1b.0: quirk_usb_early_handoff+0x0/0x750 took 65780 usecs
[    1.569207] ACPI: bus type USB registered
[    1.569557] usbcore: registered new interface driver usbfs
[    1.569727] usbcore: registered new interface driver hub
[    1.569750] usbcore: registered new device driver usb
[    1.646768] xhci_hcd 0000:02:1b.0: new USB bus registered, assigned bus number 1
[    1.648288] xhci_hcd 0000:02:1b.0: new USB bus registered, assigned bus number 2
[    1.648292] xhci_hcd 0000:02:1b.0: Host supports USB 3.0 SuperSpeed
[    1.654325] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.01
[    1.654330] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.654332] usb usb1: Product: xHCI Host Controller
[    1.654333] usb usb1: Manufacturer: Linux 6.1.0-26-amd64 xhci-hcd
[    1.654335] usb usb1: SerialNumber: 0000:02:1b.0
[    1.654583] hub 1-0:1.0: USB hub found
[    1.655805] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    1.655844] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 6.01
[    1.655847] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.655849] usb usb2: Product: xHCI Host Controller
[    1.655850] usb usb2: Manufacturer: Linux 6.1.0-26-amd64 xhci-hcd
[    1.655851] usb usb2: SerialNumber: 0000:02:1b.0
[    1.656107] hub 2-0:1.0: USB hub found
[    1.673404] uhci_hcd 0000:00:01.2: new USB bus registered, assigned bus number 3
[    1.673755] usb usb3: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 6.01
[    1.673758] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.673760] usb usb3: Product: UHCI Host Controller
[    1.673761] usb usb3: Manufacturer: Linux 6.1.0-26-amd64 uhci_hcd
[    1.673762] usb usb3: SerialNumber: 0000:00:01.2
[    1.673869] hub 3-0:1.0: USB hub found
[    2.153959] usb 3-1: new full-speed USB device number 2 using uhci_hcd
[    2.153979] usb 1-1: new full-speed USB device number 2 using xhci_hcd
[    2.303946] usb 1-1: New USB device found, idVendor=8086, idProduct=0808, bcdDevice= 1.00
[    2.303953] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    2.303955] usb 1-1: Product: USB PnP Sound Device
[    2.303957] usb 1-1: Manufacturer: C-Media Electronics Inc.
[    2.548214] usb 3-1: not running at top speed; connect to a high speed hub
[    2.564515] usb 3-1: New USB device found, idVendor=0627, idProduct=0001, bcdDevice= 0.00
[    2.564523] usb 3-1: New USB device strings: Mfr=1, Product=3, SerialNumber=10
[    2.564527] usb 3-1: Product: QEMU USB Tablet
[    2.564530] usb 3-1: Manufacturer: QEMU
[    2.564532] usb 3-1: SerialNumber: 28754-0000:00:01.2-1
[    2.591447] usbcore: registered new interface driver usbhid
[    2.591450] usbhid: USB HID core driver
[    2.593624] input: C-Media Electronics Inc.       USB PnP Sound Device as /devices/pci0000:00/0000:00:1e.0/0000:02:1b.0/usb1/1-1/1-1:1.3/0003:8086:0808.0001/input/input4
[    2.650152] hid-generic 0003:8086:0808.0001: input,hidraw0: USB HID v1.00 Device [C-Media Electronics Inc.       USB PnP Sound Device] on usb-0000:02:1b.0-1/input3
[    2.650506] input: QEMU QEMU USB Tablet as /devices/pci0000:00/0000:00:01.2/usb3/3-1/3-1:1.0/0003:0627:0001.0002/input/input5
[    2.650740] hid-generic 0003:0627:0001.0002: input,hidraw1: USB HID v0.01 Mouse [QEMU QEMU USB Tablet] on usb-0000:00:01.2-1/input0
[    2.673946] usb 1-2: new full-speed USB device number 3 using xhci_hcd
[    2.829175] usb 1-2: New USB device found, idVendor=0403, idProduct=6001, bcdDevice= 6.00
[    2.829182] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    2.829184] usb 1-2: Product: FT232R USB UART
[    2.829186] usb 1-2: Manufacturer: FTDI
[    2.829187] usb 1-2: SerialNumber: A172K0NQ
[    4.612847] usbcore: registered new interface driver usbserial_generic
[    4.612858] usbserial: USB Serial support registered for generic
[    4.621034] usbcore: registered new interface driver ftdi_sio
[    4.621046] usbserial: USB Serial support registered for FTDI USB Serial Device
[    4.621090] ftdi_sio 1-2:1.0: FTDI USB Serial Device converter detected
[    4.621152] usb 1-2: Detected FT232R
[    4.664076] usb 1-2: FTDI USB Serial Device converter now attached to ttyUSB0
[    4.765561] usbcore: registered new interface driver snd-usb-audio

What does asl-find-sound report?

root@allstar-01:~# asl-find-sound
root@allstar-01:~# echo $?
0

No output, return code 0.

root@allstar-01:~# cat /sys/bus/usb/devices/1-1/idProduct
0808
root@allstar-01:~# cat /sys/bus/usb/devices/1-2/idProduct
6001

1-1 is my C-Media Electronics USB PnP Sound 8086:0808
1-2 is my FTDI FT232R USB UART 0403:6001

It doesn’t seem to be detecting the subdevice here for some reason:

# ls /sys/bus/usb/devices/1-1/1-1:1.0/sound
card0

I think the problem is the only vendor that asl-find-sound supports seem to be 0d8c which is C-Media Electronics, Inc. where mine is Intel Corp 8086 (which… reports C-Media Electronics when queried, whatever).

Upon adding this case:

"8086" )
                IDPROD=`cat $USBDEV/idProduct   2>/dev/null`
                if   [ $((16#$IDPROD          )) -eq $((16#0808)) ]; then
                        :
                else
                        continue
                fi

                MANF=`cat $USBDEV/manufacturer  2>/dev/null`
                if [ -n "$MANF" ]; then
                        PROD="$MANF"
                else
                        PROD=`cat $USBDEV/product 2>/dev/null`
                fi
                ;;
root@allstar-01:~# asl-find-sound
1-1:1.0 -->     8086:0808 C-Media Electronics Inc.

Though I’m guessing asl-find-sound isn’t actually used for discovery because that doesn’t seem to fix auto-detection. I don’t mind shoving this value in devstr= though if I can figure out the format and there isn’t a major downside to that. However I still need to figure out how to get the serial port configured too.

I’m also just half tempted to go buy a $10 USB sound card that isn’t 40 kinds of messed up apaprently.

Autodetection is based on the same logic. It’s looking for the known set of workable vendor IDs and products. Even if you hardcode it, I’m not sure it’ll work. Perhaps @kb4mdd could chime in on if this subtype is workable.

The list of supported USB vendor/product IDs is hard-coded (and asl-find-sound reflects the same list).

Yeah had a friend find the C code here: app_rpt/res/res_usbradio.c at master · AllStarLink/app_rpt · GitHub

So yep, same logic, in C, so that’s a lot more of a pain to update.

If that device works, please consider filing a request on github to get it added. GitHub - AllStarLink/app_rpt: Refactoring and upgrade of AllStarLink's app_rpt, etc.

Is there a way to manually specific this specify the USB device in ASL3? All the documentation assumes automatic detection will work – once I get that sorted I’ll test it out and submit a request (even if I get a better USB Sound Card it’s nice to have the details for others)

Yes. Just set the devstr= in the simple usb config file to the string you found above.

Device 50555 is selected, the associated USB device string 2-1:1.0 was not found
[2024-11-04 18:33:18.320] NOTICE[1057]: app_rpt.c:5690 rpt_master: Normal Repeater Init  50555
[2024-11-04 18:33:18.322] NOTICE[1065]: chan_simpleusb.c:2565 simpleusb_setoption: Channel 50555: Set option TONE VERIFY, mode: OFF(0).
[2024-11-04 18:33:18.346] ERROR[1066]: chan_simpleusb.c:955 hidthread: Channel 50555: Device string 2-1:1.0 was not found.
~# /bin/asl-find-sound
2-1:1.0 -->     8086:0808 C-Media Electronics Inc.

Hmm, the device ID didn’t change, but Asterisk is refusing to be able to access it. I’ll continue digging.

If the Device Id does not match those predefined in the c code, it will not work. The c code will have to be updated to allow that device.

Oh duh, yeah that makes sense (I should have paid more attention to the C code I linked, not just the filtering its doing). In that case I should just get a better USB Sound card anyway, this one is a little… eh.

I’ll see about getting it added anyway.

The following change will allow you to manually configure the usb device descriptor.

… and that change will likely be included in our next (likely December) update of ASL3

Great add! Thanks @kb4mdd!

Another thing that tripped me up is to make sure the asterisk user is in appropriate groups–it should be by default: usermod -G audio,dialout,plugdev asterisk