New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 868008 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 1
Type: Bug

Blocking:
issue 672962



Sign in to add a comment

Frame size changes cause black flashes and SubmitCompositorFrame violation spam when UseSurfaceLayerForVideo is enabled.

Project Member Reported by dalecur...@chromium.org, Jul 26

Issue description

When playing
http://storage.googleapis.com/dalecurtis/frame_size_change.webm

On my Nexus 5x + O, I get tons of "[ERROR:compositor_frame_sink_impl.cc(76)] SubmitCompositorFrame failed for LocalSurfaceId(1, 1, 3745...) because Surface invariants violation"

07-25 16:25:50.529  4070  4133 E NdkImageReader: AImageReader_getWindow
07-25 16:25:50.547  4070  4134 I cr_MediaCodecBridge: create MediaCodec video decoder, mime video/x-vnd.on2.vp8
07-25 16:25:50.577  4070  4137 I MediaCodec: MediaCodec will operate in async mode
07-25 16:25:50.579  4070  4137 D SurfaceUtils: connecting to surface 0xcabac808, reason connectToSurface
07-25 16:25:50.579  4070  4137 I MediaCodec: [OMX.qcom.video.decoder.vp8] setting surface generation to 4167681
07-25 16:25:50.580  4070  4137 D SurfaceUtils: disconnecting from surface 0xcabac808, reason connectToSurface(reconnect)
07-25 16:25:50.580  4070  4137 D SurfaceUtils: connecting to surface 0xcabac808, reason connectToSurface(reconnect)
07-25 16:25:50.637  4070  4138 D SurfaceUtils: set up nativeWindow 0xcabac808 for 1920x1080, color 0x7fa30c04, rotation 0, usage 0x42002903
07-25 16:25:50.647  4070  4138 W GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2002000
07-25 16:25:50.653  4070  4138 I chatty  : uid=10115(org.chromium.chrome) CodecLooper identical 2 lines
07-25 16:25:50.659  4070  4138 W GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2002000
07-25 16:25:50.676  4070  4138 D SurfaceUtils: set up nativeWindow 0xcabac808 for 160x90, color 0x7fa30c04, rotation 0, usage 0x42002903
07-25 16:25:50.681  4070  4138 W GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2002000
07-25 16:25:50.683  4070  4138 I chatty  : uid=10115(org.chromium.chrome) CodecLooper identical 2 lines
07-25 16:25:50.685  4070  4138 W GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2002000
07-25 16:25:50.690  4070  4070 E cr_MediaCodecBridge: format change: 160x90
07-25 16:25:50.692  4070  4138 W GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2002000
07-25 16:25:50.697  4070  4105 D NdkImageReader: acquireImageLocked: Overriding buffer format YUV_420_888 to 0x7fa30c04.
07-25 16:25:50.697  4070  4105 I Adreno  : Invalid colorspace 0
07-25 16:25:50.763  4070  4138 D SurfaceUtils: set up nativeWindow 0xcabac808 for 160x120, color 0x7fa30c04, rotation 0, usage 0x42002903
07-25 16:25:50.766  4070  4105 I Adreno  : Invalid colorspace 0
07-25 16:25:50.768  4070  4138 W GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2002000
07-25 16:25:50.772  4070  4138 I chatty  : uid=10115(org.chromium.chrome) CodecLooper identical 2 lines
07-25 16:25:50.773  4070  4138 W GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2002000
07-25 16:25:50.778  4070  4070 E cr_MediaCodecBridge: format change: 160x120
07-25 16:25:50.782  4070  4138 W GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2002000
07-25 16:25:50.835  3998  3998 E chromium: [ERROR:compositor_frame_sink_impl.cc(76)] SubmitCompositorFrame failed for LocalSurfaceId(1, 1, 3745...) because Surface invariants violation
07-25 16:25:50.852  4070  4105 I Adreno  : Invalid colorspace 0
07-25 16:25:50.853  3998  3998 E chromium: [ERROR:compositor_frame_sink_impl.cc(76)] SubmitCompositorFrame failed for LocalSurfaceId(1, 1, 3745...) because Surface invariants violation
07-25 16:25:50.860  4070  4138 D SurfaceUtils: set up nativeWindow 0xcabac808 for 320x180, color 0x7fa30c04, rotation 0, usage 0x42002903
07-25 16:25:50.867  4070  4138 W GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2002000
07-25 16:25:50.871  4070  4138 W GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2002000
07-25 16:25:50.875  3998  3998 E chromium: [ERROR:compositor_frame_sink_impl.cc(76)] SubmitCompositorFrame failed for LocalSurfaceId(1, 1, 3745...) because Surface invariants violation
07-25 16:25:50.876  4070  4138 W GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2002000
07-25 16:25:50.877  4070  4138 I chatty  : uid=10115(org.chromium.chrome) CodecLooper identical 1 line
07-25 16:25:50.881  4070  4138 W GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2002000
07-25 16:25:50.881  4070  4070 E cr_MediaCodecBridge: format change: 320x180
07-25 16:25:50.904  3998  3998 E chromium: [ERROR:compositor_frame_sink_impl.cc(76)] SubmitCompositorFrame failed for LocalSurfaceId(1, 1, 3745...) because Surface invariants violation
07-25 16:25:50.911  3998  4003 I zygote  : Do partial code cache collection, code=124KB, data=93KB
07-25 16:25:50.912  3998  4003 I zygote  : After code cache collection, code=124KB, data=93KB
07-25 16:25:50.912  3998  4003 I zygote  : Increasing code cache capacity to 512KB
07-25 16:25:50.914  4070  4105 I Adreno  : Invalid colorspace 0
07-25 16:25:50.920  3998  3998 E chromium: [ERROR:compositor_frame_sink_impl.cc(76)] SubmitCompositorFrame failed for LocalSurfaceId(1, 1, 3745...) because Surface invariants violation
07-25 16:25:50.937  3998  3998 E chromium: [ERROR:compositor_frame_sink_impl.cc(76)] SubmitCompositorFrame failed for LocalSurfaceId(1, 1, 3745...) because Surface invariants violation
07-25 16:25:50.967  4070  4138 D SurfaceUtils: set up nativeWindow 0xcabac808 for 320x240, color 0x7fa30c04, rotation 0, usage 0x42002903
07-25 16:25:50.970  4070  4105 I Adreno  : Invalid colorspace 0
07-25 16:25:50.974  4070  4138 W GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2002000
07-25 16:25:50.977  4070  4138 I chatty  : uid=10115(org.chromium.chrome) CodecLooper identical 3 lines
07-25 16:25:50.983  4070  4138 W GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2002000
07-25 16:25:50.984  4070  4070 E cr_MediaCodecBridge: format change: 320x240
07-25 16:25:50.986  4070  4138 W GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2002000
07-25 16:25:51.000  3998  3998 E chromium: [ERROR:compositor_frame_sink_impl.cc(76)] SubmitCompositorFrame failed for LocalSurfaceId(1, 1, 3745...) because Surface invariants violation
07-25 16:25:51.019  3998  3998 E chromium: [ERROR:compositor_frame_sink_impl.cc(76)] SubmitCompositorFrame failed for LocalSurfaceId(1, 1, 3745...) because Surface invariants violation
07-25 16:25:51.022  4070  4105 I Adreno  : Invalid colorspace 0
07-25 16:25:51.028  3998  3998 E chromium: [ERROR:compositor_frame_sink_impl.cc(76)] SubmitCompositorFrame failed for LocalSurfaceId(1, 1, 3745...) because Surface invariants violation
07-25 16:25:51.051  3998  3998 E chromium: [ERROR:compositor_frame_sink_impl.cc(76)] SubmitCompositorFrame failed for LocalSurfaceId(1, 1, 3745...) because Surface invariants violation
07-25 16:25:51.076  4070  4138 D SurfaceUtils: set up nativeWindow 0xcabac808 for 640x360, color 0x7fa30c04, rotation 0, usage 0x42002903
07-25 16:25:51.078  4070  4105 I Adreno  : Invalid colorspace 0
07-25 16:25:51.081  4070  4138 W GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2002000
07-25 16:25:51.084  4070  4138 I chatty  : uid=10115(org.chromium.chrome) CodecLooper identical 2 lines
07-25 16:25:51.086  4070  4138 W GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2002000
07-25 16:25:51.091  4070  4070 E cr_MediaCodecBridge: format change: 640x360
07-25 16:25:51.092  4070  4138 W GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2002000
07-25 16:25:51.109  3998  3998 E chromium: [ERROR:compositor_frame_sink_impl.cc(76)] SubmitCompositorFrame failed for LocalSurfaceId(1, 1, 3745...) because Surface invariants violation
07-25 16:25:51.120  3998  3998 E chromium: [ERROR:compositor_frame_sink_impl.cc(76)] SubmitCompositorFrame failed for LocalSurfaceId(1, 1, 3745...) because Surface invariants violation
07-25 16:25:51.120  4070  4105 I Adreno  : Invalid colorspace 0
07-25 16:25:51.152  3998  3998 E chromium: [ERROR:compositor_frame_sink_impl.cc(76)] SubmitCompositorFrame failed for LocalSurfaceId(1, 1, 3745...) because Surface invariants violation

 
Cc: liber...@chromium.org
Owner: mlamouri@chromium.org
I looked into this yesterday and there will be one error per frame change. I guess your test video does a lot of them.

Fixing this shouldn't be too hard in principle but with the current design will not be trivial. We should get a new local surface id when we know the frame size has changed but we know this at the frame submitter (or provider) level. However, the surface layer bridge owns the surface id and the submitter is only told what it is.

I started a CL yesterday that would pass a callback to the submitter to request an updated surface id from the bridge but moved on to something else before finishing. Will update this bug with my findings.
Labels: -Pri-3 ReleaseBlock-Stable M-69 Pri-1
Actually I think this is causing black flashes between resolution changes. It's most easily seen here:

https://shaka-player-demo.appspot.com/demo/#asset=https://demo.unified-streaming.com/video/tears-of-steel/tears-of-steel.ism/.mpd;lang=en-US;build=compiled

Click load and then watch at frame 190 with and without surfaces enabled. Playback may freeze due to  issue 868670  if you test ToT, but that should be fixed momentarily.
Summary: Frame size changes cause black flashes and SubmitCompositorFrame violation spam when UseSurfaceLayerForVideo is enabled. (was: Frame size changes cause SubmitCompositorFrame violation spam.)
Status: Started (was: Assigned)
Blocking: 672962
Cc: fsam...@chromium.org kbr@chromium.org enne@chromium.org
fsamuel@, it looks like the errors being reported from compositor_frame_sink_impl.cc may be something you know how to best resolve; can you help?

Not sure whether this is caused indirectly by the changes from  Issue 672962  but I'm blocking the other bug on this one to establish a relationship between them. Unlink if unrelated.

Yup, I believe chatted with Mounir or CJ about this before. This is happening because we need to allocate a new LocalSurfaceId (and therefore a new surface) anytime the size changes.
Blocking: 869277
Cc: dcasta...@chromium.org vsu...@chromium.org posciak@chromium.org mlamouri@chromium.org avkodipelli@chromium.org dalecur...@chromium.org mcasas@chromium.org
 Issue 866069  has been merged into this issue.
Blocking: -869277
Project Member

Comment 10 by bugdroid1@chromium.org, Aug 1

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0f644566076fcfa8ce721861122792cfd0bfff18

commit 0f644566076fcfa8ce721861122792cfd0bfff18
Author: Mounir Lamouri <mlamouri@chromium.org>
Date: Wed Aug 01 15:29:45 2018

VideoSurfaceLayer: use ChildLocalSurfaceIdAllocator in VideoFrameSubmitter.

This allows the submitter to update the LocalSurfaceId (by modifying the
child component) before submitting a new frame. The SurfaceLayerBridge
will be notified of the change and update its internal surface id.

Bug:  868008 
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Iee17f20c753cc236b9ccce5d5bdfe05fb655b08e
Reviewed-on: https://chromium-review.googlesource.com/1157882
Reviewed-by: Fady Samuel <fsamuel@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Commit-Queue: Mounir Lamouri <mlamouri@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579812}
[modify] https://crrev.com/0f644566076fcfa8ce721861122792cfd0bfff18/third_party/blink/renderer/platform/graphics/video_frame_submitter.cc
[modify] https://crrev.com/0f644566076fcfa8ce721861122792cfd0bfff18/third_party/blink/renderer/platform/graphics/video_frame_submitter.h
[modify] https://crrev.com/0f644566076fcfa8ce721861122792cfd0bfff18/third_party/blink/renderer/platform/graphics/video_frame_submitter_test.cc

Labels: Merge-Request-69
Did the above end up fixing the black flashes mentioned in c#2 as well?
I had a very hard time to see the black frames on the video in c#2 but it seems to be fixed in https://mounirlamouri.github.io/bunny-player/index.html AFAICT. 

FWIW, the cause should be the same. Either way, I wouldn't mind if you could confirm :)
Will double check tomorrow's canary since I probably won't have time to make an android build before then.
Labels: OS-Chrome OS-Linux OS-Mac OS-Windows
FWIW, the issue is not specific to Android. Updated the OS's.
Project Member

Comment 16 by sheriffbot@chromium.org, Aug 2

Labels: -Merge-Request-69 Hotlist-Merge-Approved Merge-Approved-69
Your change meets the bar and is auto-approved for M69. Please go ahead and merge the CL to branch 3497 manually. Please contact milestone owner if you have questions.
Owners: amineer@(Android), kariahda@(iOS), cindyb@(ChromeOS), govind@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Pls merge to M69 branch 3497 ASAP. Thank you.
Project Member

Comment 18 by bugdroid1@chromium.org, Aug 2

Labels: -merge-approved-69 merge-merged-3497
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8fac0ae1a53959f24ce6d3700af85799500996a0

commit 8fac0ae1a53959f24ce6d3700af85799500996a0
Author: Mounir Lamouri <mlamouri@chromium.org>
Date: Thu Aug 02 16:42:13 2018

VideoSurfaceLayer: use ChildLocalSurfaceIdAllocator in VideoFrameSubmitter.

This allows the submitter to update the LocalSurfaceId (by modifying the
child component) before submitting a new frame. The SurfaceLayerBridge
will be notified of the change and update its internal surface id.

Bug:  868008 
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Iee17f20c753cc236b9ccce5d5bdfe05fb655b08e
Reviewed-on: https://chromium-review.googlesource.com/1157882
Reviewed-by: Fady Samuel <fsamuel@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Commit-Queue: Mounir Lamouri <mlamouri@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#579812}(cherry picked from commit 0f644566076fcfa8ce721861122792cfd0bfff18)
Reviewed-on: https://chromium-review.googlesource.com/1160961
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Cr-Commit-Position: refs/branch-heads/3497@{#338}
Cr-Branched-From: 271eaf50594eb818c9295dc78d364aea18c82ea8-refs/heads/master@{#576753}
[modify] https://crrev.com/8fac0ae1a53959f24ce6d3700af85799500996a0/third_party/blink/renderer/platform/graphics/video_frame_submitter.cc
[modify] https://crrev.com/8fac0ae1a53959f24ce6d3700af85799500996a0/third_party/blink/renderer/platform/graphics/video_frame_submitter.h
[modify] https://crrev.com/8fac0ae1a53959f24ce6d3700af85799500996a0/third_party/blink/renderer/platform/graphics/video_frame_submitter_test.cc

Status: Fixed (was: Started)
Great work Mounir fixing this thorny issue!

Sign in to add a comment