iberianpig / fusuma

Multitouch gestures with libinput driver on Linux
MIT License
3.67k stars 149 forks source link

High CPU usage, again #200

Closed z0rc closed 3 years ago

z0rc commented 4 years ago

Describe the bug After deprecation of --device option and introduction of filters fusuma and libinput-debug-events consume a lot of CPU on mouse movements.

To Reproduce Steps to reproduce the behavior:

  1. Attach mouse
  2. Move it really quickly
  3. fusuma CPU usage spikes

Expected behavior CPU usage should remain minimum.

Versions

I, [2020-08-13T22:32:16.983967 #26243]  INFO -- : reload config: /home/igor/.config/fusuma/config.yml
I, [2020-08-13T22:32:17.043391 #26243]  INFO -- : ---------------------------------------------
I, [2020-08-13T22:32:17.043425 #26243]  INFO -- : Fusuma: 1.11.1
I, [2020-08-13T22:32:17.044857 #26243]  INFO -- : libinput: 1.15.5
I, [2020-08-13T22:32:17.045392 #26243]  INFO -- : OS: Linux 5.7.15-xanmod1 #0~git20200811.9ef0fee SMP PREEMPT Tue Aug 11 18:15:11 UTC 2020
I, [2020-08-13T22:32:17.045938 #26243]  INFO -- : Distribution: Ubuntu 20.04.1 LTS \n \l
I, [2020-08-13T22:32:17.046413 #26243]  INFO -- : Desktop session: plasma x11
I, [2020-08-13T22:32:17.046433 #26243]  INFO -- : ---------------------------------------------
I, [2020-08-13T22:32:17.046446 #26243]  INFO -- : Enabled Plugins: 
I, [2020-08-13T22:32:17.046508 #26243]  INFO -- :   Fusuma::Plugin::Buffers::GestureBuffer
I, [2020-08-13T22:32:17.046529 #26243]  INFO -- :   Fusuma::Plugin::Detectors::PinchDetector
I, [2020-08-13T22:32:17.046543 #26243]  INFO -- :   Fusuma::Plugin::Detectors::RotateDetector
I, [2020-08-13T22:32:17.046555 #26243]  INFO -- :   Fusuma::Plugin::Detectors::SwipeDetector
I, [2020-08-13T22:32:17.046568 #26243]  INFO -- :   Fusuma::Plugin::Events::Records::GestureRecord
I, [2020-08-13T22:32:17.046577 #26243]  INFO -- :   Fusuma::Plugin::Events::Records::IndexRecord
I, [2020-08-13T22:32:17.046585 #26243]  INFO -- :   Fusuma::Plugin::Events::Records::TextRecord
I, [2020-08-13T22:32:17.046593 #26243]  INFO -- :   Fusuma::Plugin::Executors::CommandExecutor
I, [2020-08-13T22:32:17.046600 #26243]  INFO -- :   Fusuma::Plugin::Executors::SendkeyExecutor
I, [2020-08-13T22:32:17.046607 #26243]  INFO -- :   Fusuma::Plugin::Filters::LibinputDeviceFilter
I, [2020-08-13T22:32:17.046615 #26243]  INFO -- :   Fusuma::Plugin::Filters::LibinputTimeoutFilter
I, [2020-08-13T22:32:17.046622 #26243]  INFO -- :   Fusuma::Plugin::Inputs::LibinputCommandInput
I, [2020-08-13T22:32:17.046629 #26243]  INFO -- :   Fusuma::Plugin::Parsers::LibinputGestureParser
I, [2020-08-13T22:32:17.046654 #26243]  INFO -- : ---------------------------------------------

Additional context Effectively it's resurrection of #77. At introduction fusuma --device option was propagated to libinput-debug-events command line option, which make libinput to report events from single device. In contrary filter option doesn't have effect on libinput-debug-events command line options. On my system running filter with trackpad name results in a lot of wasted cpu cycles, where libinput-debug-events reports a lot of events from other devices (mouse is the most noisy) and fusuma just filters them out.

I'm aware about

plugin:
  inputs:
    libinput_command_input:
      device: '/dev/input/event6'

But this is another problem, as it expects kernel path, which isn't really constant (it can change depending whether laptop booted with our without dock). Ideally I'd like to have option where I can specify device name (like in filter), then it would be translated to kernel path and executed libinput-debug-events --device=<kernel path>.

z0rc commented 4 years ago

I just realized, that my issue might not be easily reproducible with any mouse, as I'm using mouse with high polling rate of 1000 Hz.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.