[pulseaudio-discuss] gst pulsesrc and default caps

Tanu Kaskinen tanuk at iki.fi
Sun Aug 15 20:42:06 PDT 2010

On Sun, 2010-08-15 at 19:30 +0200, Alexey Fisher wrote:
> Hallo all,
> i hacking currently on cheese and noticed "one more" performance issue.
> i use web cam with "sample spec: s16le 1ch 16000Hz", if i start
> gstreamer pipe it will get "float32le 1ch 44100Hz". I do not see match
> sense to upsample stream and than get bigger file size and cpu load.
> Especially on netbooks it is painful. Do you have any ideas how to let
> gstreamer check what source caps are an than use it?
> Here is pipe what i use gst-launch-0.10 pulsesrc ! audioconvert !
> vorbisenc quality=0.5 ! oggmux ! filesink location=output.ogg

This question seems more suitable for some GStreamer list, but I'll
comment what I can. I guess the problem is that pulsesrc doesn't know
which source is going to be used before actually starts recording.
Knowing that with 100% certainty isn't strictly speaking even possible,
in case someone writes a module that routes stuff randomly...

Ok, that's probably not going to happen, and certainly such module will
not gain much popularity, so is there something pulsesrc can do? It
could check what's the fallback source, and assume that's the one that
will be used. However, usually module-stream-restore is loaded, and its
opinion may override the fallback setting. Usually routing is done using
the media.role property, so if that's set on the stream, pulsesrc could
check from the stream restore database what routing will be used with
that role. If media.role is not set, there are then some other things
that module-stream-restore checks.

I don't think it makes sense to couple pulsesrc's implementation to
module-stream-restore's implementation, so currently the most sensible
thing is to just use whatever stream format is most comfortable for the
application, i.e. what happens now. It might make sense to add a
possibility for clients to ask pulseaudio "where would a stream with
this property list be routed to?" Any volunteers to implement that?

Tanu Kaskinen

More information about the pulseaudio-discuss mailing list