Have crash recovery policy with RDD process
Categories
(Core :: Audio/Video: Playback, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox99 | --- | fixed |
People
(Reporter: jya, Assigned: stransky)
References
(Blocks 1 open bug)
Details
Attachments
(5 files)
The GPU process was designed to recover smoothly should it crashed. If multiple crashes occur the content's MediaFormatReader will disable HW decoding and request a software decoder instead.
The RDD process doesn't have this policy. If it crashes the decoding will fail and be fatal (the video will stop playing).
It was very unlikely for the RDD process to crash in the past, but following bug 1595994 it is going to be almost as likely to crash as the GPU process.
For now, the issue is downplayed that we will always prefer the GPU process to run the remote decoder for HW accelerated decoders.
Reporter | ||
Updated•4 years ago
|
Assignee | ||
Comment 2•3 years ago
|
||
Recently we set NS_ERROR_DOM_MEDIA_FATAL_ERR when decoder fails to init. That leads to broken media playback even when we're requested to create a new decoder (with possibility of disabled HW acceleration.
In this patch we pass proper error code from decoder to media control code to allow decoder recovery.
Updated•3 years ago
|
Assignee | ||
Comment 3•3 years ago
|
||
Assignee | ||
Comment 4•3 years ago
|
||
With the patch here we'll restart the RDD process after every crash and try again. I wonder if we should count the crashes and throw the "unable to play" error after say three crashes for the same clip?
Assignee | ||
Comment 5•3 years ago
|
||
btw. GPU process has something similar to count failures:
https://searchfox.org/mozilla-central/rev/2a0b0ababd4541ecffb74cbe0820a9d0a25da636/gfx/ipc/GPUProcessManager.cpp#637
Assignee | ||
Comment 6•3 years ago
|
||
The issue with MediaFormatReader check is that it doesn't work with RDD:
https://searchfox.org/mozilla-central/rev/4615b544a0f7166233c409c619b426c4025467a7/dom/media/MediaFormatReader.cpp#2369-2385
- RDD overrides decoder error to NS_ERROR_DOM_MEDIA_FATAL_ERR which is not checked so we don't do any recovery from RDD crashes
- decoder.mDecoder->IsHardwareAccelerated(error) does not work as expected for RDD. As we initialize mIsHardwareAccelerated after mChild->Init() here:
mIsHardwareAccelerated has undefined value when decoder crash in mChild->Init() (decoder init). That crash happens now due RDD sandbox but can also happen for broken drivers/vaapi library or so.
OTOH: decoder.mHardwareDecodingDisabled flag is properly delivered to decoders in RDD so we can use it.
So we need to:
- return different error code from RDD or update the 'first decoded frame failure' check.
- fix decoder.mDecoder->IsHardwareAccelerated(error)
According to https://searchfox.org/mozilla-central/rev/b697834e78a3ef7613e2fa57c07624b1d9d1c909/dom/media/platforms/PlatformDecoderModule.h#482 we don't have to call Init() to call IsHardwareAccelerated() but actual implementation is different. That comment says the IsHardwareAccelerated() actually means 'HW is enabled' but it's implemented as 'HW is used'.
Updated•3 years ago
|
Assignee | ||
Comment 7•3 years ago
|
||
Assignee | ||
Comment 8•3 years ago
|
||
Depends on D138268
Assignee | ||
Comment 9•3 years ago
|
||
Depends on D138269
Assignee | ||
Comment 10•3 years ago
|
||
Depends on D138270
Updated•3 years ago
|
Assignee | ||
Comment 11•3 years ago
|
||
With the patches here we have control over RDD crashes in MediaFormatReader so we can add some check how many RDD process restart we allow.
(the patch here always asks for new decoder in case of NS_ERROR_DOM_MEDIA_REMOTE_DECODER_CRASHED_ERR).
Assignee | ||
Comment 12•3 years ago
|
||
Assignee | ||
Comment 13•3 years ago
|
||
Comment 14•3 years ago
|
||
Comment 15•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8bb5a205517f
https://hg.mozilla.org/mozilla-central/rev/745394cb6014
https://hg.mozilla.org/mozilla-central/rev/308808c4817c
https://hg.mozilla.org/mozilla-central/rev/2f72afc50db7
https://hg.mozilla.org/mozilla-central/rev/5f321c9a0add
Description
•