Skip to contentSkip to conversation

Could we get the card name in /sys/clas/sound/card0/name?

DISCUSSION Lennart Poettering 2 participants 2 messages Jan 20, 2009

lore
Share & tools
lore
#0 lore raw

Heya!

Hmm, it would be nifty if we could get the alsa card name (i.e. the one shown in [] in /proc/pcm/cards) as an attribute file in /sys/class/sound/cardX/name. Even more useful would be if this property would be writable so that the cards may be renamed during runtime.

This could be very useful to establish stable card names via udev rules, similar to what is already done to network interface names ("eth0", ...).

Would such a change be acceptable?

Lennart

Signature · 3 lines
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net         ICQ# 11060553
http://0pointer.net/lennart/           GnuPG 0x1A015CC4
#1 lore raw
Quoted 8 lines · Lennart Poettering

Heya!

Hmm, it would be nifty if we could get the alsa card name (i.e. the one shown in [] in /proc/pcm/cards) as an attribute file in /sys/class/sound/cardX/name. Even more useful would be if this property would be writable so that the cards may be renamed during runtime.

Quoted 5 lines

This could be very useful to establish stable card names via udev rules, similar to what is already done to network interface names ("eth0", ...).

Would such a change be acceptable?

It's already implemented in our recent repositories (the change will be in 2.6.29):

Author: Jaroslav Kysela <[email protected]>
Date:   Tue Nov 11 16:51:02 2008 +0100

ALSA: add /sys/class/sound/card#/id (r/w) and card#/number (r/o) files

For udev, we need a way to rename soundcard names. The soundcard numbers (indexes) are hardwired but we have a text identification which can be changed at run-time. The ALSA user space tools already allow using of this text identification.

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.