forked from Grumbel/jstest-gtk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TODO
195 lines (142 loc) · 5.68 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
Pre Release Testing:
====================
* check the version number
VERSION="0.1.0"
TAG="v${VERSION}"
git tag -s "${TAG}" -m "jstest-gtk ${TAG}"
git archive --format=tar --prefix="jstest-gtk-${VERSION}/" ${TAG} | bzip2 -c > /tmp/jstest-gtk-${VERSION}.tar.bz2
git push --tags
==========
[[ TODO ]]
==========
* add ability to plot axis values into a dynamic 2d graph (good for seeing steps/noise)
* use libudev for automatic detection of newly plugged in joysticks
(would allow getting the correct evdev and doing proper reset of
joystick calibration values without replug)
* axis mapping seems to behave broken
* grey out Properties when no joystick is present in the list
* Refresh doesn't work (can't find images)
* display "No joystick found" when no joystick is available
* [ Save Profile ]
|-----------------------|
| Name: ............... |
| [*] save calibration |
| [*] save calibration |
| [Cancel] [Ok] |
Give Overwrite warning when name matches existing one.
* implement command line profile load
* use while loop in Joystick::update
* don't pop up new dialogs when old ones are still present
* [FEATURE] Load and save presets in devices, and to load them automatically
when you connect the device.
* [CLEANUP] sync evtest_helper.?pp, make sure no boost dependency is
present
* [CLEANUP] center font in ButtonWidget (current way is a dirty hack)
* [FEATURE] axis names (ABS_X, ...) should be used instead of raw axis numbers
to guess which layout is correct, also the layout should be properly
labeled
* [BUG] add some more checks to catch invalid button/axis mappings supplied
to the joydev interface
* [FEATURE] provide additional support for SDL and evdev devices
=================================
[[ Possible Future Improvments ]]
=================================
* [FEATURE] Possibility of activate noise reduction in joystick axis
(read only field, but can't hurd to have it, in case any app wants
to play with it)
* Joystick Database, base it on evdev, not joydev:
* [FEATURE] Watch the system, maybe being in systray, to protect the
device from accidental reconfiguration by another
application. (unlikely, as that would mean polling and other then
jscalibrator there isn't much to mess up joystick calibration)
* draw calibration icon
* draw mapping icon
* Joystick name of a joydev is taken from USB and build up of
(iManufacturer + iProduct), but thats ugly, (idVendor + idProduct)
or just idProduct would give much prettier name:
idVendor 0x045e Microsoft Corp.
idProduct 0x0007 SideWinder Game Pad
bcdDevice 1.05
iManufacturer 1 Microsoft<AE>
iProduct 2 Microsoft<AE> SideWinder<AE> Game Pad USB
* the joystick name seems to be the only way to link from a joydev to
a evdev, hack some code together to accomplish that as it would
allow proper reset of calibration data
* axis names very buggy:
- ABS_RZ instead of ABS_RUDDER (Sidewinder2)
- ABS_RZ,ABS_THROTTLE instead of ABS_RX,ABS_RY (Thrustmaster gamepad)
- BTN_TL2,BTN_TR2 instead of BTN_START, BTN_MODE (Sidewinder gamepad)
- ...
* create a small database with most common joysticks, maybe add a way
how a user can automatically submit his joystick profile, to ease
the database generation
==================
[[ Random Notes ]]
==================
* jscal:
# Remove any calibration and report raw USB data
jsscal -s 6,0,0,0,0,0,0,0,0,0,0,0,0 /dev/input/js0
jscal -s
6, // number of axes
.--- type (0: raw, 1: "broken line")
| .--- prec (seems to be read only, taken for evdev's absfuzz)
| | .---.- coef[0], coef[1], ...
v v v v
1, 0, -15, 15, 5534751, 5534751, ???
1, 0, -15, 15, 5534751, 5534751,
1, 0, -15, 15, 5534751, 5534751,
1, 0, 112, 142, 5534751, 5534751,
1, 0, 0, 0, 536870912, 536870912, (1<<29)
1, 0, 0, 0, 536870912, 536870912
type == 0 -> none of coef used
type == 1 -> coef[0:4] used
type == 0 -> "none (raw)"
type == 1 -> "broken line"
# Original
jscal -s 6,1,0,-15,15,5534751,5534751,1,0,-15,15,5534751,5534751,1,0,-15,15,5534751,5534751,1,0,112,142,5534751,5534751,1,0,0,0,536870912,536870912,1,0,0,0,536870912,536870912 /dev/input/js0
# No Dead
jscal -s 6,1,0,0,0,5534751,5534751,1,0,0,0,5534751,5534751,1,0,0,0,5534751,5534751,1,0,112,142,5534751,5534751,1,0,0,0,536870912,536870912,1,0,0,0,536870912,536870912 /dev/input/js0
int solve_broken(int *results /* coef[4] */, struct correction_data inputs)
{
results[0] = inputs.cmin[CENTER];
results[1] = inputs.cmax[CENTER];
results[2] = (32767.0 / (inputs.cmin[CENTER] - inputs.cmax[MINIMUM])) * 16384.0;
results[3] = (32767.0 / (inputs.cmin[MAXIMUM] - inputs.cmax[CENTER])) * 16384.0;
results[2] = (32767 * 16384) / left_range
results[3] = (32767 * 16384) / left_range
// in float terms:
// [2] = 1.0f / left_range;
// [3] = 1.0f / right_range;
return 1;
}
Apply coef:
===========
if (value > corr->coef[0])
{
if (value < corr->coef[1])
{
value = 0;
}
else
{
value = (corr->coef[3] * (value - corr->coef[1])) / 16384;
}
}
else
{
value = (corr->coef[2] * (value - corr->coef[0])) / 16384;
}
return value < -32767 ? -32767 : (value > 32767 ? 32767 : value);
Set coef:
=========
joydev->corr[i].type = JS_CORR_BROKEN;
joydev->corr[i].prec = dev->absfuzz[j];
joydev->corr[i].coef[0] = (dev->absmax[j] + dev->absmin[j]) / 2 - dev->absflat[j];
joydev->corr[i].coef[1] = (dev->absmax[j] + dev->absmin[j]) / 2 + dev->absflat[j];
t = (dev->absmax[j] - dev->absmin[j]) / 2 - 2 * dev->absflat[j];
if (t)
{
joydev->corr[i].coef[2] = (1 << 29) / t;
joydev->corr[i].coef[3] = (1 << 29) / t;
}
# EOF #