Closed Bug 952232 Opened 11 years ago Closed 10 years ago

[B2G][API Mediarecorder] "OnError" is not fired up in logcat when receiving/answering a phone call while media is recording

Categories

(Core :: WebRTC, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED INVALID
Tracking Status
b2g-v1.2 --- affected
b2g-v1.3 --- affected

People

(Reporter: sarsenyev, Assigned: bechen)

Details

(Whiteboard: burirun1.3-1, burirun1.4-1)

Attachments

(3 files)

Attached file log12-19.txt
Description:
When receiving & answer an incoming call
Then logcat doesn't show evidence that onerror fired 

Repro Steps:
1) Updated Buri to BuildID: 20131218004002
2) Open "Browser" and type in URL: http://mozilla.github.io/qa-testcase-data/webapi/mediarecorder/index.html
3) Select microphone, and select setup and grant permission
4) Select to start recording
5) Receive & answer an incoming call

Actual:
Logcat doesn't show evidence that onerror fired 

Expected:
Logcat shows evidence that onerror fired

Environmental Variables:
Device: Buri 1.3 MOZ
BuildID: 20131218004002
Gaia: a99b23e73fe5630a877004746d0e7fcec1b6d653
Gecko: 369bdbff6c38
Version: 28.0a2
Firmware Version:v1.2_20131115

Notes:
Repro frequency: 100%
Link to failed test case:
https://moztrap.mozilla.org/manage/cases/?filter-id=10154
See attached: logcat
It does reproduce with 1.2 build, logcat doesn't show "onerror" in logcat

Device: Buri 1.2 COM
BuildID: 20131218004002
Gaia: 38338b31b554cdb8c6242b15a966f171a0e7abaa
Gecko: dcffefec8206
Version: 26.0
RIL Version: 01.02.00.019.102
Firmware Version:v1.2_20131115
The logcat here isn't right - it's missing messages all together when media recording active. Can you attach a new logcat with this bug reproducing that shows evidence of "Media Recorder created on index" in the logcat?
Flags: needinfo?(sarsenyev)
No active recording message appear when starting recording, 
https://bugzilla.mozilla.org/show_bug.cgi?id=951008
Flags: needinfo?(sarsenyev)
(In reply to sarsenyev from comment #3)
> No active recording message appear when starting recording, 
> https://bugzilla.mozilla.org/show_bug.cgi?id=951008

I think that's because you don't have console enabled set to true in the debug settings. If that's not enabled, then you won't get the logcat output. Try again with console enabled set.
Flags: needinfo?(sarsenyev)
Attached file log12-20.txt
Logcat with "console enabled"
Flags: needinfo?(sarsenyev)
Assignee: nobody → rlin
The getUserMedia onerror callback should also fired this kind of event and pass through media stream.
Hi Benjamin, 
Please help to handle this, thanks a lot.
Assignee: rlin → bechen
Attached patch bug-952232.patchSplinter Review
1. Add |mErrorCallbacks| member to store the GUM's error callback.
2. Fire GUM's error callback when answering a phone call.

By apply this patch, we can see the message in logcat:
E/GeckoConsole(12266): Content JS LOG at http://mozilla.github.io/qa-testcase-data/webapi/mediarecorder/common.js:76 in createGUMStream/<: IMCOMING_CALL
Hi Sarsenyev:
Is it ok if we fire the GUM's error callback when answering a phone call?
Flags: needinfo?(sarsenyev)
(In reply to Benjamin Chen [:bechen] from comment #9)
> Hi Sarsenyev:
> Is it ok if we fire the GUM's error callback when answering a phone call?

I can answer this - I'm the owner of those test cases.

Yes that's fine.
Flags: needinfo?(sarsenyev)
Component: Video/Audio → WebRTC
Comment on attachment 8372091 [details] [diff] [review]
bug-952232.patch

Hi Randell:
Would you please help to review this patch?
Attachment #8372091 - Flags: review?(rjesup)
Comment on attachment 8372091 [details] [diff] [review]
bug-952232.patch

Review of attachment 8372091 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/media/MediaManager.cpp
@@ +1893,5 @@
>      array->GetElementAt(i, getter_AddRefs(window));
>      nsCOMPtr<nsPIDOMWindow> win(do_QueryInterface(window));
>      if (win) {
> +#ifdef MOZ_WIDGET_GONK
> +      // fire onErrorCallback

Please note that this is to cause any un-answered gUM requests to have their error callbacks fired when access to the mic is overridden by a higher-priority audio request.  (and add comments about what the overall StopMediaStreams() call is for, and make the entire function #ifdef MOZ_WIDGET_GONK - since it can only be called from GONK, it's dead code elsewhere for now).
Comment on attachment 8372091 [details] [diff] [review]
bug-952232.patch

Review of attachment 8372091 [details] [diff] [review]:
-----------------------------------------------------------------

Per discussion with jib: please make sure the error callback is freed once the success callback is called.  If it's complicated or there's something to worry about, please let me know and re can re-evaluate.
Attachment #8372091 - Flags: review?(rjesup) → review-
(In reply to Randell Jesup [:jesup] from comment #13)
> Comment on attachment 8372091 [details] [diff] [review]
> bug-952232.patch
> 
> Review of attachment 8372091 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Per discussion with jib: please make sure the error callback is freed once
> the success callback is called.  If it's complicated or there's something to
> worry about, please let me know and re can re-evaluate.
Why do we need to clear error callbacks after success callback is called?

In this case, when user granted the permission, MediaManager clears the callbacks in |mActiveCallbacks|.
After that we don't have any callbacks can be fired when answering a phone call.
That's why I add |mErrorCallbacks| to store the error callbacks and doesn't clear it when observe "getUserMedia:response:allow".
Flags: needinfo?(rjesup)
No longer blocks: MediaRecording
Whiteboard: burirun1.3-1 → burirun1.3-1, burirun1.4-1
Hi Jason:
Is it possible to change the test case to "No error callback when answering a phone" or "Don't check the error callback" ?
Because 
1. When the user answering the phone call, the MediaStream will be stopped, so the recording functionality should be fine.
2. My patch to store the error callbacks seems not a correct solution for this bug, and the bug can't be fix in a short time if we need a error callback under this case.
Flags: needinfo?(jsmith)
Rob - What do you think here? Should we fire an error in this case or not? I'm in the middle on this one, as I could see a case for including onerror to indicate to the developer that an incoming call killed the recording vs. not including it aligns with stop() getting called on a media stream.
Flags: needinfo?(jsmith) → needinfo?(roc)
I don't think we should fire an error. The microphone input should be suspended temporarily while you're on the call, but afterwards it should resume as if nothing happened.
Flags: needinfo?(roc)
That makes sense to me. Okay, I'll fix the test case here.
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: needinfo?(rjesup) → in-moztrap?(jsmith)
Resolution: --- → INVALID
Updated test cases.
Flags: in-moztrap?(jsmith) → in-moztrap+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: