Bug 1275070

Summary: Can't "edge scroll" on Dell N5040
Product: [Fedora] Fedora Reporter: Марко М. Костић (Marko M. Kostić) <marko.m.kostic>
Component: systemdAssignee: systemd-maint
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 22CC: gustavo, johannbg, jsynacek, lnykryn, marko.m.kostic, msekleta, peter.hutterer, s, systemd-maint, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-10 03:53:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
evemu-record output
none
Region I usually slide through to scroll and touchpad's dimensions
none
touchpad-edge-detector output
none
udevadm after installing custom rpms
none
udevadm after installing correct custom rpms
none
dnf distro-sync output
none
dnf install packages from koji
none
libinput-list-devices output
none
udevadm-info output
none
Xorg log
none
touchpad section of the Gnome CC
none
new touchpad-edge-detector output none

Description Марко М. Костић (Marko M. Kostić) 2015-10-25 15:24:47 UTC
Description of problem:
I can't scroll by using an edge of touchpad reliably as I've used to on the old Synaptics driver. It seems that libinput doesn't detect the edge scroll as a scroll but rather as a movement. I can "two finger scroll" with no problem.

Here's the part of the output of the libinput-debug-events when I "two finger" scroll:

[..]
event8 	POINTER_AXIS	 +4.56s	vert 9.92 horiz 0.00
event8 	POINTER_AXIS	 +4.59s	vert 10.39 horiz 0.00
event8 	POINTER_AXIS	 +4.62s	vert 8.66 horiz 0.00
event8 	POINTER_AXIS	 +4.65s	vert 5.35 horiz 0.00
event8 	POINTER_AXIS	 +4.69s	vert 3.78 horiz -0.20
event8 	POINTER_AXIS	 +4.72s	vert 2.05 horiz -0.39
event8 	POINTER_AXIS	 +4.75s	vert 0.63 horiz -0.20
event8 	POINTER_AXIS	 +4.80s	vert 0.00 horiz 0.00

And here's when I try to "edge scroll":

[..]
event8 	POINTER_MOTION	+10.57s	  0.00/  5.08
event8 	POINTER_MOTION	+10.59s	  0.00/  3.85
event8 	POINTER_MOTION	+10.60s	  0.00/  2.94
event8 	POINTER_MOTION	+10.62s	  0.00/  2.69
event8 	POINTER_MOTION	+10.63s	  0.00/  1.57
event8 	POINTER_MOTION	+10.64s	  0.00/  1.26
event8 	POINTER_MOTION	+10.66s	  0.00/  0.47
event8 	POINTER_MOTION	+10.67s	  0.00/ -0.44

If I'm reading it correctly, libinput sees the edge scroll as a movement instead as a "scroll event".

Version-Release number of selected component (if applicable):
libinput.x86_64                       1.0.1-2.fc22              @updates        
libinput-devel.x86_64                 1.0.1-2.fc22              @updates        
xorg-x11-drv-libinput.x86_64          0.14.0-1.fc22             @updates

How reproducible:
Almost always (I think that I've used to be able to edge scroll sometimes last month).

Steps to Reproduce:
1. Boot up Fedora 22 and disable "two finger scroll"
2. Run dmesg in a terminal
3. Try to do a "edge scroll" (scrolling by using the right edge of the touchpad)

Actual results:
Libinput registers the touch events as a movement instead as scrolling.

Expected results:
Scrolling through the output of dmesg works

Additional info:
[root@box ~] # cat /proc/bus/input/devices
I: Bus=0011 Vendor=0002 Product=0008 Version=0300
N: Name="AlpsPS/2 ALPS DualPoint Stick"
P: Phys=isa0060/serio1/input1
S: Sysfs=/devices/platform/i8042/serio1/input/input9
U: Uniq=
H: Handlers=mouse1 event7 
B: PROP=21
B: EV=7
B: KEY=70000 0 0 0 0
B: REL=3

I: Bus=0011 Vendor=0002 Product=0008 Version=0300
N: Name="AlpsPS/2 ALPS DualPoint TouchPad"
P: Phys=isa0060/serio1/input0
S: Sysfs=/devices/platform/i8042/serio1/input/input6
U: Uniq=
H: Handlers=mouse2 event8 
B: PROP=9
B: EV=b
B: KEY=e420 70000 0 0 0 0
B: ABS=260800001000003

Comment 1 Peter Hutterer 2015-10-26 07:30:44 UTC
Record an edge scroll event with evemu-record please and attach the output here, thanks.

Comment 2 Марко М. Костић (Marko M. Kostić) 2015-10-28 12:45:15 UTC
Created attachment 1087246 [details]
evemu-record output

Comment 3 Марко М. Костић (Marko M. Kostić) 2015-10-31 10:32:55 UTC
Do I need to provide anything else? Anyway, thanks for loooking into this issue, Peter.

Comment 4 Peter Hutterer 2015-11-01 23:33:31 UTC
can you run the touchpad-edge-detector tool from libevdev-utils please? The basic sequence looks right, but the right edge is further to the right than your finger so libinput interprets this as normal movement, not as edge scroll. It should work if you move your finger to the far right edge. 
If not, the tool should be able to tell us what the real edges are vs what the firmware reports. The scroll edge should be approximately 7mm wide, so there's something amiss. Also measure your touchpad's physical size in mm and let us know how big it is.

Comment 5 Марко М. Костић (Marko M. Kostić) 2015-11-02 11:27:50 UTC
Created attachment 1088538 [details]
Region I usually slide through to scroll and touchpad's dimensions

"It should work if you move your finger to the far right edge."

I think that I'm already moving my finger to the far right edge. I marked the region I usually slide through to scroll as blue, on this attachement.

Also, I've marked the physical size of the touchpad. It's 91mm×49mm, as shown on the attached picture.

Comment 6 Марко М. Костић (Marko M. Kostić) 2015-11-02 11:33:23 UTC
Created attachment 1088540 [details]
touchpad-edge-detector output

I've moved my finger around the touchpad, as the tool suggested. If there's anything else missing, please tell me so.

Comment 7 Peter Hutterer 2015-11-02 21:49:13 UTC
http://koji.fedoraproject.org/koji/taskinfo?taskID=11676551
when this finishes it should set the EVDEV_ABS_... properties on the device (check with udevadm info /sys/class/input/event8) and adjust the axis range, i.e. evemu should now report the min/max ranges you recorded and a resolution value.

Then restart X and the scroll edge should work and be correctly sized.

Once you've verified that's all working please run the edge-detector tool again and compare the numbers it spits out, we'd like to get the most accurate minimum/maximum and it may take a few tries to get to see them.

Comment 8 Марко М. Костић (Marko M. Kostić) 2015-11-03 21:31:30 UTC
I'm affraid that I will a bit detailed instructions for testing this out.

If I understood you correctly, I shold:
wait for build to finish, 
update my system, 
reboot or restart Xorg,
Try to do 'udevadm info /sys/class/input/event8' and see if there are EVDEV_ABS entries in the ouput,
adjust the axis range (how do I do that?),
and after seeing that "edge scroll" works, run touchpad-edge-detector tool a couple of times to get a mostly accurate reading of the touchpad borders?

I am terribly sorry but this is a bit complex for me to test out... :(

If you could give me a detailed instructions, I would be very grateful.

Comment 9 Peter Hutterer 2015-11-03 23:07:09 UTC
yep, download the rpms from that scratch build locally, dnf install them.
Then reboot, run udevadm info /sys/class/input/event8. If the props are there, edge scrolling should work fine from then on. The reboot will obviously restart X, so you don't have to restart X again :)

The build I submitted has your axis ranges from comment 6, so they should already be adjusted. Run evemu-describe and look at the output, you'll notice that the min/max/resolution for ABS_X/Y and ABS_MT_POSITION_X/Y are different to the first recording you submitted.

Provided that's all fine, run the touchpad-edge-detector again to get the most accurate readings you can.

If the properties don't show up let me know and I'll explain how to fix that bit.

Comment 10 Марко М. Костић (Marko M. Kostić) 2015-11-04 18:27:15 UTC
Created attachment 1089826 [details]
udevadm after installing custom rpms

I've installed the RPMs from Koji and rebooted my laptop. The props appear in the output of udevadm info but I am unable to use the touchpad at all. The settings for the touchpad are gone from gnome-control-center, and I can't enable/disable it via the Fn+F3 keyboard shortcut combo. Because of that, I was unable to test if the edge scroll works.

I've tried running the touchpad-edge-detector again, just to see if the touchpad detects movements, and it does. I can see the output.

But I am unable to enable it or to see it Gnome Control Center, now.

Comment 11 Марко М. Костић (Marko M. Kostić) 2015-11-04 18:50:38 UTC
FYI, none of the media keys aren't working after installing RPMs from Koji. It's not a problem, I have a dd copy of my "good" root partition which I can restore to fix this (because I can't do 'dnf history undo last' successfully). Maybe this symptom will help you debug it more easily.

Comment 12 Peter Hutterer 2015-11-04 21:32:19 UTC
whoah, that's a lot worse than a simple hwdb update should've done. 

you can just undo it with either dnf downgrade <systemd> or, easier, dnf history undo <index>, where index is the transaction index from the dnf install (see dnf history list and dnf history info). That will simply remove the packages and put the old ones in place if they're still around.

There was a copy/paste error in the scratch build, I fixed this with a build here: http://koji.fedoraproject.org/koji/taskinfo?taskID=11704695
the good news is that it's working, the fixed values show up in the udevadm output.

But as for the rest, I'm stumped. All this update does is add a hwdb entry for your touchpad, it doesn't touch anything else. Bit confusing. Did you update anything else since or just the packages from that scratch build?

Comment 13 Марко М. Костић (Marko M. Kostić) 2015-11-04 22:06:35 UTC
Yep. I did update my system yesterday. When I was installing these packages, it displayed that it was downgrading already installed packgaes (as if system packages were newer).

Ok, I'm going off to install these new packages and try testing again.

Comment 14 Марко М. Костић (Marko M. Kostić) 2015-11-04 22:19:33 UTC
Created attachment 1089894 [details]
udevadm after installing correct custom rpms

Installed packages from a new Koji build. Rebooted. Touchpad settings aren't shown in Gnome Control Center and I can't enable it via the Fn+F3 keyboard combo. Whenever I press Fn+F3, I always see a "action icon" I usually see when I disable the touchpad via this combo.

But this time all the other media keys work. I can play next/previous song, change brightness etc.

I've appended the output of udevadm. I also tried running touchpad-edge-detector and this tool sees the touchpad movement.

Comment 15 Peter Hutterer 2015-11-04 23:23:32 UTC
run dnf distro-sync for the systemd packages and try again, just so we can rule out any other packages messing with it. This package literally only adds the four EVDEV_ABS properties to the device which then set the axis range. Nothing else should be affected, especially not gnome, and the udevadm info output looks sane.

run libinput-list-devices as well to make sure the device shows up there as touchpad (i.e. with scrolling caps) and attach your Xorg.log.

Comment 16 Марко М. Костић (Marko M. Kostić) 2015-11-05 07:41:35 UTC
Created attachment 1089971 [details]
dnf distro-sync output

Did dnf distro-sync, then installed packages from Koji. Rebooted. It's the same as in my last comment.

Comment 17 Марко М. Костић (Marko M. Kostić) 2015-11-05 07:42:08 UTC
Created attachment 1089972 [details]
dnf install packages from koji

Comment 18 Марко М. Костић (Marko M. Kostić) 2015-11-05 07:42:33 UTC
Created attachment 1089973 [details]
libinput-list-devices output

Comment 19 Марко М. Костић (Marko M. Kostić) 2015-11-05 07:43:11 UTC
Created attachment 1089974 [details]
udevadm-info output

Comment 20 Марко М. Костић (Marko M. Kostić) 2015-11-05 07:43:42 UTC
Created attachment 1089975 [details]
Xorg log

Comment 21 Марко М. Костић (Marko M. Kostić) 2015-11-05 07:44:05 UTC
Created attachment 1089976 [details]
touchpad section of the Gnome CC

Comment 22 Peter Hutterer 2015-11-09 01:18:17 UTC
ok, found it. index error, instead of assigning the resolution to ABS_X and Y, it was off by one to assign it to ABS_Y and Z. That caused the libinput error in the libinput-list-devices output and the xorg.log and libinput to ignore the device. New scratch build:

http://koji.fedoraproject.org/koji/taskinfo?taskID=11752883

Comment 23 Peter Hutterer 2015-11-09 06:35:05 UTC
something about that patch set hates me... Next try:
http://koji.fedoraproject.org/koji/taskinfo?taskID=11753357

Comment 24 Марко М. Костић (Marko M. Kostić) 2015-11-09 21:41:57 UTC
Created attachment 1091966 [details]
new touchpad-edge-detector output

Edge scrolling works now like a charm. Great job! :)

Here's the most accurate touchpad-edge-detector output I could gather. I've scrolled over the edges of the touchpad dozen of times.

If anything else is required, please let me know.

Thanks for your help!

Comment 25 Peter Hutterer 2015-11-10 03:53:08 UTC
I've sent the patch upstream now, but it'll take a while to filter back down to f22. What I recommend is to look at /usr/lib/udev/hwdb.d/60-evdev.hwdb, take the N5040 entry that I added to the scratch package and follow the instructions at the top of the file to have a local copy for that. Then you can update the systemd packages in fedora without losing the settings.

Once the fedora package contains the entries, you can drop your local workaround.

Closing this bug as upstream and switching it to systemd, it's fixed, we just need to wait for it to trickle down.

Comment 26 Марко М. Костић (Marko M. Kostić) 2015-11-10 07:13:34 UTC
Great! I'll wait until it gets down to f23 (I'm going to upgrade to it in about month or two). I do not use touchpad that much (I prefer the mouse) and I can use the two finger scroll. I wouldn't even fill a bug report if I didn't like edge scroll that much.

Thanks again, Peter! You really made my day better.