Re: [linux-audio-dev] PCM Device Enumeration

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] PCM Device Enumeration
From: Paul Davis (pbd_AT_op.net)
Date: Sat May 11 2002 - 00:10:10 EEST


>On Friday 10 May 2002 14:48, Paul Davis wrote:
>
>> if you want to see how to do it "the right way", look at what "aplay
>> -L" does, since this takes the contents of ~/.asoundrc into
>> account. your code above doesn't do that at all. because ALSA allows
>> the user to define PCM devices with specific characteristics that are
>> slaves and/or subsets of h/w devices, what you're trying to do above
>> is really circumventing the ALSA configuration system.
>
>OK, 'aplay -L' gives a completely cryptic listing of what I assume to be a
>configuration setup.

because of ~/.asoundrc, ALSA programs should *not* attempt to
enumerate "all devices". the user knows whats there, and can ask for
it using a simple name. otherwise, use "default" as the PCM device
name, and you will get something moderately sane whatever the
hardware.

you might think that the windows/macos/oss approach of "list all the
h/w, choose one" is better. but consider this: the list a windows
audio app presents is already constrained (totally) by the "stereo
emulation model" that the driver(s) chose. if the user wants, say, a 6
channel setup, they can't get it unless the driver allowed that and
created a virtual driver to support it. under ALSA, the *user* gets to
define this kind of thing regardless (more or less) of the
capabilities of the hardware. that's why there is no definitive list
of the PCM devices available through the API.

> Is this stuff documented somewhere? Alsa-project.org
>seems pretty much useless for 0.9.0 docs.

its documented there in "reference" form. see

   http://www.alsa-project.org/alsa-doc/alsa-lib/conf.html#conf

then read:

     .../alsa-lib/doc/asoundrc.txt

no, i don't like the format. yes, i've complained about it. yes, its
what we've got. compare it to an Xresources file (the format is
actually very similar even though the examples tend to be more complex
than an Xresources file would be).

and this is not trivial stuff: this is the core of how users (or
programs that work on behalf of users) render ALSA usable, even
though at first sight this stuff is a cryptic nightmare.

--p


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Sat May 11 2002 - 00:09:07 EEST