Media Keys Don't Work

Reply

Media Keys Don't Work

12173268984
Casual Listener

Plan

Free

Country

 USA

Device

(Desktop PC)

Operating System

Debian with Unstable Updates

 

My Question or Issue

 The Media Keys Play/Pause/Next/Previous on the keyboard don't work with the Spotify Application.

 

The Media Keys work with other applications in Linux such as Clementine and also work with the Spotify Application in Windows just fine. I would think it should be easy to make the media keys work just like they do in Clementine and other media applications in Linux.

90 Replies

grindcore
Regular

I'm using KDE (and Firefox, not Chrome if this matters) and found another problem why it was not working: the media player Clementine overwrote the global shortcuts to control the current media player.

 

Go to Settings > Global shortcuts > Media controls and reassign the keys. Works for me again.

andrebrait
Casual Listener

I can confirm disabling media key handling on Chrome fixes this.

 

Weird thing is that I had no media being played on Chrome, so maybe this is a Chrome bug instead?

grimpressive
Casual Listener

I finally found the way to have it working (if you are a Chrome browser user), whether with deb package or snap on Ubuntu 19.10.

 

First of all check in Settings > Devices > Keyboard Shortcuts that your Media Keys are present (release update from 19.04 to 19.10 set them all to Disabled in my case)

 

Then open Chrome browser :

  1. In the address bar go to chrome://flags/#hardware-media-key-handling
  2. Change the value to Disabled
  3. Restart Chrome

Deal.

 

 

diegoluiz
Newbie

Worked perfectly. Problem wasn't spotify at all, but chrome messing using the keys! 

6etacat
Casual Listener

I'm using Spotify 1.1.10.546.ge08ef575 on Manjaro Linux. The browser and other software work well with media keys, not Spotify. Please fix this issue. 

BlackDex
Regular

There are several items which cause the media-keys not to work.

One is that chrome/chromium can also hijack these key's when you use youtube.

The systems then doesn't know which player to select and it can fail.


I have created a small utility which you can download from github:

https://github.com/BlackDex/mpris-control/releases


I created a special shortcut by using the super+media-keys which work only for spotify by using `mpris-control -t Spotify toggle` for example.


If you find any bugs, please report that at the issues section.

 

iulianrang
Visitor
Thank you very much BlackDex !!!
mpris-control made my Ubuntu better and my life happier 🙂
Thanks a lot friend!

hector373
Regular
For me it helped to disable Media-Key-Control in Chrome browser, if he is running at the same time with Spotify.
https://www.addictivetips.com/web/disable-media-key-control-in-chrome/

tolgamertertin
Visitor

Yes, problem was Chrome's hardware media key handling for me, too.

mckarsi
Visitor

Thank you, bro! Media keys started to work after I had disabled "Hardware Media Key Handling" from Google Chrome.

dimovnike
Casual Listener

You are right... killing chrome solves the issue. It seems that chrome does not release the keys when youtube is closed (if there is such a thing). Thanks.

SirScrambly
Regular

How is this still an issue? Spotify, you're a down right travesty. UX, who does that?

Lemonase
Visitor
Maybe they feel the dbus/mpris workaround is an acceptable fix. Let's be honest, Linux users are always forced to do this kind of stuff. I agree that it is bad UX though. Spootify plz fix.

sleigh_boy
Casual Listener

Spotify 1.0.80.480.g51b03ac3 . Running on Gentoo with Plasma desktop. All media players and browsers work flawlessly with media keys, not Spotify. Alternate media shortcuts via D-Bus commands is a nasty hack. Please address this.

sleigh_boy
Casual Listener

UPDATE: I'm on Plasma desktop, and removed a long-used widget "Compact Media Player" in favor of the bundled Media Player widget. And suddenly all media key interaction works. System audio mute, previous, play/pause, next, etc. Keep this in mind if you're here looking for answers.

MadMartian
Music Fan
Not working again for me either.  I notice it works for awhile after a
reboot but then I think plasmashell or pulseaudio crashed and had to be
restarted and then the media keys stopped working again.
Do the devs read these? I wonder if the code is relying on stale
handles.

xkg02s-u_shl
Music Fan

EDIT: my bad. reboot fixed it

The latest snap update 1.1.5.153.gf614956d-16 is not with media keys too on Kubuntu 19.04. It worked with the previous versions (but that couldn't play local files due to a bug). Spotify doesn't show up in the media player widget

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.

ArtGravity
Composer

I found that the suggestion to use mpris-control did exactly what I wanted, and this is no longer problematic for me.

MadMartian
Music Fan
Media keys stopped working for me after an update and then started working again suddenly. I checked the version and it's 1:1.0.98.78.gb45d2a6b-10. I don't know if the client was upgraded or a dependent package was upgraded.
SUGGESTED POSTS