Page 1 of 1

help me debug touchscreen bad touch input [SOLVED]

Posted: Fri Dec 16, 2016 6:35 pm
by mike955
Hello,

summary: how can I downgrade software + firmware to one year back?


I have a raspberry pi b+ with official displays. They've mostly been running a
pygame touchscreen clock app I wrote, and done it for over a year.

However, the touchscreens are now both giving me strange touch inputs
that I'm having trouble decoding in software.

I saw the other threads on 'ghost input', but they went in a hardware
direction for newly installed displays.

The thing is I've basically changed very little in these machines in the last
year, except 'apt-get update/upgrade'. I haven't really mucked with the
touchscreen code since I wrote it. The hardware is unchanged (one has
a pluggable usb hub, one has an external microusb wall wart.


So my question: How can I revert my pi to firmware and software from a
year ago? I think I started with wheezy, but they're both up to jessie now.

I could probably get an older raspbian, but is there a special procedure to downgrade the firmware?

this is my first post, hope I'm doing this right, thanks so much!
Mike

p.s. It might still be a hardware problem. I might be getting two simultaneous
bad power supplies. Or maybe new software versions have started using more
power and making things marginal. I'd just like to rule out software first.

example of pygame touchscreen swipe input I'm getting. Sorry, I don't have old logs from a year ago.

machine 1:

<Event(5-MouseButtonDown {'button': 1, 'pos': (799, 479)})>
<Event(4-MouseMotion {'rel': (0, 1), 'pos': (799, 479), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (601, 213), 'pos': (799, 479), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (-3, 0), 'pos': (796, 479), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (598, 213), 'pos': (799, 479), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (-30, -3), 'pos': (769, 476), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (568, 210), 'pos': (799, 479), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (-31, -3), 'pos': (768, 476), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (537, 207), 'pos': (799, 479), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (-27, -4), 'pos': (772, 475), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (510, 203), 'pos': (799, 479), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (-56, -13), 'pos': (743, 466), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (454, 190), 'pos': (799, 479), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (-58, -7), 'pos': (741, 472), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (396, 183), 'pos': (799, 479), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (-36, -4), 'pos': (763, 475), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (360, 179), 'pos': (799, 479), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (-95, 3), 'pos': (704, 479), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (265, 182), 'pos': (799, 479), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (265, 182), 'pos': (799, 479), 'buttons': (1, 0, 0)})>
<Event(6-MouseButtonUp {'button': 1, 'pos': (799, 479)})>

machine 2:

<Event(5-MouseButtonDown {'button': 1, 'pos': (799, 479)})>
<Event(4-MouseMotion {'rel': (-1, -2), 'pos': (798, 477), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (466, 386), 'pos': (799, 479), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (-10, -33), 'pos': (789, 446), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (456, 353), 'pos': (799, 479), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (-7, -34), 'pos': (792, 445), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (449, 319), 'pos': (799, 479), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (-1, -25), 'pos': (798, 454), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (448, 294), 'pos': (799, 479), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (0, -53), 'pos': (799, 426), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (448, 241), 'pos': (799, 479), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (2, -62), 'pos': (799, 417), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (450, 179), 'pos': (799, 479), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (3, -38), 'pos': (799, 441), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (453, 141), 'pos': (799, 479), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (8, -38), 'pos': (799, 441), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (461, 103), 'pos': (799, 479), 'buttons': (1, 0, 0)})>
<Event(4-MouseMotion {'rel': (461, 103), 'pos': (799, 479), 'buttons': (1, 0, 0)})>
<Event(6-MouseButtonUp {'button': 1, 'pos': (799, 479)})>

Re: help me debug touchscreen bad touch input [SOLVED]

Posted: Mon Dec 19, 2016 5:11 am
by mike955
Replying to my own comment because I found the problem (solution anyway)

There were some changes to recent packages using 'apt-get update/upgrade' and I'm not sure which one broke things.

1) I start my python pygame app using .profile and .xinitrc
- the machine is set up for auto-login with text console
- I launch X from my .profile using:
startx > logfile 2>&1
- I launch my python app in .xinitrc

something changed and it was failing with this message:

(WW) xf86OpenConsole: VT_ACTIVATE failed: Operation not permitted
(EE) Fatal server error:
(EE) xf86OpenConsole: Switching VT failed


this was solved with:
startx -- -keeptty > logfile 2>&1

2) touchscreen inputs were just wrong as shown above.

I actually tried writing a simple touchscreen test app and found everything worked fine.
using divide and error (only later conquer), I found this fixed it:

changing this:
screen = pygame.display.set_mode((800,480),pygame.FULLSCREEN)
to this:
screen = pygame.display.set_mode((800,480))

somehow pygame.FULLSCREEN causes touchscreen input to bork.

Looking at my apt logs, I suspect one of these recent package updates since pygame didn't change:

Setting up xserver-common (2:1.18.4-2+rpi1) ...
Setting up xserver-xorg-core (2:1.18.4-2+rpi1) ...
Setting up xserver-xorg-video-fbturbo (1.20161111~122359) ...
Setting up xserver-xorg-video-fbdev (1:0.4.4-1+rpi2) ...
Setting up xserver-xorg-input-synaptics (1.8.3-2) ...
Setting up xserver-xorg-input-evdev (1:2.10.3-1) ...
Setting up xserver-xorg (1:7.7+16) ...


hope this helps someone!

Re: help me debug touchscreen bad touch input [SOLVED]

Posted: Thu Dec 29, 2016 7:37 pm
by Dan c
i am very new to raspberry pi and am currently trying to setup the touch screen but am getting some errors. Can someone explain in beginner words how to fix this?
xorg-server (2:1.17.3-1) unstable; urgency medium
the xorg server is no longer setuid root by default. this change reduces the risk or privilege escalation due to x server bugs