Media Keys Don't Work

Reply

Re: Media Keys Don't Work

Rising Star 6 ArtGravity
Rising Star 6

@navnav wrote:

I've been a premium member for years and I *only* use Linux.

I, too, have been a paid subscriber for years and only use Linux (and Android, which technically runs on a Linux kernel, so I stand by my "only Linux" claim). When I first signed up, the only way to use Spotify on Linux was as a paid subscriber. For a brief period I did use the ad-supported version when it finally came to Linux, but it wasn't long before I switched back to premium.

 

Overall this is a minor issue for me since reverting the snap to 1.0.89.313.g34a58dea-5 restores functionality, but, assuming that the number in parentheses that follows the application version increments by one for every snap app release, I am now 10 releases behind current!

2 people liked this

Re: Media Keys Don't Work

MadMartian
Regular

Does d-bus still work?

dbus-send --print-reply=literal --session --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause

If so, someone mentioned earlier they made a temporary work-around with a Python script that maps the media keys to the appropriate dbus messages.

Re: Media Keys Don't Work

rjbruintjes
Regular

@ArtGravity wrote: 

Overall this is a minor issue for me since reverting the snap to 1.0.89.313.g34a58dea-5 restores functionality...


Perhaps off topic, but I cannot find a way to install a specific snap if I didn't have it installed before. (I'm installing Spotify on a new Ubuntu 16.04 machine.) Does anyone know how to do this?

1 person liked this

Re: Media Keys Don't Work

geca
Casual Listener

@MadMartian wrote:

Does d-bus still work?

dbus-send --print-reply=literal --session --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause

If so, someone mentioned earlier they made a temporary work-around with a Python script that maps the media keys to the appropriate dbus messages.


Yes! d-bus still works in my computer (16.04). I just created new keyboard shortcuts  with the dbus commands and assigned to them the media keys. It works! And I am only using media keys with spotify so it works for me.

5 people liked this

Re: Media Keys Don't Work

gumbeto
Regular

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")

2 people liked this

Re: Media Keys Don't Work

rouck
Casual Listener

Worked for me. The only drawback is that you loose the media buttons for everything else.

I'm considering using other programmable buttons to do this.

Re: Media Keys Don't Work

gumbeto
Regular

Good point. You could add a different keybinding for spotify only, but that is not ideal either.

Re: Media Keys Don't Work

Rising Star 6 ArtGravity
Rising Star 6

I just pressed the play/pause key on my Logitech K750 that had been encountering this issues, and it worked, so I checked my Spotify snap app version to confirm that it was still on the last known working release. Much to my surprise, it had been upgraded to 1.0.98.78.gb45d2a6b-10.

 

This version is working for me!

 

Edit: not working on same version on the following day - see follow up post.

Re: Media Keys Don't Work

gumbeto
Regular

Not working here, and I have the same version. Did you change anything else relevant in your system?

Re: Media Keys Don't Work

Rising Star 6 ArtGravity
Rising Star 6

@gumbeto wrote:

Not working here, and I have the same version. Did you change anything else relevant in your system?


I did not make any software changes outside of normal package updates from system repositories, which should not be relevant.

 

After reading a previous comment about altering keyboard shortcut assignments, it is worth mentioning that I did examine my system setting for Keyboard/Shorcuts/Sound and Media. I selected Play (or play/pause) and pressed the play/pause key on my keyboard. It did not alter the value displayed, but on the off chance that it had an effect, it seemed worth mentioning.

SUGGESTED POSTS