Looks like some decoding calls are running for much longer than normal, often between 80ms~100ms. I can see a similar behavior when profiling with my Nvidia card, but it doesn't manage to drop nearly as many frames as you're probably seeing.
This may be related to some non-fatal COM errors that periodically show up when running the WMF AV1 decoder with 8K video, which on my machine coincided with some frames being slightly delayed. On my hardware, the frames were never dropping, though, since it looks like I only get up to ~30ms of delay on a frame. Anyone with hardware to test this could run with Visual Studio attached as a debugger and the COM errors should show up in the output like this:
`Exception thrown at 0x00007FFD04CA428C in firefox.exe: Microsoft C++ exception: _com_error at memory location 0x000000BD6BEFE820.`
The stack trace when the error occurs is as follows:
```
KernelBase.dll!00007ffd04ca428c() Unknown
msvcrt.dll!00007ffd05b4b3b7() Unknown
d3d11.dll!00007ffcfdd3b29e() Unknown
d3d11.dll!00007ffcfdca603f() Unknown
av1decodermft_store.dll!00007ffc92350ca1() Unknown
av1decodermft_store.dll!00007ffc92340c72() Unknown
av1decodermft_store.dll!00007ffc923d1ac2() Unknown
av1decodermft_store.dll!00007ffc92389bed() Unknown
av1decodermft_store.dll!00007ffc92380db1() Unknown
av1decodermft_store.dll!00007ffc9237794e() Unknown
av1decodermft_store.dll!00007ffc923776e4() Unknown
av1decodermft_store.dll!00007ffc9234134a() Unknown
av1decodermft_store.dll!00007ffc9233602f() Unknown
av1decodermft_store.dll!00007ffc92334308() Unknown
av1decodermft_store.dll!00007ffc923322b9() Unknown
> xul.dll!mozilla::MFTDecoder::Output(RefPtr<IMFSample> * aOutput) Line 334 C++
xul.dll!mozilla::WMFVideoMFTManager::Output(__int64 aStreamOffset, RefPtr<mozilla::MediaData> & aOutData) Line 808 C++
xul.dll!mozilla::WMFMediaDataDecoder::ProcessOutput(nsTArray<RefPtr<mozilla::MediaData>> & aResults) Line 151 C++
xul.dll!mozilla::WMFMediaDataDecoder::ProcessDecode(mozilla::MediaRawData * aSample) Line 111 C++
[Inline Frame] xul.dll!mozilla::detail::RunnableMethodArguments<mozilla::MediaRawData *>::applyImpl(mozilla::WMFMediaDataDecoder * o, RefPtr<mozilla::MozPromise<nsTArray<RefPtr<mozilla::MediaData>>,mozilla::MediaResult,1>>(mozilla::WMFMediaDataDecoder::*)(mozilla::MediaRawData *) m, mozilla::Tuple<StoreRefPtrPassByPtr<mozilla::MediaRawData>> & args, std::integer_sequence<unsigned long long,0>) Line 1147 C++
[Inline Frame] xul.dll!mozilla::detail::RunnableMethodArguments<mozilla::MediaRawData *>::apply(mozilla::WMFMediaDataDecoder * o, RefPtr<mozilla::MozPromise<nsTArray<RefPtr<mozilla::MediaData>>,mozilla::MediaResult,1>>(mozilla::WMFMediaDataDecoder::*)(mozilla::MediaRawData *) m) Line 1153 C++
[Inline Frame] xul.dll!mozilla::detail::MethodCall<mozilla::MozPromise<nsTArray<RefPtr<mozilla::MediaData>>,mozilla::MediaResult,1>,RefPtr<mozilla::MozPromise<nsTArray<RefPtr<mozilla::MediaData>>,mozilla::MediaResult,1>> (mozilla::WMFMediaDataDecoder::*)(mozilla::MediaRawData *),mozilla::WMFMediaDataDecoder,mozilla::MediaRawData *>::Invoke() Line 1518 C++
xul.dll!mozilla::detail::ProxyRunnable<mozilla::MozPromise<nsTArray<RefPtr<mozilla::MediaData>>,mozilla::MediaResult,1>,RefPtr<mozilla::MozPromise<nsTArray<RefPtr<mozilla::MediaData>>,mozilla::MediaResult,1>> (mozilla::WMFMediaDataDecoder::*)(mozilla::MediaRawData *),mozilla::WMFMediaDataDecoder,mozilla::MediaRawData *>::Run() Line 1539 C++
xul.dll!mozilla::TaskQueue::Runner::Run() Line 266 C++
xul.dll!nsThreadPool::Run() Line 311 C++
xul.dll!nsThread::ProcessNextEvent(bool aMayWait, bool * aResult) Line 1199 C++
xul.dll!NS_ProcessNextEvent(nsIThread * aThread, bool aMayWait) Line 465 C++
xul.dll!mozilla::ipc::MessagePumpForNonMainThreads::Run(base::MessagePump::Delegate * aDelegate) Line 301 C++
xul.dll!MessageLoop::RunHandler() Line 375 C++
xul.dll!MessageLoop::Run() Line 357 C++
xul.dll!nsThread::ThreadFunc(void * aArg) Line 386 C++
nss3.dll!_PR_NativeRunThread(void * arg) Line 408 C
nss3.dll!pr_root(void * arg) Line 140 C
[External Code]
```
I'm unsure of how to load symbols to find out where this is failing, if any are available at all. Since the error is occurring in d3d11.dll, this could be related to how we copy the frame for display, since I don't see the same issue with my card when zero-copy is enabled.
Hopefully it's all right if I needinfo you :alwu, and also :sotaro, since your domain has been the graphics side of Windows video lately, any ideas on why this might be happening? I may be a bit out of my depth without more tools to investigate. :(
Bug 1793477 Comment 12 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Looks like some decoding calls are running for much longer than normal, often between 80ms~100ms. I can see a similar behavior when profiling with my Nvidia card, but it doesn't manage to drop nearly as many frames as you're probably seeing.
This may be related to some non-fatal COM errors that periodically show up when running the WMF AV1 decoder with 8K video, which on my machine coincided with some frames being slightly delayed. On my hardware, the frames were never dropping, though, since it looks like I only get up to ~30ms of delay on a frame. Anyone with hardware to test this could run with Visual Studio attached as a debugger and the COM errors should show up in the output like this:
`Exception thrown at 0x00007FFD04CA428C in firefox.exe: Microsoft C++ exception: _com_error at memory location 0x000000BD6BEFE820.`
The stack trace when the error occurs is as follows:
```
KernelBase.dll!00007ffd04ca428c() Unknown
msvcrt.dll!00007ffd05b4b3b7() Unknown
d3d11.dll!00007ffcfdd3b29e() Unknown
d3d11.dll!00007ffcfdca603f() Unknown
av1decodermft_store.dll!00007ffc92350ca1() Unknown
av1decodermft_store.dll!00007ffc92340c72() Unknown
av1decodermft_store.dll!00007ffc923d1ac2() Unknown
av1decodermft_store.dll!00007ffc92389bed() Unknown
av1decodermft_store.dll!00007ffc92380db1() Unknown
av1decodermft_store.dll!00007ffc9237794e() Unknown
av1decodermft_store.dll!00007ffc923776e4() Unknown
av1decodermft_store.dll!00007ffc9234134a() Unknown
av1decodermft_store.dll!00007ffc9233602f() Unknown
av1decodermft_store.dll!00007ffc92334308() Unknown
av1decodermft_store.dll!00007ffc923322b9() Unknown
> xul.dll!mozilla::MFTDecoder::Output(RefPtr<IMFSample> * aOutput) Line 334 C++
xul.dll!mozilla::WMFVideoMFTManager::Output(__int64 aStreamOffset, RefPtr<mozilla::MediaData> & aOutData) Line 808 C++
xul.dll!mozilla::WMFMediaDataDecoder::ProcessOutput(nsTArray<RefPtr<mozilla::MediaData>> & aResults) Line 151 C++
xul.dll!mozilla::WMFMediaDataDecoder::ProcessDecode(mozilla::MediaRawData * aSample) Line 111 C++
[Inline Frame] xul.dll!mozilla::detail::RunnableMethodArguments<mozilla::MediaRawData *>::applyImpl(mozilla::WMFMediaDataDecoder * o, RefPtr<mozilla::MozPromise<nsTArray<RefPtr<mozilla::MediaData>>,mozilla::MediaResult,1>>(mozilla::WMFMediaDataDecoder::*)(mozilla::MediaRawData *) m, mozilla::Tuple<StoreRefPtrPassByPtr<mozilla::MediaRawData>> & args, std::integer_sequence<unsigned long long,0>) Line 1147 C++
[Inline Frame] xul.dll!mozilla::detail::RunnableMethodArguments<mozilla::MediaRawData *>::apply(mozilla::WMFMediaDataDecoder * o, RefPtr<mozilla::MozPromise<nsTArray<RefPtr<mozilla::MediaData>>,mozilla::MediaResult,1>>(mozilla::WMFMediaDataDecoder::*)(mozilla::MediaRawData *) m) Line 1153 C++
[Inline Frame] xul.dll!mozilla::detail::MethodCall<mozilla::MozPromise<nsTArray<RefPtr<mozilla::MediaData>>,mozilla::MediaResult,1>,RefPtr<mozilla::MozPromise<nsTArray<RefPtr<mozilla::MediaData>>,mozilla::MediaResult,1>> (mozilla::WMFMediaDataDecoder::*)(mozilla::MediaRawData *),mozilla::WMFMediaDataDecoder,mozilla::MediaRawData *>::Invoke() Line 1518 C++
xul.dll!mozilla::detail::ProxyRunnable<mozilla::MozPromise<nsTArray<RefPtr<mozilla::MediaData>>,mozilla::MediaResult,1>,RefPtr<mozilla::MozPromise<nsTArray<RefPtr<mozilla::MediaData>>,mozilla::MediaResult,1>> (mozilla::WMFMediaDataDecoder::*)(mozilla::MediaRawData *),mozilla::WMFMediaDataDecoder,mozilla::MediaRawData *>::Run() Line 1539 C++
xul.dll!mozilla::TaskQueue::Runner::Run() Line 266 C++
xul.dll!nsThreadPool::Run() Line 311 C++
xul.dll!nsThread::ProcessNextEvent(bool aMayWait, bool * aResult) Line 1199 C++
xul.dll!NS_ProcessNextEvent(nsIThread * aThread, bool aMayWait) Line 465 C++
xul.dll!mozilla::ipc::MessagePumpForNonMainThreads::Run(base::MessagePump::Delegate * aDelegate) Line 301 C++
xul.dll!MessageLoop::RunHandler() Line 375 C++
xul.dll!MessageLoop::Run() Line 357 C++
xul.dll!nsThread::ThreadFunc(void * aArg) Line 386 C++
nss3.dll!_PR_NativeRunThread(void * arg) Line 408 C
nss3.dll!pr_root(void * arg) Line 140 C
[External Code]
```
I'm unsure of how to load symbols to find out where this is failing, if any are available at all. Since the error is occurring in d3d11.dll, this could be related to how we copy the frame for display, since I don't see the same issue with my card when zero-copy is enabled.
We also need to determine whether this COM error is also occurring on an RX 6000 or newer card, but it seems pretty likely that it is.
Hopefully it's all right if I needinfo you :alwu, and also :sotaro, since your domain has been the graphics side of Windows video lately, any ideas on why this might be happening? I may be a bit out of my depth without more tools to investigate this error. :(