kozec / sc-controller

User-mode driver and GTK3 based GUI for Steam Controller
GNU General Public License v2.0
1.53k stars 128 forks source link

Add Samsung Gear VR Controller support #399

Open rdady opened 6 years ago

rdady commented 6 years ago

Of course it would be nice to use the Gear VR Controller with sc-controller!!!! I have built a POC code for the gearvrcontroller in python3, which I would love to contribute to this project. The controller is recognized as other device, not as a HID. The user needs to pair and connect to PC via bluetooth, the program reads the touchpad absolute coordinates and issues uinput mouse relXY displacement. The mouse movement is kind of funny, no smoothing implemented yet. Interested?

kozec commented 6 years ago

Interested?

Definitely, although if we are talking about this device, one may need two to cover most games :)

rdady commented 6 years ago

That is exactly that device. I don't know, whether you need 2 of them, maybe. The amazon deal sells one headset with one controller. Everyone has a different usecase, mine would be one handed mouse - browsing around while having my newborn on my shoulder and not being able to lean as close to the PC as usually. A SC is not easy to hold in one hand. I consider the gearvrcontroller being the one handed brother of the SC.

In my opinion sc-controller is sometimes used beyond gaming as well - and that is cool :)

rdady commented 6 years ago

Hi again, I came so far. The pointer smoothing is really a point I haven't come clear with. https://github.com/rdady/gear-vr-controller-linux

My code mainly relies on these: https://github.com/jsyang/gearvr-controller-webbluetooth/blob/master/ControllerBluetoothInterface.js http://jsyang.ca/hacks/gear-vr-rev-eng/ https://github.com/jsyang/gluetooth/blob/master/gear-vr-controller.bluetooth.js

I just connected the progress others made, like reverse engineering the data stream, bluetooth GATT characteristic reading and writing to uinput.

kozec commented 6 years ago

I came so far. The pointer smoothing is really a point I haven't come clear with.

There is pointer smoothing code in SC-Controller that could be used. It's fairly simple - just remember X last positions that HW sent and use weighted (or normal, but weighted works better) average as output.

rdady commented 6 years ago

Yes, I have already seen it. The thing is, that the touchpad gives readings between 10-315 unlike a SC from -32767 to +32767. Untouched reads as touchposition 0,0. And the refresh rate is also below the SC, which I haven't measured yet. I will give it a try xdotools as well, instead of uinput.

Edit: I am almost done with my scenario, only keeping alive won't work for now. I've updated the above link.

Edit2: I am satisfied with this controller, you will be as well if you got one. :) I moved the project to github https://github.com/rdady/gear-vr-controller-linux Works as expected for. It will be definetly fun seeing this integrated into sc-contoller :)

parkerlreed commented 5 years ago

@rdady Just stumbled across your project after looking for forever (granted a few months back)

Love it!