What's new

Multiple controllers, same name, different mapping

bmxmann

New member
Hello,

Hate for my first post to be a controller issue, but I have been hitting my head against the wall the past couple days trying to get it to work, and am now pretty much admitting defeat and asking for help.

First my setup:

Mupen64plus version 2.0.0
Running on ubuntu 14.04 LTS 64-bit

Here is my situation, I purchased two USB N64 controllers off Amazaon, one of them is a Retro link, the other a no-name generic (did not buy them at the same time). My problem though is they both show up in Mupen as 'Generic USB Joystick '. Now this wouldn't be a problem if i could have the mapping the same, but I cannot as they keys do not match between the controllers. IE the trigger is button 7 on one and 8 on the other.

I cannot find where it is coming up with this name ('Generic USB Joystick ') or how to change it. I have tried all sorts of things, creating udev rules, to editing the udev ID file with no luck. I was able to get lsusb to display different names by editing the usb.ids file in (/var/lib/usbutils) but this has no affect on the name that Mupen shows or that doing a "cat /proc/bus/input/devices".

Here is my (relevant) output from "lsusb"

Bus 003 Device 019: ID 0079:0006 DragonRise Inc. RetroLink
Bus 003 Device 020: ID 0079:0002 DragonRise Inc. GenericN64

(NOTE: I set those names "RetroLink" and "GenericN64" in the usb.ids file)

Here is my (relevant) output from "cat /proc/bus/input/devices"

I: Bus=0003 Vendor=0079 Product=0006 Version=0110
N: Name="Generic USB Joystick "
P: Phys=usb-0000:00:14.0-9/input0
S: Sysfs=/devices/pci0000:00/0000:00:14.0/usb3/3-9/3-9:1.0/input/input33
U: Uniq=
H: Handlers=event15 js0
B: PROP=0
B: EV=20001b
B: KEY=fff00000000 0 0 0 0
B: ABS=3002f
B: MSC=10
B: FF=107030000 0

I: Bus=0003 Vendor=0079 Product=0002 Version=0110
N: Name="Generic USB Joystick "
P: Phys=usb-0000:00:14.0-10/input0
S: Sysfs=/devices/pci0000:00/0000:00:14.0/usb3/3-10/3-10:1.0/input/input34
U: Uniq=
H: Handlers=event20 js4
B: PROP=0
B: EV=1b
B: KEY=fff00000000 0 0 0 0
B: ABS=3002f
B: MSC=10

What I would like to know, is where does the N: Name="Generic USB Joystick " come from in that output, and can I change it? Seemingly wherever this is being pulled from is also what Muppen is looking at (only spot I have found that had the odd spacing in it). If I can change it for one controller (assuming I can as they have different Product ID numbers) then I can get these things to have separate mappings. This is an example of the udev rule I tried to create, though looking through docs on udev it appears the "NAME" option may only be for network interfaces. This was placed in another working udev file for some flight sim pedals I have.

KERNEL=="event*", ATTRS{idProduct}=="0002", ATTRS{idVendor}=="0079", NAME="GenericN64"

Or, is there a way for the AutoCfg.ini file to look for something other than the name? such as the vendor and product ID?

But was of no use.

Appreciate any assistance. Hopefully there is some easy option that I am just missing!

Thanks,

Nick

EDIT: I think this removes some of the extra spaces in the name that mupen shows for some reason, so here it is but instead of spaces dashes.

"Generic---USB--Joystick--"
 
Last edited:

V1del

New member
Aside from forcing a specific name in the kernel which is probably a tad out of scope here, you can edit ~/.config/mupen64plus/mupen64plus.cfg and set the mode parameter under the specific [Input-SDL-Control#] to 0 and manually assign the correct buttons, you can use sdljoytest to find out which buttons correspond to which input and edit accordingly.

Btw kudos to such a thouroughly researched post, its nice seeing people putting in some effort before asking :)
 
OP
B

bmxmann

New member
Aside from forcing a specific name in the kernel which is probably a tad out of scope here, you can edit ~/.config/mupen64plus/mupen64plus.cfg and set the mode parameter under the specific [Input-SDL-Control#] to 0 and manually assign the correct buttons, you can use sdljoytest to find out which buttons correspond to which input and edit accordingly.

Btw kudos to such a thouroughly researched post, its nice seeing people putting in some effort before asking :)



Thank you for your help, by editing that file I was able to get it working, but not without some more frustration! Not sure what it was about this, or just other stresses with work but it was driving me crazy! In case anyone else runs into similar issues, here are some of my notes:

the .config/ folder is a hidden folder in the user directory, in ubuntu at least if you open up your home folder then do CNTRL + H, it will show the hidden folders and it will be in there.

I had to set my mupen64plus.cfg file to read-only after editing it, otherwise it would re-write parts of the controller config, and was typically pushing my controllers from being controllers 1 and 2 to being controllers 3 and 4, even though I set 1 and 2 to be fully manual (Via 0). So after I was done editing my controllers, I would just go to the file, right click properties, then permissions tab, then set all of them to read-only. Close, then if I needed to change anything, had to go back and set it to read-write, ect.

I set controllers 3 and 4 to be fully manual, in addition to setting the "Plugged" option to false. There were still times it was pushing one of my controllers to 4 even though it should not have been plugged in.

I was not able to get SDLJoytest to work correctly for me I think. I could only get it to display basic info, and only by downloading one that was labled SDLJoyTest-Linux32. I could not get the one on sourceforge to install.... the readme was blank, and when I would try to install by sudo "./install.sh" it would report it was missing a folder or files. Unsure what happened there. Either way, I was only able to get the one to do anything by running "./SDLJoyTest-linux32" in the folder I extracted it to.

My BIGGEST problem though, was that initially I was trying to get these to work while I still had my Saitek flight yoke still plugged in... (as I am lazy and prefer to leave it plugged in) I could not get it to work at all with this, SDLJoytest would show it as Joystick 0, and even though I would set the Mupen config to use joystick 1 as controller one (which SDLJoytest showed as one of my N64 controllers), it would not work. So lesson would be to remove all other NON 64 controllers when messing about with this. Once I unplugged it, everything fell into place relatively easily.

Hopefully this helps.
 

Top