Closed Bug 1201969 Opened 9 years ago Closed 9 years ago

[Camera] If user has an interruption while using camera and returns to it the screen will be black/white

Categories

(Core :: Audio/Video, defect, P1)

ARM
Gonk (Firefox OS)
defect

Tracking

()

VERIFIED FIXED
FxOS-S7 (18Sep)
blocking-b2g 2.5+
Tracking Status
firefox43 --- fixed
b2g-v2.2 --- unaffected
b2g-master --- verified

People

(Reporter: AdamA, Assigned: alwu)

References

()

Details

(Keywords: regression, smoketest, Whiteboard: [2.5-Daily-Testing][Spark])

Attachments

(2 files)

Attached file logcat
Description:
When the user is in the camera and receives a phone call or locks the screen then returns to the camera the phone will be a blank screen that is either white or black with the camera UI.

Repro Steps:
1) Update a Aries to 20150904150548
2) Open Camera
3) Lock the screen or receive a phone call
4) Return to camera app
5) Observe camera

Actual:
The camera app does not show what the camera is viewing

Expected:
It is expected that you can see what the camera is showing

Environmental Variables:
Device: Aries 2.5 [Full Flash]
Build ID: 20150904150548
Gaia: 85ae6808d298a4010aaab341c66699f1b87eec9c
Gecko: 691b1524602d
Gonk: 2916e2368074b5383c80bf5a0fba3fc83ba310bd
Version: 43.0a1 (2.5)
Firmware Version: D5803_23.1.A.1.28_NCB.ftf
User Agent: Mozilla/5.0 (Mobile; rv:43.0) Gecko/43.0 Firefox/43.0

Repro frequency: 10/10
Link to failed test case: https://moztrap.mozilla.org/manage/case/2460/
See attached: video clip, logcat
This issue DOES occur on Flame 2.5.

Environmental Variables:
Device: Flame 2.5 [Full Flash][319mb]
BuildID: 20150903150222
Gaia: d7385b79e68d4ad662cacf810506e9ee53345d23
Gecko: 7f987c38bd3e5ac9a834981e85378bdb02338e9d
Gonk: c4779d6da0f85894b1f78f0351b43f2949e8decd
Version: 43.0a1 (2.5) 
Firmware Version: v18D
User Agent: Mozilla/5.0 (Mobile; rv:43.0) Gecko/43.0 Firefox/43.0

Result:
The camera app does not show what the camera is viewing
------------------------------------
This issue DOES NOT occur on Flame 2.2.

Environmental Variables:
Device: Flame 2.2 [Full Flash]
BuildID: 20150903183008
Gaia: 335cd8e79c20f8d8e93a6efc9b97cc0ec17b5a46
Gecko: d3cb4f28c735
Gonk: bd9cb3af2a0354577a6903917bc826489050b40d
Version: 37.0 (2.2) 
Firmware Version: v18D
User Agent: Mozilla/5.0 (Mobile; rv:37.0) Gecko/37.0 Firefox/37.0

Result:
The camera works as expected.
QA Whiteboard: [QAnalyst-Triage?]
Flags: needinfo?(ktucker)
Whiteboard: [2.5-Daily-Testing][Spark]
QA Whiteboard: [QAnalyst-Triage?] → [QAnalyst-Triage+]
Flags: needinfo?(ktucker)
QA Contact: mshuman
This issue appears to be caused by:
Bug 1200099 - Eliminate HTMLMediaElement::mPlaybackStream

Mozilla-inbound Regression Window

Last Working 
Environmental Variables:
Device: Flame 2.5
BuildID: 20150902053523
Gaia: e2fab8f6ac345ecde10a1350e699be9ceb6987d6
Gecko: af087b6d30d70c00cdb902e3f902d399f2d0d71f
Version: 43.0a1 (2.5)
Firmware Version: v18D
User Agent: Mozilla/5.0 (Mobile; rv:43.0) Gecko/43.0 Firefox/43.0

First Broken 
Environmental Variables:
Device: Flame 2.5
BuildID: 20150902055426
Gaia: e2fab8f6ac345ecde10a1350e699be9ceb6987d6
Gecko: e110acdf8e64125af01ace9800f593814ce021e1
Version: 43.0a1 (2.5)
Firmware Version: v18D
User Agent: Mozilla/5.0 (Mobile; rv:43.0) Gecko/43.0 Firefox/43.0

Last Working gaia / First Broken gecko - Issue DOES reproduce
Gaia: e2fab8f6ac345ecde10a1350e699be9ceb6987d6
Gecko: e110acdf8e64125af01ace9800f593814ce021e1

First Broken gaia / Last Working gecko - Issue does NOT reproduce
Gaia: e2fab8f6ac345ecde10a1350e699be9ceb6987d6
Gecko: af087b6d30d70c00cdb902e3f902d399f2d0d71f

Gecko Pushlog:
http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=af087b6d30d70c00cdb902e3f902d399f2d0d71f&tochange=e110acdf8e64125af01ace9800f593814ce021e1
Blocks: 1200099
QA Whiteboard: [QAnalyst-Triage+] → [QAnalyst-Triage?]
Flags: needinfo?(jmercado)
Robert this issue seems to have been caused by the changes for bug 1200099 can you please take a look.  This is a major blocker for smoketest.
Flags: needinfo?(jmercado) → needinfo?(roc)
I can reproduce this. Investigating.
Flags: needinfo?(roc)
I think bug 1200099 uncovered an existing bug related to AudioChannels. When there's an interruption (by suspending the phone, in my case), the <video> element is set into the MUTED_BY_AUDIO_CHANNEL state, because the channel is muted via JS:

0 BrowserElementChild.prototype._recvSetAudioChannelMuted(data = [object Object]) ["chrome://global/content/BrowserElementChildPreload.js":1465]
    this = [object Object]
1 BrowserElementChild.prototype._init/<(aMessage = [object Object]) ["chrome://global/content/BrowserElementChildPreload.js":259]
    this = [object ContentFrameMessageManager @ 0xb07268e0 (native @ 0xb0749ce0)]

But after resuming and unlocking the screen, the <video> element never seems to be unmuted, which seems wrong. In particular HTMLMediaElement::UpdateChannelMuteState is never called again.

I think before bug 1200099 was fixed, this wasn't a problem since HTMLMediaElement::SetupSrcMediaStreamPlayback would set up the stream and then do:
  if (mPausedForInactiveDocumentOrChannel) {
    GetSrcMediaStream()->ChangeExplicitBlockerCount(1);
  }
and CameraPreviewStream implements ChangeExplicitBlockerCount as a noop, so mPausedForInactiveDocumentOrChannel being true had no effect.

With bug 1200099 fixed, this is a problem since when we pause the element for any reason, we disconnect the source MediaStream's video output, and only reconnect it if/when the element is unpaused.

So to fix this, someone needs to make sure that the audio channel is unmuted when the camera app becomes active again.
Flags: needinfo?(amarchesini)
Ken, do you have anyone that knows the audio code and can help out for this smoketest blocker?
Flags: needinfo?(kchang)
Blake and Alastor, please help.
Flags: needinfo?(bwu)
Flags: needinfo?(alwu)
Flags: needinfo?(kchang)
Keep my NI, I'll check it later.
Flags: needinfo?(bwu)
Flags: needinfo?(amarchesini)
Flags: needinfo?(alwu)
Flags: needinfo?(alwu)
Assignee: nobody → alwu
Flags: needinfo?(alwu)
Bug 1201969 - pause element only when start playing
The root cause is that the MUTED_BY_AUDIO_CHANNEL affects the loading process. 
It's the same as the bug1186572. As original plan, the bug1192748 would fix this issue. 
However, I think this issue should be solved ASAP, so I split the solution from the bug1192748.

---

Try-server result.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=ea88184a0c16
Comment on attachment 8658513 [details]
MozReview Request: Bug 1201969 - pause element only when start playing

Hi, Baku,
Could you help me review this patch?
This patch is split from the bug1192748, it would prevent the MUTED_AUDIO_CHANNEL to interrupt the loading process.
Very appreciate :)
Attachment #8658513 - Flags: review?(amarchesini)
Comment on attachment 8658513 [details]
MozReview Request: Bug 1201969 - pause element only when start playing

https://reviewboard.mozilla.org/r/18619/#review16687
Attachment #8658513 - Flags: review?(amarchesini) → review+
Thank Baku for review!
Keywords: checkin-needed
blocking-b2g: --- → 2.5+
Priority: -- → P1
https://hg.mozilla.org/mozilla-central/rev/b74e8af3488c
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → FxOS-S7 (18Sep)
Keywords: verifyme
This issue is verified fixed in the latest Aries 2.5 and Flame 2.5.

Environmental Variables:
Device: Aries 2.5 [Full Flash]
BuildID: 20150909215207
Gaia: 47459eead04385e22f967012b824f5abdddcfb7c
Gecko: dd2a1d737a64d9a3f23714ec5cc623ec8933b51f
Gonk: 2916e2368074b5383c80bf5a0fba3fc83ba310bd
Version: 43.0a1 (2.5) 
Firmware Version: D5803_23.1.A.1.28_NCB.ftf
User Agent: Mozilla/5.0 (Mobile; rv:43.0) Gecko/43.0 Firefox/43.0

Device: Flame 2.5 [Full Flash]
BuildID: 20150910030223
Gaia: 47459eead04385e22f967012b824f5abdddcfb7c
Gecko: dd2a1d737a64d9a3f23714ec5cc623ec8933b51f
Gonk: c4779d6da0f85894b1f78f0351b43f2949e8decd
Version: 43.0a1 (2.5) 
Firmware Version: v18D
User Agent: Mozilla/5.0 (Mobile; rv:43.0) Gecko/43.0 Firefox/43.0

Result:
The camera works after an interruption.
Status: RESOLVED → VERIFIED
Flags: needinfo?(jmercado)
Keywords: verifyme
QA Whiteboard: [QAnalyst-Triage?] → [QAnalyst-Triage+]
Flags: needinfo?(jmercado)
See Also: → 1186677
Based on regression window and patch
Component: Gaia::Camera → Audio/Video
Product: Firefox OS → Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: