YaLTeR / niri

A scrollable-tiling Wayland compositor.
https://matrix.to/#/#niri:matrix.org
GNU General Public License v3.0
3.34k stars 95 forks source link

High cpu usage with fcitx5 when screen is turned off via `niri msg` #602

Open BRS5672023 opened 4 weeks ago

BRS5672023 commented 4 weeks ago

System Information

I noticed this issue when I locked the screen and wait until the screen is off, then the cpu fan ramped up after a couple of seconds, but if I then wake up the screen, the cpu usage goes down as normal.. I found something goes wrong with fcitx5 using ssh on my phone..

Screenshot_2024-08-16-21-09-59-699_com termux

This issue doesn't happen on hyprland though, and neither when I use the shortcut to turn off the screen Mod+Shift+P { power-off-monitors; }. But if I type niri msg output eDP-1 off within the terminal then the issue appears (and I don't know how to turn on the screen in this case).

One can reproduce this issue with niri msg invoked by swayidle, e.g., the following

timeout 600 'pidof swaylock || swaylock -f'
timeout 630 'niri msg output eDP-1 off' resume 'niri msg output eDP-1 on'
timeout 30 'pidof swaylock && niri msg output eDP-1 off' resume 'niri msg output eDP-1 on'
before-sleep 'pidof swaylock || swaylock -f'
YaLTeR commented 4 weeks ago

Hm, guess something is busylooping. If you can, please build and run niri with debuginfo and then when the issue occurs, record some seconds with:

perf record -F 99 --call-graph dwarf,65528 -p $(pidof niri)

Then make and upload here a flamegraph using something like:

perf script | inferno-collapse-perf | inferno-flamegraph > flamegraph.svg

(this uses commands from inferno)

It should look similar to this: https://github.com/YaLTeR/niri/assets/1794388/9d81ac17-50a6-4994-abd9-6d1b4debcb34

Sidenote, why are you turning off the monitor in swayidle rather than niri msg action power-off-monitors?

BRS5672023 commented 4 weeks ago

Sidenote, why are you turning off the monitor in swayidle rather than niri msg action power-off-monitors?

Sorry, I just not find the way of turning off screen as I can do with the shortcut.. And I'm using swayidle to invoke niri msg for I don't know how to wake the screen up after I type niri msg output eDP-1 off..

BRS5672023 commented 4 weeks ago

Hm, guess something is busylooping. If you can, please build and run niri with debuginfo and then when the issue occurs, record some seconds with:

perf record -F 99 --call-graph dwarf,65528 -p $(pidof niri)

Then make and upload here a flamegraph using something like:

perf script | inferno-collapse-perf | inferno-flamegraph > flamegraph.svg

I have no idea about what the graph tells.. flamegraph

YaLTeR commented 4 weeks ago

Hm, this looks really weird honestly.