How to get media keys working on Ubuntu 19.10 for Kodi
#1
Hi,

I have a NUC set up with Ubuntu 19.10 desktop and try to control it with Harmony Hub over Bluetooth (was the only option that I found in the messy harmony menu). Navigation works well, (even sound control in on the computer which I obviously don't use), but the play pause ffw keys don't. I have tried the playing around with dconf-editor with no luck, and Kodi MPRIS plugging which just gives error.

Any advice?

I run Kodi disabling Pulse and running through ALSA if that makes any difference.
I moved to Linux on a NUC for my media center experience, since I can setup all media systems on the same computer, (snapclient, chromium, and Kodi) and get a good sound. (Pi4 does not support HD Sound properly, and windows don't support snapclient)
Reply
#2
First I would try to follow the kodi log to see if Kodi receives the non working keys: tail -f ~/.kodi/temp/kodi.log (with debugging enabled) and then press some of the non working keys. Kodi should react on them. 

If you see any reaction at the log, then you can try to map those via the keymap editor add-on.
Reply
#3
(2020-03-24, 09:15)DaVu Wrote: First I would try to follow the kodi log to see if Kodi receives the non working keys: tail -f ~/.kodi/temp/kodi.log (with debugging enabled) and then press some of the non working keys. Kodi should react on them. 

If you see any reaction at the log, then you can try to map those via the keymap editor add-on.

I tried key mapping in Kodi as a first thing, but Kodi does not pick up the key at all. I will check the logs later today.

I get a pop-up like this when I use the keys: Image
Reply
#4
I admit to not knowing the technical details but if you are getting a reaction from Kodi's UI it must be reacting to something.

Have you tried the debug level log as yet?
Reply
#5
(2020-03-26, 15:36)littlejeem Wrote: I admit to not knowing the technical details but if you are getting a reaction from Kodi's UI it must be reacting to something.

Have you tried the debug level log as yet?

Kodi gives output in the debug log for the keys that work. Nothing for the keys that don't work. There seems to be some incompatibility with Ubuntu.
Reply
#6
Perhaps this may be of some help ?
Learning Linux the hard way !!
Reply
#7
Fixed!  Rofl

Was a gnome feature blocking the keys. Found it after ages of searching ask.ubuntu and trial en error:
  • Chek the keys with: sudo showkey -k
  • Then you need to change the keys in gnome:
    • Install the visual key editor: dconf-editor
    • Navigate to org/gnome/settings-daemon/plugins/media-keys
    • Remove the default values and replace with ['']
  • Then you need to change it in one more place, you can read more in ask.ubuntu:
    • Find the keys that you need that have default values: gsettings list-recursively org.gnome.settings-daemon.plugins.media-keys | grep thekey
    • Blank the keys with: conf write /org/gnome/settings-daemon/plugins/media-keys/thekey "''"
    • Check which keys have been set: /etc/systemd/system/cockpit.socket.d/listen.conf
  • reboot 
Reply
#8
(2020-03-27, 18:44)Tiger75 Wrote: Fixed!  Rofl

Was a gnome feature blocking the keys. Found it after ages of searching ask.ubuntu and trial en error:
  • Chek the keys with: sudo showkey -k
  • Then you need to change the keys in gnome:
    • Install the visual key editor: dconf-editor
    • Navigate to org/gnome/settings-daemon/plugins/media-keys
    • Remove the default values and replace with ['']
  • Then you need to change it in one more place, you can read more in ask.ubuntu:
    • Find the keys that you need that have default values: gsettings list-recursively org.gnome.settings-daemon.plugins.media-keys | grep thekey
    • Blank the keys with: conf write /org/gnome/settings-daemon/plugins/media-keys/thekey "''"
    • Check which keys have been set: /etc/systemd/system/cockpit.socket.d/listen.conf
  • reboot 
 

https://askubuntu.com/questions/990284/m...untu-17-10
https://askubuntu.com/questions/527990/a...-in-ubuntu
Reply
#9
(2020-03-27, 18:44)Tiger75 Wrote: Fixed!  Rofl

Was a gnome feature blocking the keys. Found it after ages of searching ask.ubuntu and trial en error:
  • Chek the keys with: sudo showkey -k
  • Then you need to change the keys in gnome:
    • Install the visual key editor: dconf-editor
    • Navigate to org/gnome/settings-daemon/plugins/media-keys
    • Remove the default values and replace with ['']
  • Then you need to change it in one more place, you can read more in ask.ubuntu:
    • Find the keys that you need that have default values: gsettings list-recursively org.gnome.settings-daemon.plugins.media-keys | grep thekey
    • Blank the keys with: conf write /org/gnome/settings-daemon/plugins/media-keys/thekey "''"
    • Check which keys have been set: /etc/systemd/system/cockpit.socket.d/listen.conf
  • reboot 

Hello dear, I am trying to follow the instructions but I cannot follow all the steps, would there be a way for me to make a video or images with the steps please I would appreciate it
Reply
#10
(2020-08-04, 00:37)rodypi Wrote:
(2020-03-27, 18:44)Tiger75 Wrote: Fixed!  Rofl

Was a gnome feature blocking the keys. Found it after ages of searching ask.ubuntu and trial en error:
  • Chek the keys with: sudo showkey -k
  • Then you need to change the keys in gnome:
    • Install the visual key editor: dconf-editor
    • Navigate to org/gnome/settings-daemon/plugins/media-keys
    • Remove the default values and replace with ['']
  • Then you need to change it in one more place, you can read more in ask.ubuntu:
    • Find the keys that you need that have default values: gsettings list-recursively org.gnome.settings-daemon.plugins.media-keys | grep thekey
    • Blank the keys with: conf write /org/gnome/settings-daemon/plugins/media-keys/thekey "''"
    • Check which keys have been set: /etc/systemd/system/cockpit.socket.d/listen.conf
  • reboot 

Hello dear, I am trying to follow the instructions but I cannot follow all the steps, would there be a way for me to make a video or images with the steps please I would appreciate it
Sorry, I got fed up with all the problems with Ubuntu, it feels like Windows 95, so I moved back to Windows 10 for graphical clients and migrated to Debian for my servers (i had windows and Debian mixed before, but Debian loves servers). Both are much faster and smoother to work in. So I don't have anywhere to show this.

If you start from install dconf-editor, then open it in the Ubuntu Desktop, i.e. it is graphical. Then follow the path and remove the default values. This is pretty straight forward, the keys you will have to test, I did one key all steps tested and then next, and so on.
Reply
#11
(2020-03-27, 18:46)Tiger75 Wrote:
(2020-03-27, 18:44)Tiger75 Wrote: Fixed!  Rofl

Was a gnome feature blocking the keys. Found it after ages of searching ask.ubuntu and trial en error:
  • Chek the keys with: sudo showkey -k
  • Then you need to change the keys in gnome:
    • Install the visual key editor: dconf-editor
    • Navigate to org/gnome/settings-daemon/plugins/media-keys
    • Remove the default values and replace with ['']
  • Then you need to change it in one more place, you can read more in ask.ubuntu:
    • Find the keys that you need that have default values: gsettings list-recursively org.gnome.settings-daemon.plugins.media-keys | grep thekey
    • Blank the keys with: conf write /org/gnome/settings-daemon/plugins/media-keys/thekey "''"
    • Check which keys have been set: /etc/systemd/system/cockpit.socket.d/listen.conf
  • reboot 

https://askubuntu.com/questions/990284/m...untu-17-10
https://askubuntu.com/questions/527990/a...-in-ubuntu

Can I just say how much I hate linux ... I swear to God, every time I try to get back into it I spend hours and HOURS trying to figure out the most ridiculous, idiotic problems. I'm still trying to get my remote control, which worked in Ubuntu 16.x to work in 20.x because apparently multimedia keys are getting hijacked. I followed the same rabbithole you did and I'm still effing stuck.  I think I'll buy a few shares of MSFT ...
Reply
#12
(2021-02-08, 22:11)MoistCowbell Wrote:
(2020-03-27, 18:46)Tiger75 Wrote:
(2020-03-27, 18:44)Tiger75 Wrote: Fixed!  Rofl

Was a gnome feature blocking the keys. Found it after ages of searching ask.ubuntu and trial en error:
  • Chek the keys with: sudo showkey -k
  • Then you need to change the keys in gnome:
    • Install the visual key editor: dconf-editor
    • Navigate to org/gnome/settings-daemon/plugins/media-keys
    • Remove the default values and replace with ['']
  • Then you need to change it in one more place, you can read more in ask.ubuntu:
    • Find the keys that you need that have default values: gsettings list-recursively org.gnome.settings-daemon.plugins.media-keys | grep thekey
    • Blank the keys with: conf write /org/gnome/settings-daemon/plugins/media-keys/thekey "''"
    • Check which keys have been set: /etc/systemd/system/cockpit.socket.d/listen.conf
  • reboot 

https://askubuntu.com/questions/990284/m...untu-17-10
https://askubuntu.com/questions/527990/a...-in-ubuntu

Can I just say how much I hate linux ... I swear to God, every time I try to get back into it I spend hours and HOURS trying to figure out the most ridiculous, idiotic problems. I'm still trying to get my remote control, which worked in Ubuntu 16.x to work in 20.x because apparently multimedia keys are getting hijacked. I followed the same rabbithole you did and I'm still effing stuck.  I think I'll buy a few shares of MSFT ...

Have you tried checking keyboard shortcuts to any MPRIS widgets or docker plugins?
Reply
#13
(2021-02-09, 16:50)TheJezstarr Wrote:
(2021-02-08, 22:11)MoistCowbell Wrote:
(2020-03-27, 18:46)Tiger75 Wrote: https://askubuntu.com/questions/990284/m...untu-17-10
https://askubuntu.com/questions/527990/a...-in-ubuntu

Can I just say how much I hate linux ... I swear to God, every time I try to get back into it I spend hours and HOURS trying to figure out the most ridiculous, idiotic problems. I'm still trying to get my remote control, which worked in Ubuntu 16.x to work in 20.x because apparently multimedia keys are getting hijacked. I followed the same rabbithole you did and I'm still effing stuck.  I think I'll buy a few shares of MSFT ...

Have you tried checking keyboard shortcuts to any MPRIS widgets or docker plugins?

I figured it out, ultimately it was a gnome issue with grabbing key events, and the built-in keyboard editor didn't do what it was supposed to do.
I know Linux decently well, I can't imagine someone that doesn't would ever spend the time to try and get through this.
And they shouldn't have to - when something as simple as default key mapping is broken, people will just throw their hands up and walk away. It's a shame.
Not a rant towards Kodi - I just wish there was an easier way to for the *nix development community to synergize.
Reply
#14
(2021-02-09, 18:38)MoistCowbell Wrote: <snip>
I know Linux decently well, I can't imagine someone that doesn't would ever spend the time to try and get through this.
And they shouldn't have to - when something as simple as default key mapping is broken, people will just throw their hands up and walk away. It's a shame.
<snip>

I agree wholeheartedly. The worst part of all is the, "it's not a bug, it's a feature," thing that often comes with things like this. I have seen both KDE and Gnome advertising this as a Good Thing™ as it guarantees that all media apps that submit to the v2 MPRIS spec will have the media keys 'just work' and don't mention that it breaks it for everything else.
Reply
#15
Multiple threads to same topic. Here is a solution that worked for me. Quite simple.

https://forum.kodi.tv/showthread.php?tid=104541&page=16
Reply

Logout Mark Read Team Forum Stats Members Help
How to get media keys working on Ubuntu 19.10 for Kodi0