Playlist next/prev controls only available when player is in foreground

Bug #1538703 reported by Pat McGowan
50
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
Critical
John McAleely
indicator-sound (Ubuntu)
Invalid
Critical
Xavi Garcia
media-hub (Ubuntu)
Fix Released
Critical
Jim Hodapp
qtubuntu-media (Ubuntu)
Fix Released
Critical
Jim Hodapp
unity-scopes-shell (Ubuntu)
Invalid
Undecided
Paweł Stołowski

Bug Description

Switch to the dash (i.e. app scope) while music app is playing
The indicator switches to mediaplayer with controls disabled

Note also that the media player is shown with controls disabled on a fresh boot when no media has ever been played, the indicator should only show controls after playback.

Something in the scopes is incorrectly telling media hub there is a new ctive player.

Install the music app from the store
Start a playlist in music app
Switch apps
Next and Prev are disabled in the indicator

This was fixed after a reboot.

Related branches

Changed in indicator-sound (Ubuntu):
assignee: nobody → Charles Kerr (charlesk)
importance: Critical → High
description: updated
description: updated
tags: added: bgplaylist
Changed in canonical-devices-system-image:
assignee: nobody → Alejandro J. Cura (alecu)
importance: Undecided → High
milestone: none → ww08-2016
status: New → Confirmed
Changed in media-hub (Ubuntu):
assignee: nobody → Jim Hodapp (jhodapp)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in media-hub (Ubuntu):
status: New → Confirmed
tags: added: regression-release
tags: added: regression-proposed
removed: regression-release
Jim Hodapp (jhodapp)
description: updated
Revision history for this message
Xavi Garcia (xavi-garcia-mena) wrote :

I managed to recreate the issue.
It looks like after switching to any application using sound makes the indicator reset the state of the playback controls.

If I switch to the main dash (no scope using sound) it works fine.

Needs further investigation

Charles Kerr (charlesk)
Changed in indicator-sound (Ubuntu):
assignee: Charles Kerr (charlesk) → Xavi Garcia (xavi-garcia-mena)
Changed in canonical-devices-system-image:
importance: High → Critical
Changed in indicator-sound (Ubuntu):
importance: High → Critical
Revision history for this message
Xavi Garcia (xavi-garcia-mena) wrote :

After looking at this for quite some time I saw that, after switching to the music scope I get the following MPRIS properties for MediaPlayer:

signal sender=:1.50 -> dest=(null destination) serial=8169 path=/org/mpris/MediaPlayer2; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
   string "org.mpris.MediaPlayer2.Player"
   array [
      dict entry(
         string "PlaybackStatus"
         variant string "Stopped"
      )
   ]
   array [
   ]
signal sender=:1.50 -> dest=(null destination) serial=8170 path=/org/mpris/MediaPlayer2; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
   string "org.mpris.MediaPlayer2.Player"
   array [
      dict entry(
         string "LoopStatus"
         variant string "None"
      )
   ]
   array [
   ]
signal sender=:1.50 -> dest=(null destination) serial=8171 path=/org/mpris/MediaPlayer2; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
   string "org.mpris.MediaPlayer2.Player"
   array [
      dict entry(
         string "CanPlay"
         variant boolean false
      )
   ]
   array [
   ]
signal sender=:1.50 -> dest=(null destination) serial=8172 path=/org/mpris/MediaPlayer2; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
   string "org.mpris.MediaPlayer2.Player"
   array [
      dict entry(
         string "CanPause"
         variant boolean false
      )
   ]
   array [
   ]
signal sender=:1.50 -> dest=(null destination) serial=8173 path=/org/mpris/MediaPlayer2; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
   string "org.mpris.MediaPlayer2.Player"
   array [
      dict entry(
         string "CanGoPrevious"
         variant boolean false
      )
   ]
   array [
   ]
signal sender=:1.50 -> dest=(null destination) serial=8174 path=/org/mpris/MediaPlayer2; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
   string "org.mpris.MediaPlayer2.Player"
   array [
      dict entry(
         string "CanGoNext"
         variant boolean false
      )
   ]
   array [
   ]

The indicator sound is updating the player correctly, but the information received is wrong.

Also: as the "Metadata" property is not implemented in media-hub we don't get any update on the icon, song name or artist currently playing.

The "Metadata" property not implemented was reported in the following bug: https://bugs.launchpad.net/ubuntu/+source/media-hub/+bug/1498962

In summary: I think this is NOT an indicator sound bug.

Changed in indicator-sound (Ubuntu):
status: Confirmed → Invalid
Changed in canonical-devices-system-image:
assignee: Alejandro J. Cura (alecu) → John McAleely (john.mcaleely)
Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

What happens when you switch to the app scope?
I do not understand what is triggring a change to the active player when there is no change, that is what makes mediaplayer active and music no longer active?

description: updated
Changed in unity-scopes-shell (Ubuntu):
assignee: nobody → Pawel Stolowski (stolowski)
Changed in canonical-devices-system-image:
assignee: John McAleely (john.mcaleely) → Alejandro J. Cura (alecu)
Revision history for this message
Paweł Stołowski (stolowski) wrote :

Shell plugin only exposes the list of songs from scopes to unity8 and doesn't control any aspects of the playback (is not involved at all in fact). All the playback state is controlled by unity8 - meda-hub - sound-indicator. Marking invalid in unity-scopes-shell

Changed in unity-scopes-shell (Ubuntu):
status: New → Invalid
Revision history for this message
Albert Astals Cid (aacid) wrote :

Speaking from unity8-dash's side the only thing we do (unless the user presses the play button on an Audio Card) is ask for the playlist.currentItemSource of an Audio {} item

Revision history for this message
Xavi Garcia (xavi-garcia-mena) wrote :

The indicator can only listen what comes from the media-hub in terms of MPRIS messages, it does not decide what to show on the playback control.

Maybe something is confusing the media-hub when the dash is asking for the playlist?

As we discussed with Albert and Pawel the playback controls only change when there is a scope using audio...

Revision history for this message
Xavi Garcia (xavi-garcia-mena) wrote :

And looking from a higher point of view...

This is a comment by greyback on IRC:

<greyback> unity8 does export a dbus service com.canonical.Unity.WindowStack which media service could use to monitor what app is currently focused
<greyback> only other idea is that when app is unfocused, it signals that to media-hub, and media-hub does the wrong thing with that info
<greyback> but those are the only 2 ways such state could be passed from the app/window manager to media-hub I can think of

The sound indicator is not monitoring the stated dbus service.

Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

I can think of no reason why media hub needs to know an apps focus state
Its also the case that focusing a different app does not cause this behavior, its only when the dash is focused

Changed in qtubuntu-media (Ubuntu):
assignee: nobody → Jim Hodapp (jhodapp)
Revision history for this message
Jim Hodapp (jhodapp) wrote :

Seems the implementation approach is incorrect and needs to change to a last player played model instead of what was last focused in the UI.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in qtubuntu-media (Ubuntu):
status: New → Confirmed
Changed in canonical-devices-system-image:
assignee: Alejandro J. Cura (alecu) → John McAleely (john.mcaleely)
Changed in canonical-devices-system-image:
status: Confirmed → In Progress
milestone: ww08-2016 → 11
Changed in media-hub (Ubuntu):
status: Confirmed → In Progress
Changed in qtubuntu-media (Ubuntu):
status: Confirmed → In Progress
Jim Hodapp (jhodapp)
Changed in media-hub (Ubuntu):
importance: Undecided → Critical
Changed in qtubuntu-media (Ubuntu):
importance: Undecided → Critical
Jim Hodapp (jhodapp)
Changed in media-hub (Ubuntu):
status: In Progress → Fix Committed
Changed in qtubuntu-media (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Xavi Garcia (xavi-garcia-mena) wrote :

I've been testing this with silo 51 and I still see the issue.
I don't know if I'm doing something wrong, but these are my steps:

1- Start music in the music app
2. Check the indicator (controls are fine)
3. Move back to music scope
4. Check the indicator... controls are disabled and I cannot pause music until I put the focus on the music app again...

this is maybe what the proposed branches implement (to grab back the MPRIS controls when we get the focus on music app)...

I though it was going to be around which is the last app playing something. So if music app is the one playing music, then the controls are for music app, if we switch to another music source, then controls are changed for that other app...

Revision history for this message
Jim Hodapp (jhodapp) wrote :

It doesn't sound like you have the proposed changes installed. The sequence of events that you listed should work fine and does work fine for me on multiple devices. Can you make sure that you have the right versions of all of the packages from the silo installed?

Revision history for this message
Xavi Garcia (xavi-garcia-mena) wrote :

Ok, so the issue was with the stable image of krillin.

Using silo 51 updates media-hub, but not qtubuntu-media.
This is the error I get: qtubuntu-media : Depends: libqt5multimedia5 (>= 5.4.1-1ubuntu19~overlay3~vivid1~test4

After testing with rc-proposed image it works as expected. :)

Changed in canonical-devices-system-image:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qtubuntu-media - 0.8.1+16.04.20160503.4-0ubuntu1

---------------
qtubuntu-media (0.8.1+16.04.20160503.4-0ubuntu1) xenial; urgency=medium

  * A rewrite of how the current player is set which is what the MPRIS
    control interface actively uses. media-hub is now responsible for
    managing this and qtubuntu-media is no longer involved at all. (LP:
    #1564813, #1538703)

 -- Jim Hodapp <email address hidden> Tue, 03 May 2016 18:55:07 +0000

Changed in qtubuntu-media (Ubuntu):
status: Fix Committed → Fix Released
Changed in canonical-devices-system-image:
status: Fix Committed → Fix Released
Jim Hodapp (jhodapp)
Changed in media-hub (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.