Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 955122 - media-video/mpv-0.40: USE=opengl removal breaks vdpau
Summary: media-video/mpv-0.40: USE=opengl removal breaks vdpau
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Ionen Wolkens
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-30 16:22 UTC by Shiba
Modified: 2025-05-01 01:16 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shiba 2025-04-30 16:22:16 UTC
I haven't been able to keep up with things very much later, but I see that USE=opengl was removed in https://gitweb.gentoo.org/repo/gentoo.git/commit/media-video/mpv?id=b616876327f00eadb888ebf3480b2444671f81c0 . This however breaks --hwdec=vdpau, which requires specifically --gpu-context=x11 (as per the man page).
Comment 1 Shiba 2025-04-30 19:14:09 UTC
lately*

Since vdpau is possibly the only case where this is still needed, maybe something like this could be added to the ebuild:

$(meson_feature vdpau gl-x11)
$(meson_feature vdpau vdpau-gl-x11)
Comment 2 Ionen Wolkens gentoo-dev 2025-04-30 23:00:19 UTC
(In reply to Shiba from comment #1)
> Since vdpau is possibly the only case where this is still needed, maybe
> something like this could be added to the ebuild:
> 
> $(meson_feature vdpau gl-x11)
> $(meson_feature vdpau vdpau-gl-x11)
Enabling it only with USE=vdpau sounds reasonable, I don't think there's other notable use cases to need its own USE.

Or for now at least, could argue that should drop USE=vdpau entirely for mpv and recommend that users migrate to either --hwdec=nvdec (USE=nvenc) or --hwdec=vulkan for NVIDIA.

Albeit vdpau still has uses for old cards, technically --hwdec=nvdec is usable even with 390.x drivers but afaik that would require building with old not-in-tree nv-codec-headers. 340.x I'm not too sure but that's not in-tree.

If look at the mpv man page, will see that this is all kind of deprecated and not recommended:

       --gpu-context=<context1,context2,...[,]>
              ...
              x11    X11/GLX (deprecated/legacy, EGL is preferred these days)

        ... with --hwdec=vdpau. Note that there is absolutely no reason to use this, other than compatibility. We strongly recommend that you use --vo=gpu with --hwdec=nvdec instead
        (that bit is for -vo vdpau, but the recommendation applies regardless)
Comment 3 Larry the Git Cow gentoo-dev 2025-04-30 23:28:42 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ca9107e1cd748ea06933d1af3a6a7c8dbef35cb0

commit ca9107e1cd748ea06933d1af3a6a7c8dbef35cb0
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2025-04-30 23:17:22 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2025-04-30 23:28:27 +0000

    media-video/mpv: re-enable gl-x11 only with USE=vdpau
    
    Closes: https://bugs.gentoo.org/955122
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 .../mpv/{mpv-0.40.0-r1.ebuild => mpv-0.40.0-r2.ebuild}        | 11 +++++++++--
 media-video/mpv/mpv-9999.ebuild                               | 11 +++++++++--
 2 files changed, 18 insertions(+), 4 deletions(-)
Comment 4 Shiba 2025-04-30 23:51:42 UTC
Thanks, but there is a misunderstanding here. This is what the 3 meson options enable:

  gl-x11        ==>  --gpu-context=x11
  vdpau-gl-x11  ==>  --hwdec=vdpau
  vdpau         ==>  --vo=vdpau

The one that actually enables VDPAU hardware decoding is the second one, vdpau-gl-x11 (although of course gl-x11 is required as well). The third one just enables MPV's "vdpau" video output, the one they describe as «there is absolutely no reason to use this» and it is not involved in VDPAU decoding (it's a bit confusing, I know).

For the deprecation I wouldn't worry too much, VDPAU strictly requires x11(GLX) so they will probably go away together from MPV, and as long as there is libvdpau (and something that can make use of it) in Gentoo, might as well use it.
Comment 5 Ionen Wolkens gentoo-dev 2025-05-01 00:15:32 UTC
It should be fine as-is and vdpau-gl-x11 *is* enabled. I decided some time ago to stop passing some of the automatic options without special requirements for nothing.

aka, vdpau-gl-x11 is enabled if vpdau + gl-x11

features += {'vdpau-gl-x11': features['vdpau'] and gl_x11.allowed()}
Comment 6 Ionen Wolkens gentoo-dev 2025-05-01 00:19:26 UTC
Also, if normal vdpau isn't enabled, it skips the hwdec entirely:

if features['vdpau'] and features['vdpau-gl-x11']
    sources += files('video/out/opengl/hwdec_vdpau.c')
Comment 7 Ionen Wolkens gentoo-dev 2025-05-01 00:41:12 UTC
(In reply to Ionen Wolkens from comment #5)
> I decided some time ago to stop passing some of the automatic
> options without special requirements for nothing.
(the rationale was that it's redundant given they are purely controlled by meson options and not e.g. a dependency check that *could* fail, and it added complexity to the ebuild where often had to check two different USE flags, like vdpau + former opengl to enable something -- they are combined now, but explicitly passing vdpau-gl-x11 is still redundant)
Comment 8 Shiba 2025-05-01 00:59:42 UTC
You are right sorry, I didn't read the code thoroughly and I was mislead by the configure summary which didn't show vdpau-gl-x11 as enabled. Just tested it and it is OK, thank you again.

Just one last addendum to my previous reply because I hadn't thought about that: Nouveau also supports VDPAU for old cards (although in my tests it leads to way too frequent system hangs, but maybe someone is luckier), so there is probably also that to consider before dropping libvdpau once all proprietary VDPAU capable Nvidia drivers are out of tree.
Comment 9 Ionen Wolkens gentoo-dev 2025-05-01 01:16:56 UTC
(In reply to Shiba from comment #8)
> Just one last addendum to my previous reply because I hadn't thought about
> that: Nouveau also supports VDPAU for old cards (although in my tests it
> leads to way too frequent system hangs, but maybe someone is luckier), so
> there is probably also that to consider before dropping libvdpau once all
> proprietary VDPAU capable Nvidia drivers are out of tree.
vdpau in general likely isn't going anywhere for a very long time (nvidia still supports and updates it -- even added av1 support not that long ago, albeit it remains a X-only thing), this really is just about mpv given it supports alternatives for nvidia and upstream does not like vdpau very much based on comments I've seen.

And yeah I doubt it's used much with nouveau between bugs, working only for a handful of specific cards, and needing firmware extracted from nvidia-drivers (nvidia-firmware package).

With some luck, newer cards (GSP) may be able to use --hwdec=vulkan with nouveau+NVK eventually though.