[gst-devel] clocking problem on playback (plays 4x too fast)

Joe Sauer jsauer at vernier.com
Tue Jul 3 03:21:42 CEST 2007


I am developing a simple recorder/player app for the Vernier Labquest handheld (www.vernier.com/labquest) using gnome-recorder as a starting point.  Because we don't have an FPU and our PXA270 processor is not too powerful we use the speex codec for recording voice on the internal microphone and playing back on the internal speaker.  I am prototyping the elements of the gstreamer pipleline using gst-launch.

My problem is that when I make a recording with gstreamer the timing is wrong on playback (it plays back 4x too fast).  As an alternative way to create a speex file I use "arecord" and pipe it to speexenc, which plays back fine.  So I am pretty sure the problem is with the gstreamer pipeline elements for recording.  I have tried everything I can think of to fix the problem but no luck. 

Here's the log of what I have done:

Create a speex file using arecord piped to speexenc (5 sec recording):

# arecord -d 5 -f s16_le -r 8000 | speexenc - /media/ram/test.spx 
Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono
Encoding 8000 Hz audio using narrowband mode (mono)
<completes after 5 seconds>

Play back using gstreamer pipeline:

# gst-launch filesrc location=/media/ram/test.spx ! oggdemux ! speexdec ! alsasink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...			>> sounds fine
New clock: audioclock0
Got EOS from element "pipeline0".
Execution ended after 5083757000 ns.		>> playback duration matches record time
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
FREEING pipeline ...

Now try recording with gstreamer pipeline:

# gst-launch alsasrc ! audio/x-raw-int,rate=8000,channels=1 ! speexenc ! oggmux ! filesink location=/media/ram/test-gst.spx
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: audioclock0
Caught interrupt -- Pausing pipeline.		>> hit control-C after ~24 seconds
Pipeline paused.
WARNING: Element "pipeline0" warns: pipeline interrupted
Element "pipeline0" has gone from PLAYING to PAUSED, quitting.
Execution ended after 25947989000 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...

Play back with same gsteamer pipeline as before:

# gst-launch filesrc location=/media/ram/test-gst.spx ! oggdemux ! speexdec ! alsasink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...			>> timing is too fast - data is being dropped
New clock: audioclock0
Got EOS from element "pipeline0".
Execution ended after 5799122000 ns.		>> playback duration is 1/4 of record time!!!
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
FREEING pipeline ...

If anyone has an idea what I am missing please let me know!

Thanks,


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Joe Sauer
Linux Software Engineer
Vernier Software & Technology
13979 SW Millikan Way
Beaverton, OR 97005-2886

phone: (503) 277-2299
fax:   (503) 277-2440
www.vernier.com




More information about the gstreamer-devel mailing list