Posts: 49
Joined: Feb 2008
Reputation:
0
Hippo
Junior Member
Posts: 49
Well, I had temporarily circumvented the problem by opening xbmc-standalone in a second session at startup. ( sudo startx -- :1 ) with .xinitrc = "xbmc-standalone"
That way I could have the full xbmc session and still have desktop running.
It's not really perfect as I prefer to be able to watch and browse side by side, but still have the system boot into a remote control only type setup for the wife and kid.
I'll do some more testing, but I think it's time to enter a trac request that the "front powerbutton action" setting come back to us.
It's fairly obvious that this isn't exactly a bug, just a side effect of choices and changes made.
Posts: 3
Joined: Feb 2010
Reputation:
0
2010-02-02, 00:25
(This post was last modified: 2010-02-02, 10:44 by hb76.)
When you set loglevel to 2 one can see the KeyPress events. Usually the logfile contains two messages:
1. SDLKeyboard for the lowlevel Keyboard Event
2. OnKey for recognized Keyboard events that can be assigned an action via keyboard.xml
When I press the PC Case powerbutton (or the Fn-Power combination on my MF-Keyboard) I only see the first message (SDLKeyboard) with a scancode of 124 (PC Case Powerbutton) or 150 (Fn-Power combination) .
There is no OnKey message - so changing the keyboard.xml does not help.
I dug into the source and found that the problem lies in the function LookupKeyMapping (KeyboardStat.cpp).
LookupKeyMapping simply does not assign a m_VKey for the scancode received by SDLKeyboard. The reason is probably that the
static XBMC_KeyMapping g_mapping_evdev structure is garbled (does not reflect the structure definition and does not contain the scancodes my powerbutton sends.
The same is true for static XBMC_KeyMapping g_mapping_ubuntu[].
So adding my scancodes to the static XBMC_KeyMapping g_mapping_evdev structure or static XBMC_KeyMapping g_mapping_ubuntu does not work.
So what I did to verify my assumptions:
1. I hardcoded the assignement to m_VKey into LookupKeyMapping:
+ if((source == 150) || (source == 124))
+ *VKey=XBMCK_POWER;
return false;
}
2. I checked the logfile and now found an OnKey Line reading:
DEBUG: OnKey: 61504 pressed, action is 0
3. I edited keyboard.xml so that the key 61504 gives the correct action:
<key id='61504'>XBMC.ShutDown()</key>
4. I checked that it works (PC power button -> XBMC Quits
5. checked the logfile
DEBUG: OnKey: 61504 pressed, action is 122
Maybe a developer can look into this - I dont feel comfortable enough with this source code to propose a fix for this problem. However I think I nailed it down to the very function where I think the error lies.
BTW: I used the git source from 2010/01/31
Posts: 3
Joined: Feb 2010
Reputation:
0
I resolved the problem for me. Even though I don't exactly know why the problem only arises in all versions of xbmc (standalone, live, xbmc.bin).
I start xbmc.bin from the gnome desktop via autostart at login.
BTW: my system is a ZOTAC MAG HD-ND01 (Atom330 / Ion)
According to XFree86, the keycodes for PM functions are defined as:
124 XF86PowerOff
150 XF86Sleep
213 XF86Suspend
As I wrote in my previous post, these keycodes are properly sent by the powerbutton on the pc case (124) and the Sleep combination of my logitech cordless desktop (Fn-POWER: 150).
Sleep works fine when I am on the GNOME desktop. However when I am in XBMC, the button codes don't reach the gnome powermanager. They do however appear as SDLKeyboard events in the xbmc.log.
Even tough they are recognized as keyboard events, they are not assigned to XBMC Keyboard events. Somehow there is no proper mapping for this.
What I did, is hardcode this mapping from SDL Keyboard events to XBMC keyboard events in KeyboardStat.cpp. (see my previous post)
Then it is easy to assign an action to the power button.
Now, everything was done with the xbmc 9.11 source tarball.
Posts: 124
Joined: Nov 2008
Reputation:
0
im having this same issue with my current htpc.
its running ubuntu 9.10 and one of the later SVNs of XBMC.
the weird thing is, my ion based htpc functions normally.
the problematic computer has a ma780gm mobo if it makes a difference.
same symptoms as most everyone else: front panel power button will put the computer into standby no issue. as soon as xbmc is running, it no longer functions.
Posts: 49
Joined: Feb 2008
Reputation:
0
Hippo
Junior Member
Posts: 49
Well, that worked for me. I edited the powerbtn.sh file, and I can now shut down from the remote. Of course I shouldn't have to do that, but at least it's working again.
Many times I've found the computer has been on all night because somebody forgot that you have to quit XBMC before pushing the off button on the remote....
Posts: 159
Joined: Oct 2009
Reputation:
0
2010-11-27, 16:15
(This post was last modified: 2010-11-27, 16:16 by generator.)
@galets: What exactly did you comment out?
Posts: 51
Joined: Dec 2006
Reputation:
0
I am also intrigued by this.
I am running an Acer 3610 with Ubuntu 10.04, XBMC running as a standard application from Gnome.
If I try to click the hard power button on the case when in XBMC full screen, nothing happens.
If I try it when XBMC is running within a gnome window, or when XBMC is closed - system hibernates.
I searched the forum and I found at least 5 threads with the same problem, but no solution.
Anyone has a clean solution?
Thanks.