Bug 255561 - www/chromium: Video playback error (Chromium-only, other browsers unaffected)
Summary: www/chromium: Video playback error (Chromium-only, other browsers unaffected)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-chromium (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-03 02:02 UTC by Patricio Villar
Modified: 2022-02-23 16:59 UTC (History)
5 users (show)

See Also:
bugzilla: maintainer-feedback? (chromium)


Attachments
0001-try-MADV_FREE-and-then-fallback-to-MADV_DONTNEED-for.patch (3.07 KB, patch)
2022-02-23 16:15 UTC, Robert Nagy
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Patricio Villar 2021-05-03 02:02:10 UTC
OS: FreeBSD 13.0-RELEASE
DE: KDE Plasma 5.21.4
Graphics: drm-fbsd13-kmod v5.4.92.g20210419
Driver: modesetting
Chromium version: 90.0.4430.93

Way too many streaming videos suddenly fail in the middle of being played. Some of them display the text "Video error" on top of the video, some just stop playing, and others just restart playing from the very beginning.

Some points to take into account:
-Youtube videos seem immune to this problem.
-It doesn't seem to matter the WM or DE in use (tested on KDE, Openbox and Cinnamon).
-It happens with modesetting driver as well as intel.
-Using mesa-devel instead of regular mesa port makes no difference.
-Enabling/disabling hardware acceleration makes no difference either.
-The same videos play without issues in Firefox, Falkon, VLC and mpv.
-They play completely fine in Chromium on Linux too (Manjaro, for instance).
-They play great in Chromium-based browsers run through Linuxulator (tried Brave and Google Chrome).

*Note: This has been happening since a very long time (at least pre Chromium v80) and in older versions of FreeBSD too.
Comment 1 Patricio Villar 2021-05-03 16:50:13 UTC
Additional details:
GPU: Intel HD Graphics 5500

-Playing the troubled videos in Incognito mode doesn't help.

-Here are some links with examples where the problem occurs:


[1] https://twitter.com/TechInsider/status/1389150101986234369

I get this message: "The media could not be played."


[2] https://redgol.cl/vidal/Inter-Juventus-Arturo-Vidal-y-Cristiano-Ronaldo-tienen-fuerte-cruce-en-pleno-partido-en-la-Copa-Italia-20210202-0091.html

I get this message: "VIDEO ERROR".


As always, all these a little while after the video started playing...
Comment 2 Matthias Wolf 2021-05-03 17:09:29 UTC
This probably affects all MP4 videos. Trying to chase it down, but didn't find anything obvious so far.
Comment 3 Patricio Villar 2021-05-03 17:21:23 UTC
(In reply to Matthias Wolf from comment #2)
Ok, thanks. Hope you find the underlying issue soon :)
Comment 4 Oleh Hushchenkov 2021-05-17 11:42:28 UTC
For problem videos I see a message like this in Developer tools > Media > Messages:

> Append: stream parsing failed. Data size=4894 append_window_start=0 append_window_end=inf
Comment 5 Oleh Hushchenkov 2022-01-24 11:03:03 UTC
Build(v96) from https://github.com/freebsd/chromium not affected by the issue.
Comment 6 Patricio Villar 2022-02-13 11:58:05 UTC
(In reply to Oleh Hushchenkov from comment #5)
Can confirm that Chromium v97.0.4692.99 has finally solved this bug for me!
Big thank you to the maintainers of this hugely complicated port!!
Comment 7 Oleh Hushchenkov 2022-02-21 18:10:01 UTC
After updating to v98 the issue returned.
Comment 8 Robert Nagy 2022-02-23 16:15:04 UTC
Created attachment 232048 [details]
0001-try-MADV_FREE-and-then-fallback-to-MADV_DONTNEED-for.patch

The attached patch fixes the issue.
Comment 9 commit-hook freebsd_committer freebsd_triage 2022-02-23 16:53:56 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2bc6cc38f24dd256461df52f2eda7be12b1c28c5

commit 2bc6cc38f24dd256461df52f2eda7be12b1c28c5
Author:     Robert Nagy <robert@openbsd.org>
AuthorDate: 2022-02-23 16:50:34 +0000
Commit:     Rene Ladan <rene@FreeBSD.org>
CommitDate: 2022-02-23 16:52:31 +0000

    www/chromium: fix MP4 video playback

    PR:             255561
    Reported by:    patovm04@gmail.com

 www/chromium/Makefile                                    |  1 +
 ...llocator_partition__allocator_page__allocator.h (new) | 11 +++++++++++
 ...__allocator_page__allocator__internals__posix.h (new) | 16 ++++++++++++++++
 3 files changed, 28 insertions(+)
Comment 10 commit-hook freebsd_committer freebsd_triage 2022-02-23 16:54:58 UTC
A commit in branch 2022Q1 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5d3a2cfbe493ca12f6945fc3eca803b13ddffd97

commit 5d3a2cfbe493ca12f6945fc3eca803b13ddffd97
Author:     Robert Nagy <robert@openbsd.org>
AuthorDate: 2022-02-23 16:50:34 +0000
Commit:     Rene Ladan <rene@FreeBSD.org>
CommitDate: 2022-02-23 16:53:58 +0000

    www/chromium: fix MP4 video playback

    PR:             255561
    Reported by:    patovm04@gmail.com

    (cherry picked from commit 2bc6cc38f24dd256461df52f2eda7be12b1c28c5)

 www/chromium/Makefile                                    |  1 +
 ...llocator_partition__allocator_page__allocator.h (new) | 11 +++++++++++
 ...__allocator_page__allocator__internals__posix.h (new) | 16 ++++++++++++++++
 3 files changed, 28 insertions(+)