Closed
Bug 860150
Opened 12 years ago
Closed 12 years ago
audio API: mozSetup/mozWriteAPI should join audio channel
Categories
(Firefox OS Graveyard :: General, defect)
Tracking
(blocking-b2g:leo+, firefox21 wontfix, firefox22 wontfix, firefox23 fixed, b2g18 fixed, b2g18-v1.0.0 wontfix, b2g18-v1.0.1 wontfix)
RESOLVED
FIXED
blocking-b2g | leo+ |
People
(Reporter: alive, Assigned: mchen)
References
()
Details
(Whiteboard: [fixed-in-birch])
Attachments
(2 files, 4 obsolete files)
(deleted),
patch
|
mchen
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
mchen
:
review+
|
Details | Diff | Splinter Review |
See https://bugzilla.mozilla.org/show_bug.cgi?id=846092#c10
Dialer is using mozSetup/mozWriteAudio API to generate DTMF tone.
However in this case it doesn't join any audio channel even when we force assign the mozAudioChannelType to audio element.
+++ This bug was initially created as a clone of Bug #846092 +++
1. Title : In dial pad screen, cannot change keypad volume.
2. Precondition : Settings >> Sound >> Keypad - check >> Home >> Run Dialer >> Dial pad screen
3. Tester's Action : Press side volume up/down key
4. Detailed Symptom (ENG.) : Not change keypad volume.
6. Expected : Can change keypad volume.
7. Reproducibility: Y
1) Frequency Rate : 100%
8. Gaia revision : 6916e18d1f72936e892543cf4a104a7d457f78ad
Reporter | ||
Comment 1•12 years ago
|
||
Tracking gecko codes and it looks like it's already manipulated in
http://hg.mozilla.org/mozilla-central/file/9db46ddfb517/content/html/content/src/HTMLAudioElement.cpp#l126
> aRv = mAudioStream->Init(aChannels, aRate, mAudioChannelType);
When the audio element is doing |mozSetup|. So there may be something wrong before audio-channel-changed event fires.
Reporter | ||
Comment 2•12 years ago
|
||
Taken first after discussing with :mchen.
Ignore comment 1 because audioStream isn't audioChannelAgent. It's the way down to gonk but won't pass by audioChannelAgent nor audioElement.
What we could do is: call audioChannelAgent.startPlaying when |mozWriteAudio| and make an interval to check the audio playing is ended to call audioChannelAgent.stopPlaying because mozWriteAudio doesn't support ended event now.
Assignee: nobody → alive
Assignee | ||
Comment 4•12 years ago
|
||
Hi Matthew,
Could you help to review this patch? Thanks.
This would be needed on b2g18 branch although audio data api is depreciated on m-c.
The purpose of this patch is that HTMLAudioElement doesn't use mDeocder so it's parent class HTMLMediaElement doesn't trigger the AudioChannelAgent to join AudioChannelService.
This patch inherited some virtual functions from parent then re-implement them for audio data API. And according to that there is no pause/stop point for audio data API, I create a timer for monitoring the flow of data and timeout is set to 1 second because it is the max buffer in audio backend.
Attachment #736706 -
Flags: review?(kinetik)
Reporter | ||
Updated•12 years ago
|
Assignee: alive → mchen
Comment 5•12 years ago
|
||
Comment on attachment 736706 [details] [diff] [review]
Patch v1
Review of attachment 736706 [details] [diff] [review]:
-----------------------------------------------------------------
::: content/html/content/public/HTMLAudioElement.h
@@ +78,5 @@
> + // Due to that audio data API doesn't indicate the timing of pause or end,
> + // the timer is used to defer the timing of pause/stop after writing data.
> + nsCOMPtr<nsITimer> mDeferStopPlayTimer;
> + // To indicate mDeferStopPlayTimer is on fire or not.
> + bool mTimerActivated;
I wonder if we can do away with this bool and just use a non-null check of mDeferStopPlayTimer instead? That does require freeing the timer when it's not in use, but that seems preferable to keeping an inactive timer around.
::: content/html/content/src/HTMLAudioElement.cpp
@@ +46,5 @@
>
>
> HTMLAudioElement::HTMLAudioElement(already_AddRefed<nsINodeInfo> aNodeInfo)
> + : mTimerActivated(false),
> + HTMLMediaElement(aNodeInfo),
Keep the HTMLMediaElement initialization first.
@@ +47,5 @@
>
> HTMLAudioElement::HTMLAudioElement(already_AddRefed<nsINodeInfo> aNodeInfo)
> + : mTimerActivated(false),
> + HTMLMediaElement(aNodeInfo),
> + mDeferStopPlayTimer(nullptr)
nsCOMPtrs are initialized to null by default.
Attachment #736706 -
Flags: review?(kinetik) → review+
Assignee | ||
Comment 6•12 years ago
|
||
1. Keep the HTMLMediaElement initialization first.
2. nsCOMPtrs are initialized to null by default so remove initialization from constructor.
Add reviewer and approval by leo.
Attachment #736706 -
Attachment is obsolete: true
Attachment #741188 -
Flags: review+
Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 8•12 years ago
|
||
Do some additional test then ask for landing.
Keywords: checkin-needed
Assignee | ||
Comment 9•12 years ago
|
||
Hi Matthew,
I missed that the overriding of UpdateAudioChannelPlayingState()/CanPlayChanged() will cause audio tag to use the version in HTMLAudioElement but HTMLMediaElement, even it is used to play from a file.
So in this patch I use mAudioStream is null or not to check whether UpdateAudioChannelPlayingState()/CanPlayChanged() should be called from HTMLAudioElement or HTMLMediaElement.
Thanks for your review again.
Attachment #741188 -
Attachment is obsolete: true
Attachment #741189 -
Attachment is obsolete: true
Attachment #741235 -
Flags: review?(kinetik)
Comment 10•12 years ago
|
||
Comment on attachment 741235 [details] [diff] [review]
Patch v2
Review of attachment 741235 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks!
::: content/html/content/src/HTMLAudioElement.cpp
@@ +248,5 @@
> + // Only Audio_Data API will initialize the mAudioStream, so we call the parent
> + // one when this audio tag is not used by Audio_Data API.
> + if (!mAudioStream) {
> + HTMLMediaElement::CanPlayChanged(canPlay);
> + return NS_OK;
Make these two lines:
return HTMLMediaElement::CanPlayChanged(canPlay);
Attachment #741235 -
Flags: review?(kinetik) → review+
Assignee | ||
Comment 11•12 years ago
|
||
Assignee | ||
Comment 12•12 years ago
|
||
1. https://tbpl.mozilla.org/?tree=Try&rev=b68ee23af8f6
2. Add reviewer and approval for Leo.
3. Patch for m-c
Attachment #741235 -
Attachment is obsolete: true
Attachment #742946 -
Flags: review+
Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
Comment 14•12 years ago
|
||
Keywords: checkin-needed
Updated•12 years ago
|
Whiteboard: [fixed-in-birch]
Comment 15•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Comment 16•12 years ago
|
||
status-b2g18:
--- → fixed
status-b2g18-v1.0.0:
--- → wontfix
status-b2g18-v1.0.1:
--- → wontfix
status-firefox21:
--- → wontfix
status-firefox22:
--- → wontfix
status-firefox23:
--- → fixed
Updated•11 years ago
|
Flags: in-moztrap?
Updated•11 years ago
|
Flags: in-moztrap? → in-moztrap+
Updated•11 years ago
|
QA Contact: croesch
You need to log in
before you can comment on or make changes to this bug.
Description
•