-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
Two DualShocks connected via bluetooth - only one is remapped #766
Comments
So, when the DS4 are connected via USB (and bluetooth is off) input-remapper does see 2 devices and remap the 2 correctly. Is this a bluetooth config error on my side or something to be implemented in input-remapper? |
You're welcome Run
which might help identify the problem |
Hello, here is the output with the 2 DS4 connected via USB and here is the one when connected via bluetooth in both cases, 10 devices are 'received' : USB: Bluetooth: Thank you! |
The problem is, that quite often one hardware-device is represented by multiple uinputs in /dev/input, each one of them reporting different kinds of events. To avoid confusion in the gui, they are grouped together. When recording inputs, they are recorded from all those devices at the same time. Your two gamepads appear to be grouped together in that fashion. input-remapper fails to figure out that they are actually two distinct gamepads. This happens in No idea how an easy fix for this could look like. Try running this small python script with sudo: import evdev
for path in evdev.list_devices():
input_device = evdev.InputDevice(path)
print(input_device.name)
print('uniq', input_device.uniq)
print('phys', input_device.phys)
print('info', input_device.info)
print('version', input_device.version)
print('path', input_device.path)
print() The info printed here is what we have to work with. |
I want to echo OP: input-remapper is amazing, thank you so much for this. I have this same problem with simultaneously using two Logitech MX Ergo Mice: input-remapper 2.0.1 a012746 python script from above:
Let me know how I can help here with any debugging/testing/other info that could be helpful. Note: this used to work and stopped working a while back, but I don't remember when it stopped working. Also fun: which mouse works changes often :) Thanks again for all your hard work here! It is very much appreciated, you literally have made it possible for me to use my devices on linux, thank you.
|
Here is the result of the python script (I've removed the other devices)
|
I have some hopes that by including "uniq" into the function after all, this can be improved. For all of my devices uniq is just empty, but it looks like it could work for you.
is this with only one gamepad connected? What if you connect both of them via bluetooth and run the script?
Thank you! |
There might be another problem. input-remapper creates generic target uinputs, and if you have two different gamepads and map buttons on each one of them to another button/macro (lets say Left-Trigger to BTN_A on gamepad 1, and Right-Trigger to BTN_B on gamepad 2), then BTN_A and BTN_B appear in the same generic gamepad output. It will look to the game as if a third gamepad is connected. This would require the target selection to allow injecting them into the "forwarded" device. This is most likely easier said than done, due to the architecture. |
This is with the 2 DS4 connected via bluetooth:
|
Try the "uniq" branch. Let me know if you have trouble installing it: https://github.com/sezanzeb/input-remapper/tree/uniq |
Thx, so just |
That might work for you, but you'll need to install it system-wide via For me, this doesn't work, because of this annoying issue: pypa/wheel#92. try git clone https://github.com/sezanzeb/input-remapper.git
cd input-remapper
git checkout uniq
sudo python3 setup.py install
should print
|
in a console, run
then open the gui and try again. The resulting logs might tell us why |
So I tried different things and can confirm:
If I disable 'autoload' on both and then apply presets manually on both, it works. |
So the old version (without the patch from the uniq branch) was still running in the background, oops. autoloading doesn't work, because input-remapper-control sends the device name, and nothing else. So the daemon will never know for which of your two controllers to autoload. This is an unfortunate problem. This needs adjusting in the dbus endpoints of the daemon and the the udev rule. However, you might get around the issue by running |
I tried running |
For the future, it might be better if instead of sending the device name, the device path is sent to input-remapper-service via dbus. the service could then probably figure out to which group this path belongs. |
UPDATE: after a reboot the "uniq" branch is auto loading for both of my Logitech MX Ergo mice without me doing a custom call to input-remapper-control, just the following startup application in Ubuntu 22: bash -c "input-remapper-control --command stop-all && input-remapper-control --command autoload" Original comment for reference: Thanks for working on this! Updates for my 2 logitech mx ergo devices: TL;DR: 'uniq' branch works for my 2 logitech ergo devices, but autostart now doesn't for all devices. I have to manually start, but that works, thank you so much for this. Details in case this is useful, happy to do more testing, mention me in a comment/reply with anything you'd like me to try/test/report back on. Long version: Ubuntu 22.04 LTS with x11 (not Wayland):
neither worked because (I later learned from the deamon output) was using 'wheel-right-and-left.json' and it was looking for 'wheel-right-and-left.json.json' both still worked after I go into the UI and manually click "apply" for each
sudo input-remapper-control --command start --device 'Logitech MX Ergo' --preset 'wheel-right-and-left' BOTH NOW WORK! Awesome progress :) Disconnected both devices (but left logitech dongle, the mx ergo devices have a button that allows to switch between two different dongles, so I switched them both to the other computer to see if the preset loading works if the device isn't connected but the dongle is) -- and it worked!
BOTH NOW WORK! Awesome progress :) Will need to manually run all the presets but I can set up a startup application script to do this. Can't thank you enough, this is enough for me to be able to use both going forward. But it's still not ideal for others since the "autoload" switch is ignored for all devices on the "uniq" branch for me. Happy to test any future updates, mention me and let me know if there's anything you want me to test for you with these logitech devices. I expect this loading wouldn't work with a device disconnected like mfauvain DualShock problem above, but for me the logitech dongle is always plugged in and seems to not need the mouse actually connected to still have the mapping work. Thanks so much for the quick work on this and for getting this to workable for me, so much appreciated :) :) |
UPDATE: after a reboot the "uniq" branch is auto loading for both of my Logitech MX Ergo mice without me doing a custom call to input-remapper-control. I do have the following startup application on Ubuntu: bash -c "input-remapper-control --command stop-all && input-remapper-control --command autoload" Thanks so much for this work! Let me know if there's anything I can do to help test further. |
yeah, this is included by default: https://github.com/sezanzeb/input-remapper/blob/main/data/input-remapper-autoload.desktop
The daemon won't attempt to autoload. It will only do so when input-remapper-control communicates with it, because the daemon runs as root and therefore doesn't know for which user to autoload. So this is fine
It still won't autoload when you disconnect and reconnect one of your mice, right? I honestly don't remember the details well, but I'm assuming |
So one of the things I like about these Logitech MX Ergo mice (besides the ergonomics, highly recommended) is that there is a dongle that seems to keep the device info and I have one dongle in one computer, and another dongle in another, and the button on the mice let's me switch between. So I think that there's no "disconnecting" since the dongle is reporting the devices not the devices themselves. So far every reboot since both Logitech MX Ergo mice have their mappings auto-loading regardless of if they were connected to this computer's dongle at boot (which is exactly what I want). I haven't tested manually unplugging the dongle and rebooting to see if the autoload still works, I can do that if you'd like.
Again, I think this is becasue the dongle is always present and reporting the devices even if not plugged in. Let me know if there are specific things you'd like me to test with these or other devices (I have a few other ones I use with input-remapper, too, but they don't have duplicate devices so they always just work on both the master and the uniq branches) Thanks again for all your time and effort here!!! So very much appreciated. |
Hi, first, thx for input-remapper, brilliant work.
I am trying to apply the same preset to 2 connected DualShock4.
When only one is connected (doesn't matter which one) it works perfect. However when 2 are connected, only one gets the remapping.
Anyway to get 2 controllers remapped at the same time?
The text was updated successfully, but these errors were encountered: