[alsa-devel] where to get snd_pcm_hardware info when usb audio device plug in?

loody miloody at gmail.com
Sun Sep 8 10:25:55 CEST 2013


hi Clements and all:

2013/8/29 loody <miloody at gmail.com>:
> hi clements:
>
> 2013/8/28 Clemens Ladisch <clemens at ladisch.de>:
>> loody wrote:
>>> is it possible to get snd_pcm_hardware information in /proc, /sys or
>>> anywhere when usb audio device plug in?
>>>
>>> if no, is there api I can take in usermode to get snd_pcm_hardware of
>>> this usb audio device?
>>
>> Something like this?
>> http://download.atmark-techno.com/misc/demos/usb-audio-a500-howto/hw_params.c
> I download the file and
> 1. cross-compile it with alsa-lib-1.0.23
>
> but I get below message
> # ./hw_params
> no soundcards found...no soundcards found...
Sorry, it is my fault :)
I didn't create /dev/snd/xxxx nodes for hw_params to access.

after creating /dev/snd/xxx nodes, I get another problem.
hw_params will try to access alsa.conf, which is located my host machine.

# ./hw_params
PLAYBACK
ALSA lib conf.c:3601:(snd_config_update_r) Cannot access file
/media/sdb1/software/linux.sound/alsa-lib-1.0.23.mips.clibc/build/share/alsa/alsa.conf
ALSA lib control.c:902:(snd_ctl_open_noupdate) Invalid CTL hw:0
control open (0): No such file or directoryCAPTURE
ALSA lib conf.c:3601:(snd_config_update_r) Cannot access file
/media/sdb1/software/linux.sound/alsa-lib-1.0.23.mips.clibc/build/share/alsa/alsa.conf
ALSA lib control.c:902:(snd_ctl_open_noupdate) Invalid CTL hw:0
control open (0): No such file or directory/
#

Except create the same location on target board, is there any compile
option I can use to change the path of alsa.conf for hw_params to look
for?

appreciate your help,


More information about the Alsa-devel mailing list