Closed Bug 1117510 Opened 9 years ago Closed 9 years ago

[Flame][Music]There are 2 songs playing at the same time when set a song as ringtone.

Categories

(Firefox OS Graveyard :: Gaia::Music, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(tracking-b2g:backlog, b2g-v2.2 affected, b2g-master affected)

RESOLVED WORKSFORME
tracking-b2g backlog
Tracking Status
b2g-v2.2 --- affected
b2g-master --- affected

People

(Reporter: zikui.yang, Unassigned)

References

Details

Attachments

(2 files)

[1.Description]:
[Flame][v2.2][Music]Play a song and set as ringtone,then lock the screen. And unlock screen after tap play icon,there are 2 songs playing at the same time.
Attchment:logcat.txt and  VIDEO0202_Compress.MP4
Happen time:3:54

[2.Testing Steps]: 
Precondition:There are some songs in phone storage.
1.Launch Music
2.Switch to Songs list
3.Tap a song to play
4.Tap Share icon->Ringtones->Tap play
5.Press power key twice to enter Lock screen->tap Play button and slide screen to unlock

[3.Expected Result]: 
5.The play button should not be shown on lockscreen.

[4.Actual Result]: 
5.There are 2 songs playing at the same time after you tap the play button on lock screen. 

[5.Reproduction build]: 
Flame 2.2 build:
Gaia-Rev        698e6e8a098cc060b26cd6f25171633c4c7e739d
Gecko-Rev       https://hg.mozilla.org/mozilla-central/rev/57e4e9c33bef
Build-ID        20150103010205
Version         37.0a1

[6.Reproduction Frequency]: 
Always Recurrence,5/5
TCID: Free Test
Attached video VIDEO0202_Compress.MP4
Attached file logcat.txt
Hi Alison, Could you help with this, music played at the same time, thanks..
Flags: needinfo?(ashiue)
Hi Jim,
Could you please take a look at this interesting bug? After the STR, 2 music would play at the same time.
Flags: needinfo?(ashiue)
Yeah, I wouldn't be surprised that this happens. The music app should probably notify listeners when playback is blocked by something. Let's try to fix this by fixing the audio competing policy though; we've written far too many workaround patches for this already, and it's becoming more and more clear that we're not going to be able to cover all possible scenarios unless we devote some serious time to improving the lower-level components.
QA Whiteboard: [COM=Gaia::Music]
This bug has been verified still exist on latest Flame 2.2 & 3.0 build.

Issue steps:
Precondition:There are some songs in phone storage.
1.Launch Music.
2.Switch to Songs list.
3.Tap a song to play.
4.Tap Share icon->Ringtones->Tap play.
5.Press power key twice to enter Lock screen->tap Play button and slide screen to unlock.

Expected Result:
5.The play button should not be shown on lockscreen.

Actual Result: 
5.There are 2 songs playing at the same time after you tap the play button on lock screen. 

See attachment: VIDEO0202_Compress.MP4
Reproducing rate: 5/5

Flame 2.2 version:
Build ID               20150215002504
Gaia Revision          ea64caf6d4ab03fc4472eca9f41f20d651d55fa9
Gaia Date              2015-02-13 05:27:43
Gecko Revision         https://hg.mozilla.org/releases/mozilla-b2g37_v2_2/rev/62c80c92b39e
Gecko Version          37.0a2
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20150215.040852
Firmware Date          Sun Feb 15 04:09:03 EST 2015
Bootloader             L1TC000118D0

flame 3.0 version:
Build ID               20150215010209
Gaia Revision          f0b93e0668ef9565bd6f050b15b4f794d59feb65
Gaia Date              2015-02-13 13:13:27
Gecko Revision         https://hg.mozilla.org/mozilla-central/rev/e0cb32a0b1aa
Gecko Version          38.0a1
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20150215.043133
Firmware Date          Sun Feb 15 04:31:43 EST 2015
Bootloader             L1TC000118D0
QA Whiteboard: [COM=Gaia::Music] → [COM=Gaia::Music][MGSEI-Triage+]
Flags: needinfo?(whsu)
(In reply to Norry.L.F from comment #6)
> This bug has been verified still exist on latest Flame 2.2 & 3.0 build.
> 
> Issue steps:
> Precondition:There are some songs in phone storage.
> 1.Launch Music.
> 2.Switch to Songs list.
> 3.Tap a song to play.
> 4.Tap Share icon->Ringtones->Tap play.
> 5.Press power key twice to enter Lock screen->tap Play button and slide
> screen to unlock.
> 
> Expected Result:
> 5.The play button should not be shown on lockscreen.
> 
> Actual Result: 
> 5.There are 2 songs playing at the same time after you tap the play button
> on lock screen. 

Thanks for the branch check.
:)
Flags: needinfo?(whsu)
If anyone wants to fix this before the audio channel rework (which will hopefully make our lives easier), here's the problem:

When an activity is created, the caller isn't marked as "hidden", meaning that Gaia thinks the music app is still in the foreground, along with the Ringtones activity. This means that both have equal priority for playing audio by the rules of the audio competing policy. We try to work around this by using mozSettings as a communications channel[1], but the hack is incomplete and doesn't set anything in the music app to indicate that playing is *blocked* by an activity.

Fixing this bug would mean adding an indication like that, but I'm not very enthusiastic about doing so, since a crash in the ringtones activity could possibly cause the music app to be unable to resume playback without restarting it.

[1] https://github.com/mozilla-b2g/gaia/blob/e85b725df81860f79d7dc69729ec2a34fd476a6c/apps/music/js/ui/views/player_view.js#L850-L914
[Tracking Requested - why for this release]:
Waiting for audio channel rework (I'm guessing it's bug 1089539)
Depends on: NewAudioChannel
This doesn't happen anymore for a few reasons. 1) The ringtone preview stops when you turn off the screen, and 2) the music controls are hidden because the ringtones activity is overriding them.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: