Linux-Magic-Trackpad-2-Driver icon indicating copy to clipboard operation
Linux-Magic-Trackpad-2-Driver copied to clipboard

Magic Mouse Scrolling not working in Ubuntu 19.04

Open ddalida opened this issue 5 years ago • 43 comments

I had this module working in 18.04 with the 4.20... kernel without issues. I know it has been implemented into the release but the scrolling isn't working. I've tried rmmod and insmod under the 5.0.0-13 kernel with 19.04 but no joy. This is with the Magic Mouse 2 and not the trackpad.

Am I missing something? Any info that could be relevant I can provide?

ddalida avatar May 02 '19 20:05 ddalida

This is what gets loaded at startup (lsmod | grep hid):

hid_apple 16384 0 hidp 28672 2 hid_generic 16384 0 bluetooth 557056 40 btrtl,hidp,btintel,btbcm,bnep,btusb,rfcomm usbhid 53248 0 mac_hid 16384 0 hid_magicmouse 20480 0 hid 126976 5 hidp,usbhid,hid_apple,hid_generic,hid_magicmouse

ddalida avatar May 02 '19 21:05 ddalida

(--Moving from a closed issue--)

@romanAbrahamovic how much work would supporting Magic Mouse 2 take? (Enabling scrolling, that is)

I recon there would be many Linux users happy to buy you a coffee if you got this working...

stubbulon5 avatar Jun 17 '19 15:06 stubbulon5

I found that there is a branch in @rohitpid's fork that is at least a start on getting MM2 to work, but I haven't tested it: https://github.com/rohitpid/Linux-Magic-Trackpad-2-Driver/tree/magicmouse2

djhoese avatar Sep 05 '19 20:09 djhoese

It work i tested

mrdev023 avatar Sep 12 '19 08:09 mrdev023

It work i tested

You mean Magi Mouse 2 scrolling with the above repository link?

stubbulon5 avatar Sep 12 '19 11:09 stubbulon5

I found that there is a branch in @rohitpid's fork that is at least a start on getting MM2 to work, but I haven't tested it: https://github.com/rohitpid/Linux-Magic-Trackpad-2-Driver/tree/magicmouse2

I tested it today, and it worked! thanks @rohitpid

stubbulon5 avatar Sep 27 '19 15:09 stubbulon5

Hi, wondering if anyone can help with debugging an issue on this magicmouse2 driver. I'm using the fork from @rohitpid, unfortunately there's no way to file issues on that repo so I'm commenting here. The mouse connects over bluetooth successfully every time but the scroll wheel does not work until I reload the driver using:

sudo rmmod hid_magicmouse
sudo insmod /lib/modules/5.3.0-7625-generic/updates/dkms/hid-magicmouse.ko

These are the logs in ~/.local/share/xorg/Xorg.1.log:

[    30.156] (II) config/udev: Adding input device Home Mouse (/dev/input/mouse1)
[    30.156] (II) No input driver specified, ignoring this device.
[    30.156] (II) This device may have been added with another device file.
[    30.212] (II) config/udev: Adding input device Home Mouse (/dev/input/event14)
[    30.212] (**) Home Mouse: Applying InputClass "libinput pointer catchall"
[    30.212] (II) Using input driver 'libinput' for 'Home Mouse'
[    30.213] (II) systemd-logind: got fd for /dev/input/event14 13:78 fd 60 paused 0
[    30.213] (**) Home Mouse: always reports core events
[    30.213] (**) Option "Device" "/dev/input/event14"
[    30.213] (**) Option "_source" "server/udev"
[    30.217] (II) event14 - Home Mouse: is tagged by udev as: Mouse
[    30.217] (EE) event14 - Home Mouse: libinput bug: kernel fuzz of 4 but LIBINPUT_FUZZ_35 is missing
[    30.217] (EE) event14 - Home Mouse: libinput bug: kernel fuzz of 4 but LIBINPUT_FUZZ_36 is missing
[    30.217] (II) event14 - Home Mouse: device is a pointer
[    30.218] (II) event14 - Home Mouse: device removed
[    30.218] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:14.0/usb1/1-10/1-10:1.0/bluetooth/hci0/hci0:256/0005:004C:0269.0001/input/input23/event14"
[    30.218] (II) XINPUT: Adding extended input device "Home Mouse" (type: MOUSE, id 12)
[    30.220] (**) Option "AccelerationScheme" "none"
[    30.221] (**) Home Mouse: (accel) selected scheme none/0
[    30.221] (**) Home Mouse: (accel) acceleration factor: 2.000
[    30.221] (**) Home Mouse: (accel) acceleration threshold: 4
[    30.224] (II) event14 - Home Mouse: is tagged by udev as: Mouse
[    30.224] (EE) event14 - Home Mouse: libinput bug: kernel fuzz of 4 but LIBINPUT_FUZZ_35 is missing
[    30.224] (EE) event14 - Home Mouse: libinput bug: kernel fuzz of 4 but LIBINPUT_FUZZ_36 is missing
[    30.225] (II) event14 - Home Mouse: device is a pointer
[    61.796] (II) config/udev: removing device Home Mouse
[    61.796] (**) Option "fd" "60"
[    61.796] (II) event14 - Home Mouse: device removed
[    61.803] (II) UnloadModule: "libinput"
[    61.803] (II) systemd-logind: releasing fd for 13:78
[    61.830] (II) config/udev: Adding input device Home Mouse (/dev/input/mouse1)
[    61.831] (II) No input driver specified, ignoring this device.
[    61.831] (II) This device may have been added with another device file.
[    61.875] (II) config/udev: Adding input device Home Mouse (/dev/input/event14)
[    61.876] (**) Home Mouse: Applying InputClass "libinput pointer catchall"
[    61.876] (II) Using input driver 'libinput' for 'Home Mouse'
[    61.889] (EE) systemd-logind: failed to take device /dev/input/event14: No such device
[    61.889] (**) Home Mouse: always reports core events
[    61.889] (**) Option "Device" "/dev/input/event14"
[    61.889] (**) Option "_source" "server/udev"
[    61.889] (EE) xf86OpenSerial: Cannot open device /dev/input/event14
	Permission denied.
[    61.889] (II) event14: opening input device '/dev/input/event14' failed (Permission denied).
[    61.889] (II) event14 - failed to create input device '/dev/input/event14'.
[    61.889] (EE) libinput: Home Mouse: Failed to create a device for /dev/input/event14
[    61.889] (EE) PreInit returned 2 for "Home Mouse"
[    61.889] (II) UnloadModule: "libinput"
[    61.891] (II) config/udev: Adding input device Home Mouse (/dev/input/event15)
[    61.891] (II) No input driver specified, ignoring this device.
[    61.891] (II) This device may have been added with another device file.
[    61.984] (II) config/udev: Adding input device Home Mouse (/dev/input/mouse1)
[    61.984] (II) No input driver specified, ignoring this device.
[    61.984] (II) This device may have been added with another device file.
[    62.060] (II) config/udev: Adding input device Home Mouse (/dev/input/event14)
[    62.060] (**) Home Mouse: Applying InputClass "libinput pointer catchall"
[    62.060] (II) Using input driver 'libinput' for 'Home Mouse'
[    62.066] (II) systemd-logind: got fd for /dev/input/event14 13:78 fd 68 paused 0
[    62.066] (**) Home Mouse: always reports core events
[    62.066] (**) Option "Device" "/dev/input/event14"
[    62.066] (**) Option "_source" "server/udev"
[    62.069] (II) event14 - Home Mouse: is tagged by udev as: Mouse
[    62.069] (EE) event14 - Home Mouse: libinput bug: kernel fuzz of 4 but LIBINPUT_FUZZ_35 is missing
[    62.069] (EE) event14 - Home Mouse: libinput bug: kernel fuzz of 4 but LIBINPUT_FUZZ_36 is missing
[    62.070] (II) event14 - Home Mouse: device is a pointer
[    62.070] (II) event14 - Home Mouse: device removed
[    62.070] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:14.0/usb1/1-10/1-10:1.0/bluetooth/hci0/hci0:256/0005:004C:0269.0001/input/input26/event14"
[    62.070] (II) XINPUT: Adding extended input device "Home Mouse" (type: MOUSE, id 12)
[    62.072] (**) Option "AccelerationScheme" "none"
[    62.074] (**) Home Mouse: (accel) selected scheme none/0
[    62.074] (**) Home Mouse: (accel) acceleration factor: 2.000
[    62.074] (**) Home Mouse: (accel) acceleration threshold: 4
[    62.077] (II) event14 - Home Mouse: is tagged by udev as: Mouse
[    62.077] (EE) event14 - Home Mouse: libinput bug: kernel fuzz of 4 but LIBINPUT_FUZZ_35 is missing
[    62.077] (EE) event14 - Home Mouse: libinput bug: kernel fuzz of 4 but LIBINPUT_FUZZ_36 is missing
[    62.077] (II) event14 - Home Mouse: device is a pointer

jeffywu avatar Jan 02 '20 06:01 jeffywu

I had the same issue and my mouse would randomly disconnect. I ended up getting rid of my magic mouse and switched to a logitech bluetooth mouse after I couldn't find a solution to the scrolling issue. You may have luck with the "unstable" branch mentioned above.

djhoese avatar Jan 02 '20 17:01 djhoese

Hello, I have been scrolling through several of these issues and found some solutions, I decided to pick some of them up and compiled them. Can you please try my solution out?

https://github.com/RicardoEPRodrigues/Linux-Magic-Trackpad-2-Driver

This should fix 2 problems: Magic Mouse 2 driver not loading after reconnection and random Bluetooth disconnections.

RicardoEPRodrigues avatar Feb 03 '20 23:02 RicardoEPRodrigues

@RicardoEPRodrigues, thanks! I tested out your instructions and they worked well. A couple minor suggestions. This udev configuration works well for me, in your version the second line is missing a comma and a backslash I believe.

SUBSYSTEMS=="input", \
    ATTRS{name}=="XXX", \
    ACTION=="add", \
    SYMLINK+="input/magicmouse", \
    RUN+="/opt/magic-mouse-fix/magic-mouse-2-add.sh"

I was able to view the properties on the mouse via dbus: dbus-send --system --print-reply --type=method_call --dest=org.bluez / org.freedesktop.DBus.ObjectManager.GetManagedObjects

jeffywu avatar Feb 05 '20 06:02 jeffywu

Hello, thank you for the input! I updated the udev rule. I hope it now works correctly:

SUBSYSTEMS=="usb", \
    ATTRS{idProduct}=="e300", \
    ACTION=="add", \
    SYMLINK+="input/magicmouse", \
    RUN+="/opt/magic-mouse-fix/magic-mouse-2-add.sh"

Correct me if I'm wrong, but I think this rule goes like: "if an usb device with the product id of e300 is detected (the ID is the one from the Magic Mouse) then load an input driver for that device".

I read more info on the device based on this command udevadm info -a -p $(udevadm info -q path -n /dev/input/eventXX). Change the /dev/input/eventXX with the correct device in your OS.

RicardoEPRodrigues avatar Feb 05 '20 10:02 RicardoEPRodrigues

Hello again, sorry for the SPAM.

My solution doesn't work as is. The way I was trying to do things was to read an id from usb1/X-X which is specific to the PC and not the mouse.

I trying to find a solution. If we can find a Magic Mouse 2 ID in the udev info then we can change the rule and the solution should work for everyone.

If not, then I'm trying to find an ID in the Bluetooth info, with that we can have a script running every time an input device is plugged in, but that script will only load the drive if that device is a Magic Mouse 2.

You can help me by posting a file with the output of this command udevadm info -a -p $(udevadm info -q path -n /dev/input/eventXX), where you need to change the /dev/input/eventXX with the XX corresponding with the Magic Mouse 2.

RicardoEPRodrigues avatar Feb 06 '20 10:02 RicardoEPRodrigues

Ok, I figured it out.

I rewrote the rule to catch all the Magic Mouse 2. FINALLY. Check this out:

SUBSYSTEM=="input", \
    KERNEL=="mouse*", \
    KERNELS=="0005:004C:0269*", \
    ACTION=="add", \
    SYMLINK+="input/magicmouse-%k", \
    RUN+="/opt/magic-mouse-fix/magic-mouse-2-add.sh"

Remember to try my ./install in my repo. Any input is good input.

RicardoEPRodrigues avatar Feb 06 '20 13:02 RicardoEPRodrigues

The second rule works for me. Thanks for your effort!

jeffywu avatar Feb 10 '20 04:02 jeffywu

This isn't working on Elementary OS 5.1.5. Here's the steps I'm taking. Move the original kernel driver hid-magicmouse.ko from my 5.3.0-59-generic kernel and running "depmod -a" then reboot. After the system comes back up I'm following the install instructions (git clone and then running the install.sh as root) and reboot. When the system is back up and I click the mouse it is seen and paired but the pointer doesn't move, the track-pad still works though. Here's the output from my xorg.log:

[ 546.767] (II) config/udev: Adding input device (unnamed) (/dev/input/mouse0) [ 546.767] (II) No input driver specified, ignoring this device. [ 546.767] (II) This device may have been added with another device file. [ 609.625] (EE) event16 - bcm5974: kernel bug: Touch jump detected and discarded. See https://wayland.freedesktop.org/libinput/doc/1.10.4/touchpad_jumping_cursor.html for details [ 692.303] (II) config/udev: Adding input device Magic Mouse 2 (/dev/input/event7) [ 692.303] () Magic Mouse 2: Applying InputClass "libinput pointer catchall" [ 692.303] (II) Using input driver 'libinput' for 'Magic Mouse 2' [ 692.303] () Magic Mouse 2: always reports core events [ 692.303] () Option "Device" "/dev/input/event7" [ 692.303] () Option "_source" "server/udev" [ 692.322] (EE) xf86OpenSerial: Cannot open device /dev/input/event7 No such device. [ 692.322] (II) event7: opening input device '/dev/input/event7' failed (No such device). [ 692.322] (II) event7 - failed to create input device '/dev/input/event7'. [ 692.322] (EE) libinput: Magic Mouse 2: Failed to create a device for /dev/input/event7 [ 692.322] (EE) PreInit returned 2 for "Magic Mouse 2" [ 692.322] (II) UnloadModule: "libinput"

Please let me know if you need more info from me. Thanks, Ralph

ralphsc avatar Jun 11 '20 18:06 ralphsc

@ralphsc did you try my fork?

https://github.com/RicardoEPRodrigues/Linux-Magic-Trackpad-2-Driver

I have a pending pull-request (https://github.com/rohitpid/Linux-Magic-Trackpad-2-Driver/pull/1) where some discussion has been going on. It might help.

RicardoEPRodrigues avatar Jun 12 '20 13:06 RicardoEPRodrigues

Hi Ricardo, Yes I was using your fork for this.

I'll take a look at https://github.com/rohitpid/Linux-Magic-Trackpad-2-Driver/pull/1 and let you know how it goes.

On Fri, Jun 12, 2020 at 9:20 AM Ricardo Rodrigues [email protected] wrote:

@ralphsc https://github.com/ralphsc did you try my fork?

https://github.com/RicardoEPRodrigues/Linux-Magic-Trackpad-2-Driver

I have a pending pull-request (rohitpid#1 https://github.com/rohitpid/Linux-Magic-Trackpad-2-Driver/pull/1) where some discussion has been going on. It might help.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mwyborski/Linux-Magic-Trackpad-2-Driver/issues/38#issuecomment-643266668, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEM4WWIFX33SAHI74QPYPELRWITQXANCNFSM4HKH6HEQ .

ralphsc avatar Jun 12 '20 13:06 ralphsc

Ricardo, I tried the suggestions in the link you sent but it's still not working. This time I installed by running install-fix.sh, the mouse now moves but without scrolling. I also removed / moved the original kernel hid-magicmouse.ko driver before starting. Here's the xorg log when the mouse is loaded:

[ 805.929] (II) config/udev: Adding input device Magic Mouse 2 (/dev/input/mouse0) [ 805.929] (II) No input driver specified, ignoring this device. [ 805.929] (II) This device may have been added with another device file. [ 806.011] (II) config/udev: Adding input device Magic Mouse 2 (/dev/input/event7) [ 806.011] () Magic Mouse 2: Applying InputClass "libinput pointer catchall" [ 806.011] (II) Using input driver 'libinput' for 'Magic Mouse 2' [ 806.011] () Magic Mouse 2: always reports core events [ 806.012] () Option "Device" "/dev/input/event7" [ 806.012] () Option "_source" "server/udev" [ 806.012] (II) event7 - Magic Mouse 2: is tagged by udev as: Mouse [ 806.012] (II) event7 - Magic Mouse 2: device is a pointer [ 806.012] (II) event7 - Magic Mouse 2: device removed [ 806.067] () Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8.3/1-8.3:1.0/bluetooth/hci0/hci0:12/0005:004C:0269.000A/input/input225/event7" [ 806.067] (II) XINPUT: Adding extended input device "Magic Mouse 2" (type: MOUSE, id 13) [ 806.068] () Option "AccelerationScheme" "none" [ 806.069] () Magic Mouse 2: (accel) selected scheme none/0 [ 806.069] () Magic Mouse 2: (accel) acceleration factor: 2.000 [ 806.069] (**) Magic Mouse 2: (accel) acceleration threshold: 4 [ 806.070] (II) event7 - Magic Mouse 2: is tagged by udev as: Mouse [ 806.070] (II) event7 - Magic Mouse 2: device is a pointer

On Fri, Jun 12, 2020 at 9:35 AM Ralph Crongeyer [email protected] wrote:

Hi Ricardo, Yes I was using your fork for this.

I'll take a look at https://github.com/rohitpid/Linux-Magic-Trackpad-2-Driver/pull/1 and let you know how it goes.

On Fri, Jun 12, 2020 at 9:20 AM Ricardo Rodrigues < [email protected]> wrote:

@ralphsc https://github.com/ralphsc did you try my fork?

https://github.com/RicardoEPRodrigues/Linux-Magic-Trackpad-2-Driver

I have a pending pull-request (rohitpid#1 https://github.com/rohitpid/Linux-Magic-Trackpad-2-Driver/pull/1) where some discussion has been going on. It might help.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mwyborski/Linux-Magic-Trackpad-2-Driver/issues/38#issuecomment-643266668, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEM4WWIFX33SAHI74QPYPELRWITQXANCNFSM4HKH6HEQ .

ralphsc avatar Jun 12 '20 13:06 ralphsc

And just so you can see what happens with the udev rule in place here's the xorg log output when the mouse is connected:

[ 1845.138] (II) config/udev: Adding input device Magic Mouse 2 (/dev/input/event7) [ 1845.139] () Magic Mouse 2: Applying InputClass "libinput pointer catchall" [ 1845.139] (II) Using input driver 'libinput' for 'Magic Mouse 2' [ 1845.139] () Magic Mouse 2: always reports core events [ 1845.139] () Option "Device" "/dev/input/event7" [ 1845.139] () Option "_source" "server/udev" [ 1845.155] (EE) xf86OpenSerial: Cannot open device /dev/input/event7 No such device. [ 1845.155] (II) event7: opening input device '/dev/input/event7' failed (No such device). [ 1845.155] (II) event7 - failed to create input device '/dev/input/event7'. [ 1845.155] (EE) libinput: Magic Mouse 2: Failed to create a device for /dev/input/event7 [ 1845.155] (EE) PreInit returned 2 for "Magic Mouse 2" [ 1845.155] (II) UnloadModule: "libinput" [ 1849.370] (II) config/udev: Adding input device (unnamed) (/dev/input/mouse0) [ 1849.370] (II) No input driver specified, ignoring this device. [ 1849.370] (II) This device may have been added with another device file.

On Fri, Jun 12, 2020 at 9:58 AM Ralph Crongeyer [email protected] wrote:

Ricardo, I tried the suggestions in the link you sent but it's still not working. This time I installed by running install-fix.sh, the mouse now moves but without scrolling. I also removed / moved the original kernel hid-magicmouse.ko driver before starting. Here's the xorg log when the mouse is loaded:

[ 805.929] (II) config/udev: Adding input device Magic Mouse 2 (/dev/input/mouse0) [ 805.929] (II) No input driver specified, ignoring this device. [ 805.929] (II) This device may have been added with another device file. [ 806.011] (II) config/udev: Adding input device Magic Mouse 2 (/dev/input/event7) [ 806.011] () Magic Mouse 2: Applying InputClass "libinput pointer catchall" [ 806.011] (II) Using input driver 'libinput' for 'Magic Mouse 2' [ 806.011] () Magic Mouse 2: always reports core events [ 806.012] () Option "Device" "/dev/input/event7" [ 806.012] () Option "_source" "server/udev" [ 806.012] (II) event7 - Magic Mouse 2: is tagged by udev as: Mouse [ 806.012] (II) event7 - Magic Mouse 2: device is a pointer [ 806.012] (II) event7 - Magic Mouse 2: device removed [ 806.067] () Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8.3/1-8.3:1.0/bluetooth/hci0/hci0:12/0005:004C:0269.000A/input/input225/event7" [ 806.067] (II) XINPUT: Adding extended input device "Magic Mouse 2" (type: MOUSE, id 13) [ 806.068] () Option "AccelerationScheme" "none" [ 806.069] () Magic Mouse 2: (accel) selected scheme none/0 [ 806.069] () Magic Mouse 2: (accel) acceleration factor: 2.000 [ 806.069] (**) Magic Mouse 2: (accel) acceleration threshold: 4 [ 806.070] (II) event7 - Magic Mouse 2: is tagged by udev as: Mouse [ 806.070] (II) event7 - Magic Mouse 2: device is a pointer

On Fri, Jun 12, 2020 at 9:35 AM Ralph Crongeyer [email protected] wrote:

Hi Ricardo, Yes I was using your fork for this.

I'll take a look at https://github.com/rohitpid/Linux-Magic-Trackpad-2-Driver/pull/1 and let you know how it goes.

On Fri, Jun 12, 2020 at 9:20 AM Ricardo Rodrigues < [email protected]> wrote:

@ralphsc https://github.com/ralphsc did you try my fork?

https://github.com/RicardoEPRodrigues/Linux-Magic-Trackpad-2-Driver

I have a pending pull-request (rohitpid#1 https://github.com/rohitpid/Linux-Magic-Trackpad-2-Driver/pull/1) where some discussion has been going on. It might help.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mwyborski/Linux-Magic-Trackpad-2-Driver/issues/38#issuecomment-643266668, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEM4WWIFX33SAHI74QPYPELRWITQXANCNFSM4HKH6HEQ .

ralphsc avatar Jun 12 '20 14:06 ralphsc

@ralphsc Unfortunately I don't have a lot of time to try to debug this issue, but here are my thoughts.

The Magic Mouse 2 creates 2 devices, one /dev/input/eventX (the touchpad) and a /dev/input/mouseX (the mouse and buttons). libinput picks up any mouseX event and loads a driver for it, that is why by default you have a mouse with no scroll.

What my repo does is to load the driver for the eventX that knows how to deal with the touchpad.

I believe that for some reason, either the rule isn't being called and that is why you have a mouse moving and no scroll, or the udev rules are removing the mouseX, but still loading the driver, which results in the touchpad working, but not the mouse.

If you have some time, please read through 0xABAD repo where the process to get the driver loaded is described. My repo is inspired and improves on his work.

RicardoEPRodrigues avatar Jun 14 '20 19:06 RicardoEPRodrigues

Hey Ricardo, No worries man. Thanks for the info I'll read through it and if I do figure it out I'll share what works with this thread.

Thanks again for your time.

Sincerely, Ralph

On Sun, Jun 14, 2020 at 3:07 PM Ricardo Rodrigues [email protected] wrote:

@ralphsc https://github.com/ralphsc Unfortunately I don't have a lot of time to try to debug this issue, but here are my thoughts.

The Magic Mouse 2 creates 2 devices, one /dev/input/eventX (the touchpad) and a /dev/input/mouseX (the mouse and buttons). libinput picks up any mouseX event and loads a driver for it, that is why by default you have a mouse with no scroll.

What my repo does is to load the driver for the eventX that knows how to deal with the touchpad.

I believe that for some reason, either the rule isn't being called and that is why you have a mouse moving and no scroll, or the udev rules are removing the mouseX, but still loading the driver, which results in the touchpad working, but not the mouse.

If you have some time, please read through 0xABAD repo https://github.com/0xABAD/magic-mouse-2 where the process to get the driver loaded is described. My repo is inspired and improves on his work.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mwyborski/Linux-Magic-Trackpad-2-Driver/issues/38#issuecomment-643808636, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEM4WWM5Y6I2XMK2WEWOJM3RWUNYNANCNFSM4HKH6HEQ .

ralphsc avatar Jun 15 '20 00:06 ralphsc

On Elementary OS I had to add a DRIVER section to get it to work, like so:

SUBSYSTEM=="input",
KERNEL=="mouse*",
KERNELS=="0005:004C:0269.*" SUBSYSTEMS=="hid",
DRIVERS=="hid-generic",
ACTION=="add",
SYMLINK+="input/magicmouse-%k",
RUN+="/opt/magic-mouse-fix/magic-mouse-2-add.sh"

On Sun, Jun 14, 2020 at 3:07 PM Ricardo Rodrigues [email protected] wrote:

@ralphsc https://github.com/ralphsc Unfortunately I don't have a lot of time to try to debug this issue, but here are my thoughts.

The Magic Mouse 2 creates 2 devices, one /dev/input/eventX (the touchpad) and a /dev/input/mouseX (the mouse and buttons). libinput picks up any mouseX event and loads a driver for it, that is why by default you have a mouse with no scroll.

What my repo does is to load the driver for the eventX that knows how to deal with the touchpad.

I believe that for some reason, either the rule isn't being called and that is why you have a mouse moving and no scroll, or the udev rules are removing the mouseX, but still loading the driver, which results in the touchpad working, but not the mouse.

If you have some time, please read through 0xABAD repo https://github.com/0xABAD/magic-mouse-2 where the process to get the driver loaded is described. My repo is inspired and improves on his work.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mwyborski/Linux-Magic-Trackpad-2-Driver/issues/38#issuecomment-643808636, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEM4WWM5Y6I2XMK2WEWOJM3RWUNYNANCNFSM4HKH6HEQ .

ralphsc avatar Jun 18 '20 20:06 ralphsc

@ralphsc Great to know you got it working!

I tried to use your udev rule and it didn't work for me. I don't have any parent with DRIVERS=="hid-generic". I made some changes, can you try to run this version and check if it works?

SUBSYSTEM=="input", \
    KERNEL=="mouse*", \
    DRIVER=="", \
    SUBSYSTEMS=="hid", \
    KERNELS=="0005:004C:0269*", \
    DRIVERS=="hid-generic|magicmouse", \
    ACTION=="add", \
    SYMLINK+="input/magicmouse-%k", \
    RUN+="/opt/magic-mouse-fix/magic-mouse-2-add.sh"

Thank you!

RicardoEPRodrigues avatar Jun 18 '20 21:06 RicardoEPRodrigues

I tried it and it didn't work for me. If I change the udev rule, disconnect the mouse, unload the driver and click the mouse it pair's with BT and is connected but no mouse movement. When I change the rule back and disconnect the mouse, unload the driver and click the mouse it pair's with BT and it all works.

This is on: elementary OS 5.1.5 Hera 5.3.0-59-generic On a MAC Book Pro 2013 era.

On Thu, Jun 18, 2020 at 5:56 PM Ricardo Rodrigues [email protected] wrote:

@ralphsc https://github.com/ralphsc Great to know you got it working!

I tried to use your udev rule and it didn't work for me. I don't have any parent with DRIVERS=="hid-generic". I made some changes, can you try to run this version and check if it works?

SUBSYSTEM=="input",
KERNEL=="mouse*",
DRIVER=="",
SUBSYSTEMS=="hid",
KERNELS=="0005:004C:0269*",
DRIVERS=="magicmouse",
ACTION=="add",
SYMLINK+="input/magicmouse-%k",
RUN+="/opt/magic-mouse-fix/magic-mouse-2-add.sh"

Thank you!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mwyborski/Linux-Magic-Trackpad-2-Driver/issues/38#issuecomment-646325643, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEM4WWKY3Y5PTEPAG7BV4GLRXKEQJANCNFSM4HKH6HEQ .

ralphsc avatar Jun 18 '20 22:06 ralphsc

Can you show me the output of udevadm info -a -p $(udevadm info -q path -n /dev/input/mouseX) where mouseX is the connected magic mouse?

I edited my previous answer to have DRIVERS=="hid-generic|magicmouse", you used that one right?

Can you try the following option (I removed the DRIVER=="") :

SUBSYSTEM=="input", \
    KERNEL=="mouse*", \
    SUBSYSTEMS=="hid", \
    KERNELS=="0005:004C:0269*", \
    DRIVERS=="hid-generic|magicmouse", \
    ACTION=="add", \
    SYMLINK+="input/magicmouse-%k", \
    RUN+="/opt/magic-mouse-fix/magic-mouse-2-add.sh"

Also, what is the version of you udev? You can check it with apt show udev.

RicardoEPRodrigues avatar Jun 18 '20 22:06 RicardoEPRodrigues

udev: Version: 237-3ubuntu10.41 xinput: Version: 1.6.2-1build1

ralphsc avatar Jun 18 '20 22:06 ralphsc

It didn't work with that rule either. It seems that if I have "magicmouse" as a driver it fails to function. Here's the hid drivers I have loaded when the mouse is working:

lsmod | grep hid hid_magicmouse 20480 0 hidp 28672 2 bluetooth 573440 42 btrtl,hidp,btintel,btbcm,bnep,btusb,rfcomm mac_hid 16384 0 hid_apple 16384 0 hid_generic 16384 0 usbhid 53248 0 hid 126976 5 hidp,usbhid,hid_apple,hid_generic,hid_magicmouse

ralphsc avatar Jun 18 '20 23:06 ralphsc

Can you show me the output of udevadm info -a -p $(udevadm info -q path -n /dev/input/mouseX) where mouseX is the connected magic mouse?

RicardoEPRodrigues avatar Jun 19 '20 00:06 RicardoEPRodrigues

Sure thing. FYI, it does show DRIVERS=="magicmouse" but it doesn't work in my udev rule.

udevadm info -a -p $(udevadm info -q path -n /dev/input/mouse0)

Udevadm info starts with the device specified by the devpath and then walks up the chain of parent devices. It prints for every device found, all possible attributes in the udev rules key format. A rule to match, can be composed by the attributes of the device and the attributes from one single parent device.

looking at device '/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8.3/1-8.3:1.0/bluetooth/hci0/hci0:11/0005:004C:0269.0017/input/input143/mouse0': KERNEL=="mouse0" SUBSYSTEM=="input" DRIVER==""

looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8.3/1-8.3:1.0/bluetooth/hci0/hci0:11/0005:004C:0269.0017/input/input143': KERNELS=="input143" SUBSYSTEMS=="input" DRIVERS=="" ATTRS{name}=="Magic Mouse 2" ATTRS{phys}=="3c:15:c2:da:0a:27" ATTRS{properties}=="0" ATTRS{uniq}=="ac:bc:32:e6:54:80"

looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8.3/1-8.3:1.0/bluetooth/hci0/hci0:11/0005:004C:0269.0017': KERNELS=="0005:004C:0269.0017" SUBSYSTEMS=="hid" DRIVERS=="magicmouse" ATTRS{country}=="00"

looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8.3/1-8.3:1.0/bluetooth/hci0/hci0:11': KERNELS=="hci0:11" SUBSYSTEMS=="bluetooth" DRIVERS==""

looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8.3/1-8.3:1.0/bluetooth/hci0': KERNELS=="hci0" SUBSYSTEMS=="bluetooth" DRIVERS==""

looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8.3/1-8.3:1.0': KERNELS=="1-8.3:1.0" SUBSYSTEMS=="usb" DRIVERS=="btusb" ATTRS{authorized}=="1" ATTRS{bAlternateSetting}==" 0" ATTRS{bInterfaceClass}=="ff" ATTRS{bInterfaceNumber}=="00" ATTRS{bInterfaceProtocol}=="01" ATTRS{bInterfaceSubClass}=="01" ATTRS{bNumEndpoints}=="03" ATTRS{supports_autosuspend}=="1"

looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8.3': KERNELS=="1-8.3" SUBSYSTEMS=="usb" DRIVERS=="usb" ATTRS{authorized}=="1" ATTRS{avoid_reset_quirk}=="0" ATTRS{bConfigurationValue}=="1" ATTRS{bDeviceClass}=="ff" ATTRS{bDeviceProtocol}=="01" ATTRS{bDeviceSubClass}=="01" ATTRS{bMaxPacketSize0}=="64" ATTRS{bMaxPower}=="0mA" ATTRS{bNumConfigurations}=="1" ATTRS{bNumInterfaces}==" 4" ATTRS{bcdDevice}=="0137" ATTRS{bmAttributes}=="e0" ATTRS{busnum}=="1" ATTRS{configuration}=="" ATTRS{devnum}=="6" ATTRS{devpath}=="8.3" ATTRS{idProduct}=="8289" ATTRS{idVendor}=="05ac" ATTRS{ltm_capable}=="no" ATTRS{manufacturer}=="Apple Inc." ATTRS{maxchild}=="0" ATTRS{product}=="Bluetooth USB Host Controller" ATTRS{quirks}=="0x0" ATTRS{removable}=="fixed" ATTRS{rx_lanes}=="1" ATTRS{speed}=="12" ATTRS{tx_lanes}=="1" ATTRS{urbnum}=="137628" ATTRS{version}==" 2.00"

looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-8': KERNELS=="1-8" SUBSYSTEMS=="usb" DRIVERS=="usb" ATTRS{authorized}=="1" ATTRS{avoid_reset_quirk}=="0" ATTRS{bConfigurationValue}=="1" ATTRS{bDeviceClass}=="09" ATTRS{bDeviceProtocol}=="00" ATTRS{bDeviceSubClass}=="00" ATTRS{bMaxPacketSize0}=="8" ATTRS{bMaxPower}=="94mA" ATTRS{bNumConfigurations}=="1" ATTRS{bNumInterfaces}==" 1" ATTRS{bcdDevice}=="0100" ATTRS{bmAttributes}=="e0" ATTRS{busnum}=="1" ATTRS{configuration}=="" ATTRS{devnum}=="2" ATTRS{devpath}=="8" ATTRS{idProduct}=="4500" ATTRS{idVendor}=="0a5c" ATTRS{ltm_capable}=="no" ATTRS{manufacturer}=="Apple Inc." ATTRS{maxchild}=="3" ATTRS{product}=="BRCM20702 Hub" ATTRS{quirks}=="0x0" ATTRS{removable}=="unknown" ATTRS{rx_lanes}=="1" ATTRS{speed}=="12" ATTRS{tx_lanes}=="1" ATTRS{urbnum}=="4430" ATTRS{version}==" 2.00"

looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1': KERNELS=="usb1" SUBSYSTEMS=="usb" DRIVERS=="usb" ATTRS{authorized}=="1" ATTRS{authorized_default}=="1" ATTRS{avoid_reset_quirk}=="0" ATTRS{bConfigurationValue}=="1" ATTRS{bDeviceClass}=="09" ATTRS{bDeviceProtocol}=="01" ATTRS{bDeviceSubClass}=="00" ATTRS{bMaxPacketSize0}=="64" ATTRS{bMaxPower}=="0mA" ATTRS{bNumConfigurations}=="1" ATTRS{bNumInterfaces}==" 1" ATTRS{bcdDevice}=="0503" ATTRS{bmAttributes}=="e0" ATTRS{busnum}=="1" ATTRS{configuration}=="" ATTRS{devnum}=="1" ATTRS{devpath}=="0" ATTRS{idProduct}=="0002" ATTRS{idVendor}=="1d6b" ATTRS{interface_authorized_default}=="1" ATTRS{ltm_capable}=="no" ATTRS{manufacturer}=="Linux 5.3.0-59-generic xhci-hcd" ATTRS{maxchild}=="14" ATTRS{product}=="xHCI Host Controller" ATTRS{quirks}=="0x0" ATTRS{removable}=="unknown" ATTRS{rx_lanes}=="1" ATTRS{serial}=="0000:00:14.0" ATTRS{speed}=="480" ATTRS{tx_lanes}=="1" ATTRS{urbnum}=="2072" ATTRS{version}==" 2.00"

looking at parent device '/devices/pci0000:00/0000:00:14.0': KERNELS=="0000:00:14.0" SUBSYSTEMS=="pci" DRIVERS=="xhci_hcd" ATTRS{ari_enabled}=="0" ATTRS{broken_parity_status}=="0" ATTRS{class}=="0x0c0330" ATTRS{consistent_dma_mask_bits}=="64" ATTRS{d3cold_allowed}=="1" ATTRS{device}=="0x8c31" ATTRS{dma_mask_bits}=="64" ATTRS{driver_override}=="(null)" ATTRS{enable}=="1" ATTRS{irq}=="37" ATTRS{local_cpulist}=="0-7" ATTRS{local_cpus}=="ff" ATTRS{msi_bus}=="1" ATTRS{numa_node}=="-1" ATTRS{revision}=="0x05" ATTRS{subsystem_device}=="0x7270" ATTRS{subsystem_vendor}=="0x8086" ATTRS{vendor}=="0x8086"

looking at parent device '/devices/pci0000:00': KERNELS=="pci0000:00" SUBSYSTEMS=="" DRIVERS==""

ralphsc avatar Jun 19 '20 00:06 ralphsc

This is going to be a long text. Sorry in advance.

So, the DRIVERS=="hid-generic" changes to DRIVERS=="magicmouse" when the driver is loaded. My guess is that for some reason on ElementaryOS when the driver changes it no longer loads the generic mouse driver.

I think you can try this out the following way:

  1. Turn off the mouse
  2. Use your udev rule with the DRIVERS=="hid-generic" or my udev rule with the DRIVERS=="hid-generic|magicmouse"
  3. sudo ./install-fix.sh
  4. Reboot the system
  5. Turn on the mouse and it should connect and work correctly
  6. Turn the mouse off and on and the mouse connects
  7. If you used your udev rule, the mouse should work without scrolling
  8. If you used my udev rule, the mouse should not work except for scrolling

Sorry for the work, but can you check if this happens?


Another thing also came to mind from your previous comments. First off, it seems you only have one mouse connect and it is the magic mouse (because the mouse is assigned mouse0), correct?

Second, lsmod | grep hid seems similar when it is working, I want to see the output of this when the scrolling works, but the mouse doesn't. Can you get it for me?

Why am I asking these questions? I think that when the magicmouse driver is loaded it no longer loads the hid-generic if no more mice are connected, thus the mouse doesn't work but the scroll does. Therefore, if you have an extra mouse around can you give this a try? Plug in that mouse and then (with my udev rule) connect the magic mouse. Let's see what happens.

RicardoEPRodrigues avatar Jun 19 '20 09:06 RicardoEPRodrigues