Closed
Bug 819852
Opened 12 years ago
Closed 12 years ago
Background music intermittently plays while the phone is ringing because looped <audio> doesn't occupied the channel the whole time
Categories
(Firefox OS Graveyard :: General, defect, P2)
Tracking
(blocking-basecamp:+, firefox19 wontfix, firefox20 wontfix, firefox21 fixed, b2g18 fixed)
People
(Reporter: alive, Assigned: mchen)
References
Details
Attachments
(1 file, 2 obsolete files)
1.44 KB,
patch
|
mchen
:
review+
|
Details | Diff | Splinter Review |
STR:
1. Open Music app
2. Play a song.
3. Call in by another phone.
Expected:
1. The music is totally muted or paused.
Actual:
1. The music plays intermittently when the ringing sound stops.(Before next ring)
Note:
This is not dupe of bug 819849.
Reporter | ||
Updated•12 years ago
|
blocking-kilimanjaro: --- → ?
OS: Mac OS X → Gonk (Firefox OS)
Hardware: x86 → ARM
Reporter | ||
Comment 1•12 years ago
|
||
Wrong flag.
blocking-basecamp: --- → ?
blocking-kilimanjaro: ? → ---
Updated•12 years ago
|
Assignee: nobody → dkuo
Target Milestone: --- → B2G C3 (12dec-1jan)
Bug 815569 won't actually help here. The only thing that will help is to use a looping audio rather than repeatedly calling .play().
Bug 815569 would just mean that we'd play a different set of snippets of music between the rings than we do now.
No longer depends on: 815569
Comment 4•12 years ago
|
||
(In reply to Jonas Sicking (:sicking) from comment #3)
> Bug 815569 won't actually help here. The only thing that will help is to use
> a looping audio rather than repeatedly calling .play().
>
> Bug 815569 would just mean that we'd play a different set of snippets of
> music between the rings than we do now.
Dominic, would you give some updates on your proposed fix?
Comment 5•12 years ago
|
||
I just took a look at the code of Dialer, and found out the audio element does use loop = true to play a ringtone.
I guess it might be an issue of the implementation on looping an audio in gecko, looks like while we are looping an audio in Dialer, it does not always occupy the mozAudioChannel, it releases mozAudioChannel after every cycle when the ringtone ends, so Music in background will play intermittently in the interval of end and start of that ringtone.
If my guessing is right, it should be possible to fix this bug, but a workaround actually.
Here is my proposal:
1. Listen to timeupdate event of audio element.
2. Check if audio.currentTime is smaller then audio.duration,
like (this.audio.currentTime >= this.audio.duration - 1), cannot be equal cause we don't want the audio to reach to the end, then trigger mozAudioChannel change.
3. Seek audio.currentTime to 0 so it will just like a restart of the ringtone.
And I think Music app cannot do anything to help this bug, since Music shouldn't do anything to audio element when mozAudioChannel changes, except the UI works.
If the music app is already using looping, then I think we should fix this in the platform. I.e. no changes should be needed in the app, instead the platform should ensure to occupy the "ringer" channel as long as the element is looping.
Matthew, is this something you could take? Or Dominic, would you be able to?
Comment 7•12 years ago
|
||
This is now a platform audio bug, according to comment 6.
Marco, can you help? Thanks.
Assignee: dkuo → nobody
Component: Gaia → General
Flags: needinfo?(mchen)
Summary: Background music intermittently plays while the phone is ringing → Background music intermittently plays while the phone is ringing because looped <audio> doesn't occupied the channel the whole time
Actually, why don't we give this to someone that doesn't have a big pile of B2G bugs already :)
Assignee: amarchesini → kinetik
Assignee | ||
Comment 11•12 years ago
|
||
Hi kinetik,
I want to help here because there is no Christmas Eve here.
Assignee: kinetik → mchen
Assignee | ||
Comment 12•12 years ago
|
||
To modify the UpdateAudioChannelPlayingState() as below.
If media element is not in pause state and attribute of Loop is true, then it means this media element will be continued to play again when it is in end of the stream.
So we keep audio channel state as playing in case above in order to prevent other sound fires in that gap.
Attachment #695920 -
Flags: review?(kinetik)
Assignee | ||
Comment 13•12 years ago
|
||
Attachment #695920 -
Attachment is obsolete: true
Attachment #695920 -
Flags: review?(kinetik)
Assignee | ||
Updated•12 years ago
|
Attachment #695921 -
Flags: review?(kinetik)
Comment 14•12 years ago
|
||
is :kinetik available to review this bug? if not, will someone else be able to?
Updated•12 years ago
|
Target Milestone: B2G C3 (12dec-1jan) → B2G C4 (2jan on)
Attachment #695921 -
Flags: review?(kinetik) → review+
Reporter | ||
Comment 15•12 years ago
|
||
Would this patch change the timing to fire audio-channel-changed event?
Which event is that?
It only changes behavior for looping elements, at least.
it's an event that the AudioChannelService fires on Gaia whenever the currently active audio channel changes. I.e. when we switch from "normal" to "alarm" or to "none".
Assignee | ||
Comment 18•12 years ago
|
||
Since media element with loop property doesn't release the audio channel until it is paused, the audio-channel-changed event will be held to this media element's channel (if it is highest one now).
Assignee | ||
Comment 19•12 years ago
|
||
Wait for green lights from try server then check in patch.
https://tbpl.mozilla.org/?tree=Try&rev=72960020c8ec
Assignee | ||
Comment 20•12 years ago
|
||
1. Pass the try server and ask for checkin-needed.
2. Add reviewer and a=blocking-basecamp.
Attachment #695921 -
Attachment is obsolete: true
Attachment #698560 -
Flags: review+
Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
Comment 21•12 years ago
|
||
Keywords: checkin-needed
Comment 22•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Comment 23•12 years ago
|
||
status-b2g18:
--- → fixed
status-firefox19:
--- → wontfix
status-firefox20:
--- → wontfix
status-firefox21:
--- → fixed
Comment 24•12 years ago
|
||
Gaia:
Rev 7fdd1dd731ccdcf09e0c51aeefc361adc4bfc11a
BuildID 20130124114510
Version 18.0
Verified.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•