Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Jaroslav Kysela <perex@suse.cz>
Cc: ALSA development <alsa-devel@alsa-project.org>
Subject: Re: Device name lists
Date: Tue, 10 May 2005 17:19:08 +0200	[thread overview]
Message-ID: <1115738349.12058.7.camel@pegasus> (raw)
In-Reply-To: <Pine.LNX.4.58.0505101257530.1834@pnote.perex-int.cz>

Hi Jaroslav,

> 	I've added the functions handling device name list to alsa-lib.
> Because alsa-lib open functions handle virtual names, it's impossible to
> get list of all possible device names. The interface is:
> 
> typedef struct snd_devname snd_devname_t;
> 
> struct snd_devname {
>         char *name;
>         char *comment;
>         snd_devname_t *next;
> };
> 
> int snd_names_list(const char *interface, snd_devname_t **list);
> void snd_names_list_free(snd_devname_t *list);
> 
> 	As you can see, it simple as possible. The applications might 
> request for a device list which can be generated automagically or advanced
> users might create their own lists.
> 	The lookup is this:
> 
> 1) file specified with ALSA_NAMES_FILE environment variable
> 2) ~/.asoundnm
> 3) /etc/asound.names
> 
> 	Note that 2) and 3) files are not merged (only one file is 
> parsed)!!! The syntax of these files is quite straighforward (alsa-lib
> keeps the order of device compounds):
> 
> timer {
>         alsactl1 {
>                 name 'hw:CLASS=1,SCLASS=0,CARD=-1,DEV=0,SUBDEV=0'
>                 comment 'Physical Device - system timer'
>         }
> }
> 
> 	The alsactl tool was extended to generate a basic set of
> device names (might be extended to detect other plugins as well). This 
> command will generate /etc/asound.names file:
> 
> 	alsactl names
> 
> To generate the user file use:
> 
> 	alsactl -f ~/.asoundnm names
> 
> 
> It's still time to do any changes and I would really appreciate 
> comments...

this is prefect and I hope that the ALSA library users adapt this very
soon, but two questions came to my mind:

1) What is the reason for not merging /etc/asound.names and ~/.asoundnm?

2) Is another config file really needed? Why not add another parameter
called "name" to the current config file. So that I can simply create
this entry for my Bluetooth headphone from HP:

	pcm.hp {
	        type a2dp
	        name "HP stereo headphone"
	        bdaddr "00:0D:44:xx:xx:xx"
	}

If the name value is present then snd_names_list() will show it and
otherwise not. Telling people to add entries in two files sounds not
right to me.

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click

  reply	other threads:[~2005-05-10 15:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-23 14:36 Plugin loading and unloading Marcel Holtmann
2005-04-30 11:35 ` Marcel Holtmann
2005-05-09  8:10 ` Jaroslav Kysela
2005-05-09  8:16   ` Marcel Holtmann
2005-05-09  8:36     ` Jaroslav Kysela
2005-05-09  9:07       ` Marcel Holtmann
2005-05-10 11:21         ` Device name lists Jaroslav Kysela
2005-05-10 15:19           ` Marcel Holtmann [this message]
2005-05-10 15:32             ` Clemens Ladisch
2005-05-10 15:57               ` Jaroslav Kysela
  -- strict thread matches above, loose matches on Subject: below --
2005-05-10 11:36 Peter Zubaj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1115738349.12058.7.camel@pegasus \
    --to=marcel@holtmann.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=perex@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox