Regarding the Current Implementation of dxva2 and wmv Playback

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
riuga
Newbie
Newbie
Posts: 2
Joined: Wed Jul 15, 2020 10:38 am

Regarding the Current Implementation of dxva2 and wmv Playback

Post by riuga »

The game I am dealing with utilizes both DXVA2 and Media Foundation for playback of .wmv files. The problem is that neither the video nor audio streams play, resulting in a black screen until skipped via a keypress. There are no errors or warnings, merely two fixmes regarding IDirect3DDeviceManager9->ResetDevice as a semi-stub and d3d_shader::shader_sm4_read_instruction_modifier unhandled modifiers. I believe the fixmes regarding shaders aren't the root issue at hand as one would expect the audio to still play at the very least. Analyzing the source of device_manager_ResetDevice also shows no indication of how it could bork video playback altogether. I am left with believing the issue is caused by the implementation of either mf/mfplat or dxva2. Going solely off the fact that I know of at least one other MF-based game which does not use DXVA2, which does in fact have working wmv video playback with the latest wine, I am led to the conclusion that the issue may be stemming from dxva2 itself. The current implementation hinges on the native vtable for IDirect3DDeviceManager9, from which all the relevant functionality for MF-based wmv playback can be accessed from. Before potentially looking into writing a patch for a more explicit implementation, I was wondering if anyone could chime in on whether this hypothesis is plausible? I would greatly appreciate counterexamples if any exist. The most I could find on this subject was an archived thread from another forum several years back describing the lack of working wmv support for dxva2, however I was unsure on whether this had been addressed since then.
riuga
Newbie
Newbie
Posts: 2
Joined: Wed Jul 15, 2020 10:38 am

Re: Regarding the Current Implementation of dxva2 and wmv Playback

Post by riuga »

Requesting moderators to lock this thread; I've made significant headway w.r.t. this issue since the time of posting.

The problem is caused by various issues in the current Media Foundation implementation, more than just lack of decoder support. The presence of dxva2 calls from the static disassembly and wine traces turned out to be a false positive. The game makes no attempt whatsoever to enable DXVA2 decoding while constructing the IMFMediaSession. I could not confirm this until I fixed several intermediate issues causing an early exit during media session construction over the past few days. Since this is a Playstation port done by a less-than-reputable entity, my guess is that they had planned to use DXVA2 decoding initially, but settled for software decoding due to time constraints, without ever removing all of the DXVA2 init code.
Locked