blutsucht
Posts: 3
Joined: Mon Jun 22, 2015 8:52 pm

Re: Multi-console gamepad driver for GPIO

Mon Jun 22, 2015 9:02 pm

Hi,

I'm ran into a problem which I don't know how to fix alone.

I've got a raspberry pi 2 and I connected an original SNES (PAL if that makes a difference Model SNSP-005) to the GPIO pins. I hooked data to GPIO4 and added the following to /etc/modules

Code: Select all

gamecon_gpio_rpi map=0,0,1
I can test the controller with jstest and every button gets recognized except the start and select buttons. This is my first problem.

My second problem is, that RetroArch seems to think select (or start?) is constantly pressed, so when I'm pressing another button it performs these button combination functions like reset, save state and load state. This is my second problem. However the controller works fine in jstest and Emulationstation (except for start and select).

Can anybody suggest a solution? I already tried using different GPIO pins for data but the results were the same. Also using a 5v pin for power showed the same results.

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

Re: Multi-console gamepad driver for GPIO

Tue Jun 23, 2015 7:13 am

matock wrote:Hi marqs,

I removed the headers, as you explained, but no success.

I restarted from a fresh install v3-beta3. The firmware is 3.18.11+ and the install fails at the end (cf. 1st log attached). After a rpi-update the firmware is now 4.0.5+. With this update, the install fails immediately (cf. 2nd log attached).
I restarted also from a fresh install v3-beta4. The firmware is already in 4.0.5+ and it fails immediately as above.
rps-log-files.zip
This new firmware is online since last night. So, I'm blocked because I can not reproduce the test conditions from 2 days ago, with the 3.18.16+.

May be I have to wait until v3 is more stable. But if you have new advices for me I'm ready to test.

Thank you.
I checked the logs, and for 3.8.11 I'm not sure why it fails (further info would be in /var/lib/dkms/db9_gpio_rpi/1.0/build/make.log). 4.0.5 failed because there was no corresponding headers available at the time (fixed now). I suggest trying again with the newest firmware, which should now build successfully.

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

Re: Multi-console gamepad driver for GPIO

Tue Jun 23, 2015 8:33 am

blutsucht wrote:Hi,

I'm ran into a problem which I don't know how to fix alone.

I've got a raspberry pi 2 and I connected an original SNES (PAL if that makes a difference Model SNSP-005) to the GPIO pins. I hooked data to GPIO4 and added the following to /etc/modules

Code: Select all

gamecon_gpio_rpi map=0,0,1
I can test the controller with jstest and every button gets recognized except the start and select buttons. This is my first problem.

My second problem is, that RetroArch seems to think select (or start?) is constantly pressed, so when I'm pressing another button it performs these button combination functions like reset, save state and load state. This is my second problem. However the controller works fine in jstest and Emulationstation (except for start and select).

Can anybody suggest a solution? I already tried using different GPIO pins for data but the results were the same. Also using a 5v pin for power showed the same results.
Interesting, I haven't heard of similar issues before. PAL SNES controllers are slightly different from US/JAP ones (Nintendo's region locking back in the day), but it should not matter in this context. Start&select not working ('off' in jstest?) is strange, considering the corresponding bits are in the middle of the transmitted data where the status of other button bits is correctly detected.

If you have patience and interest in testing out, you could try recompiling the driver with longer delay between the clock edges sent to the controller. For this, you need to open /usr/src/gamecon_gpio_rpi-1.0/gamecon_gpio_rpi.c and increase the value of GC_NES_DELAY in line 414 (from 6 to e.g. 20). After saving the file, you can recompile the driver with the following commands (as root):

Code: Select all

dkms build gamecon_gpio_rpi/1.0
dkms install gamecon_gpio_rpi/1.0
Other than that (and perhaps adding level shifters on the data line as described in the wiki), I can't see what could fix that,

blutsucht
Posts: 3
Joined: Mon Jun 22, 2015 8:52 pm

Re: Multi-console gamepad driver for GPIO

Tue Jun 23, 2015 9:49 am

Thanks for the answering my questions.

Yes, Start and Select simply stay "Off" in jstest when pressed. All other keys work fine and switch to "On".

I'll try recompiling with a different delay first. If that doesn't work I'll try adding level shiftes.

Since I'm a programmer this is the first time I've used to GPIOs and the first time I soldered something like a gamecontroller port to something else (only soldered guitar cables before), but since all connections seemed fine when tested with a multimeter and most of the buttons work I figured it couldn't be that bad.

Edit: Also like to say I tried two Controllers and both act the same and they both work fine on my PAL SNES.
Last edited by blutsucht on Tue Jun 23, 2015 12:00 pm, edited 1 time in total.

cizcom
Posts: 4
Joined: Tue Jun 23, 2015 9:56 am

Re: Multi-console gamepad driver for GPIO

Tue Jun 23, 2015 10:11 am

Hi.

I installed gamecom driver on my Raspberry Pi B+ model several months ago, but I decided to upgrade to a Raspberry Pi just this past week. I never had any problems installing drivers until this new firmware came out. :\

Code: Select all

DKMS make.log for gamecon_gpio_rpi-1.0 for kernel 4.0.5-v7+ (armv7l)
Tue Jun 23 08:59:51 UTC 2015
make -C /lib/modules/4.0.5-v7+/build M=/var/lib/dkms/gamecon_gpio_rpi/1.0/build modules
make[1]: Entering directory '/usr/src/linux-headers-4.0.5-v7+'

  ERROR: Kernel configuration is invalid.
         include/generated/autoconf.h or include/config/auto.conf are missing.
         Run 'make oldconfig && make prepare' on kernel src to fix it.

  CC [M]  /var/lib/dkms/gamecon_gpio_rpi/1.0/build/gamecon_gpio_rpi.o
In file included from <command-line>:0:0:
././include/linux/kconfig.h:4:32: fatal error: generated/autoconf.h: No such file or directory
compilation terminated.
scripts/Makefile.build:264: recipe for target '/var/lib/dkms/gamecon_gpio_rpi/1.0/build/gamecon_gpio_rpi.o' failed
make[2]: *** [/var/lib/dkms/gamecon_gpio_rpi/1.0/build/gamecon_gpio_rpi.o] Error 1
Makefile:1390: recipe for target '_module_/var/lib/dkms/gamecon_gpio_rpi/1.0/build' failed
make[1]: *** [_module_/var/lib/dkms/gamecon_gpio_rpi/1.0/build] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.0.5-v7+'
Makefile:5: recipe for target 'all' failed
make: *** [all] Error 2

Code: Select all

DKMS make.log for db9_gpio_rpi-1.0 for kernel 4.0.5-v7+ (armv7l)
Tue Jun 23 08:59:35 UTC 2015
make -C /lib/modules/4.0.5-v7+/build M=/var/lib/dkms/db9_gpio_rpi/1.0/build modules
make[1]: Entering directory '/usr/src/linux-headers-4.0.5-v7+'

  ERROR: Kernel configuration is invalid.
         include/generated/autoconf.h or include/config/auto.conf are missing.
         Run 'make oldconfig && make prepare' on kernel src to fix it.

  CC [M]  /var/lib/dkms/db9_gpio_rpi/1.0/build/db9_gpio_rpi.o
In file included from <command-line>:0:0:
././include/linux/kconfig.h:4:32: fatal error: generated/autoconf.h: No such file or directory
compilation terminated.
scripts/Makefile.build:264: recipe for target '/var/lib/dkms/db9_gpio_rpi/1.0/build/db9_gpio_rpi.o' failed
make[2]: *** [/var/lib/dkms/db9_gpio_rpi/1.0/build/db9_gpio_rpi.o] Error 1
Makefile:1390: recipe for target '_module_/var/lib/dkms/db9_gpio_rpi/1.0/build' failed
make[1]: *** [_module_/var/lib/dkms/db9_gpio_rpi/1.0/build] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.0.5-v7+'
Makefile:5: recipe for target 'all' failed
make: *** [all] Error 2

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

Re: Multi-console gamepad driver for GPIO

Tue Jun 23, 2015 6:33 pm

cizcom wrote:Hi.

I installed gamecom driver on my Raspberry Pi B+ model several months ago, but I decided to upgrade to a Raspberry Pi just this past week. I never had any problems installing drivers until this new firmware came out. :\
It seems that /proc/config.gz is no more generated with the new firmware, which prevents build of the drivers. I'll look into this and try to come up with a solution.

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

Re: Multi-console gamepad driver for GPIO

Tue Jun 23, 2015 8:11 pm

marqs wrote:It seems that /proc/config.gz is no more generated with the new firmware, which prevents build of the drivers. I'll look into this and try to come up with a solution.
I managed to find out a workaround for this, and now the installation should be fine from 4.0.6+ onwards.

User avatar
DougieLawson
Posts: 33625
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Multi-console gamepad driver for GPIO

Tue Jun 23, 2015 8:15 pm

sudo modprobe configs
zcat /proc/config.gz
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

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

Re: Multi-console gamepad driver for GPIO

Tue Jun 23, 2015 8:34 pm

DougieLawson wrote:sudo modprobe configs
zcat /proc/config.gz
Interesting, I suspected that I'd need to load some module to read the config when I noticed that CONFIG_IKCONFIG was set to "m" but found no further info. Thanks for the tip.

cizcom
Posts: 4
Joined: Tue Jun 23, 2015 9:56 am

Re: Multi-console gamepad driver for GPIO

Thu Jun 25, 2015 12:54 am

marqs wrote:
marqs wrote:It seems that /proc/config.gz is no more generated with the new firmware, which prevents build of the drivers. I'll look into this and try to come up with a solution.
I managed to find out a workaround for this, and now the installation should be fine from 4.0.6+ onwards.
It's saying that's successfully installed but now i'm getting "***No rule to make target." I believe this was mentioned earlier in the thread, so I have to read the thread again to see how to fix this.

Thanks.

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

Re: Multi-console gamepad driver for GPIO

Fri Jun 26, 2015 9:10 am

cizcom wrote:It's saying that's successfully installed but now i'm getting "***No rule to make target." I believe this was mentioned earlier in the thread, so I have to read the thread again to see how to fix this.

Thanks.
Are you trying to recompile the driver or how you stumble into "***No rule to make target."? I assume that's during the preparation of kernel headers, but RetroPie should report installation status as failed if the driver was not built correctly.

blutsucht
Posts: 3
Joined: Mon Jun 22, 2015 8:52 pm

Re: Multi-console gamepad driver for GPIO

Sat Jun 27, 2015 11:24 am

After some fiddeling around with different delays between the bits nothing seemed to help. But before building a circuit to run the controllers with 5v I did a sanity check and tested both controllers once again on my original SNES and now the start and select buttons on both my controllers don't work on the SNES either.

Is it possible that some faulty wiring killed start and select on both my controllers? From what I understand how the controller works it should either be completely broken (no button works) or completely fine (every button works)


Edit: Just read that it's a common issue with the SNES controllers that Start and Select Buttons wear out. I might just have been at the breakingpoint here were my first test on the SNES (before wiring them to the pi) was the last time they worked. I'll take the controllers apart and try cleaning the contact points of the buttons on the pcb. This seems to do the trick most of the time. If that is really the problem (although it seems funny that two controllers break at the same time) I'm sorry to have wasted your time, but I think I learned a how SNES controllers communicate with the SNES, so it's really not wasted time :-)

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

Re: Multi-console gamepad driver for GPIO

Sun Jun 28, 2015 7:49 am

blutsucht wrote:Edit: Just read that it's a common issue with the SNES controllers that Start and Select Buttons wear out. I might just have been at the breakingpoint here were my first test on the SNES (before wiring them to the pi) was the last time they worked. I'll take the controllers apart and try cleaning the contact points of the buttons on the pcb. This seems to do the trick most of the time. If that is really the problem (although it seems funny that two controllers break at the same time) I'm sorry to have wasted your time, but I think I learned a how SNES controllers communicate with the SNES, so it's really not wasted time :-)
No problem - I've cleaned several SNES controllers and Start&Select are usually the buttons which need most work, especially if the controllers are used after those buttons need considerable force to be registered. The controllers are easy to clean though - it's usually enough to rub dirt off from the contacts on the PCB gently with an eraser.

Silkypico
Posts: 2
Joined: Tue Jul 14, 2015 5:06 pm

Re: Multi-console gamepad driver for GPIO

Tue Jul 14, 2015 5:08 pm

So I’ve got everything working fine.

I have my set psx_delay to 25. I’ve tried other values and it would cause the gamepad to twitch out in the Emulation Station menus.

No matter what I do, the jstest always reads the left analog stick flickering UP+LEFT. This causes the characters to jump and aim UP+LEFT in Contra (NES) but it does not do it in any other game (sometimes in NeoGeo, Metal Slug).

I have a PSX controller with the analog sticks and without, it doesn’t make a difference which one is plugged in, although sometimes I have to press the ANALOG button (on) so it will read the controller, and sometimes it doesn’t.

Sometimes the controllers work normally and sometimes they don’t. I really have no idea what is going on.

Any suggestions would be appreciated.

This is tested on RetroPie 2.6 and Retropie 3.0 Beta 4. Same issues.

I’ve checked my wiring countless times.


Also will there be any support for Genesis controller?

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

Re: Multi-console gamepad driver for GPIO

Tue Jul 14, 2015 7:48 pm

Silkypico wrote:No matter what I do, the jstest always reads the left analog stick flickering UP+LEFT. This causes the characters to jump and aim UP+LEFT in Contra (NES) but it does not do it in any other game (sometimes in NeoGeo, Metal Slug).
This might be due to lack of deadzone (what's the reported flicker range in jstest?), but can't you just unbind analog stick(s) in emulator pad config?
Silkypico wrote: Also will there be any support for Genesis controller?
Genesis controllers are supported by the db9 driver, which comes along gamecon if you installed via Retropie.

Silkypico
Posts: 2
Joined: Tue Jul 14, 2015 5:06 pm

Re: Multi-console gamepad driver for GPIO

Tue Jul 14, 2015 8:24 pm

I'll post a screenshot of the jstest when I get back home. Retroarch is setup for auto-config, which is using the PSX_controller.cfg downloaded into the joypad folder. There is no configuration for analog sticks in that file. Also the controller is set to "standard". If I try using RetroPie-Setup to "configure controller", it will automatically blaze through it by itself probably because of the UP+LEFT sticks.

Also retroarch.cfg file is blank for all controller inputs. I've tried inputting it manually.

thanks I'll check out the db9_gpio.

domspitze
Posts: 1
Joined: Sun Jul 19, 2015 1:17 pm

Re: Multi-console gamepad driver for GPIO

Sun Jul 19, 2015 1:22 pm

Hi, I´m a total noob in rasperry pi. I installed RetroPie and everything works fine. Now I would like to connect 2 C64 joysticks (DB9) with the pi and I found the db9_gpio_rpi. I installed it via retropie setup. And now...??? I can´t find any new option in vice.
Is there any tutorial? Sorry for my stupid questions, but I´m Noob. By the way english isn´t my native language. Thanks!

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

Re: Multi-console gamepad driver for GPIO

Tue Jul 21, 2015 12:39 pm

domspitze wrote:Hi, I´m a total noob in rasperry pi. I installed RetroPie and everything works fine. Now I would like to connect 2 C64 joysticks (DB9) with the pi and I found the db9_gpio_rpi. I installed it via retropie setup. And now...??? I can´t find any new option in vice.
Is there any tutorial? Sorry for my stupid questions, but I´m Noob. By the way english isn´t my native language. Thanks!
You need to first configure the driver for 2 multisystem joysticks (more info here and in the README) if you haven't already done this. You can then verify that the joysticks work OK via jstest application:

Code: Select all

sudo apt-get install joystick
jstest /dev/input/js0
jstest /dev/input/js1
The last part is to setup VICE to use physical joysticks instead of keyboard, which can be done as described here.

sayonari
Posts: 2
Joined: Tue Aug 25, 2015 12:03 am

Re: Multi-console gamepad driver for GPIO

Tue Aug 25, 2015 12:30 am

Hello!

I want to use FAMICOM controller.
I already use 1p controller.

but, I cannot use 2p controller.
Does this driver not support FAMICOM style 2p controller?

When I try to use it, 4 buttons are always turn on.

I think that it causes the FAMICOM style controller have only 2 buttons (A, B, not have start, select).

Please, help!

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

Re: Multi-console gamepad driver for GPIO

Tue Aug 25, 2015 4:13 pm

sayonari wrote:Hello!

I want to use FAMICOM controller.
I already use 1p controller.

but, I cannot use 2p controller.
Does this driver not support FAMICOM style 2p controller?

When I try to use it, 4 buttons are always turn on.

I think that it causes the FAMICOM style controller have only 2 buttons (A, B, not have start, select).

Please, help!
It should support 2p controller, because it also has the same 4021 IC (start&select just not connected). How did you connect the controller to Raspberry - directly using 3.3V supply or 5V supply +level shifter?

lionking03
Posts: 2
Joined: Tue Aug 25, 2015 8:36 pm

Re: Multi-console gamepad driver for GPIO

Tue Aug 25, 2015 8:45 pm

Hi,
I installed gamecon driver on retropie 3 beta 2 few months ago (june I think) in order to use 2 original NES controller and it works great.

I've just installed a fresh version of retropie 3 RC final and tried to install gamecon drivers from Retropie_setup script and seems to be OK. But when I test NES controller only A button works (with jstest for example when I press A button all 4 buttons (start select, B and A) give ON, but no other button works).
I saw the FAQ on the github page but it don't seem that it's a power issue as it worked fine with retropie beta 2 (on the same PI2).

Is there a way to check if the driver is really correctly installed (even if the script said OK)

uname -a give me this (if it matters, quite new on linux...)
Linux retropie 4.1.6-v7+ #810 SMP PREEMPT Tue Aug 18 15:32:12 BST 2015 armv7l GNU/Linux

thanks for help (and thanks to whoever made the gamecon driver for Pi)

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

Re: Multi-console gamepad driver for GPIO

Wed Aug 26, 2015 6:35 pm

lionking03 wrote:I've just installed a fresh version of retropie 3 RC final and tried to install gamecon drivers from Retropie_setup script and seems to be OK. But when I test NES controller only A button works (with jstest for example when I press A button all 4 buttons (start select, B and A) give ON, but no other button works).
There was a similar report earlier about A button activating all other buttons. That was caused by clock and latch lines being swapped -are you sure you have identical connection than when you used the controllers with earlier RetroPie?

lionking03
Posts: 2
Joined: Tue Aug 25, 2015 8:36 pm

Re: Multi-console gamepad driver for GPIO

Wed Aug 26, 2015 7:33 pm

HI,

thank you for answering.
Well, I didnt understand I was quite sure that I never touched the hardware after the first successful attempt to have NES controllers OK, apparently, I did.

Clock and lach wasn't swapped but lach wasn't on the right place (one pin before the right one - GPIO9 instead of GPIO11)

Thanks for your help, I'm quite confuse to post anyway ...

sayonari
Posts: 2
Joined: Tue Aug 25, 2015 12:03 am

Re: Multi-console gamepad driver for GPIO

Wed Sep 02, 2015 2:43 am

marqs wrote:
sayonari wrote:Hello!

I want to use FAMICOM controller.
I already use 1p controller.

but, I cannot use 2p controller.
Does this driver not support FAMICOM style 2p controller?

When I try to use it, 4 buttons are always turn on.

I think that it causes the FAMICOM style controller have only 2 buttons (A, B, not have start, select).

Please, help!
It should support 2p controller, because it also has the same 4021 IC (start&select just not connected). How did you connect the controller to Raspberry - directly using 3.3V supply or 5V supply +level shifter?
It is a self-less.
solved.

famicom controllers were different color scheme of 1P and 2P in line.
I did not know it. (Because I thought it’s the same color scheme, it did not work)

Code: Select all

Pin	|FC1P		FC2P		NES
------+----------------------
VCC	|White 	Blue  	White
CLK	|Yellow	White 	Red
P/S	|Orange	Yellow	Orange
OUT	|Red   	Orange	Yellow
GND	|Brown 	Red   	Brown
mic	|/     	Brown 	/

Soullous
Posts: 16
Joined: Sat Nov 28, 2015 10:49 pm

Re: Multi-console gamepad driver for GPIO

Tue Dec 01, 2015 5:48 am

Hello,

I've got two PSX controller ports wired to the Raspberry Pi (v2), using the gamecon_gpio driver, they seem to be working, OK for the most part, except for a few issues. I have two original Sony PS2 DualShock controllers, and one original Sony PS1 DualShock controller.

1) The left analog stick does not register on any of them in EmulationStation, although they register in jstest. I've seen mentions of several other people with the same issue, but have yet to see a solution.
2) The Start and Select buttons do not register on the PS1 controller. This is unfortunate, since I'm doing a PS1 case mod, and would like to use original PS1 controllers.
3) I'm not sure if it's an issue or not, but jstest shows constant movement when in analog mode. I'm assuming because the analog sticks are not properly calibrated. I've seen several posts mention running a program called jcal to calibrate them, but I don't seem to have this installed and I'm not sure where to find it. I tried installing a jcal package through apt, but it appears to have something to do with Julian calendars. Not what I'm looking for. Apparently the program is called jscal, which I found and ran jscal -c /dev/input/js0, but it doesn't seem to matter how I calibrate it. jstest still shows constant movement from the analog sticks.
4) Certain PS1 games don't seem to be registering the controller correctly, using lr-pcsx-rearmed. For instance, on Crash Bandicoot, I can't get past the title screen. No buttons seem to register here. On Oddworld: Abe's Odysee, I can navigate the title screen just fine, but once the game starts, it says "Unsupported Controller in Port 1". Both of these games worked fine before I had the controllers set up and was just using the keyboard for input.

Any help would be greatly appreciated.

Thanks!

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 7 guests