You are not logged in.

#1 2020-09-24 22:03:23

cemi
Member
Registered: 2020-09-05
Posts: 18

Firefox VA-API and Youtube Crash

Replacing intel-media-driver with libva-intel-driver results in worse performance. As of today, anything above 360p gives an error.
Followed Hardware acceleration steps relevant to my hardware / setup in the wiki, not sure what else to do.

Early KMS for intel: Without this GDM fails to load Wayland sessions.
Wayland + Gnome 3.38.1
Affects Firefox-Nightly 82, 83, and now 84.
Intel UHD 620 + intel-media-driver

Enabled VA-API by changing these values:

  • gfx.webrender.all = true

  • media.ffvpx.enabled = false

  • media.ffmpeg.vaapi.enabled = true

  • media.hardware-video-decoding.enabled = true (Default)

  • media.hardware-video-decoding.force-enabled = true

The "force" flag, simply forces FF to try and fail indefinitely, otherwise youtube will output "An error occurred. Please try again later. (Playback ID: )".

vainfo

vainfo: VA-API version: 1.9 (libva 2.9.1)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 20.2.0 ()
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

"MOZ_LOG="PlatformDecoderModule:5" firefox-nightly" while playing a 4K 60fps youtube video in fullscreen:

[Child 18594: MediaPDecoder #3]: D/PlatformDecoderModule DMABufSurfaceWrapper: VAAPI locking dmabuf surface UID = 67
[Child 18594: MediaPDecoder #4]: D/PlatformDecoderModule AudioTrimmer[0x6eb35e846480] ::Decode: sample[4621000,4641000] no trimming information
[vp9 @ 0x6eb36120b800] get_buffer() failed
[vp9 @ 0x6eb36120b800] thread_get_buffer() failed
[Child 18594: MediaPDecoder #2]: D/PlatformDecoderModule avcodec_send_packet error: -12
[Child 18594, MediaDecoderStateMachine #1] WARNING: Decoder=6eb36080c400 Decode error: NS_ERROR_DOM_MEDIA_DECODE_ERR (0x806e0004) - virtual mozilla::MediaResult mozilla::FFmpegVideoDecoder<58>::DoDecode(mozilla::MediaRawData *, uint8_t *, int, bool *, MediaDataDecoder::DecodedData &): avcodec_send_packet error: -12: file /builds/worker/checkouts/gecko/dom/media/MediaDecoderStateMachine.cpp, line 3471
[Child 18594: MediaPDecoder #3]: D/PlatformDecoderModule AudioTrimmer[0x6eb35e846480] ::HandleDecodedResult: sample[4621000,4641000] (decoded[4614500,4634500] no trimming needed
[Child 18594, MediaDecoderStateMachine #1] WARNING: Decoder=6eb36080c400 Decode error: NS_ERROR_DOM_MEDIA_DECODE_ERR (0x806e0004) - virtual mozilla::MediaResult mozilla::FFmpegVideoDecoder<58>::DoDecode(mozilla::MediaRawData *, uint8_t *, int, bool *, MediaDataDecoder::DecodedData &): avcodec_send_packet error: -12: file /builds/worker/checkouts/gecko/dom/media/MediaDecoderStateMachine.cpp, line 3471
[Child 18594, MediaDecoderStateMachine #1] WARNING: Decoder=6eb36080c400 Decode error: NS_ERROR_DOM_MEDIA_DECODE_ERR (0x806e0004) - virtual mozilla::MediaResult mozilla::FFmpegVideoDecoder<58>::DoDecode(mozilla::MediaRawData *, uint8_t *, int, bool *, MediaDataDecoder::DecodedData &): avcodec_send_packet error: -12: file /builds/worker/checkouts/gecko/dom/media/MediaDecoderStateMachine.cpp, line 3471
[Child 18594, MediaDecoderStateMachine #1] WARNING: Decoder=6eb36080c400 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - RefPtr<MediaSourceTrackDemuxer::SamplesPromise> mozilla::MediaSourceTrackDemuxer::DoGetSamples(int32_t): manager is detached.: file /builds/worker/checkouts/gecko/dom/media/MediaDecoderStateMachine.cpp, line 3471
[Child 18594, MediaDecoderStateMachine #1] WARNING: Decoder=6eb36080c400 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - RefPtr<MediaSourceTrackDemuxer::SamplesPromise> mozilla::MediaSourceTrackDemuxer::DoGetSamples(int32_t): manager is detached.: file /builds/worker/checkouts/gecko/dom/media/MediaDecoderStateMachine.cpp, line 3471

intel_gpu_top while playing a 4K 60fps youtube video in fullscreen:

intel-gpu-top - 1068/1070 MHz;    7% RC6; 10.30 Watts;      740 irqs/s

      IMC reads:     9814 MiB/s
     IMC writes:     7036 MiB/s

          ENGINE      BUSY                                      MI_SEMA MI_WAIT
     Render/3D/0   69.31% |████████████████████████▎          |      0%      0%
       Blitter/0    0.00% |                                   |      0%      0%
         Video/0   34.96% |████████████▏                      |      0%      0%
  VideoEnhance/0    0.00% |                                   |      0%      0%

Last edited by cemi (2020-11-16 02:10:20)

Offline

#2 2020-09-25 06:03:48

CarbonChauvinist
Member
Registered: 2012-06-16
Posts: 412
Website

Re: Firefox VA-API and Youtube Crash

Tmk only the i965 driver is "officially" supported. Have you tried that instead?

Intel graphics card
There are two drivers for Intel cards, libva-intel-driver (provides i965_drv_video.so) and libva-intel-hybrid-driver (iHD_drv_video.so). Firefox works with libva-intel-driver only, intel-media-driver is broken due to sandboxing issues (Bug 1619585). I strongly recommend to avoid it all cost and don’t disable media sandbox for it.


"the wind-blown way, wanna win? don't play"

Offline

#3 2020-09-25 09:47:36

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: Firefox VA-API and Youtube Crash

@CarbonChauvinist

https://www.google.com/amp/s/mastransky.wordpress.com/2020/06/03/firefox-on-fedora-finally-gets-va-api-on-wayland/amp/

Please don't post google amp links, here's the correct url :
https://mastransky.wordpress.com/2020/0 … n-wayland/

@cemi,
are you using wayland or X ?
Does firefox 82 have the problem also ?

Last edited by Lone_Wolf (2020-09-25 09:48:23)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#4 2020-09-26 05:45:37

cemi
Member
Registered: 2020-09-05
Posts: 18

Re: Firefox VA-API and Youtube Crash

Lone_Wolf wrote:

@CarbonChauvinist

https://www.google.com/amp/s/mastransky.wordpress.com/2020/06/03/firefox-on-fedora-finally-gets-va-api-on-wayland/amp/

Please don't post google amp links, here's the correct url :
https://mastransky.wordpress.com/2020/0 … n-wayland/

@cemi,
are you using wayland or X ?
Does firefox 82 have the problem also ?

Ha! Something always slips. big_smile

I am running Wayland + Gnome. Confirmed present in 82 before upgrading to 83. Tested on new firefox profiles before and after.

Offline

#5 2020-09-26 06:47:39

cemi
Member
Registered: 2020-09-05
Posts: 18

Re: Firefox VA-API and Youtube Crash

CarbonChauvinist wrote:

Tmk only the i965 driver is "officially" supported. Have you tried that instead?

Intel graphics card
There are two drivers for Intel cards, libva-intel-driver (provides i965_drv_video.so) and libva-intel-hybrid-driver (iHD_drv_video.so). Firefox works with libva-intel-driver only, intel-media-driver is broken due to sandboxing issues (Bug 1619585). I strongly recommend to avoid it all cost and don’t disable media sandbox for it.

I've become lost sad . The Wiki tells me Broadwell and newer are supported by intel-media-driver; libva-intel-driver is for older iGPU's.

Please help me understand. hmm

Last edited by cemi (2020-09-26 06:48:38)

Offline

#6 2020-09-26 08:17:09

digitalone
Member
Registered: 2011-08-19
Posts: 328

Re: Firefox VA-API and Youtube Crash

I didn't test with Nightly 83, but with 82 on my system layers.acceleration.force-enabled is set to true (false default) and media.ffvpx.enabled left to default true. Hardware decoding is working.

Edit:
Upgraded and tested on 83 also, it's working the same, even on Twitch which is heavier than Youtube on CPU. I have a Radeon card, maybe it's an Intel driver issue.

Last edited by digitalone (2020-09-26 08:25:44)

Offline

#7 2020-09-26 10:41:01

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: Firefox VA-API and Youtube Crash

VA-API support in applications is tied to specific drivers .

Firefox (for now)  only supports VAAPI with the libva-intel-driver on intel videoards.
People with intel gpu using intel-media-driver don't get VAAPI hw accerlation on firefox.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#8 2020-09-26 11:51:33

bjo
Member
Registered: 2011-09-10
Posts: 80

Re: Firefox VA-API and Youtube Crash

Lone_Wolf wrote:

VA-API support in applications is tied to specific drivers .

Firefox (for now)  only supports VAAPI with the libva-intel-driver on intel videoards.

Do you imply that e.g. amdgpu is unsupported?

Offline

#9 2020-09-26 15:04:34

CarbonChauvinist
Member
Registered: 2012-06-16
Posts: 412
Website

Re: Firefox VA-API and Youtube Crash

I also use iHD driver and gnome/wayland (but NOT firefox-nightly). What appears to work for me, even when using the nightly builds, was to create a custom firefox.desktop that changed the va driver just for firefox. Something like this perhaps?

~ $ vainfo
vainfo: VA-API version: 1.9 (libva 2.9.1)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 20.2.0 ()
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
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointFEI

~ $ rg ^Exec= .local/share/applications/firefox.desktop 
115:Exec=env LIBVA_DRIVER_NAME=i965 /usr/lib/firefox/firefox %u
232:Exec=env LIBVA_DRIVER_NAME=i965 /usr/lib/firefox/firefox --new-window %u
340:Exec=env LIBVA_DRIVER_NAME=i965 /usr/lib/firefox/firefox --private-window %u

~ $ pacman -Q | rg 'libva|intel-media|firefox'
firefox 81.0-2
firefox-sync 20180623-1
intel-media-driver 20.2.0-1
libva 2.9.0-1
libva-intel-driver 2.4.1-1
libva-utils 2.9.1-1
Lone_Wolf wrote:

People with intel gpu using intel-media-driver don't get VAAPI hw accerlation on firefox.

They do, or might, at least I did when using Nightly and intel-media; it can be just nigh unusable, for e.g. I was plagued with flashing green screens and other playback issues (sometimes stopped mid playing etc.)

Last edited by CarbonChauvinist (2020-09-26 16:00:39)


"the wind-blown way, wanna win? don't play"

Offline

#10 2020-09-27 08:08:58

cemi
Member
Registered: 2020-09-05
Posts: 18

Re: Firefox VA-API and Youtube Crash

digitalone wrote:

I didn't test with Nightly 83, but with 82 on my system layers.acceleration.force-enabled is set to true (false default) and media.ffvpx.enabled left to default true. Hardware decoding is working.

Edit:
Upgraded and tested on 83 also, it's working the same, even on Twitch which is heavier than Youtube on CPU. I have a Radeon card, maybe it's an Intel driver issue.

Definitely Intel-specific as I have just restored media.ffvpx.enabled to its default value and layers.acceleration.force-enabled to true, still fails exactly the same way as before.

Something is very wrong, firefox is struggling doing 1080p @ 60fps on an 8th gen i7 8650 with 16GB ram. Cursor hangs on log-in and briefly after arriving at GDM.

Offline

#11 2020-09-27 08:12:20

cemi
Member
Registered: 2020-09-05
Posts: 18

Re: Firefox VA-API and Youtube Crash

Lone_Wolf wrote:

VA-API support in applications is tied to specific drivers .

Firefox (for now)  only supports VAAPI with the libva-intel-driver on intel videoards.
People with intel gpu using intel-media-driver don't get VAAPI hw accerlation on firefox.

Just got done swapping intel-media-driver with libva-intel-driver, rebooting, and starting firefox with a new profile (all values set post-changes). Nada, it crashes faster where intel-media-driver would make FF sweat for at least few seconds.

Offline

#12 2020-09-27 10:00:12

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: Firefox VA-API and Youtube Crash

bjo wrote:
Lone_Wolf wrote:

VA-API support in applications is tied to specific drivers .

Firefox (for now)  only supports VAAPI with the libva-intel-driver on intel videoards.

Do you imply that e.g. amdgpu is unsupported?

Nope, did you overlook the on intel videocards part ?



cemi wrote:

Just got done swapping intel-media-driver with libva-intel-driver, rebooting, and starting firefox with a new profile (all values set post-changes). Nada, it crashes faster where intel-media-driver would make FF sweat for at least few seconds.

Revert changes and setup VA-API for your hardware as described on https://wiki.archlinux.org/index.php/Ha … tion#Intel .

Once you verified VAAPI support is working correctly, goto https://wiki.archlinux.org/index.php/Fi … celeration .
Thoroughly check the whole section , especially the green colored tip box.

Last edited by Lone_Wolf (2020-09-27 10:06:54)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#13 2020-09-28 05:17:41

cemi
Member
Registered: 2020-09-05
Posts: 18

Re: Firefox VA-API and Youtube Crash

Lone_Wolf wrote:
bjo wrote:
Lone_Wolf wrote:

VA-API support in applications is tied to specific drivers .

Firefox (for now)  only supports VAAPI with the libva-intel-driver on intel videoards.

Do you imply that e.g. amdgpu is unsupported?

Nope, did you overlook the on intel videocards part ?



cemi wrote:

Just got done swapping intel-media-driver with libva-intel-driver, rebooting, and starting firefox with a new profile (all values set post-changes). Nada, it crashes faster where intel-media-driver would make FF sweat for at least few seconds.

Revert changes and setup VA-API for your hardware as described on https://wiki.archlinux.org/index.php/Ha … tion#Intel .

Once you verified VAAPI support is working correctly, goto https://wiki.archlinux.org/index.php/Fi … celeration .
Thoroughly check the whole section , especially the green colored tip box.

Coincides with every step taken to replicate my issue(s). Replacing intel-media-driver with libva-intel-driver has no positive effect, almost the contrary.

I did: MOZ_LOG="PlatformDecoderModule:5" LIBVA_DRIVER_NAME=i965 firefox-nightly

Offline

#14 2020-11-16 10:53:44

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: Firefox VA-API and Youtube Crash

Moving to Applications & Desktop Environments at OP's request.

Offline

Board footer

Powered by FluxBB