better ALSA card name

Matthias Kretz kretz at kde.org
Tue Jan 9 08:46:41 PST 2007


On Tuesday 09 January 2007 17:12, Danny Kukawka wrote:
> 0.5.7.1 is now also more than 5 months old code. I would like to see if
> with a newer HAL (and maybe an actual kernel) this would give the same
> info.

It's really not possible for HAL to find out the necessary name for the USB 
soundcards without either using libasound or reading /proc/asound/cards. I 
went through all my sysfs and procfs files from ALSA/the devices.

A new kernel could be interesting. But I don't see why the ALSA devs should 
have had the idea to change the proc files from the USB driver.

> > From the few tests I could make (one internal soundcard, two external USB
> > soundcards) it seems that it's only USB devices where the information is
> > too sparse. My internal soundcard is easy to recognize from the output of
> > HAL.
>
> IMO it would the best to get the alsa/kernel developer to export this info
> to sysfs instead of parse deprecated proc information.

Currently (reading the code in gitweb) HAL reads the device_id and product 
properties from the /proc/asound/card%d/pcmc%d%c dirs. But the USB ALSA 
driver simply writes "USB Audio" there.

The device name that is returned through the ALSA ctl interface (using 
libasound) is the one that I parse from /proc/asound/cards. And the name from 
the ctl interface is the one that ALSA applications show to the user 
(e.g. "aplay -l" or "qjackctl").

This is how I understand the name issue with ALSA: there is a name for the 
card, then there's a name for the device. The name of the card is stored 
in /proc/asound/cards, the name of the device 
in /proc/asound/card%d/pcmc%d%c/info. For USB cards the device name always 
is "USB Audio".

Currently HAL only retrieves the device name for pcm devices. For my pci 
soundcard I can get the name of the pci card when I look at the parent 
device, for the USB soundcard that doesn't help: the product name of the 
parent is "USB Audio Interface".

I believe HAL needs to get both the card name and the device name and 
concatenate them.

-- 
________________________________________________________
Matthias Kretz (Germany)                            <><
http://Vir.homelinux.org/
MatthiasKretz at gmx.net, kretz at kde.org,
Matthias.Kretz at urz.uni-heidelberg.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20070109/5f2ba81f/attachment.pgp


More information about the hal mailing list