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 - 02:09:48 EEST


>> though at first sight this stuff is a cryptic nightmare.
>
>That's putting it politely. I understand, though. With power comes
>complexity, and any driver architecture worth the name must be general enough
>to handle many different classes of problems.
>
>However, my particular application happens to fit within the "traditional"
>stereo/interleaved/pcm mold rather well.

With ALSA, thats the wrong way around. Your application may do
that. The question is: does the user have audio interfaces that fit
this mold? The answer is always yes if you consider the "plughw" or
"plug" layers to be usable. The answer might be no if you go looking
for the actual hardware itself (though you could argue that finding
the hardware and then using the "plughw" layer on the relevant card is
a great idea. for most purposes, i'd agree). Thats because ALSA's "hw"
devices faithfully represent the hardware capabilities, and its only
the user-space code (alsa-lib, plug layer) that can do things like
alter channel counts etc.

aplay contains two relevant functions:

device_list(): this illustrates how to find out all the available
                 cards. note that it uses the control API, not the PCM
                 API, which is correct for this purpose. you don't
                 need as much information as it displays, but you
                 do need to pay attention to the presence of multiple
                 PCM devices on the same cards, and multiple
                 sub-devices on each card.

such an interface should make anyone throw their hands up in the air
and say "sheesh! i don't want to deal with that! why can't i just find
out what cards, err, PCM devices, err channels, err ... hmm, i'm not
sure what i want to find out ..." :)
                 
pcm_list() is more relevant, but unfortunately it uses a library
function to display the contents of the user's configuration, and
doesn't indicate how to access it in a useful programmatic way. my
impression is that the config stuff in alsa-lib is still rather
immature. it would be worth writing to alsa-devel, but its even more
worthwhile remembering that ALSA has hardly any project members :)

> It would be nice if there were a
>way to support this model in ALSA without getting bogged down into a morass
>of complexity. For all it's shortcomings, the OSS API was/is extremely good
>at handling this particular type of application model.

well, i won't reiterate my feelings on that. you all know that i
consider JACK to be The One True Way to do audio on Linux. Quite why
anyone is trying to present a list of physical output devices is
beyond me - what happens if I want the output to go to a hard disk
recording program, or through a software FX box?

--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 - 02:05:26 EEST