[gst-devel] ALSA mixer implementation

Leif Johnson leif at ambient.2y.net
Mon Nov 17 18:00:04 CET 2003

I did a bit more coding today to get the ALSA mixer integrated as a
separate GstElement. Things compile, and the alsasink still works for
me, but the mixer element needs some lovin' to work in the gst-mixer.
(I'm currently getting an ALSA error from gst-mixer ; I think it's a
card init issue.)

On Mon, 17 Nov 2003, Ronald Bultje wrote:

> My first question would be: are there ALSA tracks that are both playback
> and capture?

I don't know. I haven't encountered any, but I only have ALSA experience
with two types of sound cards (neither one of which is a pro audio

> > I 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.

Well, I don't know that for sure. The API includes functions to test for
a given playback or capture channel (the prototype is
snd_mixer_selem_has_{playback|capture}_channel(track, channel)) in any
mixer track. These don't seem mutually exclusive just from the API, but
in the implementation they could be.

> 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
> least temporarily)?

Yes, sounds good to me. I'll work on it and see what falls out.


Leif Morgan Johnson : http://ambient.2y.net/leif/

More information about the gstreamer-devel mailing list