LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Gamecon_gpio_rpi driver modifications causing unexpected kernel messages (https://www.linuxquestions.org/questions/programming-9/gamecon_gpio_rpi-driver-modifications-causing-unexpected-kernel-messages-4175659833/)

Katemonster 08-26-2019 11:55 AM

Gamecon_gpio_rpi driver modifications causing unexpected kernel messages
 
Hi all! First post here. Hope this isn't too much of a doozy.

I've made a hobby out of taking old Playstation consoles, ripping out the guts and putting a Raspberry Pi with Retropie in their place to make a powerful little retro gaming system. When I first started doing this, the first thing I insisted on, no matter which old system I used, was to make the original controllers function with the system.

So to that end I started using the gamecon_gpio_rpi driver to do the controller communication. However, one thing I noticed very early on was that the wiring for 2 controllers using this driver was different than how the original playstation system wired them. If you consider the following list of signals coming from a PSX controller:

P1: DATA
P2: CMD
P4: GND
P5: +3.3V
P6: ATT(Attention/Select)
P7: CLOCK
P9: ACK(Acknowledge)

On the original driver, all wires except the DATA wire are intended to be tied together between both controllers. On the PSX, everything but the ATT wires are tied. Also, the ACK pin is left unconnected in the Pi driver.

So the main focus of my changes was to change the wiring and code, so that I could wire the Pi like the PSX. I also added code to consider the ACK line between each byte transmitted.

I originally wrote my code for the Pi 3. And it all worked nicely. But then the 3B+ came out, and it stopped working. I verified several times that this was the case. It wasn't a problem a little while ago, I could just go buy a 3 in lieu of the 3B+ and I'd be fine, but now the local store doesn't carry the 3, not to mention the 4 is out, so i have to figure this thing out.

Where I'm at now is that it's almost working. When you configure the driver for 2 controllers and hook a single controller in, the input recognition is sketchy, and unreliable. But configure it for 1 controller and it works pretty well. When it's not working so well, dmesg fills up with errors like this:

Code:

huh, entered softirq 1 TIMER 08090dd0 preempt_count 00000101, exited with 08351ac5?
I'll post the full code when I get home, I'm on my phone. But I wanted to get this written out and I was hoping someone could shed some light on what that cryptic error is. It's almost assured that when I insert the driver with it configured for a pin that doesn't have a controller hooked up, those errors show up. Anyone know what causes this?

Katemonster 08-26-2019 09:43 PM

OK, finally got around to upload my code. The github repo (forked from the original) is here:

https://github.com/katemonster33/gamecon_gpio_rpi

Katemonster 08-28-2019 06:17 PM

I fixed it. No idea what the messages were.


All times are GMT -5. The time now is 05:15 PM.