-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import of Selkies JS Interposer for WebRTC to Linux Joystick support #95
Conversation
Wow. This actually works?... One aspect of testing that should be done is with Wine games and applications. |
Could this approach be expanded to allow true relative mouse cursors? |
If someone can help test, that would be great. |
I think the approach would be similar, yes. My plan is to investigate doing this for mouse emulation later so we can completely remove the dependency on uinput and have full support in container environments. |
Good to know that the approach is similar with mouse devices. Unfortunately, I don't have a real gamepad device at the moment and I am having a hard time with time management. @xhejtman perhaps interested? |
0240f55
to
57ce46e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, looks okay but was just skimming. Made comments.
- LD_PRELOAD syscall interposer to emulate gamepads. - Intercepts open() requests to /dev/input/jsX devices. - Interposer connects to selkies unix domain socket. - Interposer writes log to /tmp/selkies_js.log - Selkies WebRTC app sends Javascript gamepad events to socket. - Up to 4 simultaneous gamepads supported from WebRTC. - Build as debian package and installed to /usr/local/lib/selkies-js-interposer/joystick_interposer.so - Dev container updated to auto-load interposer. - Update to github workflow to build and publish image and release asset. - Add joystick interposer to example Dockerfile
57ce46e
to
be3c2f0
Compare
This commit is a great milestone which is a step forward from all known Linux remote desktop implementations working in containers. |
Fixes #90
Fixes #55
New features
Import of Selkies JS Interposer for WebRTC to Linux Joystick support without uinput dependency
Add turnserver to example docker image
Supported Gamepads
I've tested this with apps like retroarch and it seems to work well.
Currently only Xpad like gamepads are emulated for the button and axes mapping.
I've tested with the following controllers:
Others will surely work just fine, especially if they have similar button layouts to an Xpad.
Please let me know if there is a gamepad that doesn't work and we can try to accommodate.
Testing
The
testing
branch has been built with the new joystick interposer pre-installed and added to the default LD_PRELOAD environment variable. This branch also contains the integrated turnserver to the example container, hence the new port 3478 to the docker run command.You can test it with the example docker container like this:
Ubuntu 22.04
For Ubuntu 20.04:
Usage
jstest-gtk
to verify you see theSelkies Controller
The example docker image has these environment variables set:
The entrypoint script also creates fake jsX files in /dev/input like below to help programs that try to list the /dev/input directory discover the joystick devices:
Some software programs use different methods to discover linux joysticks. The LD_PRELOAD method seems to work for most direct linux applications and the
SDL_JOYSTICK_DEVICE
env var helps with SDL applications.