[gst-devel] ALSA mixer implementation
rbultje at ronald.bitfreak.net
Mon Nov 17 01:02:12 CET 2003
On Sun, 2003-11-16 at 21:19, Leif Johnson wrote:
> This weekend I copied over the GstOssMixer implementation file and
> converted it to the ALSA API ; it was actually pretty easy. (The key is
> to ignore the ALSA `documentation' and just look at the header files. :)
> So things look pretty good, and yesterday it finally compiled for me
> (haven't had a chance to test it yet, however).
> In the current mixer interface, there is one function for getting and
> one function for setting the volumes on all channels of a mixer track.
> This worked fine with the OSS API, but in ALSA there are two types of
> volumes, `capture' and `playback'. Does this exist in OSS as well ?
Well, differently, but yes. The interface is indeed quite "Oss'like" (I
wrote it based on my experiences with the OSS API), so maybe we should
do this differently. As you've probably noticed, a capture track is then
marked as GST_MIXER_TRACK_INPUT, and a playback one is marked as
My first question would be: are there ALSA tracks that are both playback
> don't know of any cards that have simultaneous capture and playback in
> any given mixer track (e.g. pcm, line in, mic in, line out, etc.) but I
> don't know if it's impossible. Without distinct volume controls,
> GstMixer interface users won't be able to set a record volume on a track
> flagged as playback, and vice versa. But with distinct controls, the
> interface becomes a bit less clean.
Hm... Well, depends on what point of view you take. In OSS, these are
mutually exclusive. In ALSA, apparently, they aren't. So for OSS, this
would be a bloated addendum. For ALSA, not using this would be non-clean
since you need two tracks (one marked as INPUT, one marked as OUTPUT)
for a track marked as both capture and playback. So the "correct"
solution really depends on whether you look at it from ALSA's point of
view or OSS.
For now, I'd like to propose to just make two tracks for the theoretical
case where a track is marked as both capture and playback. If we really
see issues, we can do it differently. would you agree with that (at
> I'm leaning toward keeping things simple and doing the magic in the ALSA
> code. Any comments would be helpful, though.
And what would you do then? ;). Both solutions fit in this description.
Ronald Bultje <rbultje at ronald.bitfreak.net>
Linux Video/Multimedia developer
More information about the gstreamer-devel