Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 506982 - media-video/mpv provide sdl USE flag
Summary: media-video/mpv provide sdl USE flag
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Nikoli
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-06 19:29 UTC by Julian Ospald
Modified: 2014-04-20 12:57 UTC (History)
2 users (show)

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


Attachments
mpv-0.3.7.ebuild.diff (mpv-0.3.7.ebuild.diff,1.01 KB, patch)
2014-04-06 19:46 UTC, Julian Ospald
Details | Diff
mpv-0.3.7.ebuild.diff (mpv-0.3.7.ebuild.diff,1.12 KB, patch)
2014-04-06 19:51 UTC, Julian Ospald
Details | Diff
mpv-0.3.8.ebuild.diff (mpv-0.3.8.ebuild.diff,1.15 KB, patch)
2014-04-19 13:57 UTC, Julian Ospald
Details | Diff
mpv-0.3.8.ebuild.patch (mpv-0.3.8.ebuild.patch,1.31 KB, patch)
2014-04-19 15:08 UTC, Nikoli
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Ospald 2014-04-06 19:29:52 UTC
mpv works fine with libsdl2 for both vo and ao

one sdl version is enough to support IMO
Comment 1 Julian Ospald 2014-04-06 19:46:13 UTC
Created attachment 374418 [details, diff]
mpv-0.3.7.ebuild.diff
Comment 2 Nikoli 2014-04-06 19:50:07 UTC
Upstream suggests to use sdl outputs only when all other are not available, does not seem like our case.
Comment 3 Julian Ospald 2014-04-06 19:51:02 UTC
Created attachment 374420 [details, diff]
mpv-0.3.7.ebuild.diff
Comment 4 Julian Ospald 2014-04-06 19:51:32 UTC
(In reply to Nikoli from comment #2)
> Upstream suggests to use sdl outputs only when all other are not available,
> does not seem like our case.

I want to use it, so what do I do... create a separate package?
Comment 5 Nikoli 2014-04-06 20:08:44 UTC
> I want to use it

But why? I guess you just want to test how libsdl2 works. For this purpose temporary moving mpv to local overlay seems best solution.

mpv upstream declares sdl outputs as not fully supported: they are not used by any dev and are tested and updated _very_ rare. As package maintainer i do not want to provide low quality or unstable features. USE sdl is enabled by default in all desktop profiles, so it makes situation even worse.

As a compromise we can add USE flag and mask it in profiles.
Comment 6 Julian Ospald 2014-04-06 20:18:04 UTC
(In reply to Nikoli from comment #5)
> > I want to use it
> 
> But why? I guess you just want to test how libsdl2 works. For this purpose
> temporary moving mpv to local overlay seems best solution.

No, I said I want to use it. I enabled --vo=sdl and --ao=sdl in youtube-viewer.

> 
> mpv upstream declares sdl outputs as not fully supported: they are not used
> by any dev and are tested and updated _very_ rare. As package maintainer i
> do not want to provide low quality or unstable features. USE sdl is enabled
> by default in all desktop profiles, so it makes situation even worse.

Reference?

> 
> As a compromise we can add USE flag and mask it in profiles.

Introducing features or packages masked is often the wrong approach. ~arch is meant for testing, it's not a second layer of stable arch. Usually, if something turns out to be very unstable after some time in ~arch or even broken, then the package or the related USE flags can be masked.

If it turns out to be a maintenance burden, primarily in the sense of "does not compile", then the feature can be dropped, sure.
Comment 7 Nikoli 2014-04-06 20:26:32 UTC
> Reference?

mpv irc channels. devs several times suggested to not use sdl and not enable it in packages. You can ask them yourself. Also look at the order of outputs:

https://github.com/mpv-player/mpv/blob/master/video/out/vo.c
https://github.com/mpv-player/mpv/blob/master/audio/out/ao.c

sdl outputs have really low priority when mpv chooses.
Comment 8 Julian Ospald 2014-04-06 20:34:08 UTC
(In reply to Nikoli from comment #7)
> > Reference?
> 
> mpv irc channels. devs several times suggested to not use sdl and not enable
> it in packages. You can ask them yourself.
> 

It works fine for me. If it is really unsupported, then there must be a note somewhere. I don't have any irc logs from dev channels. You seem to have more connection there than I do.

Most upstream devs don't even know the concept of USE flags, so they easily say "don't enable this or that".

> https://github.com/mpv-player/mpv/blob/master/video/out/vo.c
> https://github.com/mpv-player/mpv/blob/master/audio/out/ao.c
> 
> sdl outputs have really low priority when mpv chooses.

I choose it explicitly, so I don't really care about the order.


I don't see any problem with adding it. I will be tester... if it turns out to suck, then we just remove it again.
Comment 9 Nikoli 2014-04-06 20:55:48 UTC
I would like to know why you prefer to use '--vo=sdl --ao=sdl' instead of '--vo=opengl-hq --ao=alsa'. From my point of view it is illogical: opengl-hq now works fine with all foss drivers, supports vdpau hardware decoding, lcms color profiles and has best quality including quality of upscaling. Why use something else in modern linux desktop?


The main problem with adding USE sdl is that it is in profiles/targets/desktop/make.defaults, may be call it sdl2 like in build system? It will prevent building not well tested code by default.
Comment 10 Julian Ospald 2014-04-06 21:37:23 UTC
(In reply to Nikoli from comment #9)
> I would like to know why you prefer to use '--vo=sdl --ao=sdl' instead of
> '--vo=opengl-hq --ao=alsa'. From my point of view it is illogical: opengl-hq
> now works fine with all foss drivers, supports vdpau hardware decoding, lcms
> color profiles and has best quality including quality of upscaling. Why use
> something else in modern linux desktop?
> 
> 
> The main problem with adding USE sdl is that it is in
> profiles/targets/desktop/make.defaults, may be call it sdl2 like in build
> system?

sdl2 USE flag will cause the same confusion as gtk, gtk2, gtk3... I am strongly against anything like that

besides... this only goes for the desktop profiles

> It will prevent building not well tested code by default.

Testing... that's exactly what ~arch is for.

Masking is for cases when something is _actually_ broken, not just supposedly.
Comment 11 Julian Ospald 2014-04-19 11:25:08 UTC
so, if there is no good argument against introducing this in ~arch...
Comment 12 Nikoli 2014-04-19 12:48:24 UTC
> besides... this only goes for the desktop profiles

"Only" is not correct word in this case: mpv package is primary targeted at users of desktop profiles.

You insist on adding "sdl" USE flag without masking, by default it will force all users of desktop profiles to:
1) build low quality, unstable and not tested even by upstream parts of mpv code base
2) build and install libsdl2 package and its dependencies (How much blockers it will add when marking mpv stable?)
3) load libsdl2 libs and all its dependencies every time when running mpv (it does not use dlopen for SDL2)

I see no good reason for introducing these drawbacks: SDL2 is just wrapper for several libraries already directly used by mpv, building with SDL2 enabled does not add or improve _any_ feature.
Comment 13 Julian Ospald 2014-04-19 12:59:01 UTC
(In reply to Nikoli from comment #12)
> > besides... this only goes for the desktop profiles
> 
> "Only" is not correct word in this case: mpv package is primary targeted at
> users of desktop profiles.
> 
> You insist on adding "sdl" USE flag without masking, by default it will
> force all users of desktop profiles to:
> 1) build low quality, unstable and not tested even by upstream parts of mpv
> code base

I still see no reference. I do test it, btw.

> 2) build and install libsdl2 package and its dependencies (How much blockers
> it will add when marking mpv stable?)

That's not an argument at all and not how packaging works in gentoo.

> 3) load libsdl2 libs and all its dependencies every time when running mpv
> (it does not use dlopen for SDL2)
> 

It is a USE flag. You can emit a warning that the user might want to disable it.

> I see no good reason for introducing these drawbacks: SDL2 is just wrapper
> for several libraries already directly used by mpv, building with SDL2
> enabled does not add or improve _any_ feature.

I don't see any drawback for a package that is in _TESTING_.
Comment 14 Julian Ospald 2014-04-19 13:00:25 UTC
Otherwise I will introduce a new package in-tree and call it mpv-hasufell and make it block yours.
Comment 15 Julian Ospald 2014-04-19 13:39:45 UTC
(In reply to Julian Ospald (hasufell) from comment #14)
> Otherwise I will introduce a new package in-tree and call it mpv-hasufell
> and make it block yours.

ofc that was a joke, I'd rather just apply it, but I don't like to ignore people

however, there is another solution without masking and renaming the flag.

we can add:
media-video/mpv -sdl

to '/usr/portage/profiles/targets/desktop/package.use'
Comment 16 Nikoli 2014-04-19 13:40:40 UTC
> I still see no reference.

I asked upstream to add note to docs:
https://github.com/mpv-player/mpv/commit/0a444511e86a02feb2c945287ed535d0ca650b9b

from https://github.com/mpv-player/mpv/blob/master/DOCS/man/en/vo.rst
"The recommended output drivers are --vo=vdpau and --vo=opengl-hq. All other drivers are just for compatibility or special purposes."

"sdl
...
This driver is for compatibility with systems that don't provide proper graphics drivers, or which support GLES only."

Also upstream has a question for you:
[17:30:30] <wm4> also: "No, I said I want to use it. I enabled --vo=sdl and --ao=sdl in youtube-viewer."
[17:30:32] <wm4> ask him WHY
[17:30:39] <wm4> because what the fuck
[17:31:06] <wm4> mpv will automatically pick a AO/VO if the default one isn't available
[17:31:19] <wm4> but forcing the AO/VO will break if it's not available
Comment 17 Nikoli 2014-04-19 13:43:31 UTC
Using profiles/targets/desktop/package.use seems like best solution indeed. Attached patch most likely should be changed, i will do some testing of sdl.
Comment 18 Julian Ospald 2014-04-19 13:54:56 UTC
(In reply to Nikoli from comment #16)
> [17:30:32] <wm4> ask him WHY

Because I am a distributor and test stuff.
Comment 19 Julian Ospald 2014-04-19 13:57:42 UTC
Created attachment 375290 [details, diff]
mpv-0.3.8.ebuild.diff
Comment 20 Julian Ospald 2014-04-19 14:41:09 UTC
+  19 Apr 2014; Julian Ospald <hasufell@gentoo.org> targets/desktop/package.use:
+  prepare for media-video/mpv[sdl] wrt #506982
Comment 21 Julian Ospald 2014-04-19 14:41:47 UTC
reads:
# Julian Ospald <hasufell@gentoo.org> (19 Apr 2014)
# Overwrite default +sdl from desktop profile, since
# this codepath is untested and should not be exposed
# to regular desktop users wrt #506982
media-video/mpv -sdl
Comment 22 Nikoli 2014-04-19 15:08:56 UTC
Created attachment 375302 [details, diff]
mpv-0.3.8.ebuild.patch

'USE="-* sdl" emerge -1va mpv' plays video fine, 'sdl? ( X )' is not required at all.
Did not add X,alsa?,audio,opengl,video to media-libs/libsdl2[...] because:
1) mpv can be compiled and used as audio only or video only player (it builds and works fine when libsdl2 is compiled with audio or video support only, i checked)
2) gles can be used instead of opengl, some devices have video drivers with gles support only.
3) alsa in mpv is not related to alsa in libsdl2
4) wayland can be used instead of x11

libsdl2 has only KEYWORDS="~amd64 ~x86", so for now USE sdl should be masked for a lot arches, but it would be better to add at least arm to libsdl2 keywords.
Comment 23 Julian Ospald 2014-04-19 15:48:03 UTC
(In reply to Nikoli from comment #22)
> Created attachment 375302283 [details284, diff285]
> mpv-0.3.8.ebuild.patch
> 
> 'USE="-* sdl" emerge -1va mpv' plays video fine, 'sdl? ( X )' is not
> required at all.

indeed, that one is not needed

> Did not add X,alsa?,audio,opengl,video to media-libs/libsdl2[...] because:
> 1) mpv can be compiled and used as audio only or video only player (it
> builds and works fine when libsdl2 is compiled with audio or video support
> only, i checked)

USE="-* audio alsa" on libsdl2

breaks audio in mpv, so not sure what you tested there

> 4) wayland can be used instead of x11

can, but did you test it in conjunction with mpv?

> libsdl2 has only KEYWORDS="~amd64 ~x86", so for now USE sdl should be masked
> for a lot arches, but it would be better to add at least arm to libsdl2
> keywords.

I don't add keywords for arches I don't have.
Comment 24 Julian Ospald 2014-04-19 15:52:33 UTC
I guess you meant

	sdl? ( media-libs/libsdl2[threads] )

and let users micro-manage the features by brokenness... fine be me
Comment 25 Nikoli 2014-04-19 15:59:06 UTC
> USE="-* audio alsa" on libsdl2
> breaks audio in mpv, so not sure what you tested there

this is exactly why ebuild has 'sdl? ( media-libs/libsdl2[threads] )'

Now 'USE="-* video opengl X" emerge -1va libsdl2' works fine, but mpv upstream plans to use threads for video output too.
Comment 26 Julian Ospald 2014-04-20 12:37:58 UTC
+  20 Apr 2014; Julian Ospald <hasufell@gentoo.org> arch/alpha/package.use.mask,
+  arch/arm/package.use.mask, arch/powerpc/package.use.mask,
+  arch/sparc/package.use.mask:
+  mask 'media-video/mpv sdl ' on arches where media-libs/libsdl2 is not
+  keyworded yet wrt #506982 and #508226
Comment 27 Julian Ospald 2014-04-20 12:39:03 UTC
+  20 Apr 2014; Julian Ospald <hasufell@gentoo.org> mpv-0.3.8.ebuild,
+  mpv-9999.ebuild, metadata.xml:
+  add sdl USE flag wrt #506982
Comment 28 Julian Ospald 2014-04-20 12:39:49 UTC
if I forget to unmask the flag on those arches after libsdl2 has been keyworded, ping me
Comment 29 Nikoli 2014-04-20 12:57:20 UTC
Sure, i subscribed to keywording bug.