MediaCapabilities doesn't give correct answers on Android >= API 18.
Categories
(Core :: Audio/Video: Playback, defect, P1)
Tracking
()
People
(Reporter: jhlin, Assigned: jya)
References
Details
(Whiteboard: [gvtv:p2])
Attachments
(4 files)
AllocationPolicy
doesn't limit decoder allocations [1] so multiple decoders get created in MediaCapabilities
concurrently. Devices with limited gfx memory (e.g. Fire TV Cube) can not allocate many decoders and will report error that makes MediaCapabilities return incorrect smooth
and powerEfficient
values.
Jean-Yves, I think we could sort the configs from larger to smaller resolutions, and once a config passes, all after it can inherit the answer. What do you think?
[1] https://searchfox.org/mozilla-central/source/dom/media/platforms/AllocationPolicy.cpp#41
Reporter | ||
Updated•5 years ago
|
Comment 1•5 years ago
|
||
multiple decoders get created in MediaCapabilities concurrently
Does this problem only affect pages playing multiple videos?
Assignee | ||
Comment 2•5 years ago
|
||
(In reply to Chris Peterson [:cpeterson] from comment #1)
multiple decoders get created in MediaCapabilities concurrently
Does this problem only affect pages playing multiple videos?
It's unrelated.
When you start a YT video, they query what format we support and various resolutions. They fire those queries simultanesously.
Each query create a decoder instance and we check of it can be created and if it's a HW decoder.
Attempting to create too many decoders at once make us return that we don't support some format/resolutions.
John had talked about querying the OS to find out the capabilities instead of creating a new decoder each time.
The code already has room to serialize the decoder creation and only create a certain number of queries at once. We can easily tweak things on Android so we don't create more than say 4 decoders at once.
Updated•5 years ago
|
Updated•5 years ago
|
Comment 3•5 years ago
|
||
If my guess about this causing the problems in bug 133511 and bug 1533129 then I think we should consider turning this feature off on Android until we have a proper solution which avoids the OOO problem.
@jya what do you think?
Assignee | ||
Comment 4•5 years ago
|
||
(In reply to Nils Ohlmeier [:drno] from comment #3)
If my guess about this causing the problems in bug 133511 and bug 1533129 then I think we should consider turning this feature off on Android until we have a proper solution which avoids the OOO problem.
@jya what do you think?
It will be easier and just as quick to change the allocation policy on android to limit the number of simultaneous decoders, or have a policy specific to Media Capabilities that serialise all queries.
Long term would be to not have to create decoders to query their capabilities, instead asking the OS.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 5•5 years ago
|
||
Assignee | ||
Comment 6•5 years ago
|
||
Despite its name and apparent use LocalAllocPolicy could only handle a single call to Alloc() at a time which was okay due to how it was used by the MediaFormatReader.
However, we do want to handle multiple calls to Alloc().
These changes allow to perform simultaneous requests and have them be processed one at a time serially.
Depends on D23650
Assignee | ||
Comment 7•5 years ago
|
||
It's more descriptive with what it actually does.
Depends on D23651
Assignee | ||
Comment 8•5 years ago
|
||
Depends on D23652
Updated•5 years ago
|
Pushed by jyavenard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/137a272da6a2 P1. Extract LocalAllocPolicy from MFR. r=pehrsons https://hg.mozilla.org/integration/autoland/rev/f606c812fb5d P2. Make LocalAllocPolicy inherit from AllocPolicy. r=pehrsons https://hg.mozilla.org/integration/autoland/rev/d8d366725967 P3. Rename LocalAllocPolicy into SingleAllocPolicy. r=pehrsons https://hg.mozilla.org/integration/autoland/rev/1a2c4caa1170 P4. Serialize all the video MediaCapabilities queries. r=pehrsons
Comment 10•5 years ago
|
||
67=wontfix if this bug is only known to affect Fire TV devices and not more common phones.
Assignee | ||
Comment 11•5 years ago
|
||
(In reply to Chris Peterson [:cpeterson] from comment #10)
67=wontfix if this bug is only known to affect Fire TV devices and not more common phones.
I was aware of this issue on other android devices, both the google pixel or the samsung s8 shows this.
However, not getting 4K in the list hasn't been that important for anyone to noticed.
but the bug affects all android devices
Comment 12•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/137a272da6a2
https://hg.mozilla.org/mozilla-central/rev/f606c812fb5d
https://hg.mozilla.org/mozilla-central/rev/d8d366725967
https://hg.mozilla.org/mozilla-central/rev/1a2c4caa1170
Description
•