GNOME Bugzilla – Bug 465095
opens audio device before it needs to
Last modified: 2007-08-12 22:38:42 UTC
Please describe the problem: When using totem-2.19.4, the audio device is opened immediately on startup, even though no file is passed in. This causes ~50 unnecessary audio interrupts per second (see http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=251534). <hadess> notting: if so, it's gstreamer's playbin's fault Ergo, filing here. Steps to reproduce: 1. start totem 2. look at the open fds 3. watch interrupts with powertop Actual results: ~50 interrupts per second from the sound card Expected results: No interrupts until I actually play something. Does this happen every time? Yes. Other information:
Is there a way to hint playbin that we don't need the audio device yet? We should be able to close the FDs used when paused so that Rhythmbox and Totem don't make the HW generate so many interrupts.
doesn't totem set the audio (and video) sinks to READY to figure out if they are usable? GStreamer opens the device when the sink is set to READY but closes it again when going to NULL.
> doesn't totem set the audio (and video) sinks to READY to figure out if they > are usable? It does. I'm fairly sure playbin does the right thing here. Playbin opens the audio device only if there is audio data in the stream and once the internal prerolling has finished. (Note: it does the same for the video device, but this behaviour can't easily be changed at the moment because of how the video balance interface stuff works in the backend)
(In reply to comment #2) > doesn't totem set the audio (and video) sinks to READY to figure out if they > are usable? GStreamer opens the device when the sink is set to READY but closes > it again when going to NULL. I suppose it can't hurt for Totem to just set them to ready (and find out if they're not useable) when we actually want to play a video.
It's a bit of an artificial test case IMHO, but I guess it doesn't hurt to close the device after the initial probing: 2007-08-10 Tim-Philipp Müller <tim at centricular dot net> * src/backend/bacon-video-widget-gst-0.10.c: Close audio device again after initial probing. Playbin will open it again later if and when needed. Closes: #465095. Saves: kittens.
Do we release the device on pause as well?
> Do we release the device on pause as well? Don't think so. Not sure it's desirable either. Add a stop button if you want things stopped :P
(In reply to comment #7) > > Do we release the device on pause as well? > > Don't think so. Not sure it's desirable either. Add a stop button if you want > things stopped :P I can't see how it can do any harm; somebody could leave something paused for a while, and they don't particularly want it eating up their battery. Then again, I know nothing of the technicalities of such matters. :-(