[gst-devel] oss trouble & lame caps

Erik Walthinsen omega at temple-baptist.com
Fri Feb 22 14:29:02 CET 2002


On Wed, 2002-02-20 at 03:10, Thomas Vander Stichele wrote:
> a) have osssrc always put out the caps requested by the app regardless of 
> what oss sets it at; this sounds bad but is the easiest fix.  It'll 
> probably timestretch and pitchshift the audio but in my case that's not 
> that big of an issue.
This could be the default, with a property to tell oss[src|sink] to set
the caps to exactly what the device claims it is.  I'm not convinced the
device is even operating at that frequency.  The reality is that the
clocks on most soundcards deviate significantly from the supposed rate
anyway, and don't know it.

> b) make sink's rate of lame only accept allowed values; I will do that.
Yeah, that should be done.

> c) insert a resampler plugin in the pipeline; imo that's a bit overkill, 
> especially for my purposes
For some apps though, that's what we want.  Given the needed CPU
cycles...

> d) write a sample dropper plugin which regularly drops samples to adapt 
> for the rate difference; for small differences this might work.
Such a plugin should be available as a poor-man's slight resampler.  As
explained in the multimedia paper we're presenting at GUADEC, keeping
the audio and video synchronized by making the necessary slight
adjustments in the audio samplerate to handle the hardware drift will be
a common operation.  I'd like to have such a plugin that can drop or
duplicate (maybe with some basic interpolation of nearby samples) as
many as a few dozen samples per second to handle slight differences. 
No, this will not be in the same league as a real resampler, but it
might be sufficient when CPU cycles are low.

> e) write a plugin that ignores all audio properties and just sets output 
> rate to the value you need for encoding, and just treat incoming data as 
> if it's that rate regardless of input rate.
Dunno if this would still be necessary if the oss[src|sink] plugins are
capable of "lying" when necessary.  Are slight samplerate differences
going to be common anywhere else?

      Erik Walthinsen <omega at temple-baptist.com> - System Administrator
        __
       /  \                GStreamer - The only way to stream!
      |    | M E G A        ***** http://gstreamer.net/ *****
      _\  /_





More information about the gstreamer-devel mailing list