Flatpak regression: VAAPI doesn't work on Youtube
Categories
(Core :: Audio/Video: Playback, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr91 | --- | disabled |
People
(Reporter: bumjrah, Unassigned)
References
(Blocks 2 open bugs)
Details
(Keywords: regression)
Attachments
(7 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.0.0 Safari/537.36
Steps to reproduce:
Play any video from youtube.com with enhanced-h264ify addon and AV1 codec blocked
Actual results:
No hw video. Checked against following command in terminal "sudo intel_gpu_top". Video section displays no activity.
Expected results:
Hardware acceleration should work as confirmed by activity on video section on command "sudo intel_gpu_top" in terminal.
Test video from (https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/1080/Big_Buck_Bunny_1080_10s_20MB.mp4) outputs video activity on above command.
Check attached text file with Firefox version and env, vainfo and MOZ_LOG report
My bad. Actually this appears not to be Youtube problem, but a VP9 hardware acceleration issue.
This test video exhibits the same issue described (https://test-videos.co.uk/vids/bigbuckbunny/webm/vp9/1080/Big_Buck_Bunny_1080_10s_20MB.webm)
Comment 2•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Audio/Video: Playback' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Comment 3•3 years ago
|
||
(In reply to bujram from comment #1)
My bad. Actually this appears not to be Youtube problem, but a VP9 hardware acceleration issue.
This test video exhibits the same issue described (https://test-videos.co.uk/vids/bigbuckbunny/webm/vp9/1080/Big_Buck_Bunny_1080_10s_20MB.webm)
If so, has this issue started only recently (implying a possible regression in Firefox) or has this always been the case for you with Firefox on this system?
Does that test video get hardware accelerated when viewed in other browsers?
To rule out any add-ons causing this, can you see if the behavior is the same in troubleshooting mode: https://support.mozilla.org/en-US/kb/diagnose-firefox-issues-using-troubleshoot-mode ?
Also, if you can attach the output of about:support
so we know more about your system, that would be helpful.
Pardon me for double posting and messing the format. Attached is the full about:support.
If so, has this issue started only recently (implying a possible regression in Firefox) or has this always been the case for you with Firefox on this system?
This behavior is indeed a regression. Started noticing it maybe a little over a month ago.
Does that test video get hardware accelerated when viewed in other browsers?
Yes. Tested with Gnome-web and HW video for vp9 & mp4 works.
To rule out any add-ons causing this, can you see if the behavior is the same in troubleshooting mode: https://support.mozilla.org/en-US/kb/diagnose-firefox-issues-using-troubleshoot-mode ?
This makes no difference in behavior.
Comment 8•3 years ago
|
||
If so, has this issue started only recently (implying a possible regression in Firefox) or has this always been the case for you with Firefox on this system?
This behavior is indeed a regression. Started noticing it maybe a little over a month ago.
Can you please run https://mozilla.github.io/mozregression/ so we can narrow down exactly when this regressed?
(In reply to Jon Bauman [:jbauman:] from comment #8)
If so, has this issue started only recently (implying a possible regression in Firefox) or has this always been the case for you with Firefox on this system?
This behavior is indeed a regression. Started noticing it maybe a little over a month ago.
Can you please run https://mozilla.github.io/mozregression/ so we can narrow down exactly when this regressed?
Yeah I don't exactly like how this program works after seeing the video tutorial. Tried to install it but couldn't get the mozregression-bin package to run on my distribution.
If this bug isn't reproducible on another environment, it should just be easier for me to block vp9 video as hw mp4 video serves my need anyways.
Updated•3 years ago
|
Comment 10•3 years ago
|
||
If there is a regression, you can get narrow it down with these commands:
$ pip3 install --upgrade mozregression
$ MOZ_ENABLE_WAYLAND=1 mozregression --good 2021-05-30 --bad 2021-07-30 --pref gfx.webrender.all:true media.ffmpeg.vaapi.enabled:true media.rdd-ffvpx.enabled:false media.rdd-vpx.enabled:false -a https://upload.wikimedia.org/wikipedia/commons/transcoded/a/a7/View_of_Planet_Earth_%284K%29.webm/View_of_Planet_Earth_%284K%29.webm.1440p.vp9.webm
Reporter | ||
Comment 11•3 years ago
|
||
(In reply to Darkspirit from comment #10)
If there is a regression, you can get narrow it down with these commands:
$ pip3 install --upgrade mozregression
$ MOZ_ENABLE_WAYLAND=1 mozregression --good 2021-05-30 --bad 2021-07-30 --pref gfx.webrender.all:true media.ffmpeg.vaapi.enabled:true media.rdd-ffvpx.enabled:false media.rdd-vpx.enabled:false -a https://upload.wikimedia.org/wikipedia/commons/transcoded/a/a7/View_of_Planet_Earth_%284K%29.webm/View_of_Planet_Earth_%284K%29.webm.1440p.vp9.webm
Thank you. You just made me realize this issue is limited only to flatpak version of Firefox. At least from my observation. Running the mozregression tool using the above command shows vp9 video hardware decoding as expected. I tested h264 with no problems too. So, I guess less of an issue here but more for flatpak builds. Where is the correct place to make some noise about this?
Comment 12•3 years ago
|
||
Would these commands help?
$ flatpak install org.freedesktop.Platform.ffmpeg-full
$ flatpak install org.freedesktop.Platform.VAAPI.Intel
Reporter | ||
Comment 13•3 years ago
|
||
(In reply to Darkspirit from comment #12)
Would these commands help?
$ flatpak install org.freedesktop.Platform.ffmpeg-full
$ flatpak install org.freedesktop.Platform.VAAPI.Intel
Thank you but I have these two already installed.
Updated•3 years ago
|
Comment 14•3 years ago
|
||
Here are the things we changed about Flatpak recently:
https://hg.mozilla.org/mozilla-central/log/tip/taskcluster/docker/firefox-flatpak/runme.sh
Comment 15•3 years ago
|
||
Martin:
Is there anyone that has an idea on this?
Comment 16•3 years ago
|
||
Please run on terminal as:
MOZ_LOG="PlatformDecoderModule:5" flatpak run org.mozilla.firefox > log.txt 2>&1
try to play the video by va-api and attach the log here.
Thanks.
Reporter | ||
Comment 18•3 years ago
|
||
vp9 playback log
Reporter | ||
Comment 19•3 years ago
|
||
Also noticing this recent development in ENV values - "FEATURE_FAILURE_GLXTEST_FAILED"
Comment 20•3 years ago
|
||
Please attach the logs again, seems to be broken. Thanks.
Reporter | ||
Comment 21•3 years ago
|
||
Reporter | ||
Comment 22•3 years ago
|
||
My bad. Drag n drop is apparently not plug-n-play ready
Comment 23•3 years ago
|
||
From the log it looks ok. h264 is decoded by ffmpeg/h264 (although I don't understand why there's more than one video initialization?) and VP8/9 seems to be blocked by RDD sandbox (Bug 1683808).
Reporter | ||
Comment 24•3 years ago
|
||
(In reply to Martin Stránský [:stransky] (ni? me) from comment #23)
From the log it looks ok. h264 is decoded by ffmpeg/h264 (although I don't understand why there's more than one video initialization?) and VP8/9 seems to be blocked by RDD sandbox (Bug 1683808).
Thanks. However am able to hw decode vp9 with the regular non-flatpak Firefox nightly. This flatpak version puzzles me.
Comment 25•3 years ago
|
||
(In reply to bujram from comment #24)
(In reply to Martin Stránský [:stransky] (ni? me) from comment #23)
From the log it looks ok. h264 is decoded by ffmpeg/h264 (although I don't understand why there's more than one video initialization?) and VP8/9 seems to be blocked by RDD sandbox (Bug 1683808).
Thanks. However am able to hw decode vp9 with the regular non-flatpak Firefox nightly. This flatpak version puzzles me.
You might disable ffvpx in the profile and use ffmpeg to decode vp8/9 - In such case vaapi can be used. You need to set media.ffvpx.enabled to false at about:config to do all video decoding by ffmpeg.
Comment 26•3 years ago
|
||
There doesn't appear to be any reason for this report to be security-sensitive.
Comment 27•3 years ago
|
||
bujram, in version 94 we updated the freedesktop sdk to 21.04 and should thus have more up to date mesa, libva etc. Does the issue still persist for you?
Reporter | ||
Comment 28•3 years ago
|
||
Yes, same anomaly is consistent with version 94.0.2.
Comment 29•3 years ago
|
||
This only affects VP9, correct? Are you sure that this is a flatpack issue? Because IIRC VP9 hardware decoding should only be fixed in Firefox 96 (bug 1698778). Can you give nightly a go and see if things work for you there (or, in a couple of days after the next release, the Flatpak beta 96)?
Reporter | ||
Comment 30•3 years ago
|
||
Correct, only the flatpak version exhibits this behavior. Last time I tested standard distro package (as reported above), hw decoding vp9 was not an issue. There doesn't appear to be a testing branch for Flatpak, the only one I could find (the unofficial one) from here https://wiki.mozilla.org/Nightly seems unmaintained. I can wait to when v.96 comes to stable and do the same test for vp9 but it doesn't bother me as much as I have gotten used to disabling the codec on Youtube using enhanced-h264ify addon. If it means anything, am able to get hw video working with latest version of ungoogled-chromium (flatpak) which is compiled with vaapi patch.
Comment 31•3 years ago
|
||
You can get the beta from flathub-beta: flatpak remote-add flathub-beta https://flathub.org/beta-repo/flathub-beta.flatpakrepo
.
Updated•3 years ago
|
Reporter | ||
Comment 32•3 years ago
|
||
(In reply to Robert Mader [:rmader] from comment #31)
You can get the beta from flathub-beta:
flatpak remote-add flathub-beta https://flathub.org/beta-repo/flathub-beta.flatpakrepo
.
Current version of beta is at 95.0b12.
Comment 33•3 years ago
|
||
On 96.0.1 from Flathub, VAAPI decode acceleration works with VP9 youtube video. Confirmed with intel_gpu_top.
Set media.ffmpeg.vaapi.enabled and media.rdd-ffmpeg.enabled to true, and media.av1.enabled to false. Only the first option was strictly necessary.
On Intel, Fedora Silverblue 35.
Comment 34•3 years ago
|
||
Thanks for the confirmation.
Comment 35•3 years ago
|
||
Hardware acceleration for VP9 (I tested with Youtube) still doesn't work on my Radeon RX 6600 XT. I have Firefox 96.0.2 from Flatpak and Mesa 21.3.4. With h264 all works fine. I tried different settings at 'about:config' like a 'media.rdd-ffmpeg.enabled', 'media.av1.enabled' etc. but nothing helped. Log looks like this:
Gtk-Message: 09:08:26.975: Failed to load module "canberra-gtk-module"
Gtk-Message: 09:08:26.975: Failed to load module "canberra-gtk-module"
ATTENTION: default value of option mesa_glthread overridden by environment.
... [a lot of lines like above]
ATTENTION: default value of option mesa_glthread overridden by environment.
[Child 279: Main Thread]: D/PlatformDecoderModule PDMInitializer, Init PDMs in Content process
ATTENTION: default value of option mesa_glthread overridden by environment.
[Child 279: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
... [a lot of lines like above]
[Child 279: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[RDD 380: Main Thread]: D/PlatformDecoderModule PDMInitializer, Init PDMs in RDD process
[Child 279: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 279: MediaPDecoder #1]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 279: MediaSupervisor #1]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
ATTENTION: default value of option mesa_glthread overridden by environment.
[RDD 380: Main Thread]: D/PlatformDecoderModule Agnostic decoder rejects requested type
[RDD 380: Main Thread]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 380: Main Thread]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 380: Main Thread]: D/PlatformDecoderModule Agnostic decoder rejects requested type
[RDD 380: Main Thread]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 380: Main Thread]: D/PlatformDecoderModule Agnostic decoder rejects requested type
[RDD 380: Main Thread]: D/PlatformDecoderModule Agnostic decoder rejects requested type
[RDD 380: Main Thread]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 380: Main Thread]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 380: Main Thread]: D/PlatformDecoderModule Agnostic decoder rejects requested type
[RDD 380: Main Thread]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 380: MediaSupervisor #1]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 380: MediaSupervisor #1]: D/PlatformDecoderModule Agnostic decoder supports requested type
[Child 279: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 279: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 279: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 279: MediaPDecoder #1]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 279: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 279: MediaPDecoder #3]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 279: MediaSupervisor #1]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 279: MediaSupervisor #1]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 279: MediaSupervisor #2]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 279: MediaSupervisor #2]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[RDD 380: MediaSupervisor #1]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 380: MediaSupervisor #1]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 380: MediaSupervisor #1]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 380: MediaSupervisor #1]: D/PlatformDecoderModule Agnostic decoder supports requested type
[Child 279: MediaPDecoder #2]: D/PlatformDecoderModule AudioTrimmer[7f5e2aa43ce0] ::PrepareTrimmers: sample[0,21000] no trimming information
[RDD 380: MediaPDecoder #1]: D/PlatformDecoderModule OpusDataDecoder[7f744f088440] ::Decode: Opus decoder skipping 312 of 960 frames
[Child 279: MediaPDecoder #1]: D/PlatformDecoderModule AudioTrimmer[7f5e2aa43ce0] ::HandleDecodedResult: sample[0,21000] (decoded[0,13500] no trimming needed
[Child 279: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 279: MediaPDecoder #3]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 279: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 279: MediaPDecoder #3]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 279: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 279: MediaPDecoder #2]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 279: MediaSupervisor #1]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 279: MediaSupervisor #1]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[RDD 380: MediaSupervisor #1]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 380: MediaSupervisor #1]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 380: MediaSupervisor #1]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 380: MediaSupervisor #1]: D/PlatformDecoderModule Agnostic decoder supports requested type
[Child 279: MediaPDecoder #1]: D/PlatformDecoderModule AudioTrimmer[7f5e30477560] ::PrepareTrimmers: sample[0,21000] no trimming information
[RDD 380: MediaPDecoder #2]: D/PlatformDecoderModule OpusDataDecoder[7f744f08a4c0] ::Decode: Opus decoder skipping 312 of 960 frames
[Child 279: MediaPDecoder #2]: D/PlatformDecoderModule AudioTrimmer[7f5e30477560] ::HandleDecodedResult: sample[0,21000] (decoded[0,13500] no trimming needed
[Child 279: MediaPDecoder #3]: D/PlatformDecoderModule AudioTrimmer[7f5e30477560] ::PrepareTrimmers: sample[21000,41000] no trimming information
[Child 279: MediaPDecoder #2]: D/PlatformDecoderModule AudioTrimmer[7f5e30477560] ::HandleDecodedResult: sample[21000,41000] (decoded[14500,34500] no trimming needed
[Child 279: MediaPDecoder #2]: D/PlatformDecoderModule AudioTrimmer[7f5e30477560] ::PrepareTrimmers: sample[41000,61000] no trimming information
[Child 279: MediaPDecoder #1]: D/PlatformDecoderModule AudioTrimmer[7f5e30477560] ::HandleDecodedResult: sample[41000,61000] (decoded[34500,54500] no trimming needed
[Child 279: MediaPDecoder #1]: D/PlatformDecoderModule AudioTrimmer[7f5e30477560] ::PrepareTrimmers: sample[61000,81000] no trimming information
[Child 279: MediaPDecoder #3]: D/PlatformDecoderModule AudioTrimmer[7f5e30477560] ::HandleDecodedResult: sample[61000,81000] (decoded[54500,74500] no trimming needed
[Child 279: MediaPDecoder #3]: D/PlatformDecoderModule AudioTrimmer[7f5e30477560] ::PrepareTrimmers: sample[81000,101000] no trimming information
[Child 279: MediaPDecoder #2]: D/PlatformDecoderModule AudioTrimmer[7f5e30477560] ::HandleDecodedResult: sample[81000,101000] (decoded[74500,94500] no trimming needed
[Child 279: MediaPDecoder #2]: D/PlatformDecoderModule AudioTrimmer[7f5e30477560] ::PrepareTrimmers: sample[101000,121000] no trimming information
[Child 279: MediaPDecoder #1]: D/PlatformDecoderModule AudioTrimmer[7f5e30477560] ::HandleDecodedResult: sample[101000,121000] (decoded[94500,114500] no trimming needed
... [and more]
Comment 36•3 years ago
|
||
That looks like AV1 media, ffmpeg/ffvpx is not even loaded.
Comment 37•3 years ago
|
||
It looks like a 'media.ffvpx.enabled' option was problematic. I read some time ago that ffvpx need to be disabled for VAAPI working, properly, but after your comment I enabled (restored default) this option and it looks like a VAAPI works properly for VP9 now. It looks like just 'media.ffmpeg.vaapi.enabled' need to be manually changed to 'true' and all other variables may stay default. Am I right?
Comment 38•3 years ago
|
||
(In reply to nadro-linux from comment #37)
It looks like just 'media.ffmpeg.vaapi.enabled' need to be manually changed to 'true' and all other variables may stay default. Am I right?
Correct. For hardware decoding with VP9 and WebRTC you'll also need media.navigator.mediadatadecoder_vpx_enabled
, but that only affect conferencing, not regular streaming websites like youtube.
Description
•