How to fix an inverted touch axis (and a small request)

Search This thread

Akdor 1154

Member
Jan 17, 2011
44
6
Melbourne
So I have something to offer to you and something to ask in return :)
I've built Atmel's mxt-app (https://github.com/atmel-maxtouch/obp-utils), and have attached it to this thread. On the Desire Z, it can be used as such, from a root prompt:
Code:
#chmod 755 mxt-app
#./mxt-app -d 0 -a 4a
You won't be able to grant execute permissions on a fat32 partition (for example, your SD card), so copy it to somewhere on an ext partition first (/data/local/tmp works well).

It's probably of questionable utility to most, but certainly interesting to play around with.

Anyway, now my own request: I've installed a replacement digitizer, and the x axis is inverted. My gut says this is a config issue with the screen's firmware, but Atmel have a really weird strategy whereby their driver is completely open source but you need to sign an NDA to get the config specification. So, I would like to grab a working configuration from somewhere and just load the whole thing into mine. This is where you come in! If you are feeling helpful:
Code:
#./mxt-app -d 0 -a 4a
S
output.cfg [i]or whatever you want here[/i]
Q
#cp output.cfg /sdcard
Then upload output.cfg from your SD card to here (or just copy/paste its contents, looks like ASCII encoded octal :/) For bonus points, tell me what ROM you are using, as copying configs between different driver versions may not work so nicely.

Cheers!
Jarrad
 

Attachments

  • mxt-app.gz
    34.6 KB · Views: 236
Last edited:

Akdor 1154

Member
Jan 17, 2011
44
6
Melbourne
OK! So I've had a little success and managed to fix the x-axis on my touchscreen being inverted. This goes for anyone using a phone with the mxt224 touchscreen, though the fix isn't perfect - it needs to be reapplied every boot.
TL;DR:
Code:
#./mxt-app -d 0 -a 4a -T9 -W -r9 -n1 [b]01[/b]
should do it for the DZ/G2.

To be more exact, you need to flip the third bit (bit 2, with the least significant bit on the right being bit 0) of Register 9 of the T9 config block - you can read this register like
Code:
#./mxt-app -d 0 -a 4a -T9 -R -r9 -n1 -f
On my touch screen, this outputs (among other things) a value of
Code:
0000 0[b]1[/b]01
. This equals 05 - flipping the bit makes this value equal to
Code:
0000 0[b]0[/b]01 = 01
. The number at you are using to set needs to be specified with a two-hex-digit byte, so say if you are changing 1100 0111 to 1100 0011, you would need to write C3 as your number. Windows calculator in Programmer mode can help with this. It's also important to write zero as the first digit - the program will interpret 1 as 10! You need to write 01. :)

It would still be really useful to have an output config of a stock touchscreen posted here, as detailed in the previous post, as there are a few other things that the aftermarket controller does differently to the factory DZ part (reporting rate and edge detection are the things I've noticed).
 

vadimbrk

Senior Member
Mar 14, 2013
113
59
Tel aviv
masahim.co.il
OK! So I've had a little success and managed to fix the x-axis on my touchscreen being inverted. This goes for anyone using a phone with the mxt224 touchscreen, though the fix isn't perfect - it needs to be reapplied every boot.
TL;DR:
Code:
#./mxt-app -d 0 -a 4a -T9 -W -r9 -n1 [b]01[/b]
should do it for the DZ/G2.

To be more exact, you need to flip the third bit (bit 2, with the least significant bit on the right being bit 0) of Register 9 of the T9 config block - you can read this register like
Code:
#./mxt-app -d 0 -a 4a -T9 -R -r9 -n1 -f
On my touch screen, this outputs (among other things) a value of
Code:
0000 0[b]1[/b]01
. This equals 05 - flipping the bit makes this value equal to
Code:
0000 0[b]0[/b]01 = 01
. The number at you are using to set needs to be specified with a two-hex-digit byte, so say if you are changing 1100 0111 to 1100 0011, you would need to write C3 as your number. Windows calculator in Programmer mode can help with this. It's also important to write zero as the first digit - the program will interpret 1 as 10! You need to write 01. :)

It would still be really useful to have an output config of a stock touchscreen posted here, as detailed in the previous post, as there are a few other things that the aftermarket controller does differently to the factory DZ part (reporting rate and edge detection are the things I've noticed).

Hi,
How you figured which bits to flip?
 

Akdor 1154

Member
Jan 17, 2011
44
6
Melbourne
I think I found a list of the different registers somewhere and set about flipping bits in the ones that seemed appropriate, haha. It took a bit of mucking around.

Sent from my XT1053 using XDA Premium 4 mobile app
 

Akdor 1154

Member
Jan 17, 2011
44
6
Melbourne
Nope, I ended up just dropping a script in init.d. On Windows you could just stick a batch file in start-up. :)

Sent from my XT1053 using XDA Premium 4 mobile app
 

vadimbrk

Senior Member
Mar 14, 2013
113
59
Tel aviv
masahim.co.il
Nope, I ended up just dropping a script in init.d. On Windows you could just stick a batch file in start-up. :)

Sent from my XT1053 using XDA Premium 4 mobile app
To run it on windows it needs to be ported first.
I found a solution to my specific problem, putting the controller in bootloader mode, reboot to windows(touch doesn't work) and disconnecting the controller. Upon connecting it back the device ghost touches disappeared.
Same method of sticking a controller in bootloader mode works on another(android) device with a similar problem to yours. Try it.
 

vadimbrk

Senior Member
Mar 14, 2013
113
59
Tel aviv
masahim.co.il
To run it on windows it needs to be ported first.
I found a solution to my specific problem, putting the controller in bootloader mode, reboot to windows(touch doesn't work) and disconnecting the controller. Upon connecting it back the device ghost touches disappeared.
Same method of sticking a controller in bootloader mode works on another(android) device with a similar problem to yours. Try it.

From the command line that you using its looks like you used an old version of the utility.
Have you tried the --backup parameter? Its save the config to nvram and making the change permanent.
 

Akdor 1154

Member
Jan 17, 2011
44
6
Melbourne
Ah yeah that was a brain fail on the porting, in my defence it was 7am when I replied :p I haven't needed to play with it much since this thread was posted, I upgraded to a Moto X at the start of the year. I guess if I could make the config permanent I could happily sell my dz though, so thanks for that :)

Sent from my XT1053 using XDA Premium 4 mobile app
 

DocMAX

Senior Member
Nov 22, 2006
749
40
Hi, i also replaced my digitizer with a replacement and the x-axis is flipped.
How can i modify the driver?

mxt-app does not start: error: only position independent executables (PIE) are supported