Open Bug 1892845 Opened 5 months ago Updated 3 months ago

Seeking a video on youtube causes the hardware av1 decoding to stop processing frames until website refresh(media.ffmpeg.vaapi.enabled = true) on AMD Ryzen 6850U, Linux(fedora, opensuse tumbleweed, ubuntu).

Categories

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

Firefox 125
Desktop
Linux
defect

Tracking

()

UNCONFIRMED

People

(Reporter: jakubby, Unassigned)

References

(Blocks 2 open bugs)

Details

Attachments

(5 files)

Steps to reproduce:

  1. Install Fedora/Opensuse Tumbleweed/Ubuntu with media codecs enabled.
  2. Make sure vaapi for my gpu is installed. (For fedora also enable and install the openh264 repo).
  3. Go to about:config media.ffmpeg.vaapi.enabled set this to true.
  4. Enable the usual: bring back the old UI layout by removing empty space bringing back the search bar, set maximum tracking protection, disable system proxy settings, enable DNS over HTTPS, enable crashlogs, disable telemetry from settings, disable deceptive software protection, make the URL bar just a quick search bar for URL history, make the search bar the search bar.
  5. Install ublock origin.
  6. Login to youtube force enable AV1 on all videos.
  7. Play some videos, after sometime seek backwards with a mouse on a youtube player.

Actual results:

Frames don't get updated/decoded.

Expected results:

Frames get updated/decoded.

It could be that it breaks down on x264/vp9/av1 videos, the way youtube works one of the 3 video codecs can be pushed to the web browser, I haven't verified which one gets pushed.
I'm not sure if the issue is with vaapi in general, but mpv with vaapi doing the decoding has no problem with seeking backwards and forwards.

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
Severity: -- → S3
OS: Unspecified → Linux
Hardware: Unspecified → Desktop

I assume I have the same issue. I wondered why since some days suddenly the CPU fans are going loud and I saw the decoding for Youtube videos no longer happens on the GPU but then when I restart Firefox all worked nicely again. I also checked debug output but when starting a Youtube video all seems fine. So I had the suspicion maybe things brake after lots of seeking but I didn't test further.

Thanks for the reports.

NI Stransky for VAAPI.

A copy of about:support, and logs of when the problem happen using about:logging, https://paul.cx/public/about-logging-presentation.webm shows how, nothing to install. Please make sure to upload the profile or download it, and then attach it here (or paste the link).

To automatically select the right logging configuration, please copy-paste the following in a new tab address bar:

about:logging?modules=HTMLMediaElement:4,HTMLMediaElementEvents:4,cubeb:5,PlatformDecoderModule:5,AudioSink:5,AudioSinkWrapper:5,MediaDecoderStateMachine:4,MediaDecoder:4,MediaFormatReader:5,GMP:5,EME:5,FFmpegVideo:4&threads=cubebaudio,BackgroundThreadPool,camera,capture,Compositor,decoder,GeckoMain,gmp,graph,grph,InotifyEventThread,IPDLBackground,media,ModuleProcessThread,PacerThread,RemVidChild,RenderBackend,Renderer,SocketThread,SwComposite,webrtc,TextureUpdate

Flags: needinfo?(jakubby)
Flags: needinfo?(stransky)
Flags: needinfo?(stransky)

Added to AMD tracker, may be a bug there. We don't enable VA-API by default on AMD due to various bugs in the drivers. Please try by different application like mpv, by runnint ' mpv --hwdec=vaapi test_clip' on terminal. mpv can play YT clips directly so you can put it to command line like:

mpv --hwdec=vaapi https://www.youtube.com/watch?v=kmk43_2dtn0

(In reply to Martin Stránský [:stransky] (ni? me) from comment #5)

Added to AMD tracker, may be a bug there. We don't enable VA-API by default on AMD due to various bugs in the drivers. Please try by different application like mpv, by runnint ' mpv --hwdec=vaapi test_clip' on terminal. mpv can play YT clips directly so you can put it to command line like:

mpv --hwdec=vaapi https://www.youtube.com/watch?v=kmk43_2dtn0

IIUC comment #1 said it's working fine with mpv.

(In reply to Mario Limonciello from comment #6)

(In reply to Martin Stránský [:stransky] (ni? me) from comment #5)

Added to AMD tracker, may be a bug there. We don't enable VA-API by default on AMD due to various bugs in the drivers. Please try by different application like mpv, by runnint ' mpv --hwdec=vaapi test_clip' on terminal. mpv can play YT clips directly so you can put it to command line like:

mpv --hwdec=vaapi https://www.youtube.com/watch?v=kmk43_2dtn0

IIUC comment #1 said it's working fine with mpv.

I see, thanks. In such case please set 'media.ffmpeg.vaapi.force-surface-zero-copy' to 0 at about:config, restart browser and try again. That's now mpv plays the clips.

Flags: needinfo?(superm1)
Flags: needinfo?(superm1)

(In reply to Martin Stránský [:stransky] (ni? me) from comment #7)

(In reply to Mario Limonciello from comment #6)

(In reply to Martin Stránský [:stransky] (ni? me) from comment #5)

Added to AMD tracker, may be a bug there. We don't enable VA-API by default on AMD due to various bugs in the drivers. Please try by different application like mpv, by runnint ' mpv --hwdec=vaapi test_clip' on terminal. mpv can play YT clips directly so you can put it to command line like:

mpv --hwdec=vaapi https://www.youtube.com/watch?v=kmk43_2dtn0

IIUC comment #1 said it's working fine with mpv.

I see, thanks. In such case please set 'media.ffmpeg.vaapi.force-surface-zero-copy' to 0 at about:config, restart browser and try again. That's now mpv plays the clips.

Sadly seeking back video doesn't work on reddit(it works on youtube):
https://www.reddit.com/r/interestingasfuck/comments/1d02pt6/hawk_vs_windshield_watch_as_the_hawk_slowly/

Flags: needinfo?(jakubby)
Attached file support.txt

(In reply to Jakub Strzelecki from comment #8)

mpv --hwdec=vaapi https://www.youtube.com/watch?v=kmk43_2dtn0

Sadly seeking back video doesn't work on reddit(it works on youtube):
https://www.reddit.com/r/interestingasfuck/comments/1d02pt6/hawk_vs_windshield_watch_as_the_hawk_slowly/

Thanks for testing.

  • Is the video seeking broken in Firefox or in mpv?
  • If it's broken in Firefox, can you try with media.ffmpeg.vaapi.force-surface-zero-copy ?

Thanks.

Flags: needinfo?(jakubby)
  1. firefox the video breaks on seek-back. On mpv the audio breaks on seek-back and video breaks on seek forward(video+audio has fit into mpv cache/has been cached when I seeked).
  2. If it's broken in Firefox, can you try with media.ffmpeg.vaapi.force-surface-zero-copy: I've tried with the media.ffmpeg.vaapi.force-surface-zero-copy set to 0 as per instructions. Tihs fixes the youtube seek back, but doesn't fix it on the reddit link.
Flags: needinfo?(jakubby)

Is the video seeking broken in Firefox or in mpv?
Youtube video works on both with force-surface-zero-copy set to 0.
Reddit video is broken on both.

Thanks. Can you run Firefox on terminal with MOZ_LOG="FFmpegVideo:5" env variable like:

MOZ_LOG="FFmpegVideo:5" firefox > log.txt 2>&1

do the broken reddit one seek with force-surface-zero-copy set to 0 and attach the log here?
Thanks.

Flags: needinfo?(jakubby)

A lot of different variables than the report but, but I CND. Here's the environment I tested it with:

  • Framework 13 AMD
    • AMD Phoenix
  • CachyOS (Arch linux based)
    • mpv 1:0.38.0-4.1
    • Kernel 6.9.1-4-cachyos
    • Mesa 1:24.1.0-1
    • Linux firmware 20240510.b9d2bf23

I tried with both of these commands to reproduce but can seek just fine.

mpv "https://packaged-media.redd.it/r852my2zph2d1/pb/m2-res_720p.mp4?m=DASHPlaylist.mpd&v=1&e=1716825600&s=2dff9d9c5e363c950867737cb41789e7532617dd#t=0" --hwdec=vaapi
mpv "https://packaged-media.redd.it/r852my2zph2d1/pb/m2-res_720p.mp4?m=DASHPlaylist.mpd&v=1&e=1716825600&s=2dff9d9c5e363c950867737cb41789e7532617dd#t=0" --hwdec=vaapi-copy

Also CND on either YT or Reddit link on Firefox 126.

(In reply to Mario Limonciello from comment #16)

Also CND on either YT or Reddit link on Firefox 126.

Okay, can you please produce the firefox log from scenario where it's broken?
Thanks.

Flags: needinfo?(superm1)
Attached file log.txt

(In reply to Martin Stránský [:stransky] (ni? me) from comment #14)

Thanks. Can you run Firefox on terminal with MOZ_LOG="FFmpegVideo:5" env variable like:

MOZ_LOG="FFmpegVideo:5" firefox > log.txt 2>&1

do the broken reddit one seek with force-surface-zero-copy set to 0 and attach the log here?
Thanks.

Flags: needinfo?(jakubby)

Here is the log from the working Phoenix laptop captured using:

MOZ_LOG="FFmpegVideo:5" firefox "https://packaged-media.redd.it/r852my2zph2d1/pb/m2-res_720p.mp4?m=DASHPlaylist.mpd&v=1&e=1716825600&s=2dff9d9c5e363c950867737cb41789e7532617dd#t=0" > foo.txt 2>&1 
Flags: needinfo?(superm1)

Here is the log from the working Phoenix laptop captured using:

MOZ_LOG="FFmpegVideo:5" firefox "https://packaged-media.redd.it/r852my2zph2d1/pb/m2-res_720p.mp4?m=DASHPlaylist.mpd&v=1&e=1716825600&s=2dff9d9c5e363c950867737cb41789e7532617dd#t=0" > foo.txt 2>&1 
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: