Closed Bug 1771555 Opened 2 years ago Closed 2 years ago

VAAPI Hardware video decoding not working at all on intel iHD

Categories

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

Firefox 100
x86_64
Linux
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: hier-bei-mir, Unassigned)

References

(Blocks 1 open bug)

Details

nearly similar bug to https://bugzilla.mozilla.org/show_bug.cgi?id=1763301 but also appears with MOZ_DISABLE_RDD_SANDBOX=1 running on Ubuntu 22.04 wayland (tried both: firefox snap package and mozillateam ppa deb package)

vainfo:

libva info: VA-API version 1.14.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.14 (libva 2.12.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 22.3.1 ()
vainfo: Supported profile and entrypoints
      VAProfileNone                   :	VAEntrypointVideoProc
      VAProfileNone                   :	VAEntrypointStats
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Simple            :	VAEntrypointEncSlice
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointFEI
      VAProfileH264Main               :	VAEntrypointEncSliceLP
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointFEI
      VAProfileH264High               :	VAEntrypointEncSliceLP
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointFEI
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          :	VAEntrypointVLD
      VAProfileVP8Version0_3          :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointFEI
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileHEVCMain10             :	VAEntrypointEncSlice
      VAProfileVP9Profile0            :	VAEntrypointVLD
      VAProfileVP9Profile2            :	VAEntrypointVLD

running MOZ_ENABLE_WAYLAND=1 MOZ_LOG=ObserverService:5 MOZ_DISABLE_RDD_SANDBOX=1 firefox and heading to youtube opening a video gives:

Child 53897: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 53897: MediaPDecoder #4]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[RDD 54045: MediaSupervisor #1]: D/PlatformDecoderModule FFMPEG: FFmpegVideoDecoder::FFmpegVideoDecoder MIME video/vp9 Codec ID 167
[RDD 54045: MediaSupervisor #1]: D/PlatformDecoderModule FFMPEG: VA-API is disabled by preference.
[Child 53897: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[RDD 54045: MediaPDecoder #2]: D/PlatformDecoderModule FFMPEG: Initialising FFmpeg decoder
[RDD 54045: MediaPDecoder #2]: D/PlatformDecoderModule FFMPEG:   codec vp9 : Google VP9
[RDD 54045: MediaPDecoder #2]: D/PlatformDecoderModule FFMPEG: Set get_buffer2 for customized buffer allocation
[vp9 @ 0x7f7551c65200] Requested frame threading with a custom get_buffer2() implementation which is not marked as thread safe. This is not supported anymore, make your callback thread-safe.
[RDD 54045: MediaPDecoder #2]: D/PlatformDecoderModule FFMPEG:   FFmpeg decoder init successful.
[Child 53897: MediaPDecoder #1]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[RDD 54045: MediaSupervisor #1]: D/PlatformDecoderModule FFMPEG: FFmpegVideoDecoder::FFmpegVideoDecoder MIME video/vp9 Codec ID 167
[RDD 54045: MediaSupervisor #1]: D/PlatformDecoderModule FFMPEG: VA-API is disabled by preference.
[RDD 54045: MediaPDecoder #1]: D/PlatformDecoderModule FFMPEG: Initialising FFmpeg decoder
[RDD 54045: MediaPDecoder #1]: D/PlatformDecoderModule FFMPEG:   codec vp9 : Google VP9
[RDD 54045: MediaPDecoder #1]: D/PlatformDecoderModule FFMPEG: Set get_buffer2 for customized buffer allocation
[vp9 @ 0x7f7551c65200] Requested frame threading with a custom get_buffer2() implementation which is not marked as thread safe. This is not supported anymore, make your callback thread-safe.
[RDD 54045: MediaPDecoder #1]: D/PlatformDecoderModule FFMPEG:   FFmpeg decoder init successful.

intel_gpu_top shows no activity on the video bar. I guess [RDD 54045: MediaSupervisor #1]: D/PlatformDecoderModule FFMPEG: VA-API is disabled by preference. is the culprit.

Why is firefox telling this? (And why doesn't it state which preference to blame)

In config I do have set:

media.ffmpeg.vaapi.enabled = true
media.ffvpx.enabled = false.
media.rdd-vpx.enabled = false.
media.navigator.mediadatadecoder_vpx_enabled = true

The Bugbug bot thinks this bug should belong to the 'Core::Audio/Video: Playback' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core

The severity field is not set for this bug.
:jimm, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jmathies)
Severity: -- → S3
Flags: needinfo?(jmathies)
Priority: -- → P3

(In reply to Martin from comment #0)

Why is firefox telling this? (And why doesn't it state which preference to blame)

Does this problem still occur? If yes, please open about:support, click on "Copy raw data to clipboard" and paste it here.

No, in deed now it is working :-) (Btw. it is of course not MOZ_LOG=ObserverService:5 but MOZ_LOG=PlatformDecoderModule:5)
Running MOZ_ENABLE_WAYLAND=1 MOZ_LOG=ObserverService:5 MOZ_DISABLE_RDD_SANDBOX=1 firefox in Firefox 103.0.2 gives now:

[Child 28659: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 28659: MediaPDecoder #4]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 28659: MediaPDecoder #4]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[RDD 28769: MediaSupervisor #1]: D/PlatformDecoderModule FFmpeg decoder supports requested type 'video/vp9'
[RDD 28769: MediaSupervisor #1]: D/PlatformDecoderModule FFmpeg decoder supports requested type 'video/vp9'
[RDD 28769: MediaSupervisor #1]: D/PlatformDecoderModule FFMPEG: FFmpegVideoDecoder::FFmpegVideoDecoder MIME video/vp9 Codec ID 167
[RDD 28769: MediaPDecoder #1]: D/PlatformDecoderModule FFMPEG: Initialising VA-API FFmpeg decoder
[RDD 28769: MediaPDecoder #1]: D/PlatformDecoderModule FFMPEG:   Format vp9 is accelerated
[RDD 28769: MediaPDecoder #1]: D/PlatformDecoderModule FFMPEG:   codec vp9 : Google VP9
libva info: VA-API version 1.14.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x41524742 -> bgra.
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x42475241 -> argb.
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x41424752 -> rgba.
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x52474241 -> abgr.
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x58524742 -> bgr0.
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x42475258 -> 0rgb.
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x58424752 -> rgb0.
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x52474258 -> 0bgr.
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x30335241 -> unknown.
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x30334241 -> unknown.
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x30335258 -> x2rgb10le.
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x30334258 -> unknown.
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x36314752 -> unknown.
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x50424752 -> unknown.
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x50524742 -> unknown.
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x56555941 -> unknown.
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x30303859 -> gray.
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x3231564e -> nv12.
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x3132564e -> unknown.
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x32595559 -> yuyv422.
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x59565955 -> uyvy422.
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x32315659 -> yuv420p.
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x30323449 -> yuv420p.
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x50313134 -> yuv411p.
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x48323234 -> yuv422p.
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x56323234 -> yuv440p.
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x50343434 -> yuv444p.
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x33434d49 -> unknown.
[AVHWDeviceContext @ 0x7f022d16d800] Format 0x30313050 -> p010le.
[AVHWDeviceContext @ 0x7f022d16d800] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 22.3.1 ().
[AVHWDeviceContext @ 0x7f022d16d800] Driver not found in known nonstandard list, using standard behaviour.
[RDD 28769: MediaPDecoder #1]: D/PlatformDecoderModule FFMPEG:   VA-API FFmpeg init successful

Thanks alot!

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → WORKSFORME

@Martin just FYI MOZ_DISABLE_RDD_SANDBOX shouldn't be necessary any more, neither are media.ffvpx.enabled = false and media.rdd-vpx.enabled = false :)

Thanks alot :-)
Though, I have upgraded ffmpeg to version 5 via ppa to also get av1 hw decoding support. This again stopped va-api decoding and I am again getting
FFMPEG: VA-API is disabled by preference. again (tried with all the settings as in OP) even for vp9 videos. So only with ffmp4 it is currently working.

Weird - AV1 works on my AMD box here, both on 103 and nightly. And there have been a couple of patches that should make sure both ffmpeg 4 and 5 are supported. Could you try nightly? It should work just out of the box.

Yep, I can confirm that firefox nightly (105.0a1) works fine with ffmpeg5 and unmodified about:config. I can confirm that for vp9, for av1 I had to figure out that my iHD is not supporting it (10th gen Intel CPU).

You need to log in before you can comment on or make changes to this bug.