xbmc disturbs X idle time
#1
Hi all,

I've been using XBMC for a while now, and recently moved from camelot to Dharma (beta 2, after a couple of svn versions and beta 1).

However i'm running xbmc on a machine that also functions as a server. To be able to put the server in standby i wrote a python script that checks for all kinds of activity (xbmc status, samba shares status, transmission, etcetera. not important for this post, but for more details: http://ubuntuforums.org/showthread.php?p=9917183).
to detect user input from the keyboard or mouse i use 'xprintidle', a command that spits out the X idle time in miliseconds.

This all worked fine in Camelot, but since Dharma there is a problem: Dharma seems to generate events (about every 5 seconds) that disturb this timer.
I've been looking for other programs that do the same, but haven't been able to find any so far (the only thing disturbing the timer seems to be mouse and keyboard activity, or XBMC)

best way to try this out is:
1. opening a terminal window
2. run this command: for i in {1..10}; do sleep 5; xprintidle; done
3. don't touch the mouse or keyboard
4. try it with xbmc on and xbmc off

I'm hoping somebody can tell me why xbmc behaves like this, or that it's a bug that will be crushed in the final release Smile
Reply
#2
I am having the exact same issue, XBMC is sending events which disturb idle time.

For me, its evident because I want my display to sleep. It sleeps properly when XBMC isn't running. One of the tests I did was ran "xset dpms force suspend" when XBMC was running, and when it was not. It properly sleeps when XBMC isn't running. When it is running, it wakes the screen 2-3 secs after, without any type of input.

This is the exact same behaviour that I get with the auto sleep function inside XBMC. Display sleeps for 2 secs, and then wakes up.
Image
Reply
#3
After a couple hours of digging in straces, I figured out what is going on.

By default SDL (library that XBMC uses to render), disables the screensaver. How it disables the screensaver is that every 5 seconds it calls "XResetScreenSaver" ("UpdateSystemActivity" under Quartz).

This resets the activity timer for your screensaver, and also for DPMS.

There is a workaround (thanks bobo1on1) by running XBMC with: "SDL_VIDEO_ALLOW_SCREENSAVER=1 xbmc"

This disables the screensaver reset, and allows your display to properly sleep. Of course you will want to ensure that your OS is not set to sleep the monitor or turn on a screensaver, or it will activate during your playback.
Image
Reply
#4
tecnobrat Wrote:There is a workaround (thanks bobo1on1) by running XBMC with: "SDL_VIDEO_ALLOW_SCREENSAVER=1 xbmc"

Nice find!

Since I think I'm also suffering this on Dharma 10.0 on Windows 7,
(Dharma RC1 was OK), I wonder how to enable your fix in Windows.

Just setting an environment variable perhaps ?

thanks in advance

Per
Reply
#5
sorry realized this is the wrong sub forum, though users get directed to this thread for this problem.
Reply

Logout Mark Read Team Forum Stats Members Help
xbmc disturbs X idle time0