Closed Bug 910921 Opened 7 years ago Closed 7 years ago

WebM playback problem by using new gralloc textures

Categories

(Firefox OS Graveyard :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sotaro, Assigned: nical)

References

Details

Attachments

(1 file)

+++ This bug was initially created as a clone of Bug #907745 +++

new gralloc textures are committed to m-c, but is disabled by pref, because of media mochitest failures.

When the "new gralloc textures", is enabled, during WebM playback by Browser app, Browser app is killed by low memory killer. This seems the one reason of the media mochitest failures.
Same comment is already in Bug 907745 Comment 58.
As a precondition, this bug assume "new gralloc textures" is enabled.
 - layers.use-deprecated-textures=false
Blocks: 907745
Right now I see 3 problems.
- PlanarYCbCrImage is created instead of GrallocImage
- When PlanarYCbCrImage is used for video playback,
     memory usage increase until the app is killed by low memory killer.
- When changed the code to create GrallocImage, b2g process crashed by 

: [Parent 108] ###!!! ABORT: actor has been |delete|d: file /home/sotaro/b2g_master_unagi/B2G/objdir-gecko/ipc/ipdl/PGrallocBufferParent.cpp, line 378
E Gecko   : mozalloc_abort: [Parent 108] ###!!! ABORT: actor has been |delete|d: file /home/sotaro/b2g_master_unagi/B2G/objdir-gecko/ipc/ipdl/PGrallocBufferParent.cpp, line 378
F libc    : Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)
Assignee: nobody → sotaro.ikeda.g
Update the problem, created image was actually SharedPlanarYCbCrImage.
-[1] SharedPlanarYCbCrImage is created instead of GrallocImage
-[2] When PlanarYCbCrImage is used for video playback,
     memory usage increase until the app is killed by low memory killer.
-[3] When changed the code to create GrallocImage, b2g process crashed by
About [2], ShmemTextureClient is used to store video frame, but allocated buffer is not deleted by client side.
I think you can't Use GrallocImage there as easily.
The leak problem is because the TextureFlags is incorrect. It should have the bit TEXTURE_DEALLOCATE_HOST set but it doesn't. (I am looking at why).

When we fix bug 908196 we will be able to use Gralloc with SharedPlanarYCbCrImage (before we were asking for shmems but sometimes under the hood we would receive gralloc buffers instead, but not always).
Ha!
Found it. I don't know why, calling ImageClient::CreateBufferTextureClient and creating CompositableClient::CreateBufferTextureClient do not use the set flags, and in particular it doesn't set the default flags with ImageClient. I need to ask matt the reason of that change.

patch coming soon
The problem that ImageClient overrides CreateBufferTextureClient and did not pass TEXTURE_FLAGS_DEFAULT which meant neither TEXTURE_DEALLOCATE_HOST nor TEXTURE_DEALLOCATE_CLIENT were set, so we didn't deallocate the texture.

TEXTURE_FLAGS_DEFAULT contains TEXTURE_DEALLOCATE_HOST (see CompositorTypes.h)
Assignee: sotaro.ikeda.g → nical.bugzilla
Attachment #797907 - Flags: review?(sotaro.ikeda.g)
Comment on attachment 797907 [details] [diff] [review]
Fix the default texture flags in ImageClient

Confirmed that app crash did not happened during WebM Playback by applying the patch on master unagi.
Attachment #797907 - Flags: review?(sotaro.ikeda.g) → review+
https://hg.mozilla.org/mozilla-central/rev/75731d5bd634
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Summary: WebM playback prblem by using new gralloc textures → WebM playback problem by using new gralloc textures
No longer blocks: GFXB2G1.2
Given this landed on central before 9/16(merge day) clearing the koi nom here.
blocking-b2g: koi? → ---
You need to log in before you can comment on or make changes to this bug.