Xbox 360 Controller EventClient

  Thread Rating:
  • 4 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
bb10 Offline
Member
Posts: 88
Joined: Feb 2008
Reputation: 0
Post: #16
frain Wrote:I posted an updated diff to http://trac.xbmc.org/ticket/5299. The diff should now apply cleanly to the SVN version (this time, I checked out a fresh copy and verified this fact).

Thank you, it patched correctly now. Smile

I compiled an installer and installed it, however the controller doesn't work. Am I missing something? (Tested on Vista Home Basic 32bit, Vista Home Premium 64bit)
find quote
frain Offline
Junior Member
Posts: 14
Joined: Mar 2008
Reputation: 0
Post: #17
bb10 Wrote:Thank you, it patched correctly now. Smile

I compiled an installer and installed it, however the controller doesn't work. Am I missing something? (Tested on Vista Home Basic 32bit, Vista Home Premium 64bit)

You need to run the Xbox360EventClient.exe program separately. It should be built to project/VS2008Express/Release/Xbox360EventClient.exe.

Thanks a lot for testing this!
find quote
bb10 Offline
Member
Posts: 88
Joined: Feb 2008
Reputation: 0
Post: #18
frain Wrote:You need to run the Xbox360EventClient.exe program separately. It should be built to project/VS2008Express/Release/Xbox360EventClient.exe.

Thanks a lot for testing this!

Confirmed working on both 32bit and 64bit vista. Smile

It still has some things missing like the triggers not doing anything, but I guess that has to do with the mapping?

Also, wouldn't it be more elegant if it was integrated in XBMC or is this just a test?
find quote
frain Offline
Junior Member
Posts: 14
Joined: Mar 2008
Reputation: 0
Post: #19
bb10 Wrote:Confirmed working on both 32bit and 64bit vista. Smile
Nice Smile
Quote:It still has some things missing like the triggers not doing anything, but I guess that has to do with the mapping?
Hm, I don't use the triggers so I don't know - they should work in principle. I will investigate this!
Quote:Also, wouldn't it be more elegant if it was integrated in XBMC or is this just a test?
As far as I'm aware, this is the new-ish and preferred way to implement input devices for XBMC (see a related wiki entry here). Also, by seperating input handling and the other XBMC functions, people can run EventClients and EventServers on different machines, enabling for example the use of the XBox360 controller with XBMC running on an XBox (like ultrabrutal described above), which would otherwise be impossible.

People more involved with the XBMC development should of course feel free to correct any errors in the above explanation!
find quote
frain Offline
Junior Member
Posts: 14
Joined: Mar 2008
Reputation: 0
Post: #20
I submitted an updated patch to http://trac.xbmc.org/ticket/5299#comment:7. Note the following:
  • a bug is fixed which caused the handling of analog triggers and thumbsticks to be incorrect and
  • the Xbox360EventClient now has to be compiled separately, using the project file in tools/EventClients/Clients/Xbox360 Controller.
find quote
bb10 Offline
Member
Posts: 88
Joined: Feb 2008
Reputation: 0
Post: #21
frain Wrote:I submitted an updated patch to http://trac.xbmc.org/ticket/5299#comment:7. Note the following:
  • a bug is fixed which caused the handling of analog triggers and thumbsticks to be incorrect and
  • the Xbox360EventClient now has to be compiled separately, using the project file in tools/EventClients/Clients/Xbox360 Controller.

Thanks! Great work. Smile
find quote
darwin Offline
Senior Member
Posts: 117
Joined: Feb 2009
Reputation: 0
Post: #22
First off I'd like to say THANKS FRAIN for this awesome EventClient, IMO XBMC without an Xbox-like controller just isn't the same. I don't mind at all starting it up before XBMC Windows, and it works wonderfully. Also THANKS TEAM XBMC for making the awesomesauce media center for free.

I'm using Vista64 and the Microsoft USB Xbox360 wireless dongle with XBMC Atlanis. I'm using Visual Studio 2008 Pro and not Express, so I don't currently have the ability to make my own builds, but I can at very least compile this EventClient. Smile

I have no complaints! One very minor difference from XBMC on the Xbox seems to be with the speed of the acceleration/repeat of the shoulder triggers, which is significantly slower than XBMC Xbox. I have noticed that there are timing knobs in the EventClient config menu, so perhaps I will try tuning that and post the values which feel "Xbox-like".

The other more significant difference is that the original patch does not map anything to the "white" and "black" buttons on the Xbox controller, so there is no way to enqueue playlist items or see the playlist. Fortunately the Xbox 360 Wireless controller has two remaining unmapped buttons, the left and right shoulder buttons.

Here's a small patch which makes the left and right shoulder buttons behave like "white" and "black", respectively. I have tested it, and it works as expected.

I'm not sure what arguments I should give diff to create a .patch, so here's the diff.

tools/EventClients/Clients/Xbox360/Xbox360EventClient.cpp

Xbox360EventClient.shoulderbuttons.patch
"
110,111c110,116
< checkButton(cont, client, 12, "lefttrigger");
< checkButton(cont, client, 13, "righttrigger");
---
> // these buttons are not yet mapped in XBMC/xbmc/ButtonTranslator.cpp
> // and therefore are used as "white" and "black" respectively, as white
> // is left of black on the original xbox controller.
> // checkButton(cont, client, 12, "leftshoulderbutton");
> // checkButton(cont, client, 13, "rightshoulderbutton");
> checkButton(cont, client, 12, "white");
> checkButton(cont, client, 13, "black");
"

I'm don't know why things are defined the way they are in ButtonTranslator.cpp, so I'm not sure whether it's more "correct" to do the above commented "leftshoulderbutton" "rightshoulderbutton" names, and define them in ButtonTranslator.cpp to be equivalent in the UI to "white" and "black?"

=darwin
find quote
bb10 Offline
Member
Posts: 88
Joined: Feb 2008
Reputation: 0
Post: #23
Opened a new ticket #5896 with the shoulder button patch. Hopefully it will get added soon. Smile


@ frain
I was wondering... would it be hard to implement the eventclient as a windows service that starts and stops with XBMC? I understand if you don't have the time to do it, but maybe it's not much work?
find quote
buntsbergh Offline
Junior Member
Posts: 13
Joined: Jul 2007
Reputation: 1
Post: #24
@frain
Man, you saved my life. I was going to dump XBMC for Windows because everything I tried getting my Wireless 360 controller to work just wasn't working properly. This Event Client was the cherry on top for me. Many thanks!!


@bb10
I tried and created a service using "sc.exe" (see http://support.microsoft.com/kb/251192/en-us)

After turning "Xbox360EventClient.exe" into a service, it works only during service startup. It somehow doesn't signal Windows that the service is loaded and then exits after timing out with error "Error 1053: The service did not respond to the start or control request in a timely fashion"
It probably has to do with "Xbox360EventClient.exe" having an infinite loop in main().


@darwin
Thanks for the patch.
Meanwhile, you can temporary change "Keymap.xml", replacing everything "white" with "leftshoulderbutton" and "black" with "rightshoulderbutton" which also does the trick.

edit: Never mind, just saw that its already included in 17720. thanks bb10


Cheers
Bunts
(This post was last modified: 2009-02-18 00:34 by buntsbergh.)
find quote
frain Offline
Junior Member
Posts: 14
Joined: Mar 2008
Reputation: 0
Post: #25
Thanks for the kind words everyone, I am glad that there are people that find my code useful!

Regarding making the EventClient into a Windows service: I don't know too much about Windows programming, and for me the commandline application suffices. I don't think it should be too hard to do, though: If anyone wants to give it a try, I think the following MSDN article on creating Win32 services in C++ might be a good starting point: http://msdn.microsoft.com/en-us/library/ms810429.aspx.
find quote
MaXMC Offline
Junior Member
Posts: 15
Joined: May 2008
Reputation: 0
Post: #26
Is this the EventClient they say is in 9.04Confused

Then Why isn't my 360 controller recognised? I can't even find EventServer in the settings in 9.04...
find quote
hansdampf Offline
Member
Posts: 67
Joined: Sep 2008
Reputation: 0
Post: #27
how do that thing work? i dont know how to compile things. Can someone provide a compiled file, please.

edit: never mind. i found a compiled file somewhere with google.
it works great!
thanks to the programmers!

edit2:
now i have another question.
if xbmc is not in the foreground of the screen. lets say i start a game. then the controller anyhow sends commands to xbmc. this can have confusing results. is this behavior normal, or i am doing something wrong?
(This post was last modified: 2009-05-31 11:39 by hansdampf.)
find quote
frain Offline
Junior Member
Posts: 14
Joined: Mar 2008
Reputation: 0
Post: #28
hansdampf Wrote:now i have another question.
if xbmc is not in the foreground of the screen. lets say i start a game. then the controller anyhow sends commands to xbmc. this can have confusing results. is this behavior normal, or i am doing something wrong?

That's a good question - I was wondering about that issue, but as I don't launch any programs from XBMC (yet) I did not look into the XBMC code to see how this problem could be fixed.

Probably when things like the XBMC Game Library are done, the XBMC EventServer should ignore EventClient input while other programs are running.
find quote
MaXMC Offline
Junior Member
Posts: 15
Joined: May 2008
Reputation: 0
Post: #29
Ok, I need an idiots guide on how to start Eventclient...

In the changelog for 9.04.1 I could read:
* Xbox 360 Controller EventClient

But I can't for the life of me find the eventclient.exe that I need to run, neither does XBMC start it automatically when I plug in my Xbox 360 controller.

Please help!
find quote
tiben20 Offline
Team-XBMC Developer
Posts: 1,029
Joined: Jun 2008
Reputation: 18
Post: #30
just use eventghost you add the take create switch events plugins and when example what im using it for mpc-hc you create a macro which will make a folder to run in exclusive mode with the event ex:[Task.NewWindow.mplayerc] and in the exclusive folder you put a macro which detect ex:[Task.ClosedWindow.mplayerc] and desactivate the exclusive mode for the folder.
find quote