Action Item #975
closedVerify touchscreen support on Pinephone Pro
Added by Hammel over 1 year ago. Updated 8 months ago.
100%
Description
The touchscreen works but piboxlib may not properly support it. This needs to be verified.
Related issues
Updated by Hammel over 1 year 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.
Updated by Hammel 9 months 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.
Updated by Hammel 9 months 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.
Updated by Hammel 8 months 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.
Updated by Hammel 8 months 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- Rebuild libpibox in buildroot and buildroot-pkg
- Rebuild SD card
- Install Xeon packages to SD card
- Rebuild appmgr and launcher manually and push to SD card
Updated by Hammel 8 months 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.
Updated by Hammel 8 months 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.
Updated by Hammel 8 months 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