atvdude01
Posts: 23
Joined: Wed Oct 03, 2012 8:01 pm

Re: Multi-console gamepad driver for GPIO

Sat Dec 08, 2012 6:55 pm

marqs wrote:
atvdude01 wrote:Well i tried this driver with a gamestop ps2 controller and it didnt work... anyone ever try it with a game stop one?
I've tried GameStop-branded Mad Catz Control Pad Pro, which worked OK. You could try to raise the access delay, although it has a negative impact on performance. The original driver code had 25us as the default btw.
well i just tried increasing the delay but still nothing.... im testing useing the jstest /dev/input/jsX. i have ps2 controller connected to pad 4 (gpio 7).... hopefully i can get it working....

Joedarlow
Posts: 5
Joined: Thu Sep 06, 2012 5:22 pm

Re: Multi-console gamepad driver for GPIO

Mon Dec 24, 2012 5:02 pm

how do get a nes pad working i know how to connect it but how do i set up the gamecon driver that ive installed via retro pie setup script.

marqs
Posts: 200
Joined: Sat Jun 09, 2012 11:34 am

Re: Multi-console gamepad driver for GPIO

Tue Dec 25, 2012 9:28 am

Joedarlow wrote:how do get a nes pad working i know how to connect it but how do i set up the gamecon driver that ive installed via retro pie setup script.
The README (/usr/share/doc/gamecon_gpio_rpi/README.gz) describes the setup procedure in detail. Basically, you need to use the following command:

Code: Select all

modprobe gamecon_gpio_rpi map=<pad1/GPIO0>,<pad2/GPIO1>,<pad3/GPIO4>,<pad4/GPIO7>,<pad5/GPIO2>,<pad6/GPIO3>
where you replace the appropiate tags with a suitable parameter (2 = NES pad, 0 = no connection).

mercraus
Posts: 3
Joined: Sat Dec 29, 2012 12:04 pm

Re: Multi-console gamepad driver for GPIO

Sat Dec 29, 2012 12:12 pm

Can you please help me? I keep getting the "module_layout" symbol error. I think I've tried every possible method of install:
RetroPie Script
Both header files from your site
Both gamecon files from your site

Each time I've removed the existing module before installing the new one. Am I missing something, or is my firmware just too new and I need to wait for a new header file on your website? Is it possible for me to just edit the code and fix the "module_layout" symbol myself?

Thanks in advance for your help.

marqs
Posts: 200
Joined: Sat Jun 09, 2012 11:34 am

Re: Multi-console gamepad driver for GPIO

Sat Dec 29, 2012 4:41 pm

mercraus wrote:Can you please help me? I keep getting the "module_layout" symbol error. I think I've tried every possible method of install:
RetroPie Script
Both header files from your site
Both gamecon files from your site

Each time I've removed the existing module before installing the new one. Am I missing something, or is my firmware just too new and I need to wait for a new header file on your website? Is it possible for me to just edit the code and fix the "module_layout" symbol myself?

Thanks in advance for your help.
Yeah, the new firmware uses 3.6.11+ kernel and needs new headers. I added them to my site, and they can be now installed by RetroPie script. I recommend removing old header and gamecon versions first, though (apt-get purge linux-headers-3.2.27+ gamecon-gpio-rpi-dkms-0.5).

mercraus
Posts: 3
Joined: Sat Dec 29, 2012 12:04 pm

Re: Multi-console gamepad driver for GPIO

Mon Dec 31, 2012 3:05 pm

marqs wrote:
mercraus wrote:Can you please help me? I keep getting the "module_layout" symbol error. I think I've tried every possible method of install:
RetroPie Script
Both header files from your site
Both gamecon files from your site

Each time I've removed the existing module before installing the new one. Am I missing something, or is my firmware just too new and I need to wait for a new header file on your website? Is it possible for me to just edit the code and fix the "module_layout" symbol myself?

Thanks in advance for your help.
Yeah, the new firmware uses 3.6.11+ kernel and needs new headers. I added them to my site, and they can be now installed by RetroPie script. I recommend removing old header and gamecon versions first, though (apt-get purge linux-headers-3.2.27+ gamecon-gpio-rpi-dkms-0.5).
Thanks! I was banging my head against the wall wonder what the problem was. Everything works great now.

ProtestTheGyro
Posts: 5
Joined: Tue Mar 27, 2012 11:14 pm

Re: Multi-console gamepad driver for GPIO

Tue Jan 01, 2013 3:28 pm

I'm currently on 3.6.11 using the appropriate headers and version 0.9 of the driver, and I keep getting the same issue (after multiple reinstalls of raspbian, driver and all). When running jstest on my controllers one (one physical controller, regardless of GPIO pin) does not work at all, the other only detects presses of the A button. I know both controllers work fine on my original NES, and my wiring looks fine.

marqs
Posts: 200
Joined: Sat Jun 09, 2012 11:34 am

Re: Multi-console gamepad driver for GPIO

Tue Jan 01, 2013 5:24 pm

ProtestTheGyro wrote:When running jstest on my controllers one (one physical controller, regardless of GPIO pin) does not work at all, the other only detects presses of the A button.
If only 'A' is detected, it sounds like clk and latch lines are the wrong way around ('A' is the first button read after latch signal). If that's not the case, the issue could be in timing or incompatibility with 3.3V. Are the controllers original or 3rd-party? I haven't heard that anyone else has had problems with NES/SNES pads yet.

ProtestTheGyro
Posts: 5
Joined: Tue Mar 27, 2012 11:14 pm

Re: Multi-console gamepad driver for GPIO

Wed Jan 02, 2013 12:02 am

marqs wrote:If only 'A' is detected, it sounds like clk and latch lines are the wrong way around ('A' is the first button read after latch signal). If that's not the case, the issue could be in timing or incompatibility with 3.3V. Are the controllers original or 3rd-party? I haven't heard that anyone else has had problems with NES/SNES pads yet.
I'm using original NES controllers, the first thing I checked were the clock and latch lines. They are wired according to these two images:

http://tinyurl.com/axwvfkn
http://tinyurl.com/a5cod5u

There shouldn't be any issues unless there is a wiring color mismatch on my NES deck.

ProtestTheGyro
Posts: 5
Joined: Tue Mar 27, 2012 11:14 pm

Re: Multi-console gamepad driver for GPIO

Wed Jan 02, 2013 1:02 am

After rewiring everything, whichever controller is in slot 1 works fine, the controller in slot 2 now either doesn't work on only detects A presses... Both controllers are wired the same way (sharing clock and latch).

marqs
Posts: 200
Joined: Sat Jun 09, 2012 11:34 am

Re: Multi-console gamepad driver for GPIO

Wed Jan 02, 2013 10:11 am

ProtestTheGyro wrote:There shouldn't be any issues unless there is a wiring color mismatch on my NES deck.
ProtestTheGyro wrote:After rewiring everything, whichever controller is in slot 1 works fine, the controller in slot 2 now either doesn't work on only detects A presses... Both controllers are wired the same way (sharing clock and latch).
If you tap the signals from NES controller port, note that pad1 and pad2 use separate CLK lines (unofficial NES schematics here), which you should wire together when using the driver (a switch would be better if you want to retain NES functionality).

Joedarlow
Posts: 5
Joined: Thu Sep 06, 2012 5:22 pm

Re: Multi-console gamepad driver for GPIO

Fri Jan 04, 2013 6:49 pm

Sorry to bother you again but after trying to set it up With

Code: Select all

Sudo modprobe gamecon_gpio_rpi map=<pad2/GPIO0>,<pad2/GPIO1>
i keep getting

Code: Select all

-bash: syntax error near unexpected token 'newline'
what does does this mean? What do I do wrong and what do I need to do differently?

marqs
Posts: 200
Joined: Sat Jun 09, 2012 11:34 am

Re: Multi-console gamepad driver for GPIO

Fri Jan 04, 2013 10:18 pm

Joedarlow wrote:Sorry to bother you again but after trying to set it up With

Code: Select all
Sudo modprobe gamecon_gpio_rpi map=<pad2/GPIO0>,<pad2/GPIO1>

i keep getting

Code: Select all
-bash: syntax error near unexpected token 'newline'

what does does this mean? What do I do wrong and what do I need to do differently?
You're supposed to replace the <...> tags corresponding to the GPIO you use with a number corresponding to the pad type. A bit confusing explanation :roll: , but if you have two NES pads connected to GPIO0 and GPIO1, you'd configure the driver the following way:

Code: Select all

sudo modprobe gamecon_gpio_rpi map=2,2
Notice that on rev 2. Pi boards GPIO0 and GPIO1 are replaced with GPIO2 and GPIO3 (see here), so in that case you'll need to load it with

Code: Select all

sudo modprobe gamecon_gpio_rpi map=0,0,0,0,2,2
After loading the driver, it's a good idea to test the pads with jstest.

Joedarlow
Posts: 5
Joined: Thu Sep 06, 2012 5:22 pm

Re: Multi-console gamepad driver for GPIO

Fri Jan 04, 2013 10:49 pm

Thanks now I get It . Thank for your time :D

Joedarlow
Posts: 5
Joined: Thu Sep 06, 2012 5:22 pm

Re: Multi-console gamepad driver for GPIO

Sat Jan 05, 2013 9:04 am

Sorry i did what you sai to do
Sudo modprobe gamecon_gpio_rpi map=2,2
but I get

Code: Select all

ERROR: could not insert 'gamecon_gpio_rpi ' :Exec format error 
:?: any suggestions?

marqs
Posts: 200
Joined: Sat Jun 09, 2012 11:34 am

Re: Multi-console gamepad driver for GPIO

Sat Jan 05, 2013 2:42 pm

Joedarlow wrote:Sorry i did what you sai to do

Sudo modprobe gamecon_gpio_rpi map=2,2

but I get

Code: Select all
ERROR: could not insert 'gamecon_gpio_rpi ' :Exec format error

:?: any suggestions?
You probably have mismatching kernel and headers versions. Look at the outputs of the following 2 commands to check if the versions match:

Code: Select all

uname -r
dpkg -l |grep linux-headers
It seems that there's a small bug in the retropie-script - the new headers aren't installed if old 3.2.27+ headers are found. If you're on 3.6.11+, you'll need to remove the old headers manually (sudo apt-get purge linux-headers-3.2.27+) and then run "Install/update multi-console gamepad driver for GPIO"-in the RetroPie-script. That should fix it. If the driver refuses to load after a subsequent fw update, just run the same procedure in RetroPie again.

Joedarlow
Posts: 5
Joined: Thu Sep 06, 2012 5:22 pm

Re: Multi-console gamepad driver for GPIO

Sat Jan 05, 2013 6:54 pm

I've done this but I doesn't change any thing do I need to install from source code rather than binary? ;)

marqs
Posts: 200
Joined: Sat Jun 09, 2012 11:34 am

Re: Multi-console gamepad driver for GPIO

Sat Jan 05, 2013 7:09 pm

Joedarlow wrote:I've done this but I doesn't change any thing do I need to install from source code rather than binary? ;)
The source installation in RetroPie is for emulators only - it won't help in this issue. If the versions matched and you re-ran the gamecon installation, and it doesn't still load the driver, there's still an old version which modprobe tries to load instead of the most recent. Could you post the output of

Code: Select all

find /lib/modules/ -name "gamecon*"
? You can also try to load a specific version of the driver with insmod:

Code: Select all

sudo insmod /lib/modules/3.6.11+/updates/dkms/gamecon_gpio_rpi.ko map=2,2

Ragoon
Posts: 2
Joined: Thu Jan 17, 2013 4:34 pm

Re: Multi-console gamepad driver for GPIO

Thu Jan 17, 2013 4:39 pm

Hi all!!

Im having the same kind of problem as "ProtestTheGyro". I tried to hook up two NES controllers but the only response I have when running jstest is the A button on only one controller, however if I switch to the 5v pin everything works fine on both controllers. I also tried to desolder one of the controllers and I had the same result, just the A button working even when only one controller is hooked up.

I'm using stock NES controllers
Any ideas?

marqs
Posts: 200
Joined: Sat Jun 09, 2012 11:34 am

Re: Multi-console gamepad driver for GPIO

Thu Jan 17, 2013 9:55 pm

Well, that's interesting. Using 3.3V instead of the nominal 5V sure slows down the 4021 chips inside NES/SNES controllers, but I'm surprised to hear it actually causing issues. Maybe the chips in my SNES controllers are manufactured with newer process...

I'd be careful when using 5V supply, since the GPIO inputs haven't overvoltage protection. If you don't mind fiddling with electronics a bit more, you could add a resistor and diode to DATA_OUT lines (controller pin 7) in the following way, after which it should be quite safe to use 5V supply.

Code: Select all

                           (3.3V)
                             |
                             Ã  (D1)
(DATA_OUT) -----| R1 |-------|-------- (GPIO header)
R1 would be around 500ohms and D1 would a typical 1N4148 signal diode (cathode to 3.3V).

The problem could possibly be also solved by increasing the delay in the driver. This is worth trying before going to 5V. You need to edit /usr/src/gamecon_gpio_rpi-0.9/gamecon_gpio_rpi.c - try changing GC_NES_DELAY to 10 in line 414 and save it. Then you need to recompile the driver:

Code: Select all

rmmod remove gamecon_gpio_rpi     #only if loaded
dkms remove gamecon_gpio_rpi/0.9 --all
dkms build gamecon_gpio_rpi/0.9
dkms install gamecon_gpio_rpi/0.9
Then you can load the recompiled driver as usual. I hope that helps.

Ragoon
Posts: 2
Joined: Thu Jan 17, 2013 4:34 pm

Re: Multi-console gamepad driver for GPIO

Mon Jan 21, 2013 11:47 am

Hi again!
Tried to adjust the timing in the code but that didn't do anything, guess I'll have to dig out the electronics kit and make it safe to run with 5v.

chriszero
Posts: 1
Joined: Sun Jan 27, 2013 8:19 pm

Re: Multi-console gamepad driver for GPIO

Sun Jan 27, 2013 8:25 pm

Hi,

Is there a way to control the emulationstation frontend with this module?
I can play all my NES / SNES games with the module, but I need the keyboard to navigate and select the game I want to play. I've used the RetroPi script to setup all.

Is there a way to setup some kind of key combination to send a "ESC" with a contoller?

Chris

marqs
Posts: 200
Joined: Sat Jun 09, 2012 11:34 am

Re: Multi-console gamepad driver for GPIO

Mon Jan 28, 2013 6:32 pm

chriszero wrote:Hi,

Is there a way to control the emulationstation frontend with this module?
I can play all my NES / SNES games with the module, but I need the keyboard to navigate and select the game I want to play. I've used the RetroPi script to setup all.

Is there a way to setup some kind of key combination to send a "ESC" with a contoller?

Chris
It's possible to map a simple button combination as retroarch exit button (see here), but I'm afraid more versatile combinations aren't supported. Emulationstation should detect a joystick and run button configuration at the first run. If not, you may need to edit ES config manually.

petrockblog
Posts: 269
Joined: Wed Jul 04, 2012 6:12 am
Location: Germany
Contact: Website

Re: Multi-console gamepad driver for GPIO

Sun Feb 03, 2013 12:47 pm

I am also having the problem with the exec format error on a fresh installation with the latest Rasbian download ... I am no DKMS expert, so that I do not know where to look at first.
fun stuff for technics enthusiasts: www.petrockblock.com

marqs
Posts: 200
Joined: Sat Jun 09, 2012 11:34 am

Re: Multi-console gamepad driver for GPIO

Sun Feb 03, 2013 4:17 pm

petrockblog wrote:I am also having the problem with the exec format error on a fresh installation with the latest Rasbian download ... I am no DKMS expert, so that I do not know where to look at first.
Did you run rpi-update and reboot before installing the module? The kernel headers are configured against the most recent firmware (https://github.com/raspberrypi/firmware ... le.symvers is downloaded during headers installation). This means that one should always have the newest firmware before gamecon installation (3.6.11+, commit 2dca91b4e9450395e2e0c54d83302f98bd5b8c6b currently).

The same issue may rise again after a subsequent fw update, but can be fixed by running the "install/update gamecon"-option in the retropie-setup. I hope we'll get to mainline kernel soon, which would hopefully bring official header packages to solve these kind of issues once and for all...

I probably should write a short FAQ to the module wikipage - some of the issues mentioned here in this thread could be explained there along with the solutions.

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 12 guests