Bug 398713 - [X11, Libinput] Selecting flat mouse acceleration profile doesn't turn off acceleration
Summary: [X11, Libinput] Selecting flat mouse acceleration profile doesn't turn off ac...
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_mouse (show other bugs)
Version: 5.15.5
Platform: Other Linux
: HI major
Target Milestone: ---
Assignee: atulbi
URL:
Keywords:
: 400229 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-09-16 12:29 UTC by tempel.julian
Modified: 2019-11-10 10:27 UTC (History)
11 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.17.1


Attachments
x11_libinput_dummydevice.c patch (2.08 KB, patch)
2019-07-28 16:19 UTC, warloxxjay
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tempel.julian 2018-09-16 12:29:45 UTC
Despite of using latest 5.13.90 beta build on Arch, setting acceleration profile to flat still doesn't lead to the desired result (only tested on Xorg): There is still strong mouse acceleration going on with this setting, while it actually should be turned off completely.
I saw this bug report:
https://bugs.kde.org/show_bug.cgi?id=394787
Perhaps the fix is not merged yet or doesn't do the trick otherwise? phabricator.kde.org is currently not available for me.
Comment 1 Nate Graham 2018-09-18 20:05:57 UTC
Bug 394787 is about Wayland; it might still be broken for X11. Any chance you could test on Wayland to see if it's actually fixed there? That would help our debugging efforts. Thanks!
Comment 2 tempel.julian 2018-09-18 20:24:17 UTC
Unfortunately, I likely can't do this very soon as I got an Nvidia card installed and can't connect my display to the IGP either.
I can give Nouveau driver a shot, but it doesn't even have hardware acceleration because of missing firmware for GTX 1070 Ti...

So, it would be great if somebody else might give this a try too.
Comment 3 Nate Graham 2018-09-18 20:34:10 UTC
NVIDIA's proprietary driver isn't completely toxic to Wayland, you just won't get GPU acceleration. :) Hopefully just for test purposes it won't be so bad.
Comment 4 tempel.julian 2018-09-18 20:47:48 UTC
It kinda works. :)
But: Just with 5 frames or so per second, which unfortunately also affects the mouse cursor. It runs way too slow to judge if changing mouse settings has the desired effect. :(
Comment 5 Nate Graham 2018-09-18 21:18:43 UTC
Mmm, that's a shame.
Comment 6 grmat 2018-09-20 16:55:57 UTC
When testing 5.13.90 under wayland, the new KCM doesn't even get presented to me, so I can't choose the flat acceleration profile. The keys in the config (~/.config/kcminputrc) also differ from x/libinput and wayland and I haven't investigated further whether a "correct" config works around the problem.

Back to topic: toggling the acceleration profile in the new KCM on X/libinput from flat to adaptive doesn't have an effect. I can confirm by the mouse feeling, measuring distance traveled w/ dpi and retreiving libinput device props with the `xinput` utility.
Comment 7 Nate Graham 2018-09-20 17:00:43 UTC
(In reply to grmat from comment #6)
> When testing 5.13.90 under wayland, the new KCM doesn't even get presented
> to me, so I can't choose the flat acceleration profile. The keys in the
> config (~/.config/kcminputrc) also differ from x/libinput and wayland and I
> haven't investigated further whether a "correct" config works around the
> problem.

Can you please open another bug for this?
Comment 8 Alexander Mentyu 2018-09-21 09:55:58 UTC
Toggling Accelaration profile works for me on Wayland

Mouse: SteelSeries Rival 100
Operating System: KDE neon Developer Edition
KDE Plasma Version: 5.14.80
Qt Version: 5.11.1
KDE Frameworks Version: 5.51.0
Kernel Version: 4.15.0-34-generic
OS Type: 64-bit
Processors: 8 × Intel® Core™ i5-8250U CPU @ 1.60GHz
Memory: 7,7 GiB of RAM
Comment 9 tempel.julian 2018-10-09 17:17:53 UTC
As expected, this issue is still present with 5.14.0.
Comment 10 tempel.julian 2018-10-24 18:00:33 UTC
I installed my RX 560 graphics card and can confirm that this issue does only affect Xorg session and not Wayland.
I'd say it feels like true 1:1 mapping on Wayland with selected flat profile default speed setting.
Comment 11 Nate Graham 2019-01-12 22:55:30 UTC
*** Bug 400229 has been marked as a duplicate of this bug. ***
Comment 12 Tom Seewald 2019-05-23 03:50:02 UTC
This issue is still present on 5.15.4, running Fedora 30.

Output of libinput list-devices after clicking "Flat" shows that it does not change the libinput acceleration profile at all - it is still set to "adaptive".

e.g.

Device:           Razer Razer DeathAdder
Kernel:           /dev/input/event2
Group:            5
Seat:             seat0, default
Capabilities:     pointer 
Tap-to-click:     n/a
Tap-and-drag:     n/a
Tap drag lock:    n/a
Left-handed:      disabled
Nat.scrolling:    disabled
Middle emulation: disabled
Calibration:      n/a
Scroll methods:   button
Click methods:    none
Disable-w-typing: n/a
Accel profiles:   flat *adaptive
Rotation:         n/a

The only way I've found to disable acceleration with KDE on X11 is to create a custom configuration file that sets it to flat.

Is there any further information needed for this issue?
Comment 13 Tom Seewald 2019-05-23 04:45:44 UTC
Looking at the output of "xinput list-props" between changes made in the kcm mouse menu, it looks like both acceleration radio buttons do nothing on X11.

If you manually set the acceleration profile to "flat", you cannot set it back to adaptive using the GUI, and vice versa going from "adaptive" -> "flat".

For reference acceleration is disabled when xinput list-props shows: 
"libinput Accel Profile Enabled (###):   0, 1"

More information can be found on the arch wiki: https://wiki.archlinux.org/index.php/Mouse_acceleration#with_libinput
Comment 14 Tom Seewald 2019-05-28 06:50:44 UTC
Confirmed this is still happening on 5.15.5 (Fedora 30).
Comment 15 warloxxjay 2019-07-28 16:19:45 UTC
Created attachment 121798 [details]
x11_libinput_dummydevice.c patch

I ran into this problem as well on kde 5.15.4. (ubunutu 19.04). And can confirm that the setting for acceleration never gets set in xinput just as described in comment 13.
The setting is an bool array where only one is allowed to be true. But the code only has functions to store single values. That's why the setting is never applied. 
I made a draft of a solution in the attachment. It likely does not compile nor is up to snuff on code quality but should make the possible solution clear.
Comment 16 warloxxjay 2019-07-28 16:31:49 UTC
Comment on attachment 121798 [details]
x11_libinput_dummydevice.c patch

Well I messed up the patch. Apply in reverse order.
Comment 17 tempel.julian 2019-09-08 13:11:26 UTC
Could this get merged for 5.17?
Comment 18 Nate Graham 2019-09-09 16:04:23 UTC
So sorry, I will redouble my efforts on this.
Comment 19 Nate Graham 2019-10-22 14:22:02 UTC
Git commit 829501dd777966091ddcf94e5c5247aaa78ac832 by Nate Graham, on behalf of Mirai Komachi.
Committed on 22/10/2019 at 14:21.
Pushed by ngraham into branch 'Plasma/5.17'.

[Mouse KCM] Fix acceleration profile on X11

Summary:
LIBINPUT_PROP_ACCEL_PROFILE_ENABLED contains two values,
valueWriterPart<bool> function didn't handle it correctly.
FIXED-IN: 5.17.1

Reviewers: #plasma, romangg, ngraham

Reviewed By: #plasma, romangg, ngraham

Subscribers: anthonyfieroni, ngraham, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D24711

M  +13   -3    kcms/mouse/backends/x11/x11_libinput_dummydevice.cpp

https://commits.kde.org/plasma-desktop/829501dd777966091ddcf94e5c5247aaa78ac832
Comment 20 tempel.julian 2019-10-22 20:35:03 UTC
Thanks a lot, Nate!
Comment 21 Nate Graham 2019-10-22 20:55:13 UTC
Don't thank me, thank Mirai who submitted this very nice patch! :)
Comment 22 Ahmad Samir 2019-11-02 16:51:35 UTC
FWIW, even with the libinput flat profile, there's still an acceleration factor, it's just constant https://wayland.freedesktop.org/libinput/doc/latest/pointer-acceleration.html#the-flat-pointer-acceleration-profile
Comment 23 Damian Höster 2019-11-10 00:43:21 UTC
(In reply to Ahmad Samir from comment #22)
> FWIW, even with the libinput flat profile, there's still an acceleration
> factor, it's just constant
> https://wayland.freedesktop.org/libinput/doc/latest/pointer-acceleration.
> html#the-flat-pointer-acceleration-profile

Yes, that makes sense, flat acceleration just isn't the same as no acceleration.
Changing the options to:

Acceleration: ꞏ Flat
              ꞏ Adaptive
              ꞏ Off

or something similar would resolve the problem.
I just hope the option to disable pointer acceleration won't get removed during future changes.
Comment 24 warloxxjay 2019-11-10 10:27:34 UTC
> flat acceleration just isn't the same as no acceleration.
Actually it is exactly that. The name "acceleration factor" might just be a bit of a confusing name. Its just a factor that results from some acceleration calculation, and when not used gets set to 1 as to not have any effect (multiplicative identity element). 

A constant acceleration factor of 1 (Flat profile) will cause no acceleration. Since the factor really is just a proportional gain of mouse movement to pointer movement. If the term where 0 the pointer would not move at all anymore. This is basically a setting of how fast you want you pointer in relation to the movement of your mouse.

The acceleration only happens when this term is not constant but depending on the current speed of you mouse movements. This happens in the adaptive profile. On higher mouse speeds the proportional term gets increased. This causes a fast movement of distance X resulting in a bigger pointer movement in the adaptive profile than in the flat profile.