GPD User Community Support Forum

Touchscreen Issue Resolved

@joshwiththegoodhair

Have tried the new method with Ubuntu 19.10 and Ubuntu Mate 18.04. Still no success:

I ran the little script:
simon@SP2M:~$ sudo ./p2max-dsdt-check.sh
[sudo] Mot de passe de simon :
You are running GPD P2 BIOS version 0.23
BIOS
BIOS
You have the DSDT for v0.23 loaded (joshwiththegoodhair version)
ERROR: You’ve loaded the wrong version of the DSDT override for your BIOS. Try loading PeterCxy’s version: https://github.com/PeterCxy/gpd_p2_max_acpi/releases/download/20190825/acpi_override

What version of mate did you use?

Ubuntu Mate 19.04

Can you paste or message me the output of dmesg?

@joshwiththegoodhair

simon@SP2M:~$ dmesg | grep DSDT
[ 0.017199] ACPI: DSDT ACPI table found in initrd [kernel/firmware/acpi/dsdt.aml][0x28dc3]
[ 0.017258] ACPI: Table Upgrade: override [DSDT-ALASKA- A M I ]
[ 0.017259] ACPI: DSDT 0x000000008CA03248 Physical table override, new table: 0x000000008B811000
[ 0.017260] ACPI: DSDT 0x000000008B811000 028DC3 (v02 ALASKA A M I 01072020 INTL 20190816)

Maybe I should try with 19.04?

EDIT:
So I tried with Mate 19.04, same result:
simon@SP2M:~$ sudo ./p2max-dsdt-check.sh
You are running GPD P2 BIOS version 0.23
BIOS
BIOS
You have the DSDT for v0.23 loaded (joshwiththegoodhair version)
ERROR: You’ve loaded the wrong version of the DSDT override for your BIOS. Try loading PeterCxy’s version: https://github.com/PeterCxy/gpd_p2_max_acpi/releases/download/20190825/acpi_override

simon@SP2M:~$ dmesg | grep DSDT
[ 0.017358] ACPI: DSDT ACPI table found in initrd [kernel/firmware/acpi/dsdt.aml][0x28dc3]
[ 0.017417] ACPI: Table Upgrade: override [DSDT-ALASKA- A M I ]
[ 0.017418] ACPI: DSDT 0x000000008CA03248 Physical table override, new table: 0x000000008B811000
[ 0.017420] ACPI: DSDT 0x000000008B811000 028DC3 (v02 ALASKA A M I 01072020 INTL 20190816)

EDIT 2: So I tried PeterCxy’s version and it works! :grinning: Strange…?

simon@SP2M:~$ dmesg | grep DSDT
[ 0.017996] ACPI: DSDT ACPI table found in initrd [kernel/firmware/acpi/dsdt.aml][0x28dc3]
[ 0.018067] ACPI: Table Upgrade: override [DSDT-ALASKA- A M I ]
[ 0.018068] ACPI: DSDT 0x000000008CA03248 Physical table override, new table: 0x000000008B811000
[ 0.018070] ACPI: DSDT 0x000000008B811000 028DC3 (v02 ALASKA A M I 01072020 INTL 20190703)
[ 0.243954] ACPI: _SB_.PCI0.LPCB.H_EC: Used as boot DSDT EC to handle transactions
[ 0.292818] ACPI: _SB_.PCI0.LPCB.H_EC: Used as boot DSDT EC to handle transactions and events
simon@SP2M:~$ sudo ./p2max-dsdt-check.sh
[sudo] Mot de passe de simon :
Désolé, essayez de nouveau.
[sudo] Mot de passe de simon :
You are running GPD P2 BIOS version 0.23
You have the DSDT for < v0.23 loaded (PeterCxy version)
ERROR: You need to upgrade your DSDT override to match BIOS version v0.23. Load this override instead: http://josh.sh/acpi_override_23
simon@SP2M:~$

Yeah, now I’m completely confused, lol.

With Peter’s version, do you power-related functions work as expected (showing percentage of power left, suspends, resumes, etc)? Any high CPU or high CPU usage from just one CPU thread?

1 Like

simon@SP2M:~$ sensors
coretemp-isa-0000
Adapter: ISA adapter
Package id 0: +45.0°C (high = +100.0°C, crit = +100.0°C)
Core 0: +45.0°C (high = +100.0°C, crit = +100.0°C)
Core 1: +44.0°C (high = +100.0°C, crit = +100.0°C)

pch_skylake-virtual-0
Adapter: Virtual device
temp1: +42.5°C

iwlwifi-virtual-0
Adapter: Virtual device
temp1: +38.0°C

Could you try sending me the file (dsdt.dat) you get from running the command below? This is a binary dump of your ACPI DSDT tables and contains nothing personal. I can then decompile and compare.

cat /sys/firmware/acpi/tables/DSDT > dsdt.dat

Also - if anyone who is running into issues (@naquad, specifically) wants to send this to me, it would help.

1 Like

added *.cfg and *.dat to authorised extension list so can be uploaded (if reqd)
I followed the above steps earlier by Josh and after a reboot - I couldn’t regain access to Ubuntu Mate only Windows. I tried Ubuntu Advanced options on grub and tried the two specified kernels and two recovery kernels but nothing worked. I then went in and managed to edit the /boot/grub/grub.cfg file through ubuntu mate live usb using root to nano the file and removed the line I added and rebooted.
this worked temporaily and rebooted and got me in.
I then double checked everything (my line number was not 225 but that line referred to something completely different I think my line number was 265 off memory) any how I checked it and it was right and i ran sudo grub-mkconfig -o /etc/grub/grub.cfg and rebooted and there was no longer any ubuntu mention at all just loaded straight to windows

I tried to do a ppa:yannubuntu/boot-repair using recommended repair but for some reason this wouldn’t run advising me to run it from a live distro (which I was using Ubuntu Mate 19.10 Live USB)
At this point im swearing, tired and fed up and decided i’m just going to wipe and reinstall the ubuntu mate partition. I’m trying this now.

OK so clean install of Ubuntu Mate 19.10 (alpha)

sudo caja
Copy the acpi_override_23 (Josh’s website URL) download raw from usb pen volume and paste into /boot (as superuser in Caja)

sudo nano /etc/grub.d/10_linux Screenshot to show you the line I edited

Ctrl O
Ctrl X

sudo grub-mkconfig -o /boot/grub/grub.cfg

sudo reboot

Selected Ubuntu from Grub menu it loaded with no errors. No touchscreen is working.

When I run Josh’s script above it says I’m using PeterCxy version and I need to upgrade the DSDT override to match. This is incorrect as there is only Josh’s CPIO in my /boot folder.

Im attaching my /boot/grub/grub.cfg here grub.cfg (8.9 KB)

I’m attaching my /etc/grub.d/10_linux here 10_linux (16.7 KB)

I’m attaching my dsdt.dat here dsdt.dat (163.4 KB)

NB: I attempted to edit line number 280 as well from initrd ${rel_dirname}/${initrd} to initrd /boot/acpi_override_23 ${rel_dirname}/${initrd}

The system throws a acpi handler error which I cannot catch before powering down hard.
Sometimes it just hangs on the Ubuntu Mate logo with the green dots cycling.

Just in case it got itself in a tizz as I have had to belly button it a few times now as it just hangs. I thought it wise as a precautionary measure to do the following from Ubuntu Mate 19.10 Live USB

It made no difference. Just hangs at the green and white dots moving.
when you press the up key
/dev/nvme0n1p4: clean, 264690/23977984 files, 3840787/95907072 blocks
is the last line (shown in the video) after all the Hailuck input drivers load.

I’m off to bed. Catch you guys another time.

Sorry this is so frustrating. I’ve started working on decompiling these DSDT table dumps to try and determine what’s going on.

1 Like

@joshwiththegoodhair - I’m not afraid to say I’m a linux noob tbh - I mean I’ve been using ubuntu/xubuntu for years but only for emacs and what I need and I get by. If you could have a quick look at my grub.cfg and 10_linux file and see what you think, i’d appreciate it. It could be user error.
NB: The only thing I would add is if you download 10_linux above I did edit line 280 as well as Line 260 or 265 (i think from memory) which you will see in the 10_linux file I attached.

Thanks.

So, I’ve decompiled (or used) the following DSLs. I also “normalized” them by removing anything that would make the two DSLs being diff’d identical.

DAT/DSLs used:

For admin, wondow and PeterCxy, the results:

  • admin + wondow = identical
  • admin + PeterCxy = identical
  • wondow + PeterCxy = identical

For me, however, compared to any of the other three, I get this diff:

    260c260
    <     Name (PPIM, 0x8CA5CF98)
    ---
    >     Name (PPIM, 0x8CA71F98)
    273c273
    <     OperationRegion (GNVS, SystemMemory, 0x8CA57000, 0x0793)
    ---
    >     OperationRegion (GNVS, SystemMemory, 0x8CA6C000, 0x0793)
    11137c11137
    <     Name (PNVB, 0x8CA5C018)
    ---
    >     Name (PNVB, 0x8CA71018)

So, in summary:

  • for admin, wondow and PeterCxy, it appears that PeterCxy’s Github release acpi_override CPIO image should work - regardless of BIOS version
  • a few people have said my acpi_override_23 CPIO image has worked for them, so I don’t think I’m a particularly unique case, but clearly, more people have tables similar to PeterCxy’s than mine.
  • I will check these dats, dsls and normalized dsls into a GIthub repo if anyone else wants to take a peek.
  • I WOULD LOVE DSDT DUMPS FROM OTHERS TO TRY AND DEBUG FURTHER!
1 Like

Thank you very much for this @joshwiththegoodhair - I downloaded PeterCxy CPIO, renamed yours to acpi_override_23_josh and pasted PeterCxy CPIO from his Github releases page https://github.com/PeterCxy/gpd_p2_max_acpi/releases (link above will take you straight to file) into /boot I then rather than rebuild my config file renamed PeterCxy CPIO image to acpi_override_23 and then rebooted. Voila.

I now have a working touchscreen on Ubuntu Mate 19.10.
Two quick questions as I’m slightly confused.

  1. Why did this not work earlier when we tried this (as my memory serves right this was the reason you rebuilt the CPIO after Bios 23? as PeterCxy version wasn’t working for us)
  2. Why do some of us have different dsdt tables? This seems rather odd to me.

Thanks though now my only issue is power management and the very dodgy resume with the black screen that won’t wake. This happened for others before bios v 0.23 but for me only started after i flashed to bios 0.23. Its rather frustrating. The only way to wake it up after walking away to make a brew is to belly button it.

Sorry I’ve just realised I sound so ungrateful. I’m genuinely really pleased I finally have a working touchscreen in Linux, its just I’m perplexed with the screen resume from wake thing that it makes the device pretty unusable, especially as I had run this daily before 0.23 and it was not doing any of these crazy power / resume issues.

To respond to your questions:

  1. I feel like Ubuntu users weren’t properly loading PeterCxy’s CPIO image which would explain why it didn’t initially work.
  2. I’m as confused as you about this. Before upgrading to the v0.23 BIOS, I had PeterCxy’s CPIO image loaded, and it was working well which would make it seem that my P2Max was in the same state as everyone else’s. I don’t use my touchscreen often, by I happened to to notice it was not working right after I performed the v0.23 BIOS update. This is why I assume (keyword being “assume”) this is related to the BIOS update, but it might not be. But even after this research, I still feel the BIOS update altered these tables in some way, but I’m not quite sure how.

I’m also questioning a lot right now, but I don’t think the kernel, kernel modules or the linux distribution affects this. I could be wrong about this though. I was able to use my working v0.23 CPIO on both Arch and Ubuntu Mate which both used different 5.2.x kernels.

2 Likes

@admin @joshwiththegoodhair

I have uploaded a hacked Goodix kernel driver DKMS module on AUR and GitHub

https://aur.archlinux.org/packages/goodix-p2max-dkms/

Just install the module using DKMS (or if you are on Arch, you can directly install via yay or yaourt or whatever), reboot (and maybe rebuild initramfs), then your touchscreen should start to work fine regardless of your BIOS.

This is an EXTREMELY dirty hack, since I don’t want to maintain a full kernel just for this. It depends on undocumented memory structure inside the Linux kernel that we have no guarantee for. But this will at least free us from the DSDT crap until my kernel patches get merged (those are the proper fixes)

I have only tested this on Linux 5.2.x on ArchLinux.

5 Likes

Whoa - thanks! I will try this first thing when I wake up.

And thanks for the PKGBUILD as well.

1 Like

@PeterCxy - I removed the override, installed the package and it worked perfectly in Arch. Thank you!

Thanks @PeterCxy I have added through DKMS on Debian-like with KDE and module works.
I have checked how does it react to sleep and after resuming touchscreen doesn’t work.
Can people who use it confirm this behaviour?
I haven’t blacklisted the sdhci family - registers are printed especially in recovery but sleep works from the beginning.
In dmesg there are errors which occur very frequently as below:

[ 3276.565288] Goodix-TS i2c-GDIX1002:00: I2C transfer error: -121
[ 3276.565530] Goodix-TS i2c-GDIX1002:00: I2C write end_cmd error
[ 3276.606241] Goodix-TS i2c-GDIX1002:00: I2C transfer error: -121
[ 3276.606419] Goodix-TS i2c-GDIX1002:00: I2C write end_cmd error
[ 3276.647189] Goodix-TS i2c-GDIX1002:00: I2C transfer error: -121
[ 3276.647421] Goodix-TS i2c-GDIX1002:00: I2C write end_cmd error
[ 3276.688185] Goodix-TS i2c-GDIX1002:00: I2C transfer error: -121
[ 3276.688424] Goodix-TS i2c-GDIX1002:00: I2C write end_cmd error
[ 3276.729176] Goodix-TS i2c-GDIX1002:00: I2C transfer error: -121
[ 3276.729412] Goodix-TS i2c-GDIX1002:00: I2C write end_cmd error
[ 3276.770153] Goodix-TS i2c-GDIX1002:00: I2C transfer error: -121

You can write a script to re-load (unload + load) the goodix module on sleep / resume. The issue will go away.

Hey guys, they released a new bios addressing these issues (v0.24)

2 Likes

touchscreen doesn’t work again since v0.25 up to v0.29