Media Keys Don't Work

Reply

Re: Media Keys Don't Work

Rising Star 12 ArtGravity
Rising Star 12

My previous celebration apparently was premature.

I don't know why the keys worked yesterday, but they no longer work again today.

 

I guess I'm going to have to run a snap revert.

ArtGravityRising Star 12
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

Re: Media Keys Don't Work

erickfernandes
Newbie

@gumbeto wrote:

I confirm the proposed dbus command works! With that, I was able to workaround the issue by adding keybindings to the commands below.

 

Note that either `--type=method_call` or `--print-reply` is needed, otherwise the type is "signal" and it does not work (see man dbus-send). I wonder if the original problem is related to that.

 

 

dbus-send --type=method_call --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
dbus-send --type=method_call --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous
dbus-send --type=method_call --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next

 

 

The keybindings can be set in the Keyboard settings window, under Shortcuts->Custom Shortcuts:

 

spotify_workaround.pngMedia keys workaround for spotify (v > 1.0.89)

After that, click on the key-combination column and press the desired media key on the keyboard. Entering each shortcut will disable existing shortcuts with the same key (namely under "Sound and Media")



Worked for me.
I only use the media keys with Spotify so this solution is perfect.
Tanks a lot!

Re: Media Keys Don't Work

BlackDex
Newbie

The workaround of @gumbeto works nicely, but i wanted to make it a bit more easy to type so i created a small application which does the same. You can replace the long dbus-send commands with a shorter line.

You can use

mpris-control toggle
mpris-control next
mpris-control previous

As the commands.

Just place the mpris-control application somewhere it can be execute, like your ~/bin folder or something.

 

You can get it from here: https://github.com/BlackDex/mpris-control/releases

Re: Media Keys Don't Work

poq
Casual Listener

Media keys still have no effect with latest apt version.

Spotify Linux version:

1.0.98.78.gb45d2a6b

On Ubuntu 16:04

This was originally reported over 4 months ago! Is there any progress on this issue?

Re: Media Keys Don't Work

MadMartian
Regular
Thank you for taking the time to post.  I almost decided to upgrade
that package today.

Re: Media Keys Don't Work

konstantinast
Casual Listener

@gumbeto wrote:

I confirm the proposed dbus command works! With that, I was able to workaround the issue by adding keybindings to the commands below.

 

Note that either `--type=method_call` or `--print-reply` is needed, otherwise the type is "signal" and it does not work (see man dbus-send). I wonder if the original problem is related to that.

 

 

dbus-send --type=method_call --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
dbus-send --type=method_call --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous
dbus-send --type=method_call --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next

 

 

The keybindings can be set in the Keyboard settings window, under Shortcuts->Custom Shortcuts:

 

spotify_workaround.pngMedia keys workaround for spotify (v > 1.0.89)

After that, click on the key-combination column and press the desired media key on the keyboard. Entering each shortcut will disable existing shortcuts with the same key (namely under "Sound and Media")


 

Spotify build: 1.1.0.237.g378f6f25

In case this sollution does not work and you are like me using Ubuntu 18.04 with Unity, then you need to apply this:

https://askubuntu.com/a/1082188

to fix a bit broken Keyboard > Custom Shortcut functionality beforehand. 

Steps that I've done:

1. Applied the sollution from askubuntu.com website.
2. Created a Custom Shortcuts as gumbeto suggested.
3. Rebooted.

Result:

Play/Plause media key on my Logitech K270 controls Spotify again.

Re: Media Keys Don't Work

tallesairandev
Newbie

This software worked for me

https://github.com/milgra/macmediakeyforwarder

http://milgra.com/mac-media-key-forwarder.html

 

Forwards media keys to iTunes or Spotify directly.

You can prioritize which app you would like to control or you can go with the default behaviour which controls the running app. The app runs in the menu bar.

Installation

Check installation steps here

Issues you should know about

The app listens on the event tap for key events. This causes problems in some rare cases, like

  • when changing search engine in Safari's preferences window

  • when trying to allow third-party kernel extensions

In these cases simply pause Mac Media Key Forwarder from it's menu.

Re: Media Keys Don't Work

poq
Casual Listener

I'm not sure the Mac media keys forwarding is relevant for this thread but the media keys still don't work.

It would be less of an issue if they'd never worked but this is an obvious regression that shouldn't have happened surely. It's pretty dissapointing but hopefully for the 6-month-versary of the issue which is coming up we'll get a fix — fingers crossed for 2019-04-14.

 

 

Re: Media Keys Don't Work

blburns
Newbie

I found a workaround that works for me consistantly on Ubuntu 18.04

 

Fix Spotify media player buttons using the dbus-send command as a new keyboard shorcut:
(this downside is that it overrides all other media players for the assigned buttons)
  • Play/Pause: 
    dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
  • Stop: 
    dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop
  • Next: 
    dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next
  • Previous: 
    dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous
Or install use the "mpris-control" instead of dbus located at:
wget -O ~/Downloads/mpris-control https://github.com/BlackDex/mpris-control/releases/download/0.1.0/mpris-control
sudo chmod +x ~/Downloads/mpris-control 
sudo mv ~/Downloads/mpris-control /usr/local/bin/
 

Re: Media Keys Don't Work

rjbruintjes
Regular

I'm really disappointed there is still no fix for this regression. I would even be happy to switch back to the older snap that works for some users in this thread, but I can apparently not get that one anymore.

 

I understand there is no official support for Linux, but if you do publish a version, then make it work. If you're not going to fix a regression that's been there for six months, that is going to frustrate a lot of paying customers, including me.

SUGGESTED POSTS