USB audio support

Hello everyone,

I am doing some development on a SiFive Unmatched development board. I need audio out support. Because the board has only one PCI express slot which I intend to use for a VGA, I’ll need to explore the possibility of USB audio.

I am aware that audio via HDMI on Radeons has been met with success for others, but I’d like to first exhaust a standalone USB audio device.

Is anyone aware of any USB audio devices that are known to work, or likely to work, with ALSA?

I am using Ubuntu Server 21.04 with all system updates. I’ve tried ensuring all of the ALSA and PulseAudio related packages are installed.

I would have thought any device using the generic USB audio module would have worked. I see that the snd-usb-audio module is built and appears to load, and yet I still can’t seem to get any sound after I plug a small portable USB speaker.

Plugging in the USB speaker, I saw the following on the bus:

$ lsusb

Bus 001 Device 003: ID 1908:2070 GEMBIRD Honk HK-5002 USB Speaker

The kernel logs the following in kern.log:

[ 291.681086] usb 1-2.3: new full-speed USB device number 3 using xhci_hcd
[ 291.850299] usb 1-2.3: New USB device found, idVendor=1908, idProduct=2070, bcdDevice= 1.00
[ 291.850333] usb 1-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 291.850345] usb 1-2.3: Product: USB2.0 Device
[ 291.850355] usb 1-2.3: Manufacturer: Generic
[ 291.850365] usb 1-2.3: SerialNumber: 20130100ph0
[ 292.434209] mc: Linux media interface: v0.10
[ 292.734949] usb 1-2.3: 1:1: cannot get freq at ep 0x2
[ 292.802612] usb 1-2.3: 2:0: bogus dB values (-12800/-12700), disabling dB reporting
[ 292.803733] usbcore: registered new interface driver snd-usb-audio

Yet the device still doesn’t appear to be visible to ALSA:

$ aplay -l
aplay: device_list:276: no soundcards found…

If I try playing an Ogg/Vorbis file with mpv(1), I see the following (but with no sound):

$ mpv “/usr/share/games/lincity-ng/music/default/01 - pronobozo - lincity.ogg”
(+) Audio --aid=1 (vorbis 2ch 44100Hz)
AO: [pulse] 44100Hz stereo 2ch float
A: 00:01:00 / 00:03:30 (28%)

The USB speaker works fine on a Raspberry Pi 4 (arm64) on Ubuntu Server (21.04).

1 Like

I think you are right with your expectation that most USB audio devices should just work. I’m using an Asus Xonar U7 on an alsa only system (no pulseaudio) and it works as expected.

I’ve searched through the linux kernel sources with the vendor/device id of your speaker and it gives no result, meaning it should be used with the generic usb audio driver, and that’s what’s happening on your system.
Did you also enable codes at drivers → sound → ALSA → HD-Audio ?

I’ve been using a USB sound card on my Unmatched without issue, but with pulseaudio. I haven’t tried using just alsa yet. The specific device was the ROCCAT Juke from Best Buy. I haven’t tried using a USB speaker yet.

1 Like

@pa4wdh, I am using Ubuntu Server (21.04) headless. I didn’t build the kernel myself, but I’d imagine the usual sound stuff was enabled when the kernel was built. But for good measure, how can I check?

@cavemanol, if you are using PulseAudio then underneath you must be using ALSA. But good to know the ROCCAT Juke works.

I don’t know how ubuntu builds their kernels, but assuming they export the configuration via /proc you can use zgrep CONFIG_SND_HDA /proc/config.gz to see which options are set.

Looks like the module is built. I also managed to get playback to work with aplay(1), but only as root. I’ll do some more digging.

I managed to get the problem solved. To anyone else having the same problem, make sure your user is added into the audio group. You can do so like so:

$ sudo usermod -a -G audio you

Hi,I got stuck with the same sound issue as yours

sunmin@unmatched:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux bookworm/sid
Release: n/a
Codename: bookworm

I’m sure my login name is in the audio group

sunmin@unmatched:~$ cat /etc/group | \grep sunmin
sudo:x:27:sunmin
audio:x:29:pulse,sunmin
users:x:100:sunmin
sunmin:x:1000:
sbuild:x:111:sunmin

here is my output after replugin the usb audio card

sunmin@unmatched:~$ sudo dmesg | tail

[  179.214703] usb 1-2.2: New USB device found, idVendor=1b3f, idProduct=2008, bcdDevice= 1.00
[  179.222325] usb 1-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  179.229625] usb 1-2.2: Product: USB Audio Device
[  179.234216] usb 1-2.2: Manufacturer: GeneralPlus
[  179.311787] input: GeneralPlus USB Audio Device as /devices/platform/soc/e00000000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/0000:02:02.0/0000:04:00.0/usb1/1-2/1-2.2/1-2.2:1.3/0003:1B3F:2008.0004/input/input4
[  179.387500] hid-generic 0003:1B3F:2008.0004: input,hidraw2: USB HID v2.01 Device [GeneralPlus USB Audio Device] on usb-0000:04:00.0-2.2/input3

sunmin@unmatched:~$ aplay -l
aplay: device_list:275: no soundcards found…

I can’t hear any soud through this sound card. I don’t have a hdmi monitor neigther.

It’s so sad…