Corey Goettsch
Posts: 5
Joined: Sun Jul 29, 2012 9:41 pm

Getting gamepads to work

Mon Aug 13, 2012 5:19 pm


I am interested in turning my pi into an emulation box. I'vemade some good progress so far--I've got retroarch up and running. Thelast piece of the puzzle is getting my gamepad to work. I have a Logitech F510 Rumble Gamepad. It works great on my Ubuntu laptop. However, my raspberry pi won't acknowledge it. I've checked /dev/input, and I've found nothing about my gamepad . Lsusb acknowledges it's plugged in. I looked in the kernel modules, and in the /lib/modules/kernel/3.1.9=/drivers/input/ folder, there is no joystick folder. There is on my ubuntu box. Does this mean I don't have any joystick headers? I've installed both the xboxdrv package and the joystick package. Does anyone have any idea where I should go from here? Do I need to compile some headers for my gamepad? Or is there something else should do? I've only been using linux for a year or so, so I'm a relative noob. I should mention that lsmod on my ubuntu box showed that two modules were at work with this game pad: xpad.ko and ff_memless.ko. I've got ff_memless on the pi, but not xpad.ko. Any help would be greatly apreciated. Thank you so much!


Corey Goettsch

Posts: 47
Joined: Tue May 15, 2012 9:52 am
Contact: Website

Re: Getting gamepads to work

Wed Aug 15, 2012 7:50 pm

If you download the kernel source then I can confirm that /drivers/input/joystick/xpad.c is there, so it should be a simple case of compiling that into a kernel module.

This thread gives the best blow by blow description of compiling a kernel module I've seen so far (you probably need to follow up to around step 14). I'd suggest copying xpad.c to a separate directory along with Module.symvers and use a Makefile like this:

Code: Select all

obj-m = xpad.o
KVERSION = $(shell uname -r)
        make -C /lib/modules/$(KVERSION)/build M=$(PWD) modules
        make -C /lib/modules/$(KVERSION)/build M=$(PWD) clean
Ensure you use tabs rather than spaces for the indentation in the Makefile, or it won't behave.
All being well you should be able to run make and it will give you an xpad.ko file that you can install with sudo insmod xpad.ko

Corey Goettsch
Posts: 5
Joined: Sun Jul 29, 2012 9:41 pm

Re: Getting gamepads to work

Wed Aug 29, 2012 8:38 pm

Thanks so much for your reply! I'm very sorry I haven't replied: I had no idea you posted this. Let me give this a whirl tonight, and I'll let you know what happens. Thanks again!

User avatar
Posts: 82
Joined: Sat Sep 15, 2012 8:09 am

Re: Getting gamepads to work

Tue Sep 18, 2012 9:12 pm

Does anybody have xpad.ko for kernel 3.2.27+ on Raspberry Pi? I am missing it a lot.. :(

Posts: 1
Joined: Sun Nov 04, 2012 5:52 pm

Re: Getting gamepads to work

Sun Nov 04, 2012 5:59 pm

Don't know if it's still needed, but recently I was able to compile a xpad.ko for 3.2.27+ on the Raspbian Image from 2012-10-28 :)

Hope that helps.
(6.53 KiB) Downloaded 206 times

Posts: 2
Joined: Fri Jan 04, 2013 9:18 pm

Re: Getting gamepads to work

Fri Jan 04, 2013 9:31 pm

Did anyone compiled this for 3.6.11+ ?
Thanks :)

Posts: 21
Joined: Tue Jul 03, 2012 2:16 pm

Re: Getting gamepads to work

Fri Feb 08, 2013 3:40 pm

That would be awesome.

Posts: 21
Joined: Tue Jul 03, 2012 2:16 pm

Re: Getting gamepads to work

Sun Feb 10, 2013 5:15 pm

I got annoyed not having the driver, so I compiled it, here is xpad.ko for 2.6.11+ which work with raspberrypi-bootloader 1.20130203-1:

Posts: 3
Joined: Mon Mar 18, 2013 2:53 pm

Re: Getting gamepads to work

Mon Apr 01, 2013 4:43 am

Hey I'm still trying to get my F510 to work with retroarch.
When I plug it in in X mode it gets correctly listed by lsusb

Code: Select all

Bus 001 Device 008: ID 046d:c21e Logitech, Inc. F510 Gamepad [XInput Mode]
but when I try to run

Code: Select all

I get:

Couldn't open joystick #0.

Has anyone be able to make this work?


Posts: 2
Joined: Tue Oct 08, 2013 6:42 pm

Re: Getting gamepads to work

Tue Oct 08, 2013 6:45 pm

I have the same Problem.
It is listed in lsusb but not found in retroarch.

Are there any news on this?
I've read that the new Version of xboxdrv could get it to work.
But it is only part of Debian testing.
So has anybody got it to work?

Return to “Troubleshooting”