intel / media-driver

Intel Graphics Media Driver to support hardware decode, encode and video processing.
https://github.com/intel/media-driver/wiki
Other
994 stars 346 forks source link

Regressed deinterlacing support as compared to i965-va-driver #804

Closed mamarley closed 2 months ago

mamarley commented 4 years ago

I have tried out media-driver 19.3.x on a few systems with Broadwell and Skylake CPUs (Specifically, HD Graphics 5500 and Iris 540) (reproduced with Linux 5.3, 5.4, and 5.5-rc) and have found that the hardware deinterlacing support doesn't work as well compared to the i965-va-driver. Here's what I have found:

  1. If ENABLE_NONFREE_KERNELS=OFF is set, double-frame-rate deinterlacing doesn't work at all, resulting in 1080i30 content created from a 60FPS source playing jerkily at 30FPS instead of 60FPS as it did with the i965-va-driver. (The previous driver supported double-frame-rate even when the non-free features were disabled.) This is important for many news and sports broadcasts on 1080i ATSC channels.
  2. If ENABLE_NONFREE_KERNELS=ON is set, double-frame-rate deinterlacing works only sometimes and with reduced quality compared to i965-va-driver. In VLC, the frame rate is always doubled, but the video seems subjectively fuzzier than with i965-va-driver and horizontal lines seem to "shimmer" up and down. In Kodi, it seems to alternate between no frame rate doubling (resulting in 30FPS) and the degraded frame rate doubling as I saw in VLC every few seconds at random intervals.

I apologize for not including any more information with this report, but there doesn't seem to be anything relevant in the logging output from either application and I'm not sure what else would be helpful. I will certainly provide any requested information though. Thanks!

heitbaum commented 2 years ago

@MicroYY - as fyi - this has been part of the LibreELEC code base for 12 months now: https://github.com/LibreELEC/LibreELEC.tv/commit/7fc14624c61d94ad4f3e0f24dd52b80b8a2c0907 Hope to see it in the official release in the near future.

yasij commented 2 years ago

How is this marked P3, no customer usage? I'm a customer, and this is a blocker bug for me. I've been testing Jister's change for a year now. What's blocking it from being committed?

chcore commented 2 years ago

Disappointing that it's been more than than 2.5 years since this was reported, and it still has not fixed. I have been compiling with #1162 (which works great) in the mean time, but I really shouldn't have to.

FurongZhang commented 2 years ago

@chcore , ok, the author of https://github.com/intel/media-driver/pull/1162 has not worked on the patch any more(quit). We will pick up his patch and check in the code.

FurongZhang commented 2 years ago

@yasij, @chcore , may I know which customer you are and what it is for? Jister has not worked on this issue any more. We will pick up his code change and commit it.

yasij commented 2 years ago

I am a individual consumer, and I am using this to deinterlace live TV from a CableCard. In the USA, there are still a lot of 1080i TV broadcasts. Without fixing this, the intel-media-driver only does bob DI despite advertising advanced DI. Bob DI has unacceptable visual artifacts. I've been compiling with that patch for a couple of years. The Libreelec project has been compiling with it for 16 months: https://github.com/LibreELEC/LibreELEC.tv/commit/7fc14624c61d94ad4f3e0f24dd52b80b8a2c0907

chcore commented 2 years ago

@FurongZhang similar to yasij, I am an end user that views a lot of interlaced content in the form of broadcast television. I have been compiling the project with the changes in #1162 for more than a year with no issues.

FurongZhang commented 2 years ago

Thank you @yasij and @chcore . Fully understood. We are trying our best to commit, but it needs some time due to process. I will let you know once we commit. Meanwhile, since we have provided the Fix https://github.com/intel/media-driver/pull/1162, I suppose it will not block you. Our check in code is exactly same as https://github.com/intel/media-driver/pull/1162, to check in this, we need to update our tool and other things, hence, it need some time. Hope you can understand that. Thanks a lot in advance!

chcore commented 1 year ago

@FurongZhang any updates with this one?

LhGu commented 1 year ago

It is in our known issues list. https://github.com/intel/media-driver/wiki/Existing-Known-Issue-List#video-processing-forward-and-backward-reference. I will close this issue in two weeks.

yasij commented 1 year ago

Please don't close this unless you actually fix the deinterlacing issue. That known issues item misunderstands the real problem here. Currently, advanced deinterlacing doesn't work at all for end users with this driver. It regresses to Bob.

LhGu commented 1 year ago

It has been our known issue. I think there is no need to have other open issues to track this. Thanks.

eero-t commented 1 year ago

It has been our known issue. I think there is no need to have other open issues to track this. Thanks.

@LhGu While it's nice to maintain concise list / summary doc of the currently known issues, text file is a not a bug tracking tool.

That text file should be include pointers to the actual tickets here, not the other way round.

As a general rule, tickets should be closed only if either:

If the aim was to categorize bugs differently based on their type, GitHub supports labels for that: https://docs.github.com/en/issues/using-labels-and-milestones-to-track-work/managing-labels


[1] Users may be busy with other things, or e.g. on vacation, so demanding them to respond faster would be unreasonable, especially in a projects where maintainers themselves take weeks / months to respond to reported issues.

And while users verifying fixes using development version would be nice, they can be hesitant to try versions that haven't gone through release testing, as there may be some other issues in those that preventing testing of user's full use-case.

LhGu commented 1 year ago

@eero-t ok, I will just add some labels for this issue.

orryverducci commented 1 year ago

The known issues lists this as an issue with low customer impact seen mostly in internal testing, however I disagree with this.

I work for a TV broadcaster, where we have servers built with Intel GPU's (on Xeon processors) to transcode interlaced video from our playout facility (recordings of shows) to progressive clips for playback on a video on demand service. We rely on hardware acceleration (via FFmpeg) to deinterlace and encode these clips at speed.

When our software was upgraded, which also upgraded to this media driver, we immediately noticed that the transcoded clips were bobbing instead of smoothly deinterlacing as they were previously. We've had to intentionally downgrade our systems to i965-va-driver to resolve this issue.

Therefore this is an issue that is very much noticeable to customers, and has a real world impact.

smp79 commented 1 year ago

This is ridiculous. They merge all sorts of useless code almost daily but they can't fix a real issue that exists for years. They don't even bother to merge an existing PR that fixes this issue.

pasikarkkainen commented 1 year ago

@LhGu Hey! Any chance to get this finally merged? Thanks a lot.

Simon566 commented 9 months ago

ping

Simon566 commented 7 months ago

pong

chcore commented 7 months ago

@XinfengZhang @FurongZhang @LhGu any progress on this? It has been nearly 4.5 years since this was reported. If you won't merge #1162 (which works), why not devise a more suitable fix?

teeedubb commented 5 months ago

I am experiencing the second issue described by the OP on a alder lake GPU with kodi. Happy to provide more info, but I am not seeing any info in any log files relating to the issues - only visual judder of deinterlaced content. Posting here because the issue has been flagged as low impact, which is not the case for myself.

LhGu commented 5 months ago

It is in known issue list. https://github.com/intel/media-driver/wiki/Existing-Known-Issue-List#video-processing-forward-and-backward-reference

teeedubb commented 5 months ago

Are you able to provide any updates on fixes for this issue? This issue is almost 5 years old

Simon566 commented 5 months ago

The devs are able to fix it , The patch is available. But they see it as a "minor" issue, even so all satellite tv programms in HD+ transmit in interlaced ^^ . No idea whats "minor" about it.

LibreElec is patching it with the existing , non merged patch and im doing it since over a year as well.

Maybe we should fork the repo in order to get it corrected

smp79 commented 5 months ago

We should try to contact someone higher up at Intel regarding this. This is not a minor issue. Someone is obviously not doing their job.

jahutchi commented 5 months ago

We should try to contact someone higher up at Intel regarding this. This is not a minor issue. Someone is obviously not doing their job.

I whole-heartedly agree. I recently moved from LibreELEC to a pure Arch Linux installation and immediately noticed poor results in interlaced content... Took quite some time and research to stumble upon this thread after spotting that LE were patching their Intel-media-driver package. I then spent (even more) time figuring out how to patch and build my own version of the intel media driver on Arch, which did (of course) resolve the problem. How this issue has been around so long without the tried-and-tested known working patch being merged is quite beyond me. Shame on you intel!!!

chcore commented 5 months ago

I used to compile this project with #1162 for use with Kodi, but have since moved to the flatpak build. Anyone know how to apply the fix to flatpak apps? Compile a custom org.freedesktop.Platform.VAAPI.Intel? How do I even do that?

@LhGu what's the reason for not merging #1162?

LhGu commented 5 months ago

I used to compile this project with #1162 for use with Kodi, but have since moved to the flatpak build. Anyone know how to apply the fix to flatpak apps? Compile a custom org.freedesktop.Platform.VAAPI.Intel? How do I even do that?

@LhGu what's the reason for not merging #1162?

Actually, I am not the owner of this issue and fix merging does not depend on me. As I know, this fix is not enough and will cause other issues in some tests.

It is documented in intel known issue list. https://github.com/intel/media-driver/wiki/Existing-Known-Issue-List#video-processing-forward-and-backward-reference

chcore commented 5 months ago

I used to compile this project with #1162 for use with Kodi, but have since moved to the flatpak build. Anyone know how to apply the fix to flatpak apps? Compile a custom org.freedesktop.Platform.VAAPI.Intel? How do I even do that? @LhGu what's the reason for not merging #1162?

Actually, I am not the owner for this issue and fix merging is not blocked by me. As I know, this fix is not enough and will cause other issues in some tests.

OK, but it is approaching 5 years without a fix. The comments in this issue and related pull request prove that there is a real impact.

What is the blocker exactly? Are there plans for a fix at all? Can this be escalated internally? Am I eligible for a refund on my intel boxes if there are no serious plans for a fix?

Simon566 commented 5 months ago

there are always excuses and fingerpointing somewhere else, but nothing happens.

fact is that LibreElec users dont face any issue and im running Kodi on Ubuntu with latest intel-media-driver releases patched also not seeing any issues

but i do bet on that nothing will be happening again because:

if i wouldnt be affected , i would fall of my seat because im laughing so hard

teeedubb commented 5 months ago

Does anyone have any pointers on how to compile the media-driver with patch applied on ubuntu? I can compile the master branch of the media-driver on ubuntu 22.04 successfully by following the instructions in the readme, but when I apply the patches to master compilation fails. I have also tried pulling Jister's fork and ADI branch (which contains an older ersion of media-driver) and compiling, but I get the same error.

The majority of my use of an intel igpu is watching interlaced content, so a 12th gen cpu has been a downgrade compared to a gemini lake cpu.

Any help is greatly appreciated!

FurongZhang commented 5 months ago

I saw our maintainer @LhGu would not take care of this issue again. Let me continue on that. We had PR https://github.com/intel/media-driver/pull/1162 for this issue and had discussion in the PR thread.

FurongZhang commented 5 months ago

@teeedubb , sure, we will rebase Jason's PR based on the latest code.

I have requested my colleague to rebase Jason's PR. It will need 1-2 days.

teeedubb commented 4 months ago

@teeedubb , sure, we will rebase Jason's PR based on the latest code.

I have requested my colleague to rebase Jason's PR. It will need 1-2 days.

Are there any updates on the rebase?

smp79 commented 4 months ago

I'm not sure if #1162 needs the rebase. No compile errors in LibreELEC build system.

teeedubb commented 4 months ago

I get a compile error with the patch applied, without the patch media-driver compiles successfully. I have tried on ubuntu 22.04 and 24.04 on multiple machines and get the same. I use master branch and compile libva and gmmlib as per the included instructions. Steps I follow for applying the patch + compiling and error I get are below.

cd ~/Downloads/software_source/intel-media-driver git clone https://github.com/intel/media-driver.git mkdir build_media cd media-driver git fetch origin pull/1162/head:vd git switch vd cd ../build_media/ cmake ../media-driver make -j"$(nproc)"

[ 12%] Building CXX object media_driver/CMakeFiles/iHD_drv_video_OBJ.dir/agnostic/common/codec/hal/codechal_encode_sfc_base.cpp.o /home/blaster/Downloads/software_source/intel-media-driver/media-driver/media_driver/agnostic/common/codec/hal/codechal_encode_sfc_base.cpp: In member function 'void CodecHalEncodeSfcBase::GetCscMatrix(MHW_CSPACE, MHW_CSPACE, float, float, float)': /home/blaster/Downloads/software_source/intel-media-driver/media-driver/media_driver/agnostic/common/codec/hal/codechal_encode_sfc_base.cpp:371:25: error: 'cscMatrix' may be used uninitialized [-Werror=maybe-uninitialized] 371 | MOS_SecureMemcpy( | ~~~~^ 372 | &cscCoeff[i3], | ~~~ 373 | sizeof(float) 3, | ~~~~~~ 374 | &cscMatrix[i4], | ~~~~ 375 | sizeof(float) 3); | ~~~~~~ In file included from /home/blaster/Downloads/software_source/intel-media-driver/media-driver/media_driver/agnostic/common/os/mos_os.h:32, from /home/blaster/Downloads/software_source/intel-media-driver/media-driver/media_driver/agnostic/common/codec/hal/codechal.h:29, from /home/blaster/Downloads/software_source/intel-media-driver/media-driver/media_driver/agnostic/common/codec/hal/codechal_encode_sfc_base.h:31, from /home/blaster/Downloads/software_source/intel-media-driver/media-driver/media_driver/agnostic/common/codec/hal/codechal_encode_sfc_base.cpp:28: /home/blaster/Downloads/software_source/intel-media-driver/media-driver/media_driver/agnostic/common/os/mos_utilities.h:1200:12: note: by argument 3 of type 'const void' to 'MOS_STATUS MOS_SecureMemcpy(void, size_t, const void, size_t)' declared here 1200 | MOS_STATUS MOS_SecureMemcpy( | ^~~~ /home/blaster/Downloads/software_source/intel-media-driver/media-driver/media_driver/agnostic/common/codec/hal/codechal_encode_sfc_base.cpp:360:13: note: 'cscMatrix' declared here 360 | float cscMatrix[12]; | ^~~~~ cc1plus: all warnings being treated as errors make[2]: [media_driver/CMakeFiles/iHD_drv_video_OBJ.dir/build.make:1280: media_driver/CMakeFiles/iHD_drv_video_OBJ.dir/agnostic/common/codec/hal/codechal_encode_sfc_base.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:286: media_driver/CMakeFiles/iHD_drv_video_OBJ.dir/all] Error 2 make: *** [Makefile:156: all] Error 2

GCC version info from ubuntu 22.04:

Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.4.0-1ubuntu1~22.04' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-11-XeT9lY/gcc-11-11.4.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-XeT9lY/gcc-11-11.4.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)

I did search the cscMatrix error and found this, tried what it mentions, but it did not work.

This is all above my head unfortunately. If anyone has any pointers on how to compile I would really appreciate it.

mamarley commented 2 months ago

The patch for this bug seems to have been applied in https://github.com/intel/media-driver/commit/8017d9c9246ce1960e5beb7d2db040935a246272!

FurongZhang commented 2 months ago

Yes. This issue is resolved by the patch https://github.com/intel/media-driver/commit/8017d9c9246ce1960e5beb7d2db040935a246272.