An update on my ongoing inverted Y axis saga:
A very brief reminder of my situation:
I installed Rasbian (2013-07-26), followed Texy's instructions and all worked fine, including in X11 (no Y axis problem) - This was about the 13th of September (Friday 13th
). A day or two later I started experiencing the problem with the Y axis being incorrectly inverted (when moving up the cursor goes down & vice-versa). I checked my settings and that I still had all of Texy's modifications, installed. I confirmed that all worked properly (Y axis was normal) outside of X, and that the problem was specifically related to X11.
I started again from a fresh install of Raspbian (2013-07-26) and this time the problem Y-axis was present from the start (unlike the delay of a day or so from the initial install). I also tried a clean install of the latest Raspbian (2013-09-10) with the same result :- a duff Y axis. Just in case I had a dodgy SD card, I repeated the exercise again on a brand new unused card - no difference, still a stuffed Y axis.
So something in the distributions must have changed between about the 12th and the 14th September! There are only two real points at which Texy's instructions 'update' any system components (unless i'm mistaken):
- 1. The installation of the replacement kernel,
2. The installation of xinput.
Of course xinput is actively used by the configuration of the TFT and Touchscreen, so do we have a smoking gun?
xinput sets attributes for the touchscreen (or other devices), specifically 'Evdev Axis Inversion' 0 1
to Invert the Y axis, in this case. I confirmed that xinput does seem to set the property correctly (e.g. by subsequent xinput -list). So the next element in the chain is evdev when it tries to configure the touchscreen to work with X11. By examining the logs it appears evdev doesn't see the property telling it to Invert the Y-axis. Having scanned the source code for evdev it does check for the relevant values, but they don't appear to be set when/where it looks. So it would never invert the axis (nor the X axis, for that matter).
I did a quick one word modification to evdev to coerce it to invert the Y axis, and hey presto the touchscreen works properly.
In the original version we have:
pEvdev->invert_y = xf86SetBoolOption(pInfo->options, "InvertY", FALSE);
which sets the InvertY property to whatever the value of "InvertY" is within the pInfo->options structure, or to FALSE if a value for "InvertY" is not found. All i did was change the FALSE to TRUE, so it becomes:
pEvdev->invert_y = xf86SetBoolOption(pInfo->options, "InvertY", TRUE);
(Actually I did make some other changes but they were to examine the various pInfo->options that evdev was seeing).
is of course not a proper solution, its merely a proof of concept. I am currently digging to try and find how and where the Axis inversion gets lost in the chain of events...
(to be continued, unless some bright spark has a proper solution)