Closed Bug 1188754 Opened 9 years ago Closed 9 years ago

Music app doesn't resume after Ringer ends.

Categories

(Firefox OS Graveyard :: AudioChannel, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(firefox43 fixed)

RESOLVED FIXED
FxOS-S6 (04Sep)
Tracking Status
firefox43 --- fixed

People

(Reporter: evanxd, Assigned: ehsan.akhgari)

References

Details

Attachments

(3 files)

STR:
1. Start Music app to play music in a device.
2. Make a phone call to it.
3. Call screen is showed and Music app stops playing music.

Actual result:
Music app doesn't resume to play music.

Excepted result:
Music app resumes to play music.
Hi Alastor,

This might be a gecko issue. After doing STR, the AudioChannelService in gaia does `channel.setMuted(false)` for the content audio channel of Music app. But Music app doesn't resume to play music.

Before doing STR, please do `git apply` these two patch[1][2]. Then you could see the below log.
```
I/GeckoConsole(22554): Content JS LOG: bug-1188754: AppWindow_4_content is playing! 
I/GeckoConsole(22554): Content JS LOG: bug-1188754: AppWindow_4_content is playing!
```

Could you take a look? Thanks.

[1]: https://github.com/evanxd/gaia/commit/4204da4b1cafecaa1ded5343bca9bb6aedc307d0
[2]: https://github.com/evanxd/gaia/commit/c34dd511afb9f44ca1a2d92fb23a990acf243f32
Assignee: evan → nobody
Flags: needinfo?(alwu)
Component: Gaia::System::Audio Mgmt → AudioChannel
Assignee: nobody → alwu
Flags: needinfo?(alwu)
Attached file Log
It seems that the audio agent would be stopped when the audio competing happens, so that we can't receive the resume command from the system app.
Bug 1188754 - don't stop agent when the document activity changes

The root cause is that we stop the audio agent when the document activity changes when the audio competing starts. (music app is going to the background) After the competing ends, the media element doesn't have the audio agent, so it can't receive the resume command from the system app.

In b2g, we should not change the audio agent at that time, because the system app would be responsible for pausing audio by checking the audio channel type and window activity.

---

Try-server result.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=253ec74ad5e4
Comment on attachment 8649815 [details]
MozReview Request: Bug 1188754 - don't stop agent when the document activity changes

Hi, Baku,
Could you help me review this patch?
The analysis is on the comment3.
Very appreciate :)
Attachment #8649815 - Flags: review?(amarchesini)
Ehsan, this code touches one of your last commit about audio policy. Wondering why your code is not enough for b2g.
Flags: needinfo?(ehsan)
On desktop and Android, NotifyOwnerDocumentActivityChangedInternal returns true if the owner document is inactive, which lets us detect the case where we are navigating away from the page.  On b2g however, this function may also return true if the media element has been muted by the audio channel agent: <http://hg.mozilla.org/mozilla-central/annotate/29b2df16e961/dom/html/HTMLMediaElement.cpp#l4043>

With that in mind, I think the patch here is wrong, since it causes us to not notify the audio channel agent when the playback stops as you navigate away.  I can think of a better fix, which I will submit in a second.  Alastor, I would appreciate if you can test that please.
Flags: needinfo?(ehsan)
Attachment #8650449 - Flags: feedback?(alwu)
Attachment #8650449 - Flags: review?(amarchesini) → review+
Attachment #8649815 - Flags: review?(amarchesini)
Thanks for the patch! 
It works well on the B2g.
Assignee: alwu → ehsan
Attachment #8650449 - Flags: feedback?(alwu) → feedback+
https://hg.mozilla.org/mozilla-central/rev/7b24a94110d0
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → FxOS-S6 (04Sep)
Depends on: 1199420
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: