Skip to contentSkip to conversation

proposal: "registering" pcm devices to present choice to user

DISCUSSION Florian Schmidt 1 participant 1 message Oct 21, 2004

lore
Share & tools
lore
#0 lore raw

Hi,

maybe i'm out of my mind but what do you think of the following:

libasound config files get extended by a "register" keyword like this:

pcm.dmixed {
type plug
slave.pcm "dmix"
register "Software mixed output"
}

Now when alsa lib traverses its config files on app startup it builds a list of all "registered" pcm's (the same scheme could of course be used for ctl's and maybe seq's (??)). This list then can be accessed by an alsa app to present a list of possible devices to the user. Something like this (ignoring all alsa coding/naming and whatever conventions :)):

// gets the total number of registered pcm device names unsigned int get_number_of_registered_pcm_devices();

// returns the name of the index'th pcm definition // ("dmixed" in above example)
char *get_registered_pcm_device_name(unsigned int index);

// returns the comment of the index'th pcm definition // ("Software mixed output")
char *get_registered_pcm_device_comment(unsigned int index);

This could be "easily" (dunno how easy it would be to extent the config language) added ontop of the existing alsa-lib api and would be completely backwards compatible as the old pcm selection by name is still available and very nessecary for this to work in the first place.

what do you think? shall i go sit in the corner? I can imagine this could ease device selection by computer newbies and illiterates very much. I'm not asking anyone to do it. I would try my hands on it myself if anyone thinks this is a good idea.

Of course there should be a sensible preselection of registered names [in the global config files [stuff like "plug:front:0", "plug:surround50", etc]], so that the user won't have to do any of this himself if he's not fumbling with .asoundrc himself.

Florian Schmidt

P.S.: I'm aware that in a sense this is orthogonal to alsa's philosophy when it comes to device selection, but still i think it could work very well in practice.

-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl