Re: [Alsa-user] USB audio on riscv64
On Thu, 2021-11-04 at 08:40 +0000, Dmitri Seletski wrote:
I am just a user. Can't help but wonder if usb snd modules were compiled in or loaded?
Hey Dmitri,
CC'ing the lists. When I plug in the device, I see 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
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, I see the following 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 device works fine on arm64 via a Raspberry Pi 4.
On Thu, 04 Nov 2021 22:37:26 +0100, Kip Warner wrote:
On Thu, 2021-11-04 at 08:40 +0000, Dmitri Seletski wrote:
I am just a user. Can't help but wonder if usb snd modules were compiled in or loaded?
Hey Dmitri,
CC'ing the lists. When I plug in the device, I see 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
The device still doesn't appear to be visible to ALSA:
$ aplay -l aplay: device_list:276: no soundcards found...
Check the contents in /proc/asound/cards. Is that empty as well?
If the card is recognized there, check the /sys/class/sound/*. If a PCM device is found there, it must be the lack of the corresponding device in /dev/snd/* that is usually created via udev.
Takashi
On Fri, 2021-11-05 at 11:17 +0100, Takashi Iwai wrote:
Check the contents in /proc/asound/cards. Is that empty as well?
Thanks for getting back to me, Takashi. Looks like it's empty:
$ sudo tree /proc/asound/ /proc/asound/ ├── Device -> card1 ├── card1 │ ├── id │ ├── pcm0p │ │ ├── info │ │ └── sub0 │ │ ├── hw_params │ │ ├── info │ │ ├── status │ │ └── sw_params │ ├── stream0 │ ├── usbbus │ ├── usbid │ └── usbmixer ├── cards ├── devices ├── hwdep ├── modules ├── oss │ ├── devices │ └── sndstat ├── pcm ├── seq │ ├── clients │ ├── drivers │ ├── queues │ └── timer ├── timers └── version
6 directories, 23 files
If the card is recognized there, check the /sys/class/sound/*.
This is what I see in that directory:
$ sudo tree /sys/class/sound/ /sys/class/sound/ ├── card1 -> ../../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.1/1-2.1:1.0/sound/card1 ├── controlC1 -> ../../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.1/1-2.1:1.0/sound/card1/controlC1 ├── pcmC1D0p -> ../../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.1/1-2.1:1.0/sound/card1/pcmC1D0p ├── seq -> ../../devices/virtual/sound/seq └── timer -> ../../devices/virtual/sound/timer
5 directories, 0 files
If a PCM device is found there, it must be the lack of the corresponding device in /dev/snd/* that is usually created via udev.
And this is what I see there:
$ sudo tree /dev/snd/ /dev/snd/ ├── by-id │ └── usb-Generic_USB2.0_Device_20130100ph0-00 -> ../controlC1 ├── by-path │ └── platform-e00000000.pcie-pci-0000:04:00.0-usb-0:2.1:1.0 -> ../controlC1 ├── controlC1 ├── pcmC1D0p ├── seq └── timer
2 directories, 6 files
A bit of information on my system:
$ uname -a Linux kip-unmatched 5.11.0-1021-generic #22-Ubuntu SMP Tue Sep 28 15:19:16 UTC 2021 riscv64 riscv64 riscv64 GNU/Linux
$ lscpu Architecture: riscv64 Byte Order: Little Endian CPU(s): 4 On-line CPU(s) list: 0-3 Thread(s) per core: 4 Core(s) per socket: 1 Socket(s): 1 L1d cache: 32 KiB L1i cache: 32 KiB L2 cache: 2 MiB
I've also attached the output of the alsa-info(1) generated log.
On Fri, 05 Nov 2021 19:47:16 +0100, Kip Warner wrote:
On Fri, 2021-11-05 at 11:17 +0100, Takashi Iwai wrote:
Check the contents in /proc/asound/cards. Is that empty as well?
Thanks for getting back to me, Takashi. Looks like it's empty:
No, it contains the card entry. You can see it in alsa-info.sh output you attached, which is:
!!Soundcards recognised by ALSA !!-----------------------------
1 [Device ]: USB-Audio - USB2.0 Device Generic USB2.0 Device at usb-0000:04:00.0-2.1, full speed
If the card is recognized there, check the /sys/class/sound/*.
This is what I see in that directory:
$ sudo tree /sys/class/sound/ /sys/class/sound/ ├── card1 -> ../../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.1/1-2.1:1.0/sound/card1 ├── controlC1 -> ../../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.1/1-2.1:1.0/sound/card1/controlC1 ├── pcmC1D0p -> ../../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.1/1-2.1:1.0/sound/card1/pcmC1D0p ├── seq -> ../../devices/virtual/sound/seq └── timer -> ../../devices/virtual/sound/timer
So all files look fine.
If a PCM device is found there, it must be the lack of the corresponding device in /dev/snd/* that is usually created via udev.
And this is what I see there:
$ sudo tree /dev/snd/ /dev/snd/ ├── by-id │ └── usb-Generic_USB2.0_Device_20130100ph0-00 -> ../controlC1 ├── by-path │ └── platform-e00000000.pcie-pci-0000:04:00.0-usb-0:2.1:1.0 -> ../controlC1 ├── controlC1 ├── pcmC1D0p ├── seq └── timer
Here, too.
I've also attached the output of the alsa-info(1) generated log.
... and this looks also fine.
Try to run like % aplay -Dplughw:1 -vv foo.wav
If this works, the problem is rather the access via PulseAudio.
Takashi
On Fri, 2021-11-05 at 19:58 +0100, Takashi Iwai wrote:
No, it contains the card entry. You can see it in alsa-info.sh output you attached, which is:
I thought cards was supposed to be a directory populated with something, but I see now that its a file containing the aforementioned.
Try to run like % aplay -Dplughw:1 -vv foo.wav If this works, the problem is rather the access via PulseAudio.
Unfortunately it didn't:
$ aplay -Dplughw:1 -vv /usr/share/games/lincity-ng/sounds/Water1.wav ALSA lib pcm_hw.c:1829:(_snd_pcm_hw_open) Invalid value for card aplay: main:852: audio open error: No such file or directory
$ aplay -l aplay: device_list:276: no soundcards found...
On Fri, 05 Nov 2021 23:19:13 +0100, Kip Warner wrote:
On Fri, 2021-11-05 at 19:58 +0100, Takashi Iwai wrote:
No, it contains the card entry. You can see it in alsa-info.sh output you attached, which is:
I thought cards was supposed to be a directory populated with something, but I see now that its a file containing the aforementioned.
Try to run like % aplay -Dplughw:1 -vv foo.wav If this works, the problem is rather the access via PulseAudio.
Unfortunately it didn't:
$ aplay -Dplughw:1 -vv /usr/share/games/lincity-ng/sounds/Water1.wav ALSA lib pcm_hw.c:1829:(_snd_pcm_hw_open) Invalid value for card aplay: main:852: audio open error: No such file or directory
$ aplay -l aplay: device_list:276: no soundcards found...
How about to run as root?
Takashi
On Sat, 2021-11-06 at 08:23 +0100, Takashi Iwai wrote:
How about to run as root?
It works as root!
$ sudo aplay -Dplughw:1 -vv /usr/share/games/lincity-ng/sounds/Water1.wav
So there appears to be a permission issue. I wonder why?
On Sat, 06 Nov 2021 20:58:59 +0100, Kip Warner wrote:
On Sat, 2021-11-06 at 08:23 +0100, Takashi Iwai wrote:
How about to run as root?
It works as root!
$ sudo aplay -Dplughw:1 -vv /usr/share/games/lincity-ng/sounds/Water1.wav
So there appears to be a permission issue. I wonder why?
It depends rather on your system setup and desktop environment. Usually the device file permissions are managed by logind and modified dynamically at login via ACL.
As it's no kernel issue, better to ask your distro.
Takashi
On Sat, 2021-11-06 at 22:13 +0100, Takashi Iwai wrote:
It depends rather on your system setup and desktop environment. Usually the device file permissions are managed by logind and modified dynamically at login via ACL.
As it's no kernel issue, better to ask your distro.
It probably is a distro issue. But at least we know now that it works and it's just a matter of fiddling with permissions. Thanks Takashi.
participants (2)
-
Kip Warner
-
Takashi Iwai