Saturday, January 23, 2016

Making The 8Bitdo NES30 Pro Work With RetroPie On Raspbian Jessie

Last night was long.

I've got a shiny new Raspberry Pi model B running NOOBS. I've got an 8Bitdo NES30 Pro bluetooth joypad. I've installed RetroPie on the thing using the RetroPie-Setup script.

All I wanted to do was to get the controller to work.

And no matter what I did, Emulationstation refused to recognise it. Even when it - occasionally - paired via Bluetooth.

After hours poring through endless forum posts mainly involving instructions to use bluez-* scripts that no longer exist on Raspbian Jessie, I had run out of hair to tear out and was ready to start tearing out other people's.

Finally, at about 4am, I found The Magic Forum Post containing the actual solution that worked for me. If you are reading this and you are in a similar situation, hopefully this will also work for you.

If your problem is that you can get the controller to pair but Emulationstation swears blind that it can't see any controllers, and when you press F4 you get a whole lot of SDL errors about key 314 not being recognised, hopefully this is your answer.

Basically the problem is this: for some reason the system sees the NES30 Pro as a keyboard and mouse, but not as a joystick. The fix is to add a udev rule that forces it to be registered as a joystick.

Creating the following file, called 10-local.rules in /etc/udev/rules.d accomplishes that:

# Add the ID_INPUT_JOYSTICK attribute to the device so SDL picks up on it

SUBSYSTEM=="input", ATTRS{name}=="8Bitdo NES30 Pro", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"

I altered the ATTRS{name} bit from The Magic Forum Post to reflect the exact name given to my 8Bitdo controller by the system (eg output of hcitool scan when the thing is ready to pair) and you should do the same.

Yes, it's a bodge. But it's a bodge that works, and that's what you need when all you really want to do is play Super Mario Kart and not stay up all night reading forum posts with conflicting advice.

It is not clear where the actual problem lies: is it the controller's fault for not reporting itself successfully as a joystick, is it somehow udev's fault for not recognising the controller as a joystick, is it SDL's fault for not recognising 8Bitdo's products, or is it somehow all of these and none? With such a nasty interaction bug between three systems (five, if you count Emulationstation and RetroPie themselves) it certainly doesn't look like there'll be a proper solution any time soon.

Meantime, bodge away and you're sorted. Further background on the fix can be found at The Magic Forum Post. Hopefully you have found this post before 4am.

Good luck!

No comments :