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

Issue 595716 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug

Blocking:
issue 602708



Sign in to add a comment

Idle suspension of media elements is disabled on OSX.

Reported by janus.z...@gmail.com, Mar 17 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36

Example URL:
http://dailymotion.github.io/hls.js/demo/

Steps to reproduce the problem:
1. Open a page with a video loaded over MSE
2. Press play 
3. Pause
4. Wait for about half a minute.

What is the expected behavior?
The video should remain paused, with the current frame visible on the screen.

What went wrong?
The current frame is hidden and gives a black or strange white anomaly.

Did this work before? Yes 49.0.2623.87 (64-bit) (OS X)

Is it a problem with Flash or HTML5? HTML5

Does this work in other browsers? Yes 

Chrome version: 49.0.2623.87  Channel: stable
OS Version: OS X 10.11.1
Flash Version: Shockwave Flash 21.0 r0
 
Cc: ccameron@chromium.org
Owner: sande...@chromium.org
Status: Assigned (was: Unconfirmed)
Hmm, seems related to suspension of idle players by destruction of the gpu video decoder. I thought we still had valid frame references after GVD destruction. Dan, do you know why we might be blanking here?
VT VDA binds textures to IOSurfaces, which it keeps alive in a map. At destruction, the textures are becoming unbacked.

The solution is probably the same as for AVDA; bind an image that owns that reference instead. Looking at the implementation, that won't actually be too difficult. Until I get to that though, we should disable suspend/resume on Mac.
Labels: -Pri-2 ReleaseBlock-Dev M-51 Pri-1
Already hit dev, so we might get reports of this coming in. Fix coming: https://codereview.chromium.org/1813883002
Project Member

Comment 4 by bugdroid1@chromium.org, Mar 17 2016

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

commit 8413f9ef260a8d5ffac018636abd55f5044ff25c
Author: dalecurtis <dalecurtis@chromium.org>
Date: Thu Mar 17 19:23:33 2016

Disable idle player suspend on OSX.

This breaks hardware decoded video since ownership of video frames
is tied to the hardware decoder.

BUG= 595716 
TEST=none

Review URL: https://codereview.chromium.org/1813883002

Cr-Commit-Position: refs/heads/master@{#381771}

[modify] https://crrev.com/8413f9ef260a8d5ffac018636abd55f5044ff25c/media/blink/webmediaplayer_impl.cc

Status: Fixed (was: Assigned)
Labels: -Pri-1 -ReleaseBlock-Dev Pri-2
Status: Assigned (was: Fixed)
Summary: Idle suspension of media elements is disabled on OSX. (was: MSE videos in Canary go blank)
Cc: -ccameron@chromium.org sande...@chromium.org
Components: -Internals>Media Internals>Media>Hardware
Owner: ccameron@chromium.org
The description above turns out to be what we already do, it appears to actually be the CVImageBufferRef that's being lost.

Assigning ownership to ccameron@ who will look at adding that to the image object. Afterwards there should be some potential to remove the picture info map, which will make VT VDA a little bit cleaner!
I wrote up a patch that scopes the CVImageBuffer to the GLImage, but they're destroyed at the same time, so it doesn't really help:

https://codereview.chromium.org/1822153002

Something needs to outlive the decoder -- do we have something that will collect the most recent frame to keep it around?
 Issue 597086  has been merged into this issue.
ccameron: Presumably you mean something in the GPU process? The frame is still held by the renderer process. It's given a destruction callback that references a static method in GpuVideoDecoder -- if the decoder is gone the frame will try to delete the textures at that point. Probably we want a similar cleanup path.

https://code.google.com/p/chromium/codesearch#chromium/src/media/filters/gpu_video_decoder.cc&l=585
Project Member

Comment 11 by bugdroid1@chromium.org, Apr 13 2016

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

commit 7f366b224dbd21f8b8e3d93b3a4635bf68f31977
Author: dalecurtis <dalecurtis@chromium.org>
Date: Wed Apr 13 01:16:17 2016

Disable idle suspend for GpuVideoDecoder produced frames on OSX, Win.

The hardware decoders on these platforms can not handle being killed
while there are outstanding frames. Disable for now.

BUG= 595716 , 602708.
TEST=suspend does not occur on OSX, Windows.

Review URL: https://codereview.chromium.org/1879253002

Cr-Commit-Position: refs/heads/master@{#386881}

[modify] https://crrev.com/7f366b224dbd21f8b8e3d93b3a4635bf68f31977/media/base/video_frame_metadata.h
[modify] https://crrev.com/7f366b224dbd21f8b8e3d93b3a4635bf68f31977/media/blink/webmediaplayer_impl.cc
[modify] https://crrev.com/7f366b224dbd21f8b8e3d93b3a4635bf68f31977/media/blink/webmediaplayer_impl.h
[modify] https://crrev.com/7f366b224dbd21f8b8e3d93b3a4635bf68f31977/media/filters/gpu_video_decoder.cc

> The frame is still held by the renderer process.

What is meant by "the frame" here, though? We need to keep the CVPixelBufferRef alive (and it only exists in the GPU process). AFAICT, the CVPixelBufferRef is being destroyed (as is the GLImage for the frame). Whatever the renderer is holding on to, it is not having the required effect in the GPU process.
Cc: w...@chromium.org liber...@chromium.org
By frame I mean media::VideoFrame, you're correct it's not solving this problem today, but I think it could be made to. The static GpuVideoDecoder::ReleaseMailbox() code could also trigger some cleanup API within the GPU process for resources which may outlive the VDA/GpuVideoDecoder objects.

cc: watk, liberato since they may be interested in this if we come up with a general solution for "destroy this after all frames are gone."
Project Member

Comment 14 by bugdroid1@chromium.org, Apr 14 2016

Labels: merge-merged-2704
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7ffc3031a4da87b87bea66f61fbbaa4d569e3fde

commit 7ffc3031a4da87b87bea66f61fbbaa4d569e3fde
Author: Dale Curtis <dalecurtis@chromium.org>
Date: Thu Apr 14 00:31:25 2016

Merge M51: "Disable idle suspend for GpuVideoDecoder produced frames on OSX, Win."

The hardware decoders on these platforms can not handle being killed
while there are outstanding frames. Disable for now.

BUG= 595716 , 602708.
TEST=suspend does not occur on OSX, Windows.

Review URL: https://codereview.chromium.org/1879253002

Cr-Commit-Position: refs/heads/master@{#386881}
(cherry picked from commit 7f366b224dbd21f8b8e3d93b3a4635bf68f31977)

Review URL: https://codereview.chromium.org/1885073004 .

Cr-Commit-Position: refs/branch-heads/2704@{#44}
Cr-Branched-From: 6e53600def8f60d8c632fadc70d7c1939ccea347-refs/heads/master@{#386251}

[modify] https://crrev.com/7ffc3031a4da87b87bea66f61fbbaa4d569e3fde/media/base/video_frame_metadata.h
[modify] https://crrev.com/7ffc3031a4da87b87bea66f61fbbaa4d569e3fde/media/blink/webmediaplayer_impl.cc
[modify] https://crrev.com/7ffc3031a4da87b87bea66f61fbbaa4d569e3fde/media/blink/webmediaplayer_impl.h
[modify] https://crrev.com/7ffc3031a4da87b87bea66f61fbbaa4d569e3fde/media/filters/gpu_video_decoder.cc

Labels: TE-Verified-M51 TE-Verified-51.0.2704.7
Tested the issue on Mac 10.11.4 and windows 7 using chrome version 51.0.2704.7 with the below steps

1. go to URL http://dailymotion.github.io/hls.js/demo/
2.Play video and clicked on pause
3.Waited for one minute
4.Video is in paused state only.

Please find the attached screen cast for the same.
Adding TE-Verified label.

Thanks,
595716.mp4
1.7 MB Download
Blocking: 602708
Project Member

Comment 17 by sheriffbot@chromium.org, Jul 27 2016

Status: Archived (was: Assigned)
This bug has been TE-Verified and unmodified for over 90 days, so archiving it. Please reopen if it's still valid.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Via-Wizard -M-51 -TE-Verified-M51 -merge-merged-2704 -TE-Verified-51.0.2704.7
Owner: sande...@chromium.org
Status: Assigned (was: Archived)
This feature is disabled and this bug is tracking re-enabling it.
Status: Fixed (was: Assigned)

Sign in to add a comment