Closed Bug 1533252 Opened 5 years ago Closed 5 years ago

MediaCapabilities doesn't give correct answers on Android >= API 18.

Categories

(Core :: Audio/Video: Playback, defect, P1)

Unspecified
Android
defect

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox65 --- wontfix
firefox66 --- wontfix
firefox67 --- wontfix
firefox68 --- fixed

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

Flags: needinfo?(jyavenard)

multiple decoders get created in MediaCapabilities concurrently

Does this problem only affect pages playing multiple videos?

OS: Unspecified → Android
Whiteboard: [gvtv]

(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.

Flags: needinfo?(jyavenard)
Whiteboard: [gvtv] → [gvtv:p2] [geckoview:p2]
Rank: 10
Priority: -- → P2
Blocks: 1533129
Blocks: 1533511

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?

Flags: needinfo?(jyavenard)
Priority: P2 → P1

(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.

Flags: needinfo?(jyavenard)
Assignee: nobody → jyavenard
Blocks: 1532250
See Also: → 1535576

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

It's more descriptive with what it actually does.

Depends on D23651

Attachment #9051240 - Attachment description: Bug 1533252 - P1. Extract LocalAllocPolicy from MFT. r?pehrsons → Bug 1533252 - P1. Extract LocalAllocPolicy from MFR. r?pehrsons
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

67=wontfix if this bug is only known to affect Fire TV devices and not more common phones.

Whiteboard: [gvtv:p2] [geckoview:p2] → [gvtv:p2]

(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

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: