Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Driver] mk_arcade_joystick_rpi GPIO Driver
At this point, I don't want to push a update to Github for this "work in process" modification.

- [Pushed to Github] debug parameter added to output various debug data to dmesg.
- [Pushed to Github] ADC_OffsetCenter() : constrain corrected value for 0-4095 to 1-4094 to try to fix Reicast analog input overflow when using evdev.
- [Pushed to Github] adc_val default is now 2048 (was 0).

Attached file is not to be considered a update but a testing file.
So after some dig, when the driver fail to get analog value, there is 2 possibles return:
110 : Connection timed out
5 : I/O error (due to noises?)

Maybe found the source and the solution for the i2c problems.

To my understand i2c-bcm2708 driver emulate SMbus functionality, there is part of the problem if the CPU is not able to track all simultaneous (or in a very short time) transactions.

The solution so far is to change in /boot/config.txt :  "dtoverlay=i2c1-bcm2708,sda1_pin=44,scl1_pin=45,pin_func=6" to "dtoverlay=i2c1-bcm2708,sda1_pin=44,scl1_pin=45,pin_func=6,combine=off"

Note: this workaround work fine on CM3L+ but have strange behave on some CM3L.
Due to how evdev work, this is a "glitch" when a program read analog value from '/dev/input/input0', this can be easily seen via 'evtest'.
Fuzz and deadzone parameters are simply ignored.
This problem does not exist when reading from '/dev/input/js0' via jstest.

Edit: This is normal, evdev and joystick are 2 different things.

The workaround for deadzone could is to constrain the analog values in the driver.
For fuzz, there is nothing to do.

/include/uapi/linux/input.h:66 : struct input_absinfo
@flat: values that are within this value will be discarded by joydev interface and reported as 0 instead.

- [Pushed to Github] Workaround to apply analog deadzone to evdev, addition of ADC_Deadzone() function, no additional modification in config file.
Implementation of a program to allow end user to create a new configuration from scrach.

To this point, analog and GPIO work fine, but user may need to reconfigure inputs from EmulationStation settings menu and also restart it's device after everythings done.

Feature to allow only update of analog calibration on a existing configuration.
We've been testing the current version you have on GitHub, seems that the analog calibration program doesn't output the correct values to the .conf file. We had to change the axis values manually to get them to work. For reference, we were using the Switch Joy-Con analog sticks.

I will probably dive through your code on my fork (mootikins/mk_arcade_joystick_rpi) and will let you know if there's anything I can do.
Can you post the .conf file please, I think I know from where it come.

The axis with wrong value has also AXISdir=-1, in this case this is normal.

I have never been able to use analog stick the carbon traces connector, too fragile for my big hands :S
options mk_arcade_joystick_rpi map=4 hkmode=1 i2cbus=1 auto_center_analog=1 x1addr=72 y1addr=79 x1params=1251,2890,16,300 y1dir=-1 y1params=2884,928,16,300 x2addr=75 y2addr=77 x2dir=-1 x2params=3048,782,16,300 y2dir=-1 y2params=3245,1172,16,300 gpio=4,17,6,5,19,26,16,18,23,24,15,14,-20,42,37,36,35,-1,-1,-1,-1

This is after a fresh run through, binding the power slider to hotkey on normal mode.
- Hotkey mode is ok
Note: Normal mode in the driver mean you need to stay pushing the input to allow hotkey, for power slider you need to use Toggle.

Y1, X2 and Y2 are reversed (y1dir=-1), there values are reversed as well, this is normal.

Values reported to user right after the calibration done does not include the reverse value to avoid any confusion:
X1: 1251,2890 and X2: 3048,782 -> Ok something is wrong, lets try again...

Having the reversal process done into the driver is very important for emulator that not have autoconfig from EmulationStation.

Also, most of the time after updating the configuration, rebind in EmulationStation is needed since buttons allocation can shift.
We did try to rebind the keys in EmulationStation, but many of the buttons didn't work. The left analog stick would sometimes not output "presses" to EmulationStation (probably wasn't hitting max reliably), the LT/RT wouldn't activate, and some other minor issues.

I'm trying my hand at making a bash script that will do much of the same thing as your program, but utilizing built in utilities like evtest to find the min and max.
Even after reboot?

This is weird, I tested this version on 2 systems on my side without problem, dual PS Vita 1000 and dual PSP 1000.
I also tested it with Hipcat without that much troubles.

A start I was thinking about evdev and joydev, the problem with this is that min and max are already apply to the value you read :/

Forum Jump:

Users browsing this thread: 1 Guest(s)