Closed Bug 1861759 Opened 2 years ago Closed 1 year ago

Enable media-gpu on Linux

Categories

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

task

Tracking

()

RESOLVED FIXED
142 Branch
Tracking Status
firefox142 --- fixed

People

(Reporter: alwu, Assigned: alwu)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

No description provided.
Assignee: nobody → alwu
Priority: P2 → P3
Depends on: 1952783
See Also: → 1953677
Attachment #9467008 - Attachment description: Bug 1861759 - enable media-gpu on Linux. → WIP: Bug 1861759 - part1 : enable media-gpu on Linux.
Depends on: 1953677
See Also: 1953677

After Bug 1953677 fixed I run another try with logging enabled:
https://treeherder.mozilla.org/jobs?repo=try&revision=96a86a87d32a037d68406f78aa13eceb04fcb721&selectedTaskRun=Kjr5dAYbS6GhBD1n5FzLYA.0

There's one issue remaining:
https://treeherder.mozilla.org/jobs?repo=try&revision=96a86a87d32a037d68406f78aa13eceb04fcb721&selectedTaskRun=Kjr5dAYbS6GhBD1n5FzLYA.0

TEST-UNEXPECTED-FAIL | dom/media/test/test_temporary_file_blob_video_plays.html | Test timed out. -

There's the related log:

[task 2025-06-09T08:22:39.200+00:00] 08:22:39     INFO - GECKO(5008) | [AVHWFramesContext @ 0x7f8932d04300] Direct mapping possible.
[task 2025-06-09T08:22:39.201+00:00] 08:22:39     INFO - GECKO(5008) | [vp8 @ 0x7f895e1ee800] Decode context initialised: 0x1000000/0x2000000.
[task 2025-06-09T08:22:39.201+00:00] 08:22:39     INFO - GECKO(5008) | [vp8 @ 0x7f895e1ee800] Param buffer (type 0, 112 bytes) is 0x8000000.
[task 2025-06-09T08:22:39.202+00:00] 08:22:39     INFO - GECKO(5008) | [vp8 @ 0x7f895e1ee800] Param buffer (type 13, 1072 bytes) is 0x8000001.
[task 2025-06-09T08:22:39.202+00:00] 08:22:39     INFO - GECKO(5008) | [vp8 @ 0x7f895e1ee800] Param buffer (type 1, 64 bytes) is 0x8000002.
[task 2025-06-09T08:22:39.203+00:00] 08:22:39     INFO - GECKO(5008) | [vp8 @ 0x7f895e1ee800] Slice 0 param buffer (72 bytes) is 0x8000003.
[task 2025-06-09T08:22:39.203+00:00] 08:22:39     INFO - GECKO(5008) | [vp8 @ 0x7f895e1ee800] Slice 0 data buffer (241 bytes) is 0x8000004.
[task 2025-06-09T08:22:39.204+00:00] 08:22:39     INFO - GECKO(5008) | [vp8 @ 0x7f895e1ee800] Decode to surface 0x4000000.
[task 2025-06-09T08:22:39.205+00:00] 08:22:39     INFO - GECKO(5008) | [RDD 5108: MediaPDecoder #1]: D/FFmpegVideo FFVPX: Incorrect frame duration, skipping decode stats.
[task 2025-06-09T08:22:39.205+00:00] 08:22:39     INFO - GECKO(5008) | [RDD 5108: MediaPDecoder #1]: D/FFmpegVideo FFVPX: VA-API Got one frame output with pts=0 dts=0 duration=0
[task 2025-06-09T08:22:39.206+00:00] 08:22:39     INFO - GECKO(5008) | [RDD 5108: MediaPDecoder #2]: D/FFmpegVideo FFVPX: ProcessFlush()
[task 2025-06-09T08:22:39.208+00:00] 08:22:39     INFO - GECKO(5008) | [RDD 5108: MediaPDecoder #2]: D/FFmpegVideo FFVPX: FFmpegDataDecoder: flushing buffers
[task 2025-06-09T08:22:39.209+00:00] 08:22:39     INFO - GECKO(5008) | [RDD 5108: MediaPDecoder #1]: D/FFmpegVideo FFVPX: FFmpegDataDecoder: shutdown
[task 2025-06-09T08:24:02.700+00:00] 08:24:02     INFO - GECKO(5008) | [Parent 5008, sqldb:places.sqlite #3] WARNING: Suboptimal indexes for the SQL statement 0x7f484c8f7d40 (http://mzl.la/1FuID0j).: file /builds/worker/checkouts/gecko/storage/mozStoragePrivateHelpers.cpp:114
[task 2025-06-09T08:24:02.700+00:00] 08:24:02     INFO - GECKO(5008) | [Parent 5008, sqldb:places.sqlite #3] WARNING: Suboptimal indexes for the SQL statement 0x7f484c8f7d40 (http://mzl.la/1FuID0j).: file /builds/worker/checkouts/gecko/storage/mozStoragePrivateHelpers.cpp:114
[task 2025-06-09T08:28:07.821+00:00] 08:28:07     INFO - TEST-INFO | started process screentopng
[task 2025-06-09T08:28:07.948+00:00] 08:28:07     INFO - TEST-INFO | screentopng: exit 0
[task 2025-06-09T08:28:07.949+00:00] 08:28:07     INFO - Buffered messages logged at 08:22:39
[task 2025-06-09T08:28:07.949+00:00] 08:28:07     INFO - Drawing color 255,0,0,1
[task 2025-06-09T08:28:07.950+00:00] 08:28:07     INFO - TEST-PASS | dom/media/test/test_temporary_file_blob_video_plays.html | Media recorder stream = canvas stream at the start of recording 
[task 2025-06-09T08:28:07.951+00:00] 08:28:07     INFO - TEST-PASS | dom/media/test/test_temporary_file_blob_video_plays.html | Media recorder should be recording 
[task 2025-06-09T08:28:07.951+00:00] 08:28:07     INFO - Got 'start' event
[task 2025-06-09T08:28:07.952+00:00] 08:28:07     INFO - TEST-PASS | dom/media/test/test_temporary_file_blob_video_plays.html | Should only get one dataavailable event 
[task 2025-06-09T08:28:07.952+00:00] 08:28:07     INFO - Got 'stop' event
[task 2025-06-09T08:28:07.953+00:00] 08:28:07     INFO - TEST-PASS | dom/media/test/test_temporary_file_blob_video_plays.html | Should have gotten a data blob 
[task 2025-06-09T08:28:07.954+00:00] 08:28:07     INFO - Waiting for video recorded-video to match [255,0,0,255] - red (Should become red)
[task 2025-06-09T08:28:07.954+00:00] 08:28:07     INFO - Frame: 0 IsPixel ref=255,0,0,255 threshold=128 value=0,0,0,0
[task 2025-06-09T08:28:07.955+00:00] 08:28:07     INFO - Buffered messages finished
[task 2025-06-09T08:28:07.956+00:00] 08:28:07     INFO - TEST-UNEXPECTED-FAIL | dom/media/test/test_temporary_file_blob_video_plays.html | Test timed out. - 

which looks like correct decode to me.

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

After Bug 1953677 fixed I run another try with logging enabled:
https://treeherder.mozilla.org/jobs?repo=try&revision=96a86a87d32a037d68406f78aa13eceb04fcb721&selectedTaskRun=Kjr5dAYbS6GhBD1n5FzLYA.0

There's one issue remaining:
https://treeherder.mozilla.org/jobs?repo=try&revision=96a86a87d32a037d68406f78aa13eceb04fcb721&selectedTaskRun=Kjr5dAYbS6GhBD1n5FzLYA.0

TEST-UNEXPECTED-FAIL | dom/media/test/test_temporary_file_blob_video_plays.html | Test timed out. -

That matches what I previously observed in my patch D241337, which temporarily disables the test. However, after reviewing the test today, it seems this section may be causing the timeout.

I suspect the timeupdate event might not be received because playback has already ended. I’ll run a test to confirm whether this is the case and see if we can fix the timeout. If not, I’ll proceed with disabling the test on Linux media-gpu.

Okay, the test is still timeout so we need to temporarily disable it. However, I noticed other issues

  • Assertions in DMABUFSurfaceImage : 1 2
  • Byte buffer leakage : might be related with VAAPI log? See here
  • Data race in av_log_default_callback : I found this from the push in comment 3

Martin, could you help take a look on them? Thanks!

Flags: needinfo?(stransky)

Sure, will look at it. The leaks come from logging, will look at the asserts.

Looks related to VP8 decoding, I'll look at it. The assertion looks related to previous bunch of errors - the bad fd reported above.
We may decode/export VP8 decoded dmabuf surface wrongly and we see the timeout and perhaps empty surface. Will try on hardware with VP8 HW decoding.

I see the bug locally on HW VP8 decoding (Intel). May be related to dmabuf handling/vp8 decoding.

Looks like we need to keep VideoFrameSurface present (or at least textures/surface/fd) after FFmpegVideoDecoder::ProcessShutdown(). Right now we delete whole surface pool there.

With Bug 1976755 we should be fine here (except the memleak caused by logging).

Flags: needinfo?(stransky) → needinfo?(alwu)

Thanks! I will check it again, keep my NI.

Attachment #9467008 - Attachment description: WIP: Bug 1861759 - part1 : enable media-gpu on Linux. → Bug 1861759 - part1 : enable media-gpu on Linux.
Attachment #9471605 - Attachment description: WIP: Bug 1861759 - part2 : only run media-gpu on linux 18.04 worker which has acutal hardware. → Bug 1861759 - part2 : only run media-gpu on linux 18.04 worker which has acutal hardware.
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 142 Branch
Flags: needinfo?(alwu)
QA Whiteboard: [qa-triage-done-c143/b142]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: