Apple Magic Trackpad 2

Getting your soundcard to work, using Debian on non-i386 hardware, etc

Apple Magic Trackpad 2

Postby kwiqsilver » 2019-02-13 00:51

Has anyone here set up a Magic Trackpad 2 on Debian? Upon plugging mine in, tracking and clicking work, but nothing else. I followed a few online guides suggesting I create a quirks file, but that didn't seem to do anything.

I'm running Buster with kernel 4.19.0, and using libinput to connect to the trackpad.

When I run libinput record /dev/input/event0, the only inputs I see are from scrolling and clicking. If I try to scroll with two fingers, it reads each finger as a separate input.
When I run libinput measure touchpad-pressure /dev/input/event0 (something the guide I followed suggested), I get this output:

Using Apple Inc. Magic Trackpad 2 Mouse: /dev/input/event0
Error: device does not have ABS_PRESSURE/ABS_MT_PRESSURE

This makes me wonder if it's not configuring the device properly.
kwiqsilver
 
Posts: 4
Joined: 2018-12-03 19:15

Re: Apple Magic Trackpad 2

Postby pylkko » 2019-02-13 14:24

Apple is notorious for hiding how it's things work. Look at this repo for an idea of how hard it is even to just get a keyboard or touchpad to work. Note the code is not yet even mainlined into the kernel, this is a DKMS. There are news pieces on the net that Google is trying to get the magic trackpad to work on linux from last September. I think it is highly possible that whatever code they managed to get done this far is not complete and perhaps only includes basic functionality. this I suspect already from the comments from the people on the article in phoronix.


https://github.com/cb22/macbook12-spi-driver/

But with respect to the error message. It might be that the kernel on Debian is compiled so that is missing something required for it to work. Have you checked this?

Could you please link whatever guide you are using`?
User avatar
pylkko
 
Posts: 1798
Joined: 2014-11-06 19:02

Re: Apple Magic Trackpad 2

Postby kwiqsilver » 2019-02-14 05:50

I kept trying and got it mostly working-ish.

I'll put my notes here for anyone interested in trying it out:

I have kernel 4.19.0-2 installed in buster/testing. With 4.20+, the driver is built into the kernel, so you wouldn't need to download, build, and install the module.

Install your kernel headers (make sure the meta-package points to a package that matches your kernel version), dkms (a tool for managing kernel modules), and the libinput packages.
Code: Select all
$ sudo apt install linux-headers-amd64 dkms libinput-bin libinput-tools

Download the driver source from github. I downloaded the zip file.
Build and install the module.
Code: Select all
$ cd Linux-Magic-Trackpad-2-Driver-master/linux/drivers/hid
$ make
$ sudo bash ../../../scripts/install.sh

It should be installed and loaded into your kernel. Run this command to ensure it is.
Code: Select all
$ lsmod | grep hid_magicmouse

At this point, I have clicking, single finger scrolling (i.e. move the mouse pointer), two finger scrolling (i.e. scroll the page up/down left/right), and button clicking (mouse button 1 only).
For now I've used xinput to fix the properties. Figure out the ID of the trackpad.
Code: Select all
$ xinput list | grep 'Magic Trackpad'

Show the properties, to figure out which ones you want to change. I changed Drag Lock Enabled, Tapping Enabled, and Natural Scrolling Enabled. You need the ID in parentheses for the property.
Code: Select all
$ xinput list-props <Trackpad ID>

Then to change one:
Code: Select all
$ xinput set-prop <Trackpad ID> <Property ID> <new value>

That gave me natural scrolling (aka Australian scrolling), tap for button 1, two finger tap for button 2, and three finger tap for button 3. I don't have inertial scrolling, but I'd like to, so I'll keep looking into that.

These values will revert if you power off or disconnect the trackpad (including during a reboot), so it's not the best solution. I'm going to keep looking into using libinput to permanently configure things the way I want them, but the Trackpad is in a state where I can use it as my primary input device and save my wrist, so that's pretty good progress.
kwiqsilver
 
Posts: 4
Joined: 2018-12-03 19:15


Return to Hardware

Who is online

Users browsing this forum: No registered users and 12 guests

fashionable