Multimedia keyboard with lag ubuntu 18.04

when I use the volume increase button when trying to type anything on the keyboard it has a lag the same happens when I am going to increase or decrease the volume.

I am using Ubuntu 18.04 Gnome shell graphic environment

does not happen in unity


I had the same problem, but for Spotify.

Searching I found this: https://community.spotify.com/t5/Desktop-Linux/Delay-when-changing-volume/td-p/1589346

Essentially PulseAudio is deliberately delaying global volume changes. This can be changed:

  • Get a root terminal and edit /etc/pulse/daemon.conf.
  • Find the setting "enable-deferred-volume", remove the semicolon at the start of the line if is commented out and set its value to "no"
  • This will enable instant global volume changes
  • Get a terminal with your normal user, restart the PulseAudio daemon:

     pulseaudio -k && pulseaudio --start
    

The man page warns about sound glitches that might occur when switching off deferred volume changes. If you experience this, switch it back on and adjust the delay settings to lower values until it suits you.


Could be a reported Gnome issue. Here's a possible solution, at least for users with a Brazilian keyboard: https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1777708/comments/8

After being annoyed by this bug for a long time, i started digging and found a workaround. Today i found that the bug is only present when i'm using certain keyboard layouts ("Portugues (Brasil)") and was not present when i changed the layout to EUA and language to English (need to set them both to English).

After some digging i found out the culprit is the ScrollLock key and that can be fixed by editing the layout file, which in my case is found at /usr/share/X11/xkb/symbols/br. The only modification i did was to remove or comment the line: modifier_map Mod3 { Scroll_Lock }; After that, set the language and layout back to Portugues (Brasil) and the problem was gone!

No more delays between typings.

PS: I tried this on Fedora, i will try this on ubuntu tomorrow.