Closed
Bug 1143694
Opened 9 years ago
Closed 9 years ago
WebRTC looks garbled on Lollipop Gonk
Categories
(Core :: WebRTC, defect, P1)
Tracking
()
People
(Reporter: diego, Assigned: sotaro)
References
Details
(Keywords: verifyme, Whiteboard: [caf priority: p1][CR 810038])
Attachments
(3 files, 3 obsolete files)
650.18 KB,
text/plain
|
Details | |
4.77 KB,
patch
|
Details | Diff | Splinter Review | |
3.27 KB,
patch
|
jesup
:
review+
diego
:
feedback+
bajaj
:
approval-mozilla-b2g37+
|
Details | Diff | Splinter Review |
Loopback works fine [1]. In an actual apprtc [2] session the outgoing video of the L-gonk phone looks garbled on the remote KK phone side [3]. The incoming video looks fine on the L-gonk phone[4]. I tried this with L-phone to KK-gonk phone and L-gonk phone to Desktop. I got the same result. Did you get a chance to try a phone to phone session on v2.2 Lollipop? [1] http://mozilla.github.io/webrtc-landing/pc_test.html [2] https://apprtc.appspot.com/ [3] https://www.dropbox.com/s/u9uum0yk0gy73zw/2015-03-13%2014.29.27.jpg?dl=0 [4] https://www.dropbox.com/s/umi9zo4kvw7gd8n/2015-03-13%2014.29.32.jpg?dl=0
Assignee | ||
Comment 1•9 years ago
|
||
diego, thanks for creating the bug. Do you enable H.264 WebRTC with the following?
> pref("media.peerconnection.video.h264_enabled", true);
Flags: needinfo?(dwilson)
Assignee | ||
Comment 2•9 years ago
|
||
I did h.264 WebRTC session with [2] between v2.2 nexus-5-l and v2.2 flame-kk, but I did not saw the problem. It might be device dependent problem.
Reporter | ||
Comment 3•9 years ago
|
||
(In reply to Sotaro Ikeda [:sotaro] from comment #1) > diego, thanks for creating the bug. Do you enable H.264 WebRTC with the > following? > > > pref("media.peerconnection.video.h264_enabled", true); I can reproduce this issue on my device with either H.264 enabled or disabled.
Flags: needinfo?(dwilson)
Assignee | ||
Updated•9 years ago
|
blocking-b2g: --- → 2.2?
Assignee | ||
Comment 4•9 years ago
|
||
One possibility is the following. - WebRTC gonk implementation expect YUV420SP as camera preview's color format. - The device's camera preview might not be YUV420SP and ConvertToI420() failed to convert the preview.
Assignee | ||
Comment 5•9 years ago
|
||
Assignee | ||
Comment 6•9 years ago
|
||
diego, can you get a log by using attachment 8578135 [details] [diff] [review] on your v2.2 lollipop device?
Flags: needinfo?(dwilson)
Assignee | ||
Comment 7•9 years ago
|
||
Remove the following from the patch.
> pref("media.peerconnection.video.h264_enabled", true);
Attachment #8578135 -
Attachment is obsolete: true
Assignee | ||
Updated•9 years ago
|
Attachment #8578137 -
Attachment is patch: true
Attachment #8578137 -
Attachment mime type: text/x-patch → text/plain
Assignee | ||
Comment 8•9 years ago
|
||
(In reply to Sotaro Ikeda [:sotaro] from comment #6) > diego, can you get a log by using attachment 8578135 [details] [diff] [review] > [review] on your v2.2 lollipop device? attachment 8578137 [details] [diff] [review] is latest log patch.
Updated•9 years ago
|
blocking-b2g: 2.2? → 2.2+
Comment 9•9 years ago
|
||
Hi Sotaro - Can you take this bug? Thanks.
Rank: 15
Flags: needinfo?(sotaro.ikeda.g)
Flags: firefox-backlog+
Priority: -- → P1
Assignee | ||
Comment 10•9 years ago
|
||
(In reply to Maire Reavy [:mreavy] (Plz needinfo me) from comment #9) > Hi Sotaro - Can you take this bug? Thanks. Okey, I could take this bug. But we do not have a hardware and development environment that could reproduce the problem. Therefore, we need help from codeaurora.
Assignee: nobody → sotaro.ikeda.g
Flags: needinfo?(sotaro.ikeda.g)
Assignee | ||
Comment 11•9 years ago
|
||
(In reply to Sotaro Ikeda [:sotaro] from comment #10) > Okey, I could take this bug. But we do not have a hardware and development > environment that could reproduce the problem. Therefore, we need help from > codeaurora. because nexus-5-l did not reproduce the problem.
Reporter | ||
Comment 12•9 years ago
|
||
Sotaro, I added your patches. I see there's some color conversion errors there. I think there's something missing in the newer baseline. I'll look into in further.
Flags: needinfo?(dwilson)
Assignee | ||
Comment 13•9 years ago
|
||
Okey, thanks.
Updated•9 years ago
|
Whiteboard: [CR 810038]
Updated•9 years ago
|
Whiteboard: [CR 810038] → [caf priority: p2][CR 810038]
Updated•9 years ago
|
Whiteboard: [caf priority: p2][CR 810038] → [caf priority: p1][CR 810038]
Reporter | ||
Comment 15•9 years ago
|
||
Turns out the issue is somewhere in webrtc image rotation: https://mxr.mozilla.org/mozilla-central/source/dom/media/webrtc/MediaEngineGonkVideoSource.cpp#722 On my device it unsuccessfully rotates the camera frames by 270 degrees which garbles the video before encoding. If I force a 0 degree rotation the video looks fine but with the wrong rotation. Any idea what could be going wrong here?
Flags: needinfo?(dwilson) → needinfo?(sotaro.ikeda.g)
Assignee | ||
Comment 16•9 years ago
|
||
diego, mRotation seems to be calculated by MediaEngineGonkVideoSource::GetRotation(). Can you analyze it on your device?
Flags: needinfo?(sotaro.ikeda.g) → needinfo?(dwilson)
Assignee | ||
Comment 17•9 years ago
|
||
(In reply to Sotaro Ikeda [:sotaro] from comment #16) > diego, mRotation seems to be calculated by > MediaEngineGonkVideoSource::GetRotation(). https://dxr.mozilla.org/mozilla-central/source/dom/media/webrtc/MediaEngineGonkVideoSource.cpp#522
Reporter | ||
Comment 18•9 years ago
|
||
(In reply to Sotaro Ikeda [:sotaro] from comment #17) > (In reply to Sotaro Ikeda [:sotaro] from comment #16) > > diego, mRotation seems to be calculated by > > MediaEngineGonkVideoSource::GetRotation(). > > https://dxr.mozilla.org/mozilla-central/source/dom/media/webrtc/ > MediaEngineGonkVideoSource.cpp#522 I believe the rotation value of 270 degrees is correct. The problem is that performing that rotation [1] looks messed up. Perhaps the stride calculations [2] are not taking rotation? [1] https://mxr.mozilla.org/mozilla-central/source/dom/media/webrtc/MediaEngineGonkVideoSource.cpp#772 [2] https://mxr.mozilla.org/mozilla-central/source/dom/media/webrtc/MediaEngineGonkVideoSource.cpp#770
Flags: needinfo?(dwilson)
Reporter | ||
Comment 19•9 years ago
|
||
This seems to be an alignment/rotation issue. If I force the rotated width to be aligned to 16 pixels [1] the same way the stride is being aligned [2] then the video looks ok (except for a green bar filling up the extra alignment padding). [1] https://mxr.mozilla.org/mozilla-central/source/dom/media/webrtc/MediaEngineGonkVideoSource.cpp#741 [2] https://mxr.mozilla.org/mozilla-central/source/dom/media/webrtc/MediaEngineGonkVideoSource.cpp#770
Flags: needinfo?(sotaro.ikeda.g)
Assignee | ||
Comment 20•9 years ago
|
||
(In reply to Diego Wilson [:diego] from comment #18) > (In reply to Sotaro Ikeda [:sotaro] from comment #17) > > (In reply to Sotaro Ikeda [:sotaro] from comment #16) > > > diego, mRotation seems to be calculated by > > > MediaEngineGonkVideoSource::GetRotation(). > > > > https://dxr.mozilla.org/mozilla-central/source/dom/media/webrtc/ > > MediaEngineGonkVideoSource.cpp#522 > > I believe the rotation value of 270 degrees is correct. The problem is that > performing that rotation [1] looks messed up. Perhaps the stride > calculations [2] are not taking rotation? I just checked flame-kk. Its camera was also 270 degree.
Flags: needinfo?(sotaro.ikeda.g)
Assignee | ||
Comment 21•9 years ago
|
||
(In reply to Diego Wilson [:diego] from comment #18) > (In reply to Sotaro Ikeda [:sotaro] from comment #17) > > (In reply to Sotaro Ikeda [:sotaro] from comment #16) > > > diego, mRotation seems to be calculated by > > > MediaEngineGonkVideoSource::GetRotation(). > > > > https://dxr.mozilla.org/mozilla-central/source/dom/media/webrtc/ > > MediaEngineGonkVideoSource.cpp#522 > > I believe the rotation value of 270 degrees is correct. The problem is that > performing that rotation [1] looks messed up. Perhaps the stride > calculations [2] are not taking rotation? Destination uses HAL_PIXEL_FORMAT_YV12, its stride is based on the following. The way of the calculation seems correct. http://androidxref.com/5.1.0_r1/xref/system/core/include/system/graphics.h#92
Reporter | ||
Comment 22•9 years ago
|
||
(In reply to Sotaro Ikeda [:sotaro] from comment #20) > (In reply to Diego Wilson [:diego] from comment #18) > > (In reply to Sotaro Ikeda [:sotaro] from comment #17) > > > (In reply to Sotaro Ikeda [:sotaro] from comment #16) > > > > diego, mRotation seems to be calculated by > > > > MediaEngineGonkVideoSource::GetRotation(). > > > > > > https://dxr.mozilla.org/mozilla-central/source/dom/media/webrtc/ > > > MediaEngineGonkVideoSource.cpp#522 > > > > I believe the rotation value of 270 degrees is correct. The problem is that > > performing that rotation [1] looks messed up. Perhaps the stride > > calculations [2] are not taking rotation? > > I just checked flame-kk. Its camera was also 270 degree. I believe the Flame camera preview defaults to 176x144 which is already 16 pixel aligned.
Assignee | ||
Comment 23•9 years ago
|
||
Add log around stride.
Attachment #8578137 -
Attachment is obsolete: true
Assignee | ||
Comment 24•9 years ago
|
||
Diego, can you take a log by using attachment 8584694 [details] [diff] [review]? I wanted to know concrete stride info. Thanks.
Flags: needinfo?(dwilson)
Assignee | ||
Comment 25•9 years ago
|
||
Assignee | ||
Comment 26•9 years ago
|
||
Diego, can you test how attachment 8584717 [details] [diff] [review] works?
Reporter | ||
Comment 27•9 years ago
|
||
Sotaro, It's definitely a stride issue. The webrtc video capture pipeline does not carry over the stride of the camera frames. One solution is to align the webrtc Y stride for YV12 to 16 pixels here: https://mxr.mozilla.org/mozilla-central/source/media/webrtc/trunk/webrtc/common_video/libyuv/webrtc_libyuv.cc#248 What do you think?
Flags: needinfo?(dwilson) → needinfo?(sotaro.ikeda.g)
Comment 28•9 years ago
|
||
Is the 16-pixel alignment a requirement of YV12 per-se? If so, that would be a reasonable place to put code to enforce it (or code to complain if it isn't). However, a more general fix (perhaps additional, since it would cover all formats as needed) would be to do the graphicBuffer->GetStride() calls in the code that calls this. (Speaking of which: sotaro, shouldn't it use GetStride for both the ConvertToI420() calls in that function? Other than that question, r+ for the GetStride patch.)
Assignee | ||
Comment 29•9 years ago
|
||
(In reply to Diego Wilson [:diego] from comment #27) > Sotaro, > > It's definitely a stride issue. The webrtc video capture pipeline does not > carry over the stride of the camera frames. One solution is to align the > webrtc Y stride for YV12 to 16 pixels here: > > https://mxr.mozilla.org/mozilla-central/source/media/webrtc/trunk/webrtc/ > common_video/libyuv/webrtc_libyuv.cc#248 > > What do you think? I also checked the code, therefore, I created attachment 8584717 [details] [diff] [review], could you respond to comment 24 and comment 25?
Flags: needinfo?(sotaro.ikeda.g) → needinfo?(dwilson)
Assignee | ||
Comment 30•9 years ago
|
||
(In reply to Randell Jesup [:jesup] from comment #28) > Is the 16-pixel alignment a requirement of YV12 per-se? I do not think it is a requirement of YV12. But it might happen often because of performance reason.
Reporter | ||
Comment 31•9 years ago
|
||
(In reply to Sotaro Ikeda [:sotaro] from comment #29) > I also checked the code, therefore, I created attachment 8584717 [details] [diff] [review] > [diff] [review], could you respond to comment 24 and comment 25? Sotaro, Your patch is for the non-gralloc case. Camera buffers (on my device at least) are gralloc buffers. When I do an equivalent change for gralloc it doesn't work. It seems the stride and the width need to have different values here as I suggest in comment 27. And I agree with Randell that ideally we would explicitly carry over the stride but that would require changing the mediapipeline to include stride values in addition to width/height.
Flags: needinfo?(dwilson)
Assignee | ||
Comment 32•9 years ago
|
||
(In reply to Diego Wilson [:diego] from comment #31) > (In reply to Sotaro Ikeda [:sotaro] from comment #29) > > I also checked the code, therefore, I created attachment 8584717 [details] [diff] [review] > > [diff] [review], could you respond to comment 24 and comment 25? > > Sotaro, > > Your patch is for the non-gralloc case. Sorry, about it. > Camera buffers (on my device at > least) are gralloc buffers. When I do an equivalent change for gralloc it > doesn't work. It seems the stride and the width need to have different > values here as I suggest in comment 27. I assume that the reason it did not work is related to the following code. https://dxr.mozilla.org/mozilla-central/source/media/webrtc/trunk/webrtc/common_video/libyuv/webrtc_libyuv.cc#
Assignee | ||
Comment 33•9 years ago
|
||
(In reply to Sotaro Ikeda [:sotaro] from comment #32) > I assume that the reason it did not work is related to the following code. > > https://dxr.mozilla.org/mozilla-central/source/media/webrtc/trunk/webrtc/ > common_video/libyuv/webrtc_libyuv.cc# Sorry, like was missing. https://dxr.mozilla.org/mozilla-central/source/media/webrtc/trunk/webrtc/common_video/libyuv/webrtc_libyuv.cc#245
Reporter | ||
Comment 34•9 years ago
|
||
So what do you think of my suggestion in comment 27? Do you think that solution is too narrow?
Flags: needinfo?(sotaro.ikeda.g)
Assignee | ||
Comment 35•9 years ago
|
||
(In reply to Diego Wilson [:diego] from comment #27) > Sotaro, > > It's definitely a stride issue. The webrtc video capture pipeline does not > carry over the stride of the camera frames. One solution is to align the > webrtc Y stride for YV12 to 16 pixels here: > > https://mxr.mozilla.org/mozilla-central/source/media/webrtc/trunk/webrtc/ > common_video/libyuv/webrtc_libyuv.cc#248 > > What do you think? This code is gonk specific. It is not general YV12 code. Then as a simple fix, " Y stride for YV12 to 16 pixels" seems reasonable.
Flags: needinfo?(sotaro.ikeda.g)
Assignee | ||
Comment 36•9 years ago
|
||
But as a long term fix, we need general fix. because it is not a android YV12's requirement.
Assignee | ||
Comment 37•9 years ago
|
||
(In reply to Sotaro Ikeda [:sotaro] from comment #36) > But as a long term fix, we need general fix. because it is not a android > YV12's requirement. Sorry, I misunderstood it. From the following, it is a requirement of android's YV12. Therefore, "Y stride for YV12 to 16 pixels" could be long term solution. http://androidxref.com/5.1.0_r1/xref/system/core/include/system/graphics.h#104
Assignee | ||
Comment 38•9 years ago
|
||
Attachment #8584717 -
Attachment is obsolete: true
Assignee | ||
Comment 39•9 years ago
|
||
Diego, does attachment 8587030 [details] [diff] [review] works on your device?
Flags: needinfo?(dwilson)
Reporter | ||
Comment 40•9 years ago
|
||
Comment on attachment 8587030 [details] [diff] [review] patch - Care about gralloc YV12 stride Review of attachment 8587030 [details] [diff] [review]: ----------------------------------------------------------------- This patch fixes it for me. Cleared for landing!
Attachment #8587030 -
Flags: feedback+
Reporter | ||
Updated•9 years ago
|
Flags: needinfo?(dwilson)
Assignee | ||
Comment 41•9 years ago
|
||
(In reply to Diego Wilson [:diego] from comment #40) > > This patch fixes it for me. Cleared for landing! Thanks for the checking!
Assignee | ||
Updated•9 years ago
|
Attachment #8587030 -
Flags: review?(rjesup)
Assignee | ||
Comment 42•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=910d79be3dcd
Updated•9 years ago
|
Attachment #8587030 -
Flags: review?(rjesup) → review+
Assignee | ||
Comment 43•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/21e4e3a2b33d
Reporter | ||
Updated•9 years ago
|
status-b2g-v2.2:
--- → affected
https://hg.mozilla.org/mozilla-central/rev/21e4e3a2b33d
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox40:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
Attachment #8587030 -
Flags: approval-mozilla-b2g37?
Updated•9 years ago
|
Attachment #8587030 -
Flags: approval-mozilla-b2g37? → approval-mozilla-b2g37+
Comment 45•9 years ago
|
||
https://hg.mozilla.org/releases/mozilla-b2g37_v2_2/rev/50848a1a89ae
Comment 46•9 years ago
|
||
verify 2.2 with below build * test env Build ID 20150406162505 Gaia Revision 485322797a069e5b185931e87d15d4e921e25b64 Gaia Date 2015-04-06 18:36:29 Gecko Revision https://hg.mozilla.org/releases/mozilla-b2g37_v2_2/rev/f766e5052b39 Gecko Version 37.0 Device Name hammerhead Firmware(Release) 5.0 Firmware(Incremental) eng.cltbld.20150406.195612 Firmware Date Mon Apr 6 19:56:28 EDT 2015 Bootloader HHZ12d
Keywords: verifyme
Comment 47•9 years ago
|
||
We don't have the device or build mentioned on comment 46. Removing this bug from our queries.
QA Whiteboard: [QAExclude]
Flags: needinfo?(jmercado)
Updated•9 years ago
|
Flags: needinfo?(jmercado)
You need to log in
before you can comment on or make changes to this bug.
Description
•