Closed Bug 1613672 Opened 4 years ago Closed 3 years ago

Too many warning 'mozilla::MediaSourceTrackDemuxer::DoGetSamples(int32_t): manager is detached'

Categories

(Core :: Audio/Video: Playback, task, P3)

72 Branch
task

Tracking

()

RESOLVED FIXED
86 Branch
Tracking Status
firefox86 --- fixed

People

(Reporter: andreadari91, Assigned: alwu)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Attached file youtube_debug.log

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0

Steps to reproduce:

Using Firefox 72.0.2 on Debian bullseye ( testing ), when changing video resolution on youtube, Firefox gives in output on the terminal the following erorr message multiple times:

[Child 20800, MediaDecoderStateMachine #2] WARNING: Decoder=7fcdc8f52800 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - RefPtr<MediaSourceTrackDemuxer::SamplesPromise> mozilla::MediaSourceTrackDemuxer::DoGetSamples(int32_t): manager is detached.: file /builds/worker/workspace/build/src/dom/media/MediaDecoderStateMachine.cpp, line 3337

I don't see any side effect for this error, video works and the audio too.
I've attached to this report youtube's debug log.

Attachment #9124741 - Attachment mime type: text/x-log → text/plain
Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core

I confirm the same issue on Firefox 73 on Linux when switching between youtube videos.

This is the error message:

[Child 10246, MediaDecoderStateMachine #1] WARNING: Decoder=7fe5e65e9000 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - RefPtr<MediaSourceTrackDemuxer::SamplesPromise> mozilla::MediaSourceTrackDemuxer::DoGetSamples(int32_t): manager is detached.: file /builds/worker/workspace/build/src/dom/media/MediaDecoderStateMachine.cpp, line 3358

Will check to see if we should remove this log.

Assignee: nobody → alwu
Priority: -- → P5

Will check to if we should remove this log.

Priority: P5 → P3

This is also happening on Firefox Nightly. While @andreadari91 says that there are no side effects, this is basically breaking HW decoding until you refresh the video. You can test it on any 8k youtube video example: https://www.youtube.com/watch?v=kFz9afj8lu0 - decoding an 8k video on CPU is a heavy job so it's very noticeable. Can at least this issue be marked as confirmed?

Client: Firefox Nightly on Wayland / Webrender.all enabled / VA-API enabled.

oops, false alarm, that particular video 8k is an AV01 stream, and when falling back to 1080p it selects an AV01 stream as well, even if there is a VP9 codec available. I'm not sure if Firefox has any responsibility for selecting which codec is being used. So it must not be related with this issue.

Sorry about that.

At the time we added this error, we expected that is a not possible situation to be called, however, we've changed our architecture a lot since then. We should revisit this error and check if we need to revise it.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR on youtube when changing video resolution → Revise the error 'manager is detached'
Blocks: MSE
Severity: normal → S4
Type: defect → task

Will start working on it to see what happened when those errors occur.

Summary: Revise the error 'manager is detached' → Too many warning 'mozilla::MediaSourceTrackDemuxer::DoGetSamples(int32_t): manager is detached'

When we shutdown MediaSourceDecoder, it would trigger a shutdown for MDSM and a detaching for media source.

In the previous one, that would eventually shutdown MediaFormatReader via tasks going through different threads (main->MDSM->MFR's supervisor).

In the latter one, it would eventually detach the TrackBufferManager from the MediaSourceTrackDemuxer. (main->Demuxer's supervisor)

As these two tasks running in different threads, and the latter usually get finished before the former one, which would result in MediaSourceTrackDemuxer no longer being able to get a sample.

When that happens, the reader hasn't been shutdown yet, so it's still holding track demuxers and keeps requesting data from them. Then demuxers would return error because its corresponding track manager has been detached.

The reader would report the demuxing error to the console, but that's acutally not a fatal error. Therefore, in this situation, as the reader is going to be shutdown soon and we can treat the detached manager as ended which would stop asking more data from track demuxers.

Attachment #9193987 - Attachment description: Bug 1613672 - treat detached track buffer manager as ended. → Bug 1613672 - return `NS_ERROR_DOM_MEDIA_CANCELED` to indicate that track buffer manager has been detached from the demuxer.
Pushed by alwu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1c00de8c800e
return `NS_ERROR_DOM_MEDIA_CANCELED` to indicate that track buffer manager has been detached from the demuxer. r=jya
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: