Touchscreen applet: if calibration wrongly and save the configuration, stylus will keep inaccurate even after correct calibration again

Bug #199065 reported by yanglei
6
Affects Status Importance Assigned to Milestone
Moblin Applets
Fix Released
Medium
ToddBrandt

Bug Description

moblin-applets: v0.42
1. launch touchscreen applet
2. simulate the incorrect calibration operations:
    i. only click the first calibration point and the all 4 points was calibrated.
    ii.after exit calibration interface, click "yes" to store the settings and X will be restarted
3. you will see the symptom: cursor and the stylus are not matched.
4. if you use touchscreen applet to calibrate touch screen again with proper way, the symptom is still existed.

I expect I can use touchscreen applet to re-calibrate and set the accuracy.

Revision history for this message
yanglei (lei-a-yang) wrote :

Todd, I set it as "high" because I cannot calibrate stylus and make the touch screen function work correctly.

Changed in moblin-ui-framework:
assignee: nobody → todd-e-brandt
importance: Undecided → High
Changed in moblin-applets:
status: New → Triaged
Revision history for this message
ToddBrandt (todd-e-brandt) wrote :

The problem here is that the xserver has no way to pull in calibration changes without a restart. So there's no easy way to fix things after a user screws them up since the applet is shut down after the reboot. Having a settings reversion dialog and timeout (just like in screen resolution) would require that the GUI restart the touchscreen applet on its own after reboot, which is doable but complicated. I've heard that in hardy the xserver supports an API to pass in xorg parameters on the fly, so there may be an elegant fix to this at some point in hardy.

Margie (margie-foster)
Changed in moblin-applets:
milestone: none → m11
Revision history for this message
cathyli (cathy-li) wrote :

Will the bug be fixed in m11? I think it should be m10, change milestone.

Changed in moblin-applets:
milestone: m11 → m10
Revision history for this message
cathyli (cathy-li) wrote :

Change milestone back to m11 to wait for Todd's decision.

Changed in moblin-applets:
milestone: m10 → m11
Revision history for this message
ToddBrandt (todd-e-brandt) wrote :

This one can't be fixed until Hardy, I'm changing it to fix-later

Changed in moblin-applets:
milestone: m11 → fix-later
Revision history for this message
ToddBrandt (todd-e-brandt) wrote :

ok, I was wrong, this one is actually a bug that can be fixed now. This will be fixed in 0.52. The problem is that the configuration editor can add a rotation of counter clockwise, but it can't remove it. I'm in the process of flushing out any other bugs in the xorg write and have added a read_configuration function to the moblin-system-daemon server and exported it to moblin-dbustest.

Changed in moblin-applets:
milestone: fix-later → m10
status: Triaged → Confirmed
Revision history for this message
ToddBrandt (todd-e-brandt) wrote :

ok, fix committed in 0.52. It was actually just a little bit more busted than this bug shows. There are 8 possible layouts for the touchscreen, all of which have now been tested. These are the possible ways that the touchscreen can be mapped to the display. These can be simulated on the samsung by pressing the buttons in different orders.

Screen points:
0 1
2 3

1) No Rotation, X Aligned, Y Aligned
press 0 1 2 3
2) No Rotation, X Inverted, Y Aligned
press 1 0 3 2
3) No Rotation, X Aligned, Y Inverted
press 2 3 0 1
4) No Rotation, X Inverted, Y Inverted
press 3 2 1 0
5) ClockWise Rotation, X Aligned, Y Aligned
press 2 0 3 1
6) ClockWise Rotation, X Inverted, Y Aligned
press 0 2 1 3
7) ClockWise Rotation, X Aligned, Y Inverted
press 3 1 2 0
8) CounterClockWise Rotation, X Aligned, Y Aligned
press 1 3 0 2

The touchscreen calibration algorithm assumes the screen is rotated if the x coordinates of points 0, 1 and 2, 3 are within 100 of each other. This way you have some room to create a rectangle with your presses but if you go too far outside the points it will create a junk config. The config can be reversed though by redoing it properly.

Changed in moblin-applets:
status: Confirmed → Fix Committed
Revision history for this message
yanglei (lei-a-yang) wrote :

Hi, Todd,

My test steps are:
screen points
0 1
2 3

step 1. Calibration on (0 0 0 0) or just click blank area to create a junk config and save and restart X.
           This uses to simulate users who made mistake when calibration.
step 2. Did calibration (0 1 2 3) to correct the touch screen settings
           At this time, as your description about calibration algorithm, the calibration algorithm add rotation of counter clockwise and I have no way to change the settings to normal behavior.
step 3. Based on Todd's digging about the calibration algorithm, I do calibration again with counter order (3 2 1 0).
           This time, touch screen settings recover as normal behavior.

The reason I re-open this bug because I expect when finish step 2, use should get correct touch screen behavior as they want.
no user can understand the tricks in step 3.

BTW: I change the importance from "high" to "medium" because we have workaround (step 3) to help user to recover from misuse of calibration.

Thanks,
Lei Y

Changed in moblin-applets:
importance: High → Medium
status: Fix Committed → New
Revision history for this message
ToddBrandt (todd-e-brandt) wrote :

I agree, this is bad, let me try to reproduce. Of all the testing I've done I've never seen the existing configuration have any affect on the new configuration. i.e. if the xorg.conf file has ccw in it, this shouldn't affect the outcome of a new calibration.

Revision history for this message
ToddBrandt (todd-e-brandt) wrote :

ok, I just tried this here on the latest target image on a samsung. I pressed the first point 4 times, then clicked yes to apply the calibration. Then when the GUI restarts I use the mouse to relaunch the touchscreen applet, press the four points correctly, then user the mouse to click yes on the apply button. After the GUI restarts, the touchscreen works fine. I tried this several times and it worked everytime.

Are you sure you followed the procedure properly? Cathy, can you reproduce Yang's error?

Revision history for this message
ToddBrandt (todd-e-brandt) wrote :

I just tried it on Bob's samsung as well and it also works

Revision history for this message
cathyli (cathy-li) wrote :

Yes, Todd. I can reproduce the issue with Lei Yang's description here. We found it on CB+LCD kit, not verified on Q1. Not sure the behavior on Q1. We will create image and verify it again on samsung Q1.

Revision history for this message
yanglei (lei-a-yang) wrote : RE: [Bug 199065] Re: Touchscreen applet: if calibration wrongly and savethe configuration,stylus will keep inaccurate even after correct calibration again

Bob,
I found the symptoms on CB+LCD kit.
But I just tested on Q1U, it is same as on CB+LCD kit.

My image is created for Beta4 test yesterday.

Moblin-applets version: 0.52
Xorg version: 1:7.2-5ubuntu13

Thanks,
Lei Y

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of ToddBrandt
Sent: 2008年4月8日 5:34
To: Yang, Lei A
Subject: [Bug 199065] Re: Touchscreen applet: if calibration wrongly and savethe configuration,stylus will keep inaccurate even after correct calibration again

I just tried it on Bob's samsung as well and it also works

--
Touchscreen applet: if calibration wrongly and save the configuration, stylus will keep inaccurate even after correct calibration again
https://bugs.launchpad.net/bugs/199065
You received this bug notification because you are a direct subscriber
of the bug.

Revision history for this message
yanglei (lei-a-yang) wrote :

Sorry for typo error.
This message should be sent to Todd. Resend here.

Todd,

I found the symptoms on CB+LCD kit.
But I just tested on Q1U, and it is same as on CB+LCD kit.

My image is created for Beta4 test yesterday.

Moblin-applets version: 0.52
Xorg version: 1:7.2-5ubuntu13

Thanks,
Lei Y

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of ToddBrandt
Sent: 2008年4月8日 5:34
To: Yang, Lei A
Subject: [Bug 199065] Re: Touchscreen applet: if calibration wrongly and savethe configuration,stylus will keep inaccurate even after correct calibration again

I just tried it on Bob's samsung as well and it also works

--
Touchscreen applet: if calibration wrongly and save the configuration, stylus will keep inaccurate even after correct calibration again
https://bugs.launchpad.net/bugs/199065
You received this bug notification because you are a direct subscriber
of the bug.

Changed in moblin-applets:
status: New → Triaged
Revision history for this message
ToddBrandt (todd-e-brandt) wrote :

ok, the problem is this, the touchscreen calibration code we inherited and that has never had troubles on samsung only looks at these five options in the xorg.conf file: MinX, MaxX, MinY, MaxY, and Rotate. The config on the crown beach apparantly adds in two rare, but valid options: SwapX and SwapY.

Let me illustrate, this is the functional config that Yang sent me (inside the touchscreen device section):

Option "MinX" "28"
Option "MinY" "46"
Option "MaxX" "991"
Option "MaxY" "954"
Option "SwapX" "1"
Option "SwapY" "1"

What this means is that the MinX, MaxX, MinY, and MaxY values look orientated typically, but the SwapX and SwapY options mean that both X and Y are actually inverted. Thus, the following should be an identical config (subtracting the two swap options):

Option "MinX" "991"
Option "MinY" "954"
Option "MaxX" "28"
Option "MaxY" "46"

Since the current touchscreen calibrator doesn't even look at the swap options, it puts the data in backwards. This is why it produces a good config when the buttons are pressed in reverse order.

Great catch Yang! I'll add a fix for 0.53 this evening.

Changed in moblin-applets:
status: Triaged → Fix Committed
Revision history for this message
ToddBrandt (todd-e-brandt) wrote :

fix committed in 0.53. I changed the behavior of the calibrator to always leave the min and max values in logical order (i.e. MaxX > MinX and MaxY > MinY) and to employ the use of SwapX and SwapY to handle inverted axes. The read_calibration and apply_calibration apis both still take five arguments, but instead of the last arg being rotation, it's a "flags" argument with 4 bits used: b0=SwapX, b1=SwapY, b2=RotateCCW, b4=RotateCW. The moblin-dbustest program has also been updated to read in this new data.

Revision history for this message
yanglei (lei-a-yang) wrote :

verified on version 0.54

Changed in moblin-applets:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.