GNOME Bugzilla – Bug 309668
hello gstreamer world example does not work
Last modified: 2005-10-21 16:32:54 UTC
Distribution/Version: Fedora Core 4 I copied the introductory example from the GStreamer Application Development Manual for 0.8 series* and compiled it successfully. However, when I run it it just runs and terminates immediately without playing anything. I can play the ogg file in other GStreamer applications and my GStreamer setup is setup to use an ALSA sink by default. The test button in gstreamer-properties for this setup works fine. I am using Fedora Core 4, with ALSA. pkg-config --modversion gstreamer-0.8 says I am using 0.8.10. * http://gstreamer.freedesktop.org/data/doc/gstreamer/stable/manual/html/chapter-helloworld.html
Do you have dmix turned on? You probably need conversion plugins (http://gstreamer.freedesktop.org/data/doc/gstreamer/stable/manual/html/section-checklist-conversion.html) for it to work, some setups have those issues. They're omitted from the example to make it look as simple as possible. You can also test this on the commandline: gst-launch-0.8 filesrc location=file.ogg ! oggdemux ! vorbisdec ! alsasink vs. gst-launch-0.8 filesrc location=file.ogg ! oggdemux ! vorbisdec ! audioconvert ! audioscale ! alsasink
gst-launch-0.8 filesrc location=test.ogg ! oggdemux ! vorbisdec ! alsasink Fails with: RUNNING pipeline ... ERROR: from element /pipeline0/alsasink0: Could not get/set settings from/on resource. ERROR: from element /pipeline0/vorbisdec0: Internal GStreamer error: pad problem. File a bug. Additional debug info: gstpad.c(2562): gst_pad_set_explicit_caps: /pipeline0/vorbisdec0: failed to negotiate (try_set_caps with "audio/x-raw-float, rate=(int)44100, channels=(int)2, endianness=(int)1234, width=(int)32, buffer-frames=(int)0" returned REFUSED) Execution ended after 16 iterations (sum 145389000 ns, average 9086812 ns, min 16000 ns, max 144400000 ns). gst-launch-0.8 filesrc location=test.ogg ! oggdemux ! vorbisdec ! audioconvert ! audioscale ! alsasink Works as expected. Am I correct in understanding that the problem here is that the audio is 44100 KHz but my ALSA setup is currently playing back at some other sampling rate? I'm guess that the audioconvert and audioscale plugins take care of resampling the audio appropriately. I don't know if I have dmix on or not. I haven't tweaked the default Fedora Core 4 sound setup at all.
Yes to all, and dmix is indeed default in FC4. I'll add a note to the example.