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 344946 - Inhibit Gnome Power Manager from suspending while playing
Inhibit Gnome Power Manager from suspending while playing
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: general
unspecified
Other All
: Normal enhancement
: 2.x
Assigned To: Banshee Maintainers
Banshee Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-06-15 05:52 UTC by lists
Modified: 2008-02-11 11:17 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description lists 2006-06-15 05:52:40 UTC
From: https://launchpad.net/distros/ubuntu/+source/banshee/+bug/49791

All Banshee has to do is call a simple dbus method when playing starts, and a simple dbus method when it's paused or stopped. This way Gnome-Power-Manager doesn't auto-suspend or power-down while banshee is playing.

See https://wiki.ubuntu.com/GnomePowerManagerInactiveSleep for more information.
Comment 1 Gabriel Burt 2006-07-06 06:08:48 UTC
I started looking into this, and from looking at http://cvs.gnome.org/viewcvs/*checkout*/gnome-power-manager/docs/dbus-interface.html#pm-method-Inhibit and the little bit of Banshee DBus code, I think something like the following needs to happen, though I'm very unfamiliar with the Dbus foo.

Connection connection = Bus.GetSessionBus();
Service service = Service.Get(connection, "org.gnome.PowerManager");
SomeType obj = (SomeType)service.GetObject(typeof(SomeType), "/org/gnome/PowerManager");

uint32 cookie = obj.Inhibit("Banshee", "Playing music");

...

obj.Uninhibit(cookie);

This should also be used by the alarm clock plugin (and probably left publically modifiable (eg Uninhibit'able) for a future plugin that suspends/hibernates the computer after a certain time/album/burn/etc).
Comment 2 Gabriel Burt 2006-07-06 06:12:16 UTC
I somehow missed the link on the ubuntu wiki that gives a C example:

http://cvs.gnome.org/viewcvs/*checkout*/gnome-power-manager/src/gpm-inhibit-test.c
Comment 3 Aaron Bockover 2006-07-06 18:19:55 UTC
I've committed "blind" GPM Inhibit/UnInhibit support to Banshee. I say "blind" because I don't have the proper methods supported in the DBus API for my GPM build. It should work though :)

I've been thinking about other power management issues in Banshee in an effort to become more "laptop friendly". Not sure where we could be more laptop friendly in Banshee though.

I'm going to close this as FIXED for now... but it's largely un-tested. If it's broken, fixing it should be very trivial.
Comment 4 lists 2008-01-04 09:19:17 UTC
I just tested this in Ubuntu Hardy Alpha 2 - Banshee 0.13.1
The inhibiting code does not seem to work; the player just suspended during the playback of a song.
Comment 5 lists 2008-01-04 09:24:08 UTC
Ah - possibly this is a problem:
Warning: [01/04/2008 22:21:53] (Power Management Call Failed) - Cannot find GNOME Power Manager: Name org.gnome.PowerManager has no owner

The inhibit code in Serpentine works correctly on this machine.
Comment 6 Gabriel Burt 2008-01-04 17:35:13 UTC
Can you please test the latest from the stable branch (what will soon become 0.13.2)?  It should be fixed there.