Project

General

Profile

Actions

Action Item #975

closed

Verify touchscreen support on Pinephone Pro

Added by Hammel 10 months ago. Updated 11 days ago.

Status:
Closed
Priority:
Immediate
Assignee:
Target version:
Start date:
18 May 2023
Due date:
% Done:

100%

Estimated time:
Severity:
01 - Critical

Description

The touchscreen works but piboxlib may not properly support it. This needs to be verified.


Related issues

Related to Xeon - Feature #700: Need Phone AppIn ProgressHammel10 Mar 2019

Actions
Actions #1

Updated by Hammel 10 months ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

It's not supported but may be supported if I just add the following

Goodix Capacitive TouchScreen

to the ts_name_default [] array in piboxlib:piboxTouchProcessor.c. However, that seems klunky. I should be able to add it to a file, say /etc/touchscreens, instead. So what I should do is have piboxlib:piboxTouchprocessor.c:ts_setup() check for the config file. If there, use that first (as it's likely to have the most recent candidates) to find a supported touchscreen. If not, or if it is but there are no matches, then fallback to using the ts_name_default[] array.

That will at least make piboxTouchProcessor think it supports the PPP. After that I have get a default launcher working and test the terminal or reboot buttons.

Actions #2

Updated by Hammel 20 days ago

  • Target version changed from Xeon 1.0 - Asimov to 3.0 - Corrino
Actions #3

Updated by Hammel 19 days ago

I might be able to simplify this even more by simply setting TSLIB_TSDEVICE="xxx" in each app. Or maybe set it as a default value for all environments in /etc/environment. I need to test this by setting the variable in launcher and if that works then try setting it in /etc/environment and test that launcher picks it up.

I believe I can use evtest to list the device file mapped to the touchscreen. That should be the value passed to TSLIB_TSDEVICE, I think.

Actions #4

Updated by Hammel 18 days ago

  • % Done changed from 10 to 20

Setting TSLIB_TSDEVICE in /etc/environment doesn't work. The launcher app does not see this when it's run from appmgr.

Actions #5

Updated by Hammel 18 days ago

Setting TSLIB_TSDEVICE in launcher.c:main() doesn't see to affect libpibox either. I need to add some debug to ts_setup() to see if the library sees the environment variable set by the app.

If the library does not see the environment variable then I can try running launcher from appmgr with the environment variable set there. If that doesn't work I'll need to debug why using TSLIB_TSDEVICE does not work or is not propagating to libpibox.

Actions #6

Updated by Hammel 16 days ago

I discovered the problem here: launcher doesn't start the app - appmgr does. So it's appmgr that needs to call setenv(TSLIB_TSDEVICE). What I need to do is have appmgr read an app specific file of environment variables to set at startup. Those environment variables would then be passed to all apps.

Actions #7

Updated by Hammel 15 days ago

  • % Done changed from 20 to 30

I've implemented this in the appmgr sandbox. It just needs to be tested on hardware.

Actions #8

Updated by Hammel 15 days ago

Didn't work - launcher sees the env var but because launcher doesn't think it's a touchscreen it doesn't try to initialize it.
Launcher (and libpibox) need some work in hw identification for Xeon.

Actions #9

Updated by Hammel 15 days ago

The first problem is that the xeon sandbox I'm working from doesn't have the latest libpibox, which has board identification support for Xeon. So I've updated the libpibox build in that sandbox.

Next, the launcher doesn't think the display is a touchscreen. It thinks this because /etc/pibox-config needs to have RPI_TOUCH instead of NOTOUCH. This is set via /etc/functions:optimizeTouchScreen() by pbtouchstate , which calls piboxTouchGetDeviceName() which calls ts_setup(). However, pbtouchstate needs to read the environment file, just like appmgr needs to, in order for ts_setup() to see the device file it should use for touchscreens.

So I need to move the code I added (but haven't committed yet) to appmgr into libpibox, then have pbtouchstate and appmgr call it to load the environment file, which should be named /etc/pibox-env.

To test
  1. Rebuild libpibox in buildroot and buildroot-pkg
  2. Rebuild SD card
  3. Install Xeon packages to SD card
  4. Rebuild appmgr and launcher manually and push to SD card
Actions #10

Updated by Hammel 14 days ago

  • % Done changed from 30 to 50

First test: update libpibox to use /etc/pibox-env.

$ pbtouchstate -v3
piboxLoadEnv[utils.c:260] INFO Loading environment updates from /etc/pibox-env
ts_setup[touchProcessor.c:140] INFO TSLIB_TSDEVICE: /dev/input/event2
ts_setup[touchProcessor.c:142] INFO dev_name: /dev/input/event2
ts_setup[touchProcessor.c:238] INFO Reading From : /dev/input/event2 (Goodix Capacitive TouchScreen)
/dev/input/event2
root(tty)$ pbtouchstate 
/dev/input/event2

So that works. Now I can try launcher and appmgr. Both should have the update for piboxLoadEnv() added.

Actions #11

Updated by Hammel 13 days ago

  • % Done changed from 50 to 60

Launcher recognizes touches now with these changes, but incorrectly identifies the cell:

touchProcessor[touchProcessor.c:374] INFO TSLIB: sample 1358499699.503239:     -2      4    255
touchProcessor[touchProcessor.c:376] INFO TSLIB: last   1358499668.551155:     -1      4    255
touchProcessor[touchProcessor.c:388] INFO 1. diff.sec: 30  -- diff.usec: 952084
touchProcessor[touchProcessor.c:405] INFO Calling registered touch callback with ABS.
touchProcessor[touchProcessor.c:435] INFO --- No Region found
iconTouchGTK[launcher.c:126] INFO Entered.
iconTouchGTK[launcher.c:141] INFO Processing touch request.
selectApp[launcher.c:628] INFO Entered selectApp
selectApp[launcher.c:646] INFO Calling to highlight new icon: idx = 0
iconTouchGTK[launcher.c:153] INFO origin, wxh: 0 30  144 / 156
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 144 30  144 / 156
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 288 30  144 / 156
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 432 30  144 / 156
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 576 30  144 / 156
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 0 186  144 / 156
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 144 186  144 / 156
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 288 186  144 / 156
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 432 186  144 / 156
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 576 186  144 / 156
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 0 342  144 / 156
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 144 342  144 / 156
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 288 342  144 / 156
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 432 342  144 / 156
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 576 342  144 / 156
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 0 498  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 144 498  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 288 498  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 432 498  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 576 498  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 0 655  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 144 655  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 288 655  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 432 655  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 576 655  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 0 812  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 144 812  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 288 812  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 432 812  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 576 812  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 0 969  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 144 969  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 288 969  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 432 969  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 576 969  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 0 1126  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 144 1126  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 288 1126  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 432 1126  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 576 1126  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 0 1283  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 144 1283  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 288 1283  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 432 1283  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:153] INFO origin, wxh: 576 1283  144 / 157
iconTouchGTK[launcher.c:170] INFO touch point, x=-2 y=4
iconTouchGTK[launcher.c:189] INFO No matching table cell identified for -2 / 4

Since that doesn't work yet I can't test appmgr.

Also, since the touch is now recognized at boot, something (likely the desktop.sh or related from pmsui) is setting the xorg.conf to the xorg.conf.rpitouch config, which is wrong. I need to disable that change for Xeon.

Also, the touchscreen works but the touch point is wrong. And it's ultra sensitive. I probably need to setup the pointercal for it as well.

Actions #12

Updated by Hammel 13 days ago

The launcher.cfg had "rotate:1" in it, which I thought was a mistake and commented out. But I think that may be correct for Xeon, so I've uncommented it and need to retry later.

Actions #13

Updated by Hammel 12 days ago

Actions #14

Updated by Hammel 12 days ago

The xorg.conf problem is an easy fix. The buildroot skeleton has S99UI with a test for switching xorg.conf files but this was only necessary for Pi systems, not Xeon. And since Xeon has it's own repo with the Buildroot skeleton, I can just remove that bit of code from S99UI. Easy-peasy.

The pointercal file is not needed. I tried creating a pointercal with ts_calibrate but when I tried to validate it with ts_calibrate -c it failed. Then I removed the pointercal file and tried to check the calibration that way and it worked, as long as I used -b 20 (touch within 20 pixels is okay, but outside would fail). Then I tried running launcher without the pointercal file and it worked fine. Each button press (pidialer and terminal were tested) worked as expected.

Launcher also doesn't need the rotate:1 option in its /etc/launcher.cfg.

Now I need to verify appmgr

Actions #15

Updated by Hammel 11 days ago

Appmgr reads the pibox-env so the apps it starts should have it too. Now I need to check pidialer logs to see if it picked up the touch interface. I think it does, because pidialer kinda worked but I need to test it a little more.

Actions #16

Updated by Hammel 11 days ago

  • % Done changed from 60 to 90

pidialer crashes when you touch a key. That is a separate issue - RM #1106.

I think the updates for this issue are complete. They need to be committed and pushed now.

Actions #17

Updated by Hammel 11 days ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

All changes committed and pushed.

Closing issue.

Actions

Also available in: Atom PDF