How to get media keys working on Ubuntu 19.10 for Kodi
#16
(2021-02-14, 13:29)wastis Wrote: Here is a solution that worked for me. Quite simple.

Linking a 10-yr old forum thread, from 2011... I'm not sure if that is the best way to go.
And please don't link it in every thread related to remotes that you can find on this forum.
Reply
#17
Sorry, was just looking at last posts which dated back to end of last year with a specific problem to a recent Ubuntu version and did respond with my solution to it, linking this thread with the same issue which I only found later. I'll never do it again.
Reply
#18
OK, for curiosity I spent again a bit of time and tried to get "MPRIS D-Bus" interface on a fresh LinuxMint 20.10 Xfce running. This addon has the potential to enable the Multimedia keys on my MCE remote within KODI ("out of the box"). 

I have to admit, I cannot find proper documentation on this. I figured out that the Python packages python-dbus and python-gobject needed to be installed. Those are Python2, Python3 packages do not work.

 
Code:
sudo apt install python-gobject python-dbus


After this I did install the addon within Kodi.

I see still error messages in the Kodi log,

Code:
2021-02-14 19:23:45.004 T:139882991187712   ERROR: service.mpris.soundmenu: GetAll called with bad interface 'org.freedesktop.DBus.Properties'
2021-02-14 19:23:45.232 T:139882991187712   ERROR: service.mpris.soundmenu: GetAll called with bad interface 'org.mpris.MediaPlayer2.Playlists'

and only the Play/Pause and Stop are working. None of the other keys.

There is also a package pympris which could be installed by pip, however pip process for Python2 seems to be broken. Not sure whether this package solves the process, though.


For now, I swap back to my working solution previously posted by me, however I feel this is the solution to go into the future, to have MPRIS build into Kodi or into an addon.
Reply
#19
continued... and finally I succeeded to install pip in an older version
Code:
curl https://bootstrap.pypa.io/2.7/get-pip.py --output get-pip.py
python2 get-pip.py
and with this pympris
Code:
pip install pympris

So error messages in Kodi log are gone. Still, multimedia keys that are working are PLAY/PAUSE and STOP, multimedia keys that are not received by Kodi are NEXT/PREV and Volume up/down/mute.

Another disadvantage compared to the inputlirc method is that certain keys a not exclusively handled by KODI, such as Power Button and Windows/Start button, maybe resulting in undesired behaviour.
But therefore it might be slightly more easy to install.
Reply
#20
(2021-02-15, 09:09)wastis Wrote: continued... and finally I succeeded to install pip in an older version
Code:
curl https://bootstrap.pypa.io/2.7/get-pip.py --output get-pip.py
python2 get-pip.py
and with this pympris
Code:
pip install pympris

So error messages in Kodi log are gone. Still, multimedia keys that are working are PLAY/PAUSE and STOP, multimedia keys that are not received by Kodi are NEXT/PREV and Volume up/down/mute.

Another disadvantage compared to the inputlirc method is that certain keys a not exclusively handled by KODI, such as Power Button and Windows/Start button, maybe resulting in undesired behaviour.
But therefore it might be slightly more easy to install.

Try this - worked for me.  358079 (thread)
Reply
#21
Running into the same issue with Mint 20.3 (Cinnamon) and probably tried the better part of 20 different solutions over the past week, none of which actually worked - though this thread pointed me in the right direction, and I FINALLY managed to get it working. Part of it seems to have been that the remote I have (an Adesso ARC-1100) just emulates/pretends to be a keyboard, and most of the guides I found focused on other types of remotes & convoluted configuration steps for "LIRC," which didn't actually apply for me.

The steps that worked, at least for my particular setup:
  1. Open System Settings (click the "Mint"/start menu, type "settings" and, in my case, it was the 2nd result.
  2. Scroll down to "Hardware," then click "Keyboard" (or just type "keyboard" into the search field at the top right).
  3. In the Keyboard settings window, click the "Shortcuts" tab at the top.
  4. In the left-hand pane, click "Sound and Media".
  5. In the top-righthand pane ("Keyboard shortcuts"), click on each of the keys that weren't working - in my case, it was the shortcuts:
    1. Play
    2. Pause playback
    3. Stop playback
    4. Previous track
    5. Next track
    6. Rewind
    7. Fast-forward

      In my case, I didn't need to do anything to get the volume control keys to work, they already functioned properly (though, of course it was the keys I don't actually use that were working - since I use the volume controls on the TV's remote instead).
  6. For each one, click on in the top-right pane to select, then you should see the bindings for it in the "Keyboard bindings" (bottom-right) pane.
  7. If you see any entries in that say anything other than "unassigned," double-click on it to edit.
  8. It should then show "Pick an accelerator" - press the backspace key to set it to "unassigned".
  9. Close the system settings window when finished.
That partially worked, in that when I pressed the play/pause/stop buttons on the remote, I no longer got the annoying circle-with-a-line-through-it icon appearing onscreen - but the keys still weren't recognized by Kodi. To get that part working, I had to use these steps:
  1. Go to "Add-ons," then "Install from repository".
  2. Select "Kodi add-on repository," then the "Program add-ons" category.
  3. Scroll down until you see "Keymap Editor," click on it and click "Install".
  4. After it finishes installing, click on it to get the "Add-on information" pop-up (can't remember if that's available from the same screen where you install the plugin - if not, go back to Kodi's main/home screen, select "Add-ons," then "My add-ons," then "All," then "Keymap Editor").
  5. Click the "Run" button on the lefthand side.
  6. Click "Edit".
  7. Click "Fullscreen Video" (2nd item in the list), then "Playback".
  8. Click on the key you want to edit - in my case, I only needed to do that with the first 2 options ("Play" and "Pause") - the "Stop" key was set to "browser_back," which worked, seemingly as a result of setting to unassigned in the System keyboard shortcuts (though it may be because I had tried to edit those keys via the Keymap Editor plugin earlier, and inadvertently removed their original Kodi-specific settings).
  9. For each key you need to edit, do the following:
    1. Click on it and in the next screen, click "Edit".
    2. You should then see a message saying "Press the key you want to assign now"
    3. Press the button on the remote you want to use for that function.
  10. That should take you back to the "Select the action to assign a key" window, and the function/shortcut you just edited should now show a numeric code to the right of it.
  11. After editing/assigning all of the remote buttons that weren't working, press Esc (or click the "X" in the pop-up window) until you get back to the window with the options "Edit," "Reset to default," and "Save" - click on the "Save" option, and that should be it.

    One other thing to note: in my case, the both the Play and Pause buttons seem to send the same code (61952), so in other words those buttons can be used interchangeably - pressing either one when video is playing will pause it, or un-pause it if playback is already paused.
Hopefully those instructions will be helpful to anyone else in the same boat.
Reply
#22
In future, before changing key mappings at desktop or system level, just install the Media Player Remote Interface addon in Kodi 19+ matrix and later.

This ensures proper handling of the multimedia keys with Kodi and also for usb remotes that are emulating a keyboard.

In addition, those keys will continue to work with other media players, such as VLC, Celluloid or others.    
 
Code:
wget https://github.com/wastis/MediaPlayerRemoteInterface/archive/refs/heads/main.tar.gz -O - | tar -xz --strip-components 1 --one-top-level=service.mpremote.interface -C ~/.kodi/addons/
Reply

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