raelgc / ubuntu_xboxdrv

Ubuntu xboxdrv Integration
https://launchpad.net/~rael-gc/+archive/ubuntu-xboxdrv
GNU General Public License v3.0
165 stars 16 forks source link

Develop multiple instances 3 #37

Open BurninTurtles opened 9 years ago

BurninTurtles commented 9 years ago

i believe it to be done. instances work, sleep resume should work, config to proper controller works, hotplugging works if its not done too quick (possibly an artifact of my hardware), and code is at least i think clearly documented. if you like it and it works on your end, we can work on that team repo. im more concerned with getting this out there and tested though.

raelgc commented 9 years ago

I'll test (hopefully) during my weekend. I wish we have more people to test this. This package is installed by more than 3k users.

BurninTurtles commented 9 years ago

ive tested on 2 laptops and a desktop, but who does that really help lol. again worst bug i found is with other applications now. if ive only played fofix with js0 and the guitar is curently js1, i need to create another controller profile. after that, back to no problems.

raelgc commented 9 years ago

How you've create another controller profile? In the game?

BurninTurtles commented 9 years ago

yes. i cant see that being a problem of this though. its more like first use configuration of games problem

raelgc commented 9 years ago

Cool!

BurninTurtles commented 9 years ago

yeah man, ive tried everything i can think of to break this and it just works so far. im sure some user will find a way but ill embrace the challange. when this package is installed, even if its not running, if a controller is plugged in that the user wants this service to respond to, it will do exactly that, catch the controller and make a unique instance of xboxdrv for it. I ironed out any problems of options mismatch pre PR2. it really simply works. kinda disapointed the cat n mouse game ended actually lol

BurninTurtles commented 9 years ago

actually, resume on sleep is broken (again xD), however replugging the controller does the trick. log files say that everything runs but at the end xboxdrv reports it never found the usb device. a little research leads me to believe this is a kernel issue with sleep/resume and the binding of usb ports. thats kinda good news though, that the worst problem ive found is either fixed simply by the user, or out of the scope of this project.

BurninTurtles commented 9 years ago

Thought of yet another way to simplify this, however I do believe this PR to be release quality. up to you, I don't know if you've played with it yet

raelgc commented 9 years ago

Not yet. But if you have plans to simplify it, I'm always a big fan of simple stuff :D

BurninTurtles commented 9 years ago

sort of simplified, sort of made more ... robust? :) If you dont have time, please encourage a friend to try this out. One with multiple different controllers to test with would be ideal.

raelgc commented 9 years ago

@gyates100895 Do you think you can port this to run in 15.04 with systemd? My idea is basically, start first publish this for 15.04.

BurninTurtles commented 9 years ago

Already reading up on it but so far yes. If you know of a resource similar to the upstart cookbook for systemd i would really appreciate it though.

BurninTurtles commented 9 years ago

Will probably work on just the core job with hotplugging before I try handling multiple controllers though. Its so different but I see the potential lol

raelgc commented 9 years ago

@gyates100895 I have in my notes a systemd cookbook for upstart users. Let me find it.

raelgc commented 9 years ago

Found it: https://wiki.ubuntu.com/SystemdForUpstartUsers

BurninTurtles commented 9 years ago

Thoroughly familiar with that page but it is helping after multiple read throughs. Seems that I relied too much on scripting. Oh well, the challenge is good. If and when @grumbel addresses issue 35 related to unregistering a disconnected controller within the daemon, I could eliminate the need for instances, and avoid the work of determining what arguments to use per instance

Grumbel commented 9 years ago

Just a random aside: Has anybody looked at the xpad driver that Valve ships with SteamOS? From what I heard that fixes most of the issues with the old xpad driver, but I haven't looked at it myself.

xboxdrv itself was never really meant for all that hotplug stuff, as the main point of it was to have custom controls per game, which doesn't really work that well with hotpluging or multiple controllers. The daemon mode sort of addresses that, but I never had any use for it myself, so it never really was more then a half done proof of concept. I'll look into it one day, but I can't promise anything quick.

For most people the xpad driver is probably the better choice at this point.

BurninTurtles commented 9 years ago

All understandable. Hey half done is working so far lol I've always preferred your driver for the exact reason you stated, customizability coupled with clarity and extendability. While this is visible to you though, thank you for the work you've done :)

raelgc commented 9 years ago

Oh @Grumbel, what a honour! :bow:

Last time I tried Valve xpad, it had 2 problems with wireless: the position light of the gamepad never stop blinking, and basically no ability to turn off the gamepad other than remove the batteries. Need to check again.

raelgc commented 9 years ago

And just to clarify: basically the @gyates100895 idea (what is amazing and if I correctly understood) is to watch dbus for new gamepads and then start xboxdrv accordingly.

BurninTurtles commented 9 years ago

Yes. Although I never considered dbus, most likely from reverent ignorance. I will look into an implementation of this with dbus for the systemd version. For this package though I think simplifying the shell scripts would be suffice. Rael thank you but actually My idea was to just match every USB event against the existence of a file. In hindsight sounds not ideal but seems to work quickly lol and for the record, I'm not even 20 yet, so I hope that any merit this establishes is at the very least impressive enough to inspire patience xD

BurninTurtles commented 9 years ago

Oh, @grumbel, to address your comment further, I'm a bit confused on using daemon mode possibly for the reason you mentioned, that is was just for proof of concept . I think that that is in part why I wanted to modify this. In my mind, I've framed xboxdrv as a sort of standalone controller interpreter, and that this projects purpose is to determine if and when to start the driver for present controllers, appending specific arguments based on type if need be.

raelgc commented 9 years ago

@gyates100895 Fine to watch usb files too. The whole idea (from you) of watch for connected devices and then start xboxdrv for each one is great :)

BurninTurtles commented 9 years ago

@raelgc thank you :) always helpful to know I'm both on a good track and not doing it entirely wrong lol today is read day and the morning most likely I'll start the systemd version. I'll start a new project for it for now, both to further learn git and keep the work seperated. Once it's mature we can go forward with that team repo if you like. Teams usually work better lol

raelgc commented 9 years ago

@gyates100895 If you want to create the team repo and add me, go ahead :)