Closed Bug 1615270 Opened 4 years ago Closed 4 years ago

[Media-Control Linux] MPRIS: Controller interface doesn't change UI correctly

Categories

(Core :: Widget: Gtk, defect, P1)

Desktop
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla75
Tracking Status
firefox75 --- fixed

People

(Reporter: MeFisto94, Assigned: MeFisto94)

References

Details

Attachments

(4 files)

According to a report on #developers:mozilla.org

on Fedora I only ever see the play > button even while playing, instead of pause
yeah pressing the button stops the stream, i am testing with https://webradio.ffh.de/leidergeil
resuming doesn't work, yeah this is Gnome

I will have to see what the cause is, specifically since this works on Ubuntu 18.04's Gnome Version

Summary: Fedora's Gnome doesn't seem to recognize playback state changes → [Media-Control Linux] MPRIS: Fedora's Gnome doesn't seem to recognize playback state changes

I used Spotify for testing. Clicking the pause button (||) actually pauses the playback. However it doesn't change into the the play button like > when paused. This works correctly on Fedora for other apps like Rhythmbox.

OS info:
Fedora 31
GNOME version 3.34.3

Actually I can reproduce that on Windows 10 with the latest Nightly on Youtube:

  1. It's not the "default" mediaplayer as the state doesn't set to playing.
  2. I can play the application but not pause it as it doesn't seem to change the state.
  3. Doing the Pause action does change the UI state but doesn't stop the media.

I will try to get logging output out of the built nightly and/or try an opt build, because locally with Debug Builds I didn't have the problem.

Edit: So I am not seeing exactly the same then, the opposite basically. We will see if it's the same source.

Attached file log.txt
Exemplary Log attached while I'm rebuilding from central:
Notice how several Play events are fired but the MediaController didn't fire back a "Play State: Playing" Event causing the UI to update?
Could be a regression from the IsOpen() patch we did one or two weeks ago, but for now all is guessing.

So, every click on pause in the UI yields the following:

[Child 6836: Main Thread]: D/MediaControl ContentMediaController=000001F40A748BE0, Handle 'Play' event, listener num=1
[Child 6836: Main Thread]: D/MediaControl HTMLMediaElement=000001F40A748B50, OnKeyPressed 'Play'
[Parent 10012: Main Thread]: D/MediaControl MediaControlKeysHandler=000001F3A76EB270, OnKeyPressed 'Play'
[Parent 10012: Main Thread]: D/MediaControl MediaController=000001F3A5C7B740, Id=3, Play
[Parent 10012: Main Thread]: D/MediaControl PlaybackController=00000031759FD058, Handle 'play' in default behavior
[Parent 10012: Main Thread]: D/MediaControl ContentMediaController=000001F3A1EA5CA0, Handle 'Play' event, listener num=0
[Child 6836: Main Thread]: D/MediaControl PlaybackController=0000009EAF7FD838, Handle 'play' in default behavior
[Child 6836: Main Thread]: D/MediaControl ContentMediaController=000001F40A748BE0, Handle 'Play' event, listener num=1
[Child 6836: Main Thread]: D/MediaControl HTMLMediaElement=000001F40A748B50, OnKeyPressed 'Play'

I can now confirm this, but only on opt builds, not debug builds.
Any idea what makes this different?

Flags: needinfo?(alwu)

After discussed offline with Marc, now we still don't clear what happen there. On Windows, the issue only happen on opt build, not debug build. On Linux, the reporter doesn't mention which build he's using (guess opt). But considering this defact affects the normal usage of media control on Windows and Linux, I would like to mark this as P1, which means we would like to solve this on this release cycle.

BTW, on OSX, media control is working well, the control button shown on touch bar can correctly control media without any issue.


Keep NI, because I'm going to try to reproduce this issue on local and see if I can figure what's happen.

Severity: normal → minor
Priority: -- → P1

I can confirm this issue happen on Ubuntu 18.04 as well. Media can be controlled by pressing physical hardware play/pause key or virtual button shown on the notification bar, but the virtual button keeps showing || no matter media is playing or paused.

Summary: [Media-Control Linux] MPRIS: Fedora's Gnome doesn't seem to recognize playback state changes → [Media-Control Linux] MPRIS: Controller interface doesn't change UI correctly
Summary: [Media-Control Linux] MPRIS: Controller interface doesn't change UI correctly → [Media-Control] Controller interface doesn't change UI correctly
OS: Linux → All

So, the scope of this has changed, I found the bug for Windows and I am certain that it's the same for Linux:
As you will see in the Phabricator Revisions, we accidentially put method calls into MOZ_ASSERT which thus got removed for opt builds.

See Also: → 1617405
OS: All → Linux
Summary: [Media-Control] Controller interface doesn't change UI correctly → [Media-Control Linux] MPRIS: Controller interface doesn't change UI correctly

Sorry for the many E-Mails, I was too eager, turns out MOZ_ASSERT is only the bug on Windows and specifically I am unable to reproduce the bug with an opt build locally, as well as padenot was not having problems either, so this really is something Distribution specific and not a failure of opt builds in general.

Investigation will continue

So, I've booted up a Fedora Virtual VM and could reproduce the following:

  • The Button in the UI Panel always shows up as Pause Button
  • Otherwise everything works as expected
  • The log didn't show any errors, specifically it emitted SetPlaybackState Events.

So this seems to be related to Gnome, I'll check the events and try to find out more.

Edit: Furthermore, I see the following when using dbus-monitor --sesssion:

method call time=1582419392.026602 sender=:1.23 -> destination=:1.139 serial=660 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=PlayPause

signal time=1582419392.027034 sender=:1.139 -> destination=(null destination) serial=53 path=/org/mpris/MediaPlayer2; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
   string "org.mpris.MediaPlayer2"
   array [
      dict entry(
         string "PlaybackStatus"
         variant             string "Playing"
      )
   ]
   array [
   ]

This means, it "should" work as expected, I need to check the event, but to me this looks like we're sending the correct event after getting the method call "Play".

Maybe a case for the GNOME Team? I don't know if Rythmbox uses MPRIS?

Attachment #9128417 - Attachment description: Bug 1615270 - [Media-Control Linux] MPRIS: Correctly emit the PropertyChange Event on the Player SubInterface, r=alwu,emilio → Bug 1615270 - [Media-Control Linux] MPRIS: Correctly emit the PropertyChange Event on the Player Interface (https://specifications.freedesktop.org/mpris-spec/latest/Player_Interface.html), r=alwu,emilio
Pushed by marc.streckfuss@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/7f400628ccce
[Media-Control Linux] MPRIS: Correctly emit the PropertyChange Event on the Player Interface (https://specifications.freedesktop.org/mpris-spec/latest/Player_Interface.html), r=emilio
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla75
Flags: needinfo?(alwu)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: