[MPlayer-users] MPlayer performance problems with Compiz
Diogo Franco
diogomfranco at gmail.com
Sun Jun 22 20:11:17 CEST 2008
Em Sáb, 2008-06-21 às 20:04 +0200, Reimar Döffinger escreveu:
> On Sat, Jun 21, 2008 at 10:38:18AM -0300, Diogo Franco wrote:
> > MPlayer is r27120-4.2.3, FFmpeg is r13836. MPlayer links to libav* wit
> > dynamic linking
>
> That is a truly horrible idea and in the case of libavutil unsupported
> (well, more precisely you will end up with a mixture of installed and
> in-MPlayer-tree libavutil).
Rebuilt mplayer with static libav*. I did make clean before
reconfiguring and make. I wanted to do dynamic linking to reduce
redundant recompilation as I always build ffmpeg and mplayer together.
>
> > > [gl] using extended formats. Use -vo gl:nomanyfmts if playback fails.
> > > VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
> > > [swscaler @ 0x7d8410]using unscaled yuv420p -> rgb32 special converter
> > > VO: [gl] 640x480 => 640x480 BGRA
> > > BENCHMARKs: VC: 5.440s VO: 5.293s A: 0.803s Sys: 18.670s = 30.206s
> > > BENCHMARK%: VC: 18.0107% VO: 17.5233% A: 2.6591% Sys: 61.8070% = 100.0000%
> > > BENCHMARKn: disp: 712 (23.57 fps) drop: 10 (1%) total: 722 (23.90 fps)
> > The only 'yuv=' mode my card supports is 'yuv=0'.
>
> I completely forgot how crappy the MX cards were, given that my GeForce
> 3 can handle yuv...
> Then -dr is an absolute must. -vo gl:force-pbo might help too, though
> with yuv=0 -dr should work better.
> And those Sys numbers are insane, there is something very wrong.
They ARE crappy, they're GeForce 2 in disguise.
The gl test now uses :force-pbo and I use dr on all VOs.
Also, is there a way to see what is the kernel doing with all that CPU
time?
> > > [VO_SDL] Using driver: x11.
> > > VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
> > > VO: [sdl] 640x480 => 640x480 Planar YV12
> > > BENCHMARKs: VC: 5.299s VO: 3.711s A: 0.850s Sys: 20.239s = 30.099s
> > > BENCHMARK%: VC: 17.6058% VO: 12.3283% A: 2.8248% Sys: 67.2411% = 100.0000%
> > > BENCHMARKn: disp: 720 (23.92 fps) drop: 2 (0%) total: 722 (23.99 fps)
> > Nothing big, only that it always creates the window on the lower left.
>
> Well, actually the window ends up where ever your window manger puts it.
> You should be able to tell your window manager to do at least a bit
> better.
Compiz only accepts coordinates in X and Y, I can't tell it to 'center'.
I'll see if I can do it on the vo level.
> [...]
> > > VDec: vo config request - 1280 x 720 (preferred colorspace: Planar YV12)
> > > VO: [xv] 1280x720 => 1280x720 Planar YV12
> > > BENCHMARKs: VC: 14.001s VO: 20.111s A: 0.397s Sys: 6.840s = 41.348s
> > > BENCHMARK%: VC: 33.8605% VO: 48.6374% A: 0.9607% Sys: 16.5415% = 100.0000%
> > > BENCHMARKn: disp: 694 (16.78 fps) drop: 29 (4%) total: 723 (17.49 fps)
> > Don't be fooled by the low drop rate, mplayer hang many times and when it hang
> > the vo would go back and forth one frame and repeated that until mplayer
> > 'revived'. If I use -noslices, tearing happens at multiple points.
>
> To be honest, with -framedrop and H.264 you are quite lucky if it works
> at all.
> But overall I would say that somehow compiz breaks xv. Are you using the
> latest version? There was a patch to hack special "compiz support" for
> -vo xv but nobody could really explain why it would be necessary for, it
> might have been to work around compiz bugs...
I'm using Compiz 0.7.4 as it came with Hardy.
Em Sáb, 2008-06-21 às 19:33 +0200, Dominik 'Rathann' Mierzejewski
escreveu:
> Why are you using threads when you have a single CPU? There seems to
> be
> a bug in threading, because I'm experiencing jerky video on my system
> (dual core Athlon64) if I enable them. Try without.
>
> Regards,
> R.
I tested again with -lavdopts threads=1.
Here are the results with Reimar's and Dominik's suggestions:
for i in "gl:force-pbo" "gl2" "gl2:noglfinish" "xv:adaptor=1" \
"sdl" "x11"; do
sudo nice -n -10 mplayer -endpos 30 -hardframedrop -slices \
-dr -lavdopts threads=1 -vf-clr -correct-pts -benchmark \
-quiet -vo $i "$video" 2>&1 \
| grep -E 'BENCHMARK|vo|VO|swscaler'
echo
done
> [gl] using extended formats. Use -vo gl:nomanyfmts if playback fails.
> VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
> [swscaler @ 0xc04df0]using unscaled yuv420p -> rgb32 special converter
> VO: [gl] 640x480 => 640x480 BGRA
> BENCHMARKs: VC: 5.205s VO: 3.402s A: 0.840s Sys: 20.776s = 30.222s
> BENCHMARK%: VC: 17.2208% VO: 11.2557% A: 2.7798% Sys: 68.7438% = 100.0000%
> BENCHMARKn: disp: 712 (23.56 fps) drop: 10 (1%) total: 722 (23.89 fps)
>
> VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
> [swscaler @ 0xc04df0]using unscaled yuv420p -> bgr24 special converter
> VO: [gl2] 640x480 => 640x480 BGR 24-bit
> BENCHMARKs: VC: 5.401s VO: 17.813s A: 1.528s Sys: 5.470s = 30.212s
> BENCHMARK%: VC: 17.8779% VO: 58.9593% A: 5.0566% Sys: 18.1062% = 100.0000%
> BENCHMARKn: disp: 712 (23.57 fps) drop: 10 (1%) total: 722 (23.90 fps)
Nothing changed for those two above.
> VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
> [swscaler @ 0xc04df0]using unscaled yuv420p -> bgr24 special converter
> VO: [gl2] 640x480 => 640x480 BGR 24-bit
> BENCHMARKs: VC: 4.906s VO: 6.047s A: 0.853s Sys: 18.334s = 30.139s
> BENCHMARK%: VC: 16.2769% VO: 20.0638% A: 2.8290% Sys: 60.8303% = 100.0000%
> BENCHMARKn: disp: 709 (23.52 fps) drop: 13 (1%) total: 722 (23.96 fps)
It still flickers when frames are dropping, even with only "-framedrop".
I left '-hardframedrop' for the tests as it gains some CPU time.
> VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
> VO: [xv] 640x480 => 640x480 Planar YV12
> BENCHMARKs: VC: 5.587s VO: 0.574s A: 0.795s Sys: 23.143s = 30.099s
> BENCHMARK%: VC: 18.5627% VO: 1.9074% A: 2.6398% Sys: 76.8901% = 100.0000%
> BENCHMARKn: disp: 722 (23.99 fps) drop: 0 (0%) total: 722 (23.99 fps)
With -dr, it shows tearing and the video doesn't look smooth.
> [VO_SDL] Using driver: x11.
> VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
> VO: [sdl] 640x480 => 640x480 Planar YV12
> BENCHMARKs: VC: 4.738s VO: 4.000s A: 0.804s Sys: 20.559s = 30.101s
> BENCHMARK%: VC: 15.7393% VO: 13.2903% A: 2.6703% Sys: 68.3002% = 100.0000%
> BENCHMARKn: disp: 720 (23.92 fps) drop: 2 (0%) total: 722 (23.99 fps)
Used less CPU than all the other ones.
> VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
> VO: [x11] 640x480 => 640x480 Planar YV12
> [swscaler @ 0xc04df0]using unscaled yuv420p -> rgb32 special converter
> BENCHMARKs: VC: 4.805s VO: 13.952s A: 0.791s Sys: 10.559s = 30.109s
> BENCHMARK%: VC: 15.9602% VO: 46.3402% A: 2.6283% Sys: 35.0713% = 100.0000%
> BENCHMARKn: disp: 716 (23.78 fps) drop: 6 (0%) total: 722 (23.98 fps)
Used more CPU than all the other ones.
With the 640x480 video no vo used 100% cpu. Also, frames are dropped only
on the beginning of the movie, maybe because X is stealing some CPU to put
the window on the screen while MPlayer is already playing the audio.
> [gl] using extended formats. Use -vo gl:nomanyfmts if playback fails.
> VDec: vo config request - 1280 x 720 (preferred colorspace: Planar YV12)
> [swscaler @ 0xc04df0]using unscaled yuv420p -> rgb32 special converter
> VO: [gl] 1280x720 => 1280x720 BGRA
> BENCHMARKs: VC: 13.117s VO: 16.585s A: 0.522s Sys: 0.700s = 30.924s
> BENCHMARK%: VC: 42.4175% VO: 53.6293% A: 1.6893% Sys: 2.2639% = 100.0000%
> BENCHMARKn: disp: 343 (11.09 fps) drop: 381 (52%) total: 724 (23.41 fps)
Still very slow.
> VDec: vo config request - 1280 x 720 (preferred colorspace: Planar YV12)
> [swscaler @ 0xc04df0]using unscaled yuv420p -> bgr24 special converter
> VO: [gl2] 1280x720 => 1280x720 BGR 24-bit
> BENCHMARKs: VC: 12.682s VO: 16.732s A: 0.418s Sys: 0.526s = 30.357s
> BENCHMARK%: VC: 41.7750% VO: 55.1163% A: 1.3758% Sys: 1.7329% = 100.0000%
> BENCHMARKn: disp: 231 (7.61 fps) drop: 493 (68%) total: 724 (23.85 fps)
Very slow too.
> VDec: vo config request - 1280 x 720 (preferred colorspace: Planar YV12)
> [swscaler @ 0xc04df0]using unscaled yuv420p -> bgr24 special converter
> VO: [gl2] 1280x720 => 1280x720 BGR 24-bit
> BENCHMARKs: VC: 14.025s VO: 15.362s A: 0.475s Sys: 0.591s = 30.453s
> BENCHMARK%: VC: 46.0531% VO: 50.4453% A: 1.5612% Sys: 1.9405% = 100.0000%
> BENCHMARKn: disp: 363 (11.92 fps) drop: 361 (49%) total: 724 (23.77 fps)
Flickers all the time with those colors.
> VDec: vo config request - 1280 x 720 (preferred colorspace: Planar YV12)
> VO: [xv] 1280x720 => 1280x720 Planar YV12
> BENCHMARKs: VC: 12.828s VO: 17.407s A: 0.394s Sys: 9.823s = 40.452s
> BENCHMARK%: VC: 31.7127% VO: 43.0307% A: 0.9731% Sys: 24.2834% = 100.0000%
> BENCHMARKn: disp: 694 (17.16 fps) drop: 29 (4%) total: 723 (17.87 fps)
No better than before.
> [VO_SDL] Using driver: x11.
> VDec: vo config request - 1280 x 720 (preferred colorspace: Planar YV12)
> VO: [sdl] 1280x720 => 1280x720 Planar YV12
> BENCHMARKs: VC: 12.392s VO: 17.436s A: 0.398s Sys: 0.190s = 30.417s
> BENCHMARK%: VC: 40.7419% VO: 57.3237% A: 1.3087% Sys: 0.6257% = 100.0000%
> BENCHMARKn: disp: 447 (14.70 fps) drop: 277 (38%) total: 724 (23.80 fps)
>
> VDec: vo config request - 1280 x 720 (preferred colorspace: Planar YV12)
> VO: [x11] 1280x720 => 1280x720 Planar YV12
> [swscaler @ 0xc04df0]using unscaled yuv420p -> rgb32 special converter
> BENCHMARKs: VC: 11.525s VO: 18.085s A: 0.398s Sys: 0.242s = 30.250s
> BENCHMARK%: VC: 38.0996% VO: 59.7866% A: 1.3147% Sys: 0.7991% = 100.0000%
> BENCHMARKn: disp: 304 (10.05 fps) drop: 420 (58%) total: 724 (23.93 fps)
These two surprised me, specially the last one as it was supposed to be
completely unnacelerated. I turned on XRender acceleration on xorg.conf,
maybe that has something to do with it? The video looked smoother than on
the other VOs. For now, SDL is winning.
PS: Possibly irrelevant, but on .mplayer/config ao=pulse.
More information about the MPlayer-users
mailing list