[alsa-devel] Getting a full device list

Jaroslav Kysela perex at suse.cz
Fri May 11 13:46:46 CEST 2007

On Fri, 11 May 2007, Nicholas Smethurst wrote:

> Jaroslav Kysela wrote:
> > On Fri, 11 May 2007, Nicholas Smethurst wrote:
> > 
> >> Is this possible? If not, can we work towards implementing such
> >> functionality?
> > 
> > User or system software manager should create a configuration which is 
> > suitable for users. You're trying to overload the user settings. Why?
> > Use information returned without any hacks in your application (you may 
> > eventually describe in documentation, how users can get more devices).
> I'm not sure I understand.
> I found the global variable "defaults.namehint.showall" in alsa.conf, which
> lives in /usr/share/alsa/. This is not the sort of place a user should be
> fiddling with. Users don't have the knowledge (or the desire) to manually
> change system configuration files.. us developers should be able to do all we
> need to do via alsa-lib.

Note that's why many distributions exist and make configuration more 
user friendly. We decided to have minimal set of offered devices by 
default. If any distribution feels it's better to give a full list, it's 
also possible by modifying the global configuration file.

> I understand that you are suggesting that user applications list what ever
> snd_device_name_hint() returns, and then describe in the application
> documentation that if the user does not see devices such as hw, they should
> manually edit a system configuration file.

Yes (but files in share tree should not be touched - you may override 
config via system configuration in /etc/asound.conf or user 
specific ~/.asoundrc).

> Or do you mean that a user application can create its own global
> configuration? I didn't know that that was possible.
> If this is the case, can I copy the default configuration and turn on
> "defaults.namehint.showall" in order that my user application can call have
> the full list from snd_device_name_hint()?

Again, why this hack? Why your application should behave differently than 

Anyway, you may specify a path to own alsa.conf file via ALSA_CONFIG_PATH 
environment variable. But if you feel in this way, it's far better to 
modify user's ~/.asoundrc file in my eyes (don't forget to tell user that 
you are doing something with the configuration, or ask user at first).


Jaroslav Kysela <perex at suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs

More information about the Alsa-devel mailing list