[Mplayer-advusers] Bug? Anomalous CPU usage when playing HDTV clips.

John Stebbins stebbins at jetheaddev.com
Tue Apr 6 01:18:59 CEST 2004


On Sat, 2004-04-03 at 01:36, Reimar Döffinger wrote:
> Hi,
> 
> > glxinfo:
> > glx version 1.2
> > OpenGL version 1.3 Mesa 5.0.2
> > glu verion 1.3
> 
> Are you sure you have hardware acclerated OpenGL? Mesa usually means you 
> are using a software-only implemetation (and I'm not sure if there 
> actually is true OpenGL support for your graphics cards).
> 

XFree86 integrates the direct rendering interface (DRI) with Mesa to
provide hardware accelerated OpenGL.  My graphics card is recognized
by DRI.

From: http://www.xfree86.org/4.1.0/DRI8.html
<quote>
glxinfo is a useful program for checking which version of libGL you're
using as well as which DRI-based driver. Simply type glxinfo and examine
the OpenGL vendor, renderer, and version lines. Among the output you
should see something like this:

          OpenGL vendor string: VA Linux Systems, Inc.
          OpenGL renderer string: Mesa DRI Voodoo3 20000224
          OpenGL version string: 1.2 Mesa 3.4
        

or this:

          OpenGL vendor string: VA Linux Systems, Inc.
          OpenGL renderer string: Mesa GLX Indirect
          OpenGL version string: 1.2 Mesa 3.4
        

The first example indicates that the 3dfx driver is using Voodoo3
hardware. The second example indicates that no hardware driver was found
and indirect, unaccelerated rendering is being used.
<end quote>

For me, glxinfo reports:
OpenGL renderer string: Mesa DRI R200 20030328 AGP 4x x86/MMX+/SSE2 TCL

That pretty much confirms it.

> > This has been a good thought exerciser for me.  I just remembered
> > that I have been purposely excluding scaling from my tests so
> > as to narrow the variables.  I just re-ran several of the same
> > tests, scaling to fullscreen.  When I do this, x11 gets dramatically
> > slower, while XV stays about the same.
> > 
> > So, I think what I'm seeing could be one of 2 subtly different things.
> 
> Could you please give the output of xvinfo?
> 

Here you go:
X-Video Extension version 2.2
screen #0
  Adaptor #0: "ATI Radeon Video Overlay"
    number of ports: 1
    port base: 69
    operations supported: PutImage 
    supported visuals:
      depth 16, visualID 0x23
      depth 16, visualID 0x24
      depth 16, visualID 0x25
      depth 16, visualID 0x26
      depth 16, visualID 0x27
      depth 16, visualID 0x28
      depth 16, visualID 0x29
      depth 16, visualID 0x2a
      depth 16, visualID 0x2b
      depth 16, visualID 0x2c
      depth 16, visualID 0x2d
      depth 16, visualID 0x2e
      depth 16, visualID 0x2f
      depth 16, visualID 0x30
      depth 16, visualID 0x31
      depth 16, visualID 0x32
    number of attributes: 12
      "XV_SET_DEFAULTS" (range 0 to 1)
              client settable attribute
      "XV_AUTOPAINT_COLORKEY" (range 0 to 1)
              client settable attribute
              client gettable attribute (current value is 1)
      "XV_COLORKEY" (range 0 to -1)
              client settable attribute
              client gettable attribute (current value is 30)
      "XV_DOUBLE_BUFFER" (range 0 to 1)
              client settable attribute
              client gettable attribute (current value is 1)
      "XV_BRIGHTNESS" (range -1000 to 1000)
              client settable attribute
              client gettable attribute (current value is 0)
      "XV_CONTRAST" (range -1000 to 1000)
              client settable attribute
              client gettable attribute (current value is 0)
      "XV_SATURATION" (range -1000 to 1000)
              client settable attribute
              client gettable attribute (current value is 0)
      "XV_COLOR" (range -1000 to 1000)
              client settable attribute
              client gettable attribute (current value is 0)
      "XV_HUE" (range -1000 to 1000)
              client settable attribute
              client gettable attribute (current value is 0)
      "XV_RED_INTENSITY" (range -1000 to 1000)
              client settable attribute
              client gettable attribute (current value is 0)
      "XV_GREEN_INTENSITY" (range -1000 to 1000)
              client settable attribute
              client gettable attribute (current value is 0)
      "XV_BLUE_INTENSITY" (range -1000 to 1000)
              client settable attribute
              client gettable attribute (current value is 0)
    maximum XvImage size: 2048 x 2048
    Number of image formats: 4
      id: 0x32595559 (YUY2)
        guid: 59555932-0000-0010-8000-00aa00389b71
        bits per pixel: 16
        number of planes: 1
        type: YUV (packed)
      id: 0x59565955 (UYVY)
        guid: 55595659-0000-0010-8000-00aa00389b71
        bits per pixel: 16
        number of planes: 1
        type: YUV (packed)
      id: 0x32315659 (YV12)
        guid: 59563132-0000-0010-8000-00aa00389b71
        bits per pixel: 12
        number of planes: 3
        type: YUV (planar)
      id: 0x30323449 (I420)
        guid: 49343230-0000-0010-8000-00aa00389b71
        bits per pixel: 12
        number of planes: 3
        type: YUV (planar)

> > 2. Mplayer does color conversion about 4 times faster than XV.
> 
> If xv does it in software (which would probably be without SSE support), 
> certainly. Have you tried any of the vidix vos (especially the ATI card 
> might be supported)? They work only as root.
> 

vidix wasn't working because I forgot to ldconfig /usr/local/lib.  It
works now and vidix performs better than XV.  Using my HD test file (45
second clip, 1280x720 progressive 60fps) I get the following:

$mplayer -vo x11 -nosound -quiet -benchmark Alias.1280.60fps.avi

BENCHMARKs: VC:  24.444s VO:  10.598s A:   0.000s Sys:   0.321s =
35.363s
BENCHMARK%: VC: 69.1227% VO: 29.9702% A:  0.0000% Sys:  0.9071% =
100.0000%


$mplayer -vo xvidix -nosound -quiet -benchmark Alias.1280.60fps.avi

BENCHMARKs: VC:  37.587s VO:   0.069s A:   0.000s Sys:   0.380s =  
38.036s
BENCHMARK%: VC: 98.8192% VO:  0.1806% A:  0.0000% Sys:  1.0001% =
100.0000%


$mplayer -vo xv -nosound -quiet -benchmark Alias.1280.60fps.avi

BENCHMARKs: VC:  18.324s VO:  33.361s A:   0.000s Sys:   0.332s =  
52.017s
BENCHMARK%: VC: 35.2267% VO: 64.1343% A:  0.0000% Sys:  0.6390% =
100.0000%

Reminder: this is on a 1.4Ghz Pentium-M laptop with ATI
Radeon Mobility 9000 (R200) vintage graphics.  Running this
on a P4 2.6Ghz should shave about 8 seconds off the times for
x11 and vidix.  12 seconds off XV.

Note that I'm not scaling anything here.  X11 is still marginally
fastest.  Vidix lags just a little and XV sucks wind.

When I add scaling, x11 gets dramatically slower and the other 2
remain essentially the same.

I don't like the idea of running my media player as root.  But if thats
what it takes to play a live HD stream...

What bugs me is that I've always been under the impression that
color space conversion and scaling were done in hardware by the
XV driver.  So I was expecting to see XV cpu usage well below x11
cpu usage.  I guess I'm going to have to look at the code to find
out whats really going on.  I wonder how the proprietary nvidia
driver compares.

> > In either case, XV scales images essentially infinitely fast.
> > 
> > I don't see any options that would allow me to force color
> > conversion in software by mplayer and still use XV for scaling output.
> 
> -vf format=BGR24 for example, but you should compare against e.g. -vf 
> format=YV12, as when specifying like this, postprocessing isn't done 
> (thus making it faster).
> 
After doing a little more reading, XV appears to only accept the
following color formats: YUY2, UYVY, YV12, and I420.

Specifying a format using -vf format=XXXX only slows things down.

> Greetings,
> Reimar Döffinger
> 
> _______________________________________________
> Mplayer-advusers mailing list
> Mplayer-advusers at mplayerhq.hu
> http://mplayerhq.hu/mailman/listinfo/mplayer-advusers




More information about the MPlayer-advusers mailing list