mate-desktop / mate-settings-daemon

MATE settings daemon
https://mate-desktop.org
GNU General Public License v2.0
44 stars 46 forks source link

Media keys (play, pause, next, previous) doesn't work with Google Chrome Media Session API #337

Closed samuel-phan closed 3 years ago

samuel-phan commented 3 years ago

Expected behaviour

When I click on my media keys (play, pause, next, previous), it controls Google Chrome Media Session API (Youtube, Google Play Music, etc.).

Actual behaviour

When I click on my media keys Play/Pause, the current Youtube video played by Google Chrome is not paused.

I did some test on different OS & browser:

That's why I guess it's related to MATE. On GNOME 3, it seems to work fine.

Steps to reproduce the behaviour

MATE general version

1.24.0

Package version

ii  google-chrome-stable                       86.0.4240.75-1                        amd64        The web browser from Google
ii  mate-settings-daemon                       1.24.0-1                              amd64        daemon handling the MATE session settings
ii  mate-settings-daemon-common                1.24.0-1                              all          daemon handling the MATE session settings (common files)

Linux Distribution

NAME="Linux Mint"
VERSION="20 (Ulyana)"
ID=linuxmint
ID_LIKE=ubuntu
PRETTY_NAME="Linux Mint 20"
VERSION_ID="20"
HOME_URL="https://www.linuxmint.com/"
SUPPORT_URL="https://forums.linuxmint.com/"
BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/"
PRIVACY_POLICY_URL="https://www.linuxmint.com/"
VERSION_CODENAME=ulyana
UBUNTU_CODENAME=focal

Link to downstream report of your Distribution

N/A.

DBus monitor logs

I ran dbus-monitor to compare the logs between the MATE desktop and the Cinnamon one.

MATE

Play:

signal time=1602707618.700762 sender=:1.97 -> destination=(null destination) serial=41 path=/org/mpris/MediaPlayer2; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
   string "org.mpris.MediaPlayer2.Player"
   array [
      dict entry(
         string "PlaybackStatus"
         variant             string "Playing"
      )
   ]
   array [
   ]
method call time=1602707618.797502 sender=:1.167 -> destination=org.freedesktop.DBus serial=1 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello
method return time=1602707618.797518 sender=org.freedesktop.DBus -> destination=:1.167 serial=1 reply_serial=1
   string ":1.167"
signal time=1602707618.797524 sender=org.freedesktop.DBus -> destination=(null destination) serial=274 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.167"
   string ""
   string ":1.167"
signal time=1602707618.797540 sender=org.freedesktop.DBus -> destination=:1.167 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.167"
method call time=1602707618.797710 sender=:1.167 -> destination=org.freedesktop.DBus serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal', path='/org/freedesktop/DBus/Local',interface='org.freedesktop.DBus.Local', member='Disconnected'"
method return time=1602707618.797723 sender=org.freedesktop.DBus -> destination=:1.167 serial=3 reply_serial=2
method call time=1602707618.797755 sender=:1.167 -> destination=org.freedesktop.DBus serial=3 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameHasOwner
   string "org.gnome.SessionManager"
method return time=1602707618.797766 sender=org.freedesktop.DBus -> destination=:1.167 serial=4 reply_serial=3
   boolean true
method call time=1602707618.797830 sender=:1.167 -> destination=org.gnome.SessionManager serial=4 path=/org/gnome/SessionManager; interface=org.gnome.SessionManager; member=Inhibit
   string "/usr/bin/google-chrome-stable"
   uint32 0
   string "Playing audio"
   uint32 4
signal time=1602707618.798226 sender=:1.15 -> destination=(null destination) serial=551 path=/org/gnome/SessionManager; interface=org.gnome.SessionManager; member=InhibitorAdded
   object path "/org/gnome/SessionManager/Inhibitor60"
method return time=1602707618.798238 sender=:1.15 -> destination=:1.167 serial=552 reply_serial=4
   uint32 49284500
method call time=1602707618.798245 sender=:1.50 -> destination=:1.15 serial=264 path=/org/gnome/SessionManager; interface=org.gnome.SessionManager; member=IsInhibited
   uint32 8
method return time=1602707618.798251 sender=:1.15 -> destination=:1.50 serial=553 reply_serial=264
   boolean false
method call time=1602707618.798299 sender=:1.50 -> destination=:1.15 serial=265 path=/org/gnome/SessionManager; interface=org.gnome.SessionManager; member=IsInhibited
   uint32 4
method return time=1602707618.798384 sender=:1.15 -> destination=:1.50 serial=554 reply_serial=265
   boolean true

Pause:

signal time=1602707929.114616 sender=:1.30 -> destination=(null destination) serial=63 path=/org/mate/SettingsDaemon/MediaKeys; interface=org.mate.SettingsDaemon.MediaKeys; member=MediaPlayerKeyPressed
   string "MsdMpris"
   string "Play"
Cinnamon

Play:

method call time=1602709059.543669 sender=:1.1 -> destination=org.freedesktop.DBus serial=12 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RequestName
   string "org.freedesktop.ReserveDevice1.Audio0"
   uint32 5
signal time=1602709059.544064 sender=org.freedesktop.DBus -> destination=(null destination) serial=102 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string "org.freedesktop.ReserveDevice1.Audio0"
   string ""
   string ":1.1"
signal time=1602709059.544149 sender=org.freedesktop.DBus -> destination=:1.1 serial=21 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string "org.freedesktop.ReserveDevice1.Audio0"
method return time=1602709059.544172 sender=org.freedesktop.DBus -> destination=:1.1 serial=22 reply_serial=12
   uint32 1
signal time=1602709059.581817 sender=:1.85 -> destination=(null destination) serial=48 path=/org/mpris/MediaPlayer2; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
   string "org.mpris.MediaPlayer2.Player"
   array [
      dict entry(
         string "PlaybackStatus"
         variant             string "Playing"
      )
   ]
   array [
   ]
signal time=1602709059.584000 sender=:1.85 -> destination=(null destination) serial=49 path=/org/mpris/MediaPlayer2; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
   string "org.mpris.MediaPlayer2.Player"
   array [
      dict entry(
         string "Metadata"
         variant             array [
               dict entry(
                  string "xesam:album"
                  variant                      string ""
               )
               dict entry(
                  string "xesam:artist"
                  variant                      array [
                        string ""
                     ]
               )
               dict entry(
                  string "xesam:title"
                  variant                      string "Yann Marguet - L'année 536"
               )
            ]
      )
   ]
   array [
   ]
signal time=1602709059.584213 sender=:1.85 -> destination=(null destination) serial=50 path=/org/mpris/MediaPlayer2; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
   string "org.mpris.MediaPlayer2.Player"
   array [
      dict entry(
         string "Metadata"
         variant             array [
               dict entry(
                  string "xesam:album"
                  variant                      string ""
               )
               dict entry(
                  string "xesam:artist"
                  variant                      array [
                        string "Montreux Comedy"
                     ]
               )
               dict entry(
                  string "xesam:title"
                  variant                      string "Yann Marguet - L'année 536"
               )
            ]
      )
   ]
   array [
   ]
signal time=1602709059.584417 sender=:1.85 -> destination=(null destination) serial=51 path=/org/mpris/MediaPlayer2; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
   string "org.mpris.MediaPlayer2.Player"
   array [
      dict entry(
         string "CanPlay"
         variant             boolean true
      )
   ]
   array [
   ]
signal time=1602709059.584522 sender=:1.85 -> destination=(null destination) serial=52 path=/org/mpris/MediaPlayer2; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
   string "org.mpris.MediaPlayer2.Player"
   array [
      dict entry(
         string "CanPause"
         variant             boolean true
      )
   ]
   array [
   ]
method call time=1602709059.616851 sender=:1.93 -> destination=org.freedesktop.DBus serial=1 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello
method return time=1602709059.617201 sender=org.freedesktop.DBus -> destination=:1.93 serial=1 reply_serial=1
   string ":1.93"
signal time=1602709059.617250 sender=org.freedesktop.DBus -> destination=(null destination) serial=103 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.93"
   string ""
   string ":1.93"
signal time=1602709059.617299 sender=org.freedesktop.DBus -> destination=:1.93 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.93"
method call time=1602709059.617459 sender=:1.93 -> destination=org.freedesktop.DBus serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal', path='/org/freedesktop/DBus/Local',interface='org.freedesktop.DBus.Local', member='Disconnected'"
method return time=1602709059.617529 sender=org.freedesktop.DBus -> destination=:1.93 serial=3 reply_serial=2
method call time=1602709059.617685 sender=:1.93 -> destination=org.freedesktop.DBus serial=3 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameHasOwner
   string "org.gnome.SessionManager"
method return time=1602709059.617735 sender=org.freedesktop.DBus -> destination=:1.93 serial=4 reply_serial=3
   boolean true
method call time=1602709059.617871 sender=:1.93 -> destination=org.gnome.SessionManager serial=4 path=/org/gnome/SessionManager; interface=org.gnome.SessionManager; member=Inhibit
   string "/usr/bin/google-chrome-stable"
   uint32 0
   string "Video Wake Lock"
   uint32 12
signal time=1602709059.626215 sender=:1.6 -> destination=(null destination) serial=367 path=/org/gnome/SessionManager; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
   string "org.gnome.SessionManager"
   array [
      dict entry(
         string "InhibitedActions"
         variant             uint32 12
      )
   ]
   array [
   ]
signal time=1602709059.626417 sender=:1.6 -> destination=(null destination) serial=368 path=/org/gnome/SessionManager; interface=org.gnome.SessionManager; member=InhibitorAdded
   object path "/org/gnome/SessionManager/Inhibitor9"
method return time=1602709059.626511 sender=:1.6 -> destination=:1.93 serial=369 reply_serial=4
   uint32 453511354
method call time=1602709059.626852 sender=:1.22 -> destination=:1.6 serial=93 path=/org/gnome/SessionManager; interface=org.gnome.SessionManager; member=IsInhibited
   uint32 8
method return time=1602709059.627100 sender=:1.6 -> destination=:1.22 serial=370 reply_serial=93
   boolean true
method call time=1602709059.627335 sender=:1.22 -> destination=:1.6 serial=94 path=/org/gnome/SessionManager; interface=org.gnome.SessionManager; member=IsInhibited
   uint32 8
method return time=1602709059.627533 sender=:1.6 -> destination=:1.22 serial=371 reply_serial=94
   boolean true
method call time=1602709059.740193 sender=:1.47 -> destination=:1.85 serial=307 path=/org/mpris/MediaPlayer2; interface=org.freedesktop.DBus.Properties; member=Get
   string "org.mpris.MediaPlayer2.Player"
   string "CanSeek"
method return time=1602709059.740530 sender=:1.85 -> destination=:1.47 serial=53 reply_serial=307
   variant       boolean false
method call time=1602709060.768665 sender=:1.94 -> destination=org.freedesktop.DBus serial=1 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello
method return time=1602709060.769210 sender=org.freedesktop.DBus -> destination=:1.94 serial=1 reply_serial=1
   string ":1.94"
signal time=1602709060.769259 sender=org.freedesktop.DBus -> destination=(null destination) serial=104 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.94"
   string ""
   string ":1.94"
signal time=1602709060.769312 sender=org.freedesktop.DBus -> destination=:1.94 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.94"
method call time=1602709060.769440 sender=:1.94 -> destination=org.freedesktop.DBus serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal', path='/org/freedesktop/DBus/Local',interface='org.freedesktop.DBus.Local', member='Disconnected'"
method return time=1602709060.769487 sender=org.freedesktop.DBus -> destination=:1.94 serial=3 reply_serial=2
method call time=1602709060.769896 sender=:1.94 -> destination=org.freedesktop.DBus serial=3 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameHasOwner
   string "org.gnome.SessionManager"
method return time=1602709060.769972 sender=org.freedesktop.DBus -> destination=:1.94 serial=4 reply_serial=3
   boolean true
method call time=1602709060.770078 sender=:1.94 -> destination=org.gnome.SessionManager serial=4 path=/org/gnome/SessionManager; interface=org.gnome.SessionManager; member=Inhibit
   string "/usr/bin/google-chrome-stable"
   uint32 0
   string "Playing audio"
   uint32 4
signal time=1602709060.773183 sender=:1.6 -> destination=(null destination) serial=372 path=/org/gnome/SessionManager; interface=org.gnome.SessionManager; member=InhibitorAdded
   object path "/org/gnome/SessionManager/Inhibitor10"
method return time=1602709060.773340 sender=:1.6 -> destination=:1.94 serial=373 reply_serial=4
   uint32 1936952946
method call time=1602709060.773428 sender=:1.22 -> destination=:1.6 serial=95 path=/org/gnome/SessionManager; interface=org.gnome.SessionManager; member=IsInhibited
   uint32 8
method return time=1602709060.773625 sender=:1.6 -> destination=:1.22 serial=374 reply_serial=95
   boolean true
method call time=1602709060.773825 sender=:1.22 -> destination=:1.6 serial=96 path=/org/gnome/SessionManager; interface=org.gnome.SessionManager; member=IsInhibited
   uint32 8
method return time=1602709060.774007 sender=:1.6 -> destination=:1.22 serial=375 reply_serial=96
   boolean true
signal time=1602709068.629906 sender=:1.72 -> destination=(null destination) serial=27 path=/org/gnome/Terminal/window/1; interface=org.gtk.Actions; member=Changed
   array [
   ]
   array [
      dict entry(
         string "copy"
         boolean true
      )
   ]
   array [
   ]
   array [
   ]
signal time=1602709068.793919 sender=:1.72 -> destination=(null destination) serial=28 path=/org/gnome/Terminal/window/1; interface=org.gtk.Actions; member=Changed
   array [
   ]
   array [
      dict entry(
         string "copy"
         boolean false
      )
   ]
   array [
   ]
   array [
   ]
signal time=1602709068.797574 sender=:1.72 -> destination=(null destination) serial=29 path=/org/gnome/Terminal/window/1; interface=org.gtk.Actions; member=Changed
   array [
   ]
   array [
      dict entry(
         string "copy"
         boolean true
      )
   ]
   array [
   ]
   array [
   ]

Pause:

method call time=1602709126.675662 sender=:1.47 -> destination=:1.17 serial=308 path=/org/cinnamon/SettingsDaemon/KeybindingHandler; interface=org.cinnamon.SettingsDaemon.KeybindingHandler; member=HandleKeybinding
   uint32 11
method call time=1602709126.676616 sender=:1.17 -> destination=:1.85 serial=63 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=PlayPause
method return time=1602709126.676634 sender=:1.17 -> destination=:1.47 serial=64 reply_serial=308
method return time=1602709126.676822 sender=:1.85 -> destination=:1.17 serial=54 reply_serial=63
signal time=1602709126.680112 sender=:1.85 -> destination=(null destination) serial=55 path=/org/mpris/MediaPlayer2; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
   string "org.mpris.MediaPlayer2.Player"
   array [
      dict entry(
         string "PlaybackStatus"
         variant             string "Paused"
      )
   ]
   array [
   ]
method call time=1602709126.692400 sender=:1.93 -> destination=org.gnome.SessionManager serial=5 path=/org/gnome/SessionManager; interface=org.gnome.SessionManager; member=Uninhibit
   uint32 453511354
signal time=1602709126.696429 sender=:1.6 -> destination=(null destination) serial=376 path=/org/gnome/SessionManager; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
   string "org.gnome.SessionManager"
   array [
      dict entry(
         string "InhibitedActions"
         variant             uint32 4
      )
   ]
   array [
   ]
signal time=1602709126.696720 sender=:1.6 -> destination=(null destination) serial=377 path=/org/gnome/SessionManager; interface=org.gnome.SessionManager; member=InhibitorRemoved
   object path "/org/gnome/SessionManager/Inhibitor9"
method return time=1602709126.696990 sender=:1.6 -> destination=:1.93 serial=378 reply_serial=5
method call time=1602709126.697027 sender=:1.22 -> destination=:1.6 serial=97 path=/org/gnome/SessionManager; interface=org.gnome.SessionManager; member=IsInhibited
   uint32 8
method call time=1602709126.697291 sender=:1.93 -> destination=org.freedesktop.DBus serial=6 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RemoveMatch
   string "type='signal', path='/org/freedesktop/DBus/Local',interface='org.freedesktop.DBus.Local', member='Disconnected'"
method return time=1602709126.697336 sender=org.freedesktop.DBus -> destination=:1.93 serial=5 reply_serial=6
signal time=1602709126.698190 sender=org.freedesktop.DBus -> destination=:1.93 serial=13 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
   string ":1.93"
signal time=1602709126.698282 sender=org.freedesktop.DBus -> destination=(null destination) serial=105 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.93"
   string ":1.93"
   string ""
method return time=1602709126.698376 sender=:1.6 -> destination=:1.22 serial=379 reply_serial=97
   boolean false
method call time=1602709126.698968 sender=:1.22 -> destination=:1.6 serial=98 path=/org/gnome/SessionManager; interface=org.gnome.SessionManager; member=IsInhibited
   uint32 4
method return time=1602709126.699881 sender=:1.6 -> destination=:1.22 serial=380 reply_serial=98
   boolean true
method call time=1602709126.700230 sender=:1.22 -> destination=:1.6 serial=99 path=/org/gnome/SessionManager; interface=org.gnome.SessionManager; member=IsInhibited
   uint32 8
method return time=1602709126.700930 sender=:1.6 -> destination=:1.22 serial=381 reply_serial=99
   boolean false
method call time=1602709128.789551 sender=:1.94 -> destination=org.gnome.SessionManager serial=5 path=/org/gnome/SessionManager; interface=org.gnome.SessionManager; member=Uninhibit
   uint32 1936952946
signal time=1602709128.795439 sender=:1.6 -> destination=(null destination) serial=382 path=/org/gnome/SessionManager; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
   string "org.gnome.SessionManager"
   array [
      dict entry(
         string "InhibitedActions"
         variant             uint32 0
      )
   ]
   array [
   ]
signal time=1602709128.796547 sender=:1.6 -> destination=(null destination) serial=383 path=/org/gnome/SessionManager; interface=org.gnome.SessionManager; member=InhibitorRemoved
   object path "/org/gnome/SessionManager/Inhibitor10"
method return time=1602709128.796948 sender=:1.6 -> destination=:1.94 serial=384 reply_serial=5
method call time=1602709128.797219 sender=:1.22 -> destination=:1.6 serial=100 path=/org/gnome/SessionManager; interface=org.gnome.SessionManager; member=IsInhibited
   uint32 8
method return time=1602709128.797506 sender=:1.6 -> destination=:1.22 serial=385 reply_serial=100
   boolean false
method call time=1602709128.798019 sender=:1.22 -> destination=:1.6 serial=101 path=/org/gnome/SessionManager; interface=org.gnome.SessionManager; member=IsInhibited
   uint32 4
method return time=1602709128.798375 sender=:1.6 -> destination=:1.22 serial=386 reply_serial=101
   boolean false
method call time=1602709128.799891 sender=:1.22 -> destination=:1.6 serial=102 path=/org/gnome/SessionManager; interface=org.gnome.SessionManager; member=IsInhibited
   uint32 8
method call time=1602709128.801708 sender=:1.94 -> destination=org.freedesktop.DBus serial=6 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RemoveMatch
   string "type='signal', path='/org/freedesktop/DBus/Local',interface='org.freedesktop.DBus.Local', member='Disconnected'"
method return time=1602709128.801730 sender=org.freedesktop.DBus -> destination=:1.94 serial=5 reply_serial=6
method return time=1602709128.801738 sender=:1.6 -> destination=:1.22 serial=387 reply_serial=102
   boolean false
signal time=1602709128.802582 sender=org.freedesktop.DBus -> destination=:1.94 serial=14 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
   string ":1.94"
signal time=1602709128.802604 sender=org.freedesktop.DBus -> destination=(null destination) serial=106 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.94"
   string ":1.94"
   string ""
signal time=1602709130.833167 sender=:1.72 -> destination=(null destination) serial=32 path=/org/gnome/Terminal/window/1; interface=org.gtk.Actions; member=Changed
   array [
   ]
   array [
      dict entry(
         string "copy"
         boolean true
      )
   ]
   array [
   ]
   array [
   ]
signal time=1602709130.976774 sender=:1.72 -> destination=(null destination) serial=33 path=/org/gnome/Terminal/window/1; interface=org.gtk.Actions; member=Changed
   array [
   ]
   array [
      dict entry(
         string "copy"
         boolean true
      )
   ]
   array [
   ]
   array [
   ]
samuel-phan commented 3 years ago

Maybe this article can help also to understand the issue: https://work.lisk.in/2020/05/06/linux-media-control.html image