After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 465095 - opens audio device before it needs to
opens audio device before it needs to
Status: RESOLVED FIXED
Product: totem
Classification: Core
Component: GStreamer backend
unspecified
Other All
: Normal normal
: ---
Assigned To: Maintainer alias for GStreamer component of Totem
Maintainer alias for GStreamer component of Totem
Depends on:
Blocks:
 
 
Reported: 2007-08-09 16:59 UTC by Bill Nottingham
Modified: 2007-08-12 22:38 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20



Description Bill Nottingham 2007-08-09 16:59:27 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:
Comment 1 Bastien Nocera 2007-08-09 17:06:06 UTC
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.
Comment 2 Wim Taymans 2007-08-10 10:15:31 UTC
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.
Comment 3 Tim-Philipp Müller 2007-08-10 10:37:55 UTC
> 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)
Comment 4 Philip Withnall 2007-08-10 10:59:23 UTC
(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.
Comment 5 Tim-Philipp Müller 2007-08-10 13:54:54 UTC
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. 

Comment 6 Bastien Nocera 2007-08-12 12:48:50 UTC
Do we release the device on pause as well?
Comment 7 Tim-Philipp Müller 2007-08-12 18:16:08 UTC
> 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
Comment 8 Philip Withnall 2007-08-12 22:38:42 UTC
(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. :-(