Fn Media keys slow/delayed on ubuntu gnome 17.04

7,508

Solution 1

For some reason my Gnome freezes when using Fn keys, or when I try to use 2 keyboards. A friend of mine pointed to me that it occurs when switching to a keyboard layout that has Scroll Lock enabled, so I disabled it in the X11 keyboard layout file for my language and it solved the problem.

The steps I followed are:

  1. Opened the keyboard layout file for my language, in my case:
    sudo nano /usr/share/X11/xkb/symbols/br
  2. Commented the line:
    modifier_map Mod3 { Scroll_Lock };
  3. Logged out and logged in again or run command setxkbmap.

These steps are specific for the Brazilian Portuguese ABNT2 Layout and may not work for other layouts, but it can help you find a similar solution.

Solution 2

I had the same problem, but instead of Fn keys my problem was with the Ctrl key. Whenever I pressed Ctrl, gnome-shell CPU usage spiked!

So I figured out that my keyboard layout was set to en-GB, United Kingdom while my keyboard layout is en-US!

While the difference between the two layouts is minimal, it still somehow bugged the whole gnome-shell. So if anyone having the same problem, double check your keyboard layout from Gnome Settings!

Solution 3

I have reported the bug here: https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1895486

I think if more people comment there, the Canonical will help us to fix the problem.

This bug appears on Ubuntu 20.04 too.

I opened a merge request in: https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/112

Share:
7,508

Related videos on Youtube

Jose Valencia
Author by

Jose Valencia

Updated on September 18, 2022

Comments

  • Jose Valencia
    Jose Valencia over 1 year

    I just installed Ubuntu 17.04 on my Asus ROG GL752VW laptop and I decided to install gnome-shell and then install ubuntu-gnome-desktop.

    After some use, I noticed a delay when using Fn + F5or F6 as media controls.

    The first time I push these key combination Gnome hangs for a short time, and the next Fn + F-key pushes work without any delay until you push any other key-combination, like Alt + Tab which does not use the Fn key. I think it could be an ACPI related issue.

    Update:

    Each time gnome hangs there is a short peak of CPU usage and this is logged.

    gnome-shell[10821]: pushModal: invocation of begin_modal failed
    gnome-shell[10821]: pushModal: invocation of begin_modal failed
    /usr/lib/gdm3/gdm-x-session[10635]: (II) NVIDIA(0):     cd/play CDPLAY 00000080 00000000 K
    /usr/lib/gdm3/gdm-x-session[10635]: (II) NVIDIA(0): ACPI: received event:  PNP0C14:01 000000ff 00000000
    /usr/lib/gdm3/gdm-x-session[10635]: (II) NVIDIA(0):     cd/play CDPLAY 00000080 00000000 K
    /usr/lib/gdm3/gdm-x-session[10635]: (II) NVIDIA(0): ACPI: received event:  PNP0C14:01 000000ff 00000000
    

    I tried reinstalling ubuntu-gnome-desktop but it didn't work.

    Update:

    I found this post which may be related.

    I started getting sporadic freezes on my T460s. These freezes tended to occasionally manifest when pressing Mod4, or other modifier or media keys.

    ...This hinted to me that this issue might be a race condition in some process that talks to systemd-logind.

    Update:

    I started to think it is not an ACPI related problem, as I just installed the media keys gnome plugin and when I try to use it happens the same thing as if I were using Fn keys, the problem must be with gnome.

    Update:

    I just reinstalled ubuntu Gnome, and it does not happens on wayland so it is xorg related. Looking for a way to make gnome-wayland work with Nvidia drivers.

    Update:

    I just installed budgie-desktop and the problem is still happening.

    Update:

    Same problem happening in ubuntu 17.10 after some use. It's so annoying...

    Update:

    Problem still happening in ubuntu 18.04. Even worse some times the system crashes when using media keys.

    • brice rebsamen
      brice rebsamen over 6 years
      linking with askubuntu.com/questions/837883/… as it's possibly related
    • brice rebsamen
      brice rebsamen over 6 years
      it appears that there is a solution in askubuntu.com/questions/911946/…
    • Jose Valencia
      Jose Valencia over 6 years
      not the same problem, I tried the suggested solution but nothing changed.
    • JoaaoVerona
      JoaaoVerona almost 6 years
      Yet here we are in 2018 and this problem still exists on GNOME 3.28... Did you get to workaround it @JoseValencia?
    • Jose Valencia
      Jose Valencia almost 6 years
      No, I couldn't figure a workaround out. Actually I started to use Windows 10 more.
    • JoaaoVerona
      JoaaoVerona almost 6 years
      I've found that, switching between typing on my laptop's internal keyboard, and on my external USB keyboard, causes that delay too. And I can also confirm that it is absolutely GNOME+x11 related, because this works fine on GNOME+Wayland and KDE+x11. Sadly I too have a NVIDIA gcard, so Wayland is not an option...
    • Aaahh
      Aaahh over 5 years
      I don't know if it is related, but my cpu takes heartbeats, regardless of activity. Similar to the ones you had but more consistent and I only have 4 cores, and it tends to be the first core that spikes Systemd and systemd related stuff crash every so often I couldn't figure it out, so I wiped my drive and installed arch linux, and lo and behold arch took heartbeats with nothing but X11 and Nvidia. Sometimes I can ever so slightly feel the heartbeats when using Graphic intensive applications on windows (could be unrelated). I still see the beats when I have the nvidia gpu disabled on ubuntu.
  • Jose Valencia
    Jose Valencia over 5 years
    Thank you very much, actually I have en(us), br and es keyboards enabled, I did it in br only and the delay is gone.
  • user1091856
    user1091856 over 5 years
    I signed up just to thank you. I spent some time trying to figure out what the heck was causing this delay in the hotkeys until I found your solution here.
  • Matheus Castello
    Matheus Castello about 4 years
    Thanks man! This works!
  • GuiGS
    GuiGS about 4 years
    Thanks a lot! You can apply the changes without logging out with setxkbmap -layout br
  • JoaaoVerona
    JoaaoVerona almost 4 years
    You, sir, just helped me solve an issue I had for the past whole year. Thank you, fellow countryman.
  • AFMeirelles
    AFMeirelles almost 4 years
    Someone give this guy a medal.
  • Talha Junaid
    Talha Junaid over 3 years
    facing the same with US layout, How I can identify what to comment
  • JulioHM
    JulioHM over 3 years
    Just confirmed. This actually works. Thank you!
  • marcus
    marcus about 3 years
    You can set your Scroll Lock as a Compose Key using Gnome Tweaks or DConf Editor (/org/gnome/desktop/input-sources/xkb-options = ['compose:sclk']). That solved the problem for me too.
  • Thiago Dias
    Thiago Dias about 3 years
    worked for me too, abnt2 keyboard on zorin os 16 core