Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[gentoo-user] screen tearing with mpv but not mplayer

370 views
Skip to first unread message

Behrouz Khosravi

unread,
Oct 19, 2016, 7:00:08 PM10/19/16
to
Hello everyone. Mpv has horizontal screen tearing(not very serious
though) while playing video while

mplayer does not. I have tried some configs which I found on the net but
nothing removes this issue.

Mpv docs even says that tearing problems are probably not related to
software but driver and such, but

it seems that this is mpv's problem. any idea about how to solve this
issue? Thanks.

[I] media-video/mpv
Available versions: 0.9.2-r1 ~0.18.0-r1 (~)0.20.0 **9999 {+X
+alsa aqua archive bluray bs2b cdda cdio +cli coreaudio doc doc-pdf drm
dvb (+)dvd (+)egl +enca encode gbm +iconv jack jpeg ladspa lcms +libass
libav libcaca libguess libmpv (+)lua luajit openal +opengl oss
pulseaudio pvr raspberry-pi rubberband samba (-)sdl selinux test
(+)uchardet v4l vaapi vdpau vf-dlopen wayland xinerama +xscreensaver
(+)xv zsh-completion}
Installed versions: 0.20.0(02:34:27 PM 10/19/2016)(X alsa cli drm
egl enca encode iconv jpeg lcms libass libmpv lua luajit opengl
pulseaudio rubberband uchardet vaapi vdpau wayland xscreensaver xv -aqua
-archive -bluray -cdda -coreaudio -doc -dvb -dvd -gbm -jack -libav
-libcaca -libguess -openal -oss -raspberry-pi -samba -sdl -selinux -test
-v4l -vf-dlopen -xinerama -zsh-completion)


[I] media-video/mplayer
Available versions: 1.2_pre20150214-r1^d ~1.2-r2^d 1.2.1^d
[M]~1.3.0^d [M]**9999^d {+X a52 aalib +alsa altivec aqua bidi bl bluray
bs2b cddb +cdio cdparanoia cpudetection debug dga directfb doc dts dv
dvb +dvd +dvdnav +enca +encode faac faad fbcon ftp ggi gif gsm +iconv
ipv6 jack joystick jpeg jpeg2k ladspa +libass libcaca libmpeg2 lirc live
lzo mad md5sum mng mp3 nas +network nut openal opengl +osdmenu oss png
pnm pulseaudio pvr radio rar rtc rtmp samba sdl selinux +shm speex tga
theora toolame tremor +truetype twolame +unicode v4l vcd vdpau vidix
vorbis x264 xanim xinerama +xscreensaver +xv xvid xvmc yuv4mpeg zoran
CPU_FLAGS_X86="3dnow 3dnowext +mmx mmxext sse sse2 ssse3" KERNEL="linux"
VIDEO_CARDS="mga s3virge tdfx"}
Installed versions: 1.2.1(10:46:46 AM 10/17/2016)(X alsa cdio dvd
dvdnav enca encode iconv ipv6 jpeg libass mp3 network opengl osdmenu png
pulseaudio shm truetype unicode vorbis xscreensaver xv -a52 -aalib
-altivec -aqua -bidi -bl -bluray -bs2b -cddb -cdparanoia -cpudetection
-debug -dga -directfb -doc -dts -dv -dvb -faac -faad -fbcon -ftp -ggi
-gif -gsm -jack -joystick -jpeg2k -ladspa -libcaca -libmpeg2 -lirc -live
-lzo -mad -md5sum -mng -nas -nut -openal -oss -pnm -pvr -radio -rar -rtc
-rtmp -samba -sdl -selinux -speex -tga -theora -toolame -tremor -twolame
-v4l -vcd -vdpau -vidix -x264 -xanim -xinerama -xvid -xvmc -yuv4mpeg
-zoran CPU_FLAGS_X86="mmx mmxext sse sse2 ssse3 -3dnow -3dnowext"
KERNEL="linux" VIDEO_CARDS="-mga -s3virge -tdfx")

[I] media-video/ffmpeg
Available versions: 2.8.6(0/54.56.56)^d ~2.8.7(0/54.56.56)^d
~2.8.8(0/54.56.56)^d [M]~3.1.3(0/55.57.57)^d [M]**9999(0/55.57.57)^d {X
aac aacplus alsa altivec amr amrenc armv5te armv6 armv6t2 armvfp bluray
bs2b +bzip2 cdio celt chromaprint cpudetection debug doc ebur128 +encode
examples faac fdk flite fontconfig frei0r fribidi gcrypt gme gmp gnutls
+gpl gsm +hardcoded-tables +iconv iec61883 ieee1394 jack jpeg2k kvazaar
ladspa libass libcaca libilbc libressl librtmp libsoxr libv4l lzma
mipsdspr1 mipsdspr2 mipsfpu mmal modplug mp3 neon +network nvenc openal
opengl openh264 openssl opus oss pic +postproc pulseaudio quvi
rubberband samba schroedinger sdl snappy speex ssh static-libs test
theora +threads truetype twolame v4l vaapi vdpau vorbis vpx wavpack webp
x264 x265 xcb xvid zimg +zlib zvbi ABI_MIPS="n32 n64 o32" ABI_PPC="32
64" ABI_S390="32 64" ABI_X86="32 64 x32" CPU_FLAGS_X86="3dnow 3dnowext
aes avx avx2 fma3 fma4 mmx mmxext sse sse2 sse3 sse4_1 sse4_2 ssse3 xop"
FFTOOLS="+aviocat +cws2fws +ffescape +ffeval +ffhash +fourcc2pixfmt
+graph2dot +ismindex +pktdumper +qt-faststart +sidxindex +trasher"}
Installed versions: 2.8.6(02:23:21 AM 10/18/2016)(X aac alsa
bzip2 cdio cpudetection encode fontconfig gpl hardcoded-tables iconv mp3
network opengl opus postproc pulseaudio sdl threads truetype v4l vaapi
vdpau vorbis vpx webp x264 x265 xcb xvid zlib -aacplus -altivec -amr
-amrenc -armv5te -armv6 -armv6t2 -armvfp -bluray -bs2b -celt -debug -doc
-examples -faac -fdk -flite -frei0r -fribidi -gme -gnutls -gsm -iec61883
-ieee1394 -jack -jpeg2k -ladspa -libass -libcaca -libressl -librtmp
-libsoxr -libv4l -lzma -mipsdspr1 -mipsdspr2 -mipsfpu -modplug -neon
-openal -openssl -oss -pic -quvi -samba -schroedinger -snappy -speex
-ssh -static-libs -test -theora -twolame -wavpack -zvbi ABI_MIPS="-n32
-n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="64 -32 -x32"
CPU_FLAGS_X86="avx mmx mmxext sse sse2 sse3 sse4_1 sse4_2 ssse3 -3dnow
-3dnowext -avx2 -fma3 -fma4 -xop" FFTOOLS="aviocat cws2fws ffescape
ffeval ffhash fourcc2pixfmt graph2dot ismindex pktdumper qt-faststart
sidxindex trasher")

wabe

unread,
Oct 19, 2016, 9:40:07 PM10/19/16
to
Behrouz Khosravi <bz.kh...@gmail.com> wrote:

> Hello everyone. Mpv has horizontal screen tearing(not very serious
> though) while playing video while
>
> mplayer does not. I have tried some configs which I found on the net
> but nothing removes this issue.
>
> Mpv docs even says that tearing problems are probably not related to
> software but driver and such, but

My GPU is a Radeon R7 250E. Screen resolution is 3840x2160@60Hz 24bpp.

I had tearing with every player before I used the "TearFree" option
in my xorg.conf. It contains only a device section, nothing else:

$ cat /etc/X11/xorg.conf

Section "Device"
Identifier "ATI-Card"
Driver "radeon"
Option "TearFree" "on"
Option "ShadowPrimary" "off"
EndSection

If you also use a Radeon GPU you can try to enable the TearFree option.
Since I've enabled this option I have no tearing problems anymore.

If you don't use a Radeon GPU then you should find out if there is a
similar option for your GPU.

Attached is my Xorg logfile (some non important stuff removed).
In the logfile you can see that I'm using a kernel parameter "radeon.dpm=1".
Without this parameter I had performance problems with my GPU in the past.
To be honest, I don't know if the performance problem I encountered still
exist without this parameter. Maybe it has been fixed in the meantime.

BTW: I'm using x11-base/xorg-server-1.18.4 and
x11-drivers/xf86-video-ati-7.7.1.

> it seems that this is mpv's problem. any idea about how to solve this
> issue? Thanks.
>
> [I] media-video/mpv
> Installed versions: 0.20.0(02:34:27 PM
> 10/19/2016)(X alsa cli drm egl enca encode iconv jpeg lcms libass
> libmpv lua luajit opengl pulseaudio rubberband uchardet vaapi vdpau
> wayland xscreensaver xv -aqua -archive -bluray -cdda -coreaudio -doc
> -dvb -dvd -gbm -jack -libav -libcaca -libguess -openal -oss
> -raspberry-pi -samba -sdl -selinux -test -v4l -vf-dlopen -xinerama
> -zsh-completion)

I don't think that it is important but for the sake of completeness
these are the USE flags for mpv (0.9.2-r1) on my system:

X alsa bluray bs2b cli doc-pdf dvd enca encode iconv jack jpeg ladspa
lcms libass libmpv lua luajit opengl oss sdl vaapi vdpau xscreensaver xv

--
Regards
wabe
Xorg.0.log

wabe

unread,
Oct 19, 2016, 10:10:03 PM10/19/16
to
wabe <wabe...@gmail.com> wrote:

> In the logfile you can see that I'm using a kernel parameter
> "radeon.dpm=1". Without this parameter I had performance problems
> with my GPU in the past.

I should give some explanation about this parameter.
It enables an older power management mechanism in the kernel that
gives better performance with my GPU than the newer one.

With radeon.dpm=1 I can use a script in /etc/local.d/ that contains
this line:

echo "performance" > /sys/class/drm/card0/device/power_dpm_state

Positive effect is, that desktop/window operations and also video
playback are much smoother.
Negative side effect is, that the power consumption of my GPU and
also its temperature is a bit higher than with the default settings.

If I don't use radeon.dpm=1 it is also possible to manually set
a GPU scheduler:

echo "profile" > /sys/class/drm/card0/device/power_method
echo "high" > /sys/class/drm/card0/device/power_profile

But as I already mentioned, performance isn't as good as with the
older power management.

However I checked this out many months ago. Maybe it isn't relevant
anymore.

--
Regards
wabe

wabe

unread,
Oct 19, 2016, 10:40:03 PM10/19/16
to
Behrouz Khosravi <bz.kh...@gmail.com> wrote:

> Hello everyone. Mpv has horizontal screen tearing(not very serious
> though) while playing video while
>
> mplayer does not. I have tried some configs which I found on the net
> but nothing removes this issue.
>
> Mpv docs even says that tearing problems are probably not related to
> software but driver and such, but
>
> it seems that this is mpv's problem. any idea about how to solve this
> issue? Thanks.

You could test different video output drivers and also hardware decoding.
If you use deinterlace you can also try to tune it's values.

This my mpv config file:

vo=vdpau:deint=-3,opengl-hq:scale=spline36,xv
hwdec=vdpau
audio-device='alsa/iec958:CARD=SB,DEV=0'
audio-channels=auto

P.S.: Sorry for the many replies. I better should turn on my mind
before posting.

--
Regards
wabe

Behrouz Khosravi

unread,
Oct 20, 2016, 6:20:04 AM10/20/16
to
You could test different video output drivers and also hardware decoding.
> If you use deinterlace you can also try to tune it's values.
>
> This my mpv config file:
>
> vo=vdpau:deint=-3,opengl-hq:scale=spline36,xv
> hwdec=vdpau
> audio-device='alsa/iec958:CARD=SB,DEV=0'
> audio-channels=auto
>
> P.S.: Sorry for the many replies. I better should turn on my mind
> before posting.
>
> --
> Regards
> wabe
>

Thanks for the response. Actually my laptop has a nvidia chip which I
have tured off and I'm using the intel integrated chip.

I tried testing some options in config file, but it didnt help.

I guess I should stick to mplayer instead of mpv.

Thanks
Behrouz

David Haller

unread,
Oct 21, 2016, 5:40:04 AM10/21/16
to
Hello,

On Thu, 20 Oct 2016, Behrouz Khosravi wrote:
>You could test different video output drivers and also hardware decoding.
[..]
>> vo=vdpau:deint=-3,opengl-hq:scale=spline36,xv
[..]
>I tried testing some options in config file, but it didnt help.

Why not check what output-driver you use with mplayer and then use
that with mpv too. E.g.:

$ mplayer foo.mp4 | grep '^VO: '
VO: [gl] ...
$ mpv foo.mp4 | grep '^VO: '
VO: [opengl]

See 'mplayer -vo help' and 'mpv -vo help'.

HTH,
-dnh

--
Well, merry frelling christmas! -- Aeryn Sun, Farscape - 4x13 - Terra Firma

Behrouz Khosravi

unread,
Oct 21, 2016, 11:40:03 AM10/21/16
to

> $ mplayer foo.mp4 | grep '^VO: '
> VO: [gl] ...
> $ mpv foo.mp4 | grep '^VO: '
> VO: [opengl]
>
> See 'mplayer -vo help' and 'mpv -vo help'.
>
> HTH,
> -dnh
>

Thanks. It seems that mplayer is using "xv" and mpv uses "opengl-hq".
mpv work ok with "xv" but quality degrades a little, or at least I think
that it does.

David Haller

unread,
Oct 22, 2016, 6:40:03 AM10/22/16
to
Hello,

On Fri, 21 Oct 2016, Behrouz Khosravi wrote:
>> $ mplayer foo.mp4 | grep '^VO: '
>> VO: [gl] ...
>> $ mpv foo.mp4 | grep '^VO: '
>> VO: [opengl]
>>
>> See 'mplayer -vo help' and 'mpv -vo help'.
>
>Thanks. It seems that mplayer is using "xv" and mpv uses "opengl-hq". mpv
>work ok with "xv" but quality degrades a little, or at least I think that it
>does.

Are you sure? Albeit, I'm not familiar with mpv.

Try 'opengl', 'opengl-old'... But 'xv' should be just as good. Maybe
there's some filter (deblocking/deringing/denoise) active with one but
not with 'xv'.

And I've IIRC used plain 'x11' (or was it 'xv'?) for a very long time.

Try benchmarking yourself a bit, after you've found a setting where no
tearing occurs. Seems mpv has scrapped that benchmarking code of
mplayer though.

$ mplayer -ss 20:00 -endpos 10 -benchmark -vo x11 foo.mkv
BENCHMARKs: VC: 0.910s VO: 1.792s A: 0.043s Sys: 5.272s = 8.017s
$ mplayer -ss 20:00 -endpos 10 -benchmark -vo xv foo.mkv
BENCHMARKs: VC: 1.076s VO: 0.147s A: 0.048s Sys: 6.746s = 8.018s
$ mplayer -ss 20:00 -endpos 10 -benchmark -vo gl foo.mkv
BENCHMARKs: VC: 1.117s VO: 0.251s A: 0.045s Sys: 6.604s = 8.018s
$ mplayer -ss 20:00 -endpos 10 -benchmark -vo gl2 foo.mkv
BENCHMARKs: VC: 0.929s VO: 0.746s A: 0.040s Sys: 6.307s = 8.021s
$ mplayer -ss 20:00 -endpos 10 -benchmark -vo vdpau foo.mkv
BENCHMARKs: VC: 1.161s VO: 0.204s A: 0.071s Sys: 6.582s = 8.018s

Look at the 'VO: ...s' column. You'd probably need longer tests for
significant results.

But, as mpv is based on the mplayer code, I guess you can "port" the
results of each "-vo" to mpv with some educated guesses, and 'gl'
(mpv: 'opengl'?) seems best ... ;)

BTW: Why not just use mplayer? What does mpv offer that mplayer doesn't?

BTW2:
$ mplayer -ss 20:00 -endpos 10 -benchmark -vo vdpau -vc ffh264vdpau foo.mkv
[just errors and some sound]
$ midentify foo.mkv | grep CODEC
ID_VIDEO_CODEC=ffh264
ID_AUDIO_CODEC=ffac3

Which is why I don't use vdpau ;)

HTH,
-dnh, firmly sticking to the original mplayer, and using mencoder
on a regular basis

--
"Airplane travel is nature's way of making you look like your
passport photo." -- Al Gore

Behrouz Khosravi

unread,
Oct 22, 2016, 9:10:03 AM10/22/16
to
well the thing with quality is not important. I is negligible ( without
xv option, video seems a little brighter) However it is not important.
Good thing is that I realized what mplayer was doing for default which
mpv wasnt.
Anyway I can get what mplayer was offering, with mpv now, so there is no
need to change.

Michael Mol

unread,
Oct 24, 2016, 8:50:03 AM10/24/16
to
On Saturday, October 22, 2016 05:28:22 AM David Haller wrote:
> Hello,
>
> On Fri, 21 Oct 2016, Behrouz Khosravi wrote:
> >> $ mplayer foo.mp4 | grep '^VO: '
> >> VO: [gl] ...
> >> $ mpv foo.mp4 | grep '^VO: '
> >> VO: [opengl]
> >>
> >> See 'mplayer -vo help' and 'mpv -vo help'.
> >
> >Thanks. It seems that mplayer is using "xv" and mpv uses "opengl-hq". mpv
> >work ok with "xv" but quality degrades a little, or at least I think that
> >it does.
>
> Are you sure? Albeit, I'm not familiar with mpv.
>
> Try 'opengl', 'opengl-old'... But 'xv' should be just as good. Maybe
> there's some filter (deblocking/deringing/denoise) active with one but
> not with 'xv'.
>
> And I've IIRC used plain 'x11' (or was it 'xv'?) for a very long time.

Unless things have changed massively in the last 3-4 years, you almost
certainly were using xv without really knowing about it. With just 'x11',
you're forced into using software scaling instead of hardware scaling, which
massively slows things down. And hardware scaling has been a feature of
essentially every video card since, I dunno, 1994 or earlier? And the xv
extension has been available since 1991...

--
:wq
signature.asc

David Haller

unread,
Oct 25, 2016, 9:40:03 AM10/25/16
to
Hello,
That was with Matrox Mystique 4 MB from 1996 and XFree86 3.3.6.

$ grep 'vo=' Backup/.../.mplayer/config:vo=x11

I tried xv, and I guess it did not work as well as x11 ;)

-dnh

--
lp1 on fire
-- One of the more obfuscated kernel messages
0 new messages