GalliumOS / galliumos-distro

Docs, issues, and artwork sources for GalliumOS
https://galliumos.org/
GNU General Public License v2.0
348 stars 11 forks source link

Touchpad/Touchscreen issues on Caroline #373

Open volfyd opened 7 years ago

volfyd commented 7 years ago

Hi,

I booted up GalliumOS 2.1 liveCD on my Samsung Chromebook Pro and the touchpad didn't work at all. Another user ( https://www.reddit.com/r/GalliumOS/comments/6ji3na/chromebook_pro_caroline_touchpad_issues/ ) experienced another problem where the touchpad wasn't responding to clicks.

Looking through the kernel source for drivers/input/touchscreen/atmel_mxt_ts.c I see that it searches for "GOOGLE" in DMI_SYS_VENDOR to find non-samus chromebooks. However, Caroline reports "Google" instead. The logic must be extended to detect Caroline.

Also, the left button press problem is related to the data structure chromebook_tp_buttons having the wrong information for Caroline. The data structure samus_touchpad_buttons has the correct configuration for Caroline instead. Logic must be added to use this data for Caroline.

I wish I knew which were the generic chromebooks that were meant to be detected by "GOOGLE" and use the other configuration data, so the logic could be made more explicit rather than finding non-samus chromebooks and assuming they are configured a certain way.

reynhout commented 7 years ago

@volfyd Thank you for this info! We'll get these packages updated.

dantrevino commented 7 years ago

Is there an update kernel available with these changes? Dev version or something?

reynhout commented 7 years ago

@volfyd I think the variation of GOOGLE vs. Google is determined by firmware. We use the same platform data on generic Chromebooks for both cases already.

It sounds like the generic platform data doesn't work for Caroline though, so we'll need to add another special case. I don't have a device to test, but I can take a shot at it and push up a test kernel.

dantrevino commented 7 years ago

@volfyd I have 2.1 installed. Just using the stylus for now. If you make a test kernel I'll take it for spin.

reynhout commented 7 years ago

@dantrevino Awesome, thank you. I've added a 4.12 test kernel with the CAROLINE platform data to the galliumos-testing repository.

To enable and install:

sudo galliumos-repodist --enable testing
galliumos-update

Or you can download the pkg file and install it directly manually:

curl -O http://apt.galliumos.org/pool/main/l/linux-4.12.0-galliumos/linux-image-4.12.0-galliumos_4.12.0-galliumos2_amd64.deb
sudo dpkg -i linux-image-4.12.0-galliumos_4.12.0-galliumos2_amd64.deb
mmeyer724 commented 7 years ago

@reynhout Unfortunately the trackpad on my Chromebook Pro does not work at all under this new kernel. Is there anything I can grab for you to assist development? nothing exciting in dmesg as far as I can tell. 🙈

reynhout commented 7 years ago

@mmeyer724 Rats, OK. Thanks for checking it out.

Maybe I missed something in the patch. @volfyd does this look reasonable? Any chance the DMI_PRODUCT_NAME fails to match?

Full diff (including other platforms): https://github.com/GalliumOS/linux/blob/v4.12.0-galliumos/galliumos/diffs/add-touchpad-touchscreen-support.diff

Here are the CAROLINE bits:

static unsigned int caroline_tp_buttons[] = {
    KEY_RESERVED,
    KEY_RESERVED,
    KEY_RESERVED,
    BTN_LEFT
};

static struct mxt_acpi_platform_data caroline_platform_data[] = {
    {
        /* Touchpad */
        .hid    = "ATML0000",
        .pdata  = {
            .t19_num_keys   = ARRAY_SIZE(caroline_tp_buttons),
            .t19_keymap = caroline_tp_buttons,
        },
    },
    {
        /* Touchscreen */
        .hid    = "ATML0001",
    },
    { }
}; 
    {
        /* Samsung Chromebook Pro */
        .ident = "Samsung Chromebook Pro",
        .matches = {
            DMI_MATCH(DMI_PRODUCT_NAME, "Caroline"),
        },
        .driver_data = caroline_platform_data,
    }, 
reynhout commented 7 years ago

@mmeyer724 If you have dmesg output on the new kernel, please pastebin it (e.g. dmesg|pastebinit) so we can take a look.

I've gone over the patch and it looks like it should do all the right things...and matches @volfyd's description as far as I can tell. Hopefully we can find something in dmesg. Thanks!

mmeyer724 commented 7 years ago

@reynhout it looks like there has been at least one kernel update since the last time I tested this out (5 days ago). I'm happy to say that my trackpad now works! :-)

reynhout commented 7 years ago

@mmeyer724 Awesome, thanks for the update! There is just one outstanding issue left on kernel 4.12.0-galliumos3 before we can promote it to the stable repositories.

dantrevino commented 7 years ago

@mmeyer724 what kernel are you using? I have xenon-testing enabled and kernel 4.12.0-galliumos but still do not have a working trackpad.

reynhout commented 7 years ago

@dantrevino make sure you have pkg 4.12.0-galliumos3. Check with dpkg -l linux-image\*. If you have an earlier version, just run galliumos-update.

mmeyer724 commented 7 years ago

Update: I installed gnome3 (it's much better on HiDPI screens) and the trackpad stopped working, even in xfce 😕. I know this is an unsupported configuration, so I don't expect any assistance, but I'm curious to know what your thoughts are on a Gnome-based GalliumOS.

XFCE is barely usable on super high resolution devices like Caroline. I tried all of the usual tricks like increasing the font size and using half resolution, but nothing even comes close to Gnome in regards to HiDPI.

What I would really love, though, is a gallium-ified Fedora (w/wayland).. maybe I'll take a crack at that.

reynhout commented 7 years ago

@mmeyer724 We've seen reports that many touchpads don't work on Gnome. We don't really keep track though, for obvious reasons.

We have a package for HiDPI config: galliumos-hidpi which might meet your needs for Xfce. We use it on the SAMUS image, and recommend it for LINK and CHELL. CAROLINE is 2400x1600, so it would definitely help there too.

After installing the package, you'd need to copy the config files into your existing user directory (they'll be copied automatically into new user config). You can just copy straight from /etc/skel/.config/xfce4 to $HOME/.config/xfce4 but keep in mind that you'll overwrite any existing customization with the default settings.

dantrevino commented 7 years ago

dpkg -l linux-image*

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                           Version           Architecture Description
+++-==============================-=================-============-======================================
un  linux-image                    <none>            <none>       (no description available)
un  linux-image-2.6                <none>            <none>       (no description available)
ii  linux-image-4.12.0-galliumos   4.12.0-galliumos3 amd64        Linux kernel, version 4.12.0-galliumos
ii  linux-image-4.8.17-galliumos   4.8.17-galliumos4 amd64        Linux kernel, version 4.8.17-galliumos
ii  linux-image-galliumos          2.0.9             all          GalliumOS kernel for most models
un  linux-image-galliumos-baytrail <none>            <none>       (no description available)
un  linux-image-galliumos-braswell <none>            <none>       (no description available)

uname -a Linux caroline 4.12.0-galliumos #1 SMP PREEMPT Sat Jul 22 00:40:58 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

reynhout commented 7 years ago

@dantrevino Hmm, confusing. That's the right pkg. @mmeyer724 any idea whether you did anything else/had other config in place when it worked for you?

dantrevino commented 7 years ago

I just tried to re-install. I'm seeing missing firmware messages that I dont remember seeing before. I likely wasnt paying attention. But a)why am i getting complaints about missing kabylake and broxton firmware? Is that normal? b) where can i find the skylake 1398 module? Not sure what that is for. Touchpad related?

Touchpad is working. Not sure what I did differently before.

dan@caroline ~ % sudo dpkg -i linux-image-4.12.0-galliumos_4.12.0-galliumos3_amd64.deb
sudo] password for dan: 
(Reading database ... 261801 files and directories currently installed.)
Preparing to unpack linux-image-4.12.0-galliumos_4.12.0-galliumos3_amd64.deb ...
Unpacking linux-image-4.12.0-galliumos (4.12.0-galliumos3) over (4.12.0-galliumos3) ...
Setting up linux-image-4.12.0-galliumos (4.12.0-galliumos3) ...
update-initramfs: Generating /boot/initrd.img-4.12.0-galliumos
W: Possible missing firmware /lib/firmware/i915/kbl_dmc_ver1_01.bin for module i915
W: Possible missing firmware /lib/firmware/i915/kbl_guc_ver9_14.bin for module i915
W: Possible missing firmware /lib/firmware/i915/bxt_guc_ver8_7.bin for module i915
W: Possible missing firmware /lib/firmware/i915/kbl_huc_ver02_00_1810.bin for module i915
W: Possible missing firmware /lib/firmware/i915/bxt_huc_ver01_07_1398.bin for module i915
W: Possible missing firmware /lib/firmware/i915/skl_huc_ver01_07_1398.bin for module i915
Generating grub configuration file ...
Found background: /usr/share/pixmaps/galliumos-solidblue.png
Found background image: /usr/share/pixmaps/galliumos-solidblue.png
Found linux image: /boot/vmlinuz-4.12.0-galliumos
Found initrd image: /boot/initrd.img-4.12.0-galliumos
Found linux image: /boot/vmlinuz-4.8.17-galliumos
Found initrd image: /boot/initrd.img-4.8.17-galliumos
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done
dantrevino commented 7 years ago

Oh and thank you @reynhout !

reynhout commented 7 years ago

@dantrevino The "possible missing firmware" messages are normal, and they show up even on inapplicable platforms. I looked into suppressing them, but I didn't see a simple way to do it without also suppressing relevant ones.

I think the SKL line is referring to this: https://01.org/linuxgraphics/downloads/skylake-huc-1.07

Which might or might not be useful/important, I don't know. I don't have a Skylake to test, and I'm not sure what a good test would be (is HEVC used for both encoding and decoding?). I'll try to figure out why the kernel knows to look for it, but does not seem to include it in the pkg.

Glad to hear the trackpad is working. :)

thad137 commented 7 years ago

I am the one who wrote the Reddit post above. (I haven't commented on here, because I know just enough about Linux to avoid most issues but not nearly enough to actively engaged here.) I'm not sure if it's helpful, but I switched to the testing branch and my touchpad is working. Although, after some reboots, the touchpad loses all functionality until I reboot again. I'm going to try to get a dmesg output next time it happens.

mmeyer724 commented 7 years ago

@reynhout I didn't have anything special in place for the trackpad to start working, although it did stop working on me once for no apparent reason. Glitchy hardware?

By the way, I got Fedora 26 running on my Chromebook with a rebuilt 4.12 kernel package (I applied your patches for GalliumOS). Everything works except for the top row keyboard shortcuts and internal audio, which is expected. I kept GalliumOS installed on the SD Card so I can dual boot, of course 😃 .

reynhout commented 7 years ago

@thad137 Well that's interesting...fits the reports of inconsistency from @thad137 and @mmeyer724 as well. Hopefully dmesg output when the device stops working will have some clues.

thad137 commented 7 years ago

@reynhout I got it to do it again. http://paste.ubuntu.com/25156666/

On the stable branch, my mouse would move when using the touchpad, but when the mouse doesn't work on the testing branch, it won't move or even show up on screen until I use the touchscreen. A reboot brings it back to working order every time (this is only the third time, the first since I said I would try to get a dmesg.

reynhout commented 7 years ago

@thad137 Thanks for the logs. I don't see the touchpad registration in there at all, can you also pastebin a dmesg from when it's working correctly so we can compare? :)

thad137 commented 7 years ago

@reynhout I'm happy to help. Here's the working mouse dmesg.

paste.ubuntu.com/25159760

thad137 commented 7 years ago

Woops, here's the link.

http://paste.ubuntu.com/25159760

reynhout commented 7 years ago

@thad137 Thanks.

I wonder if the touchpad device is not responding quickly enough to an i2c probe, and therefore being skipped by the kernel?

Both the touchscreen and the touchpad are called Touchscreen in the logs. The real touchscreen (i2c-ATML0001:00) loads properly in both cases, but the touchpad (i2c-ATML0000:00) does not.

Relevant excerpts:

Working:

[    3.202548] atmel_mxt_ts i2c-ATML0000:00: Direct firmware load for maxtouch.cfg failed with error -2
[    3.203152] atmel_mxt_ts i2c-ATML0000:00: Resetting device
[    3.204526] atmel_mxt_ts i2c-ATML0001:00: Direct firmware load for maxtouch.cfg failed with error -2
[    3.205977] atmel_mxt_ts i2c-ATML0001:00: Touchscreen size X4095Y2729
[    3.206039] input: Atmel maXTouch Touchscreen as /devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-6/i2c-ATML0001:00/input/input7
[    3.206111] atmel_mxt_ts i2c-ATML0001:00: Family: 164 Variant: 14 Firmware V2.3.AA Objects: 40
[    3.332551] atmel_mxt_ts i2c-ATML0000:00: Touchscreen size X1920Y1080
[    3.332621] input: Atmel maXTouch Touchpad as /devices/pci0000:00/0000:00:15.1/i2c_designware.1/i2c-7/i2c-ATML0000:00/input/input14
[    3.332713] atmel_mxt_ts i2c-ATML0000:00: Family: 164 Variant: 17 Firmware V2.0.AA Objects: 31

Non-working:

[    3.193726] atmel_mxt_ts i2c-ATML0001:00: Direct firmware load for maxtouch.cfg failed with error -2
[    3.195165] atmel_mxt_ts i2c-ATML0001:00: Touchscreen size X4095Y2729
[    3.195242] input: Atmel maXTouch Touchscreen as /devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-6/i2c-ATML0001:00/input/input14
[    3.195345] atmel_mxt_ts i2c-ATML0001:00: Family: 164 Variant: 14 Firmware V2.3.AA Objects: 40
dantrevino commented 7 years ago

I reinstalled and lost the touchpad. I have:

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                           Version           Architecture Description
+++-==============================-=================-============-======================================
un  linux-image                    <none>            <none>       (no description available)
un  linux-image-2.6                <none>            <none>       (no description available)
ii  linux-image-4.12.0-galliumos   4.12.0-galliumos3 amd64        Linux kernel, version 4.12.0-galliumos
ii  linux-image-4.8.17-galliumos   4.8.17-galliumos4 amd64        Linux kernel, version 4.8.17-galliumos
ii  linux-image-galliumos          2.0.9             all          GalliumOS kernel for most models
un  linux-image-galliumos-baytrail <none>            <none>       (no description available)
un  linux-image-galliumos-braswell <none>            <none>       (no description available)

http://paste.ubuntu.com/25275320/

dantrevino commented 7 years ago

FYI, this workaround works for me:

  1. blacklist atmel_mxt_ts (/etc/modprobe.d/blacklist.conf)
  2. reboot
  3. launch terminal (ctrl-alt-t)
  4. sudo modprobe atmel_mxt_ts
thad137 commented 7 years ago

Just as an update, because I'm not sure if booting from an SD card is officially supported.

I reinstalled Gallium on my SD card and enabled testing, made sure I was on the 4.12 kernel and now I can't get the touchpad to work at all, no matter how many reboots I do. However, using the method @dantrevino mentions brings it back.

aytackanaci commented 6 years ago

I also installed on SD card and having similar issues: after @dantrevino method, on login: pointer starts frozen, runnung sudo modprobe atmel_mxt_ts brings it back. After this when I select a text and right click, pointer moves but left click stops working (even with a mouse connected)

@thad137 Does installing on the internal drive resolve these issues?

thad137 commented 6 years ago

@aytackanaci I never had the right click issue you have. After following the method you did, I haven't had to touch anything.

aytackanaci commented 6 years ago

@thad137 I did a fresh install and enabled testing, now it all seems to work fine. Even though it's installed on the SD card, everything is really responsive.

seppiola commented 6 years ago

I know this issue is old but I think this should potentially solve the issue. The atmel_mx_ts driver quirk that solves the issue has been merged in mainline and stable linux releases, as you can see here (https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=v4.16.8&id=35bc2e5d8e27fe3aca059ddf8e1ee993ce9ad785). As long as the DMI strings relatives to the driver match (stock default ones) are left untouched, the touchpad is not detected as touchscreen any more and both touchscreen and touchpad work correctly.

NicholasConrad commented 3 years ago

Just thought I would add: I installed Gallium on my Chromebook pro this week, touchpad works fine except the 'reverse scroll direction' checkbox had no effect, I had to add line:

Option "Australian Scrolling" "1" to

/usr/share/X11/xorg.conf.d/50-touchpad-cmt-caroline.conf

I suggest this issue be closed.