GNOME Bugzilla – Bug 111820
Unable to play two files sequentially
Last modified: 2004-12-22 21:47:04 UTC
1/ Open two files in g-s-r 2/ Start playing first file and stop playback 3/ Start playing second file => error popup (only with HEAD, since I've added a popup error dialog :) because "/dev/dsp" is already used. Analysis : when pressing "STOP", gst playback pipeline goes into "PAUSED" state, which mean audio resource is still used. It should go into "READY" state which should released audio resource (please, confirm this one, I'm not 100% sure..)
Seems pretty significant, no? Restarting the app to do this is not ideal.
You must set the pipeline to NULL to get the audio device released. READY only rewinds the stream. A little GStreamer state change intro for all of you (note that some plugins still show buggy rbehaviour wrt this, file GStreamer bugs for it): NULL <=> READY: Set up/Tear down everything external to GStreamer. Device/file opening/closing happens here. As does connecting to servers and so on. READY <=> PAUSED: Set up/Tear down everything internal to GStreamer. Most of this is internal to GStreamer. The only important thing: Going to READY resets the stream. So when you restart you're at the beginning again. PAUSED <=> PLAYING: Start/Stop realtime stuff. This is only a difference between "are we really playing or not?" Clocks get started/stopped here for example.
I guess my question here comes down to: should we just be recommend using ESD? It seems like having the recorder tear down everything when it isn't playing isn't really reasonable to have it do. It should be able to maintain some resources... And ESD does solve this problem right? Essentially creating enough connections so everything gets mixed together happilly. I'm leaning twoards 'NOTABUG', anyone else?
*** Bug 111819 has been marked as a duplicate of this bug. ***
Using esd would only be a ugly workaround.. If I was trying to play two files at the same time, I'll agree with you, but here, I try to play one and then the other, sequentially. This bug should really be fixed by setting pipeline to NULL when pausing (I think RB does now the same thing, btw)
Putting up a patch for this problem, please review the patch and give your comments. Thanks.
Created attachment 19579 [details] [review] Patch for this bug
With the attached patch I can open 2 files in sound recorder and play them one after another. I am also able to play the opened file repeatedly. But if the file size is bigger than I am able to play only once or twice and after that I get the following error repeatedly, but I guess this is a different problem. (gnome-sound-recorder:1518): GStreamer-WARNING **: abnormal clock request diff: ABS(14123774442) > 2000000000 The patch also does things similar to the sample program given in http://gstreamer.net/docs/manual/ch12.html Thanks
Changing pri because of the patch.
This patch works perfectly.. I think it should go to r-t approval :)
Comitted to HEAD. Thanks for the patch!