[mythtv-users] High CPU with XvMC and nvidia?

Tom Lichti tom at redpepperracing.com
Fri Mar 10 19:49:23 UTC 2006


I have finally gotten XvMC working on my new frontend. Well, seemingly 
working. All indications are that XvMC is loaded and working, but my CPU 
usage is actually HIGHER than when I was using straight ffmpeg/libmpeg2 
with no hardware acceleration. Here is my setup:

Library API version: 0.19.20060226-1
Source code version: 9208
Options compiled in:
 linux debug using_xvmcw using_v4l using_oss using_alsa using_ivtv 
using_lirc using_x11 using_xv using_xrandr using_xvmc using_xvmc_vld 
using_opengl_vsync using_frontend using_backend

I have an nVidia 6200 based card, using nVidia driver 76.76 and my 
seemingly relevant frontend settings are as follows:

| AggressiveSoundcardBuffer       | 
1                                                  
| AudioDevice | /dev/dsp
| DecodeExtraAudio                | 
1                                                                   
| Deinterlace                     | 
1                                                                    
| DeinterlaceFilter               | 
bobdeint                                                      
| PreferredMPEG2Decoder           | 
xvmc                                               
| RealtimePriority                | 
0                                                                
| UseMPEG2Dec                     | 
0                                                           
| UseOpenGLVSync                  | 
1                                                        
| UseOutputPictureControls        | 
1                                                       
| UseVideoModes                   | 
0                                                           
| UseVideoTimebase                | 
1                                                         
| UseVirtualKeyboard              | 
1                                                         
| UseXVMC                         | 
1                                                             
| UseXvMcVld                      | 
0                                                            

My hardware is as follows:

P4 Celeron 2.93
1GB RAM
Via based Mobo
nVidia 6200GT AGP4x

And relevant XFree86-4 setup:

Section "Module"
    Load       "dri"
    Load           "dbe"        # Double buffer extension
    Load "v4l" # Video for Linux
    SubSection     "extmod"
        Option         "omit xfree86-dga"   # don't initialise the DGA 
extension
    EndSubSection
    Load           "type1"
    Load           "speedo"
    Load           "freetype"
    Load           "glx"
EndSection

Section "Device"
    Identifier     "device1"
    BoardName "NVIDIA GeForce FX (generic)"
    Driver "nvidia"
    Option "NvAGP" "1"
    Option "NoDDC"
    Option "ConnectedMonitor" "TV"
    Option "TVOutFormat" "SVIDEO"
    Option "TVStandard" "HD480i"
    Option "DPMS" "off"
    Option "CoolBits" "1"
    Option "IgnoreEDID" "1"
    Option "NoLogo" "true"
    Option "HWCursor" "true"
    Option "RenderAccel" "false"
    Option "XvmcUsesTextures" "false" # use 3d engine for overlays
EndSection

Here is my frontend log with -v playback,general,important:

2006-03-10 14:44:56.341 VideoOutputXv: XvMC version: 1.0
2006-03-10 14:44:56.341 XvMCSurfaceTypes::find(w 720, h 480, chroma 1, 
vld 0, idct 1, mpeg2, sub-width 0, sub-height 0, disp, p<= 270, 2700 
<=p, port, surfNum)
2006-03-10 14:44:56.342 Trying XvMC port 270
2006-03-10 14:44:56.345 Found a suitable XvMC surface 0
2006-03-10 14:44:56.347 reads allowed (128001 -1)
2006-03-10 14:44:56.345 VideoOutputXv: @ j=1 Looking for flag[s]: 
XvInputMask
2006-03-10 14:44:56.347 VideoOutputXv: Adaptor: 0 has flag[s]: 
XvInputMask XvImageMask
2006-03-10 14:44:56.347 XvMCSurfaceTypes::find(w 720, h 480, chroma 1, 
vld 0, idct 1, mpeg2, sub-width 0, sub-height 0, disp, p<= 270, 2700 
<=p, port, surfNum)
2006-03-10 14:44:56.347 Trying XvMC port 270
2006-03-10 14:44:56.347 Found a suitable XvMC surface 0
2006-03-10 14:44:56.348 VideoOutputXv: Grabbed xv port 270
2006-03-10 14:44:56.348 VideoOutputXv: XvMC surface found with IDCT 
support on port 270
2006-03-10 14:44:56.357 VideoOutputXv: Closing XVideo port 270
2006-03-10 14:44:56.359 detectInterlace(Detect Scan, Detect Scan, 29.97, 
480) ->Interlaced Scan
2006-03-10 14:44:56.360 Interlaced: Interlaced Scan  video_height: 480  
fps: 29.97
2006-03-10 14:44:56.360 AFD: Looking for decoder for MPEG2VIDEO_XVMC
2006-03-10 14:44:56.361 AFD: Opened codec 0x88fa920, id(MPEG2VIDEO_XVMC) 
type(Video)
2006-03-10 14:44:56.361 AFD: Stream #1, has id 0x448 codec id MP2, type 
Audio at 0x0x88fa7b0
2006-03-10 14:44:56.361 AFD: Looking for decoder for MP2
2006-03-10 14:44:56.382 AFD: Opened codec 0x88fb130, id(MP2) type(Audio)
2006-03-10 14:44:56.383 AFD: Stream #2, has id 0x105 codec id MPEG2VBI, 
type Data at 0x0x88fb460
2006-03-10 14:44:56.383 AFD: data codec (Data)
2006-03-10 14:44:56.389 
RingBuf(myth://10.10.20.170:6543/1002_20060310144452.mpg): 
CalcReadAheadThresh(4384 KB)
                         -> threshhold(416 KB) min read(32 KB) blk 
size(128 KB)
2006-03-10 14:44:56.391 Opening audio device 'default'.
2006-03-10 14:44:56.419 reads allowed (643073 32768)
2006-03-10 14:44:56.514 AudioOutput Warning: Mixer attach error -2: No 
such file or directory
                        Check Mixer Name in Setup: '/dev/mixer'
2006-03-10 14:44:56.515 Resyncing position map. posmapStarted = 0 
livetv(1) watchingRec(0)
2006-03-10 14:44:56.518 Position map filled from DB to: 6
2006-03-10 14:44:56.518 SyncPositionMap watchingrecording, from DB: 6 
entries
2006-03-10 14:44:56.526 Filling position map from 7 to 5
2006-03-10 14:44:56.532 Position map filled from Encoder to: 6
2006-03-10 14:44:56.532 SyncPositionMap watchingrecording total: 6 entries
2006-03-10 14:44:56.532 SyncPositionMap, new totframes: 90, new length: 
3, posMap size: 6
2006-03-10 14:44:56.532 AFD: Partial position map found
2006-03-10 14:44:56.532 AFD: Successfully opened decoder for file: 
"myth://10.10.20.170:6543/1002_20060310144452.mpg". novideo(0)
2006-03-10 14:44:56.538 VideoOutputXv: ctor
2006-03-10 14:44:56.547 Over/underscan. V: 0, H: 0, XOff: 0, YOff: 0
2006-03-10 14:44:56.551 Image size. dispxoff 0, dispyoff: 0, dispwoff: 
800, disphoff: 600, dispaspect: 1.33333
2006-03-10 14:44:56.551 Image size. imgx 0, imgy: 0, imgw: 720, imgh: 
480, aspect: 1.33333
2006-03-10 14:44:56.551 VideoOutputXv: Pixel dimensions: Screen 800x600, 
window 800x600
2006-03-10 14:44:56.552 VideoOutputXv: Estimated display dimensions: 
203x154 mm Aspect: 1.31818
2006-03-10 14:44:56.552 VideoOutputXv: Estimated window dimensions: 
203x154 mm Aspect: 1.31818
2006-03-10 14:44:56.552 VideoOutputXv: XvMC version: 1.0
2006-03-10 14:44:56.554 VideoOutputXv: @ j=1 Looking for flag[s]: 
XvInputMask
2006-03-10 14:44:56.554 VideoOutputXv: Adaptor: 0 has flag[s]: 
XvInputMask XvImageMask
2006-03-10 14:44:56.554 XvMCSurfaceTypes::find(w 720, h 480, chroma 1, 
vld 0, idct 1, mpeg2, sub-width 0, sub-height 0, disp, p<= 270, 2700 
<=p, port, surfNum)
2006-03-10 14:44:56.554 Trying XvMC port 270
2006-03-10 14:44:56.554 Found a suitable XvMC surface 0
2006-03-10 14:44:56.555 VideoOutputXv: Grabbed xv port 270
2006-03-10 14:44:56.555 VideoOutputXv: XvMC surface found with IDCT 
support on port 270
2006-03-10 14:44:56.573 VideoOutputXv Error: Couldn't get the color key 
color,
                        probably due to a driver bug or limitation.
                        You might not get any video, but we'll try anyway.
2006-03-10 14:44:56.573 Image size. dispxoff 0, dispyoff: 0, dispwoff: 
800, disphoff: 600, dispaspect: 1.33333
2006-03-10 14:44:56.574 Image size. imgx 0, imgy: 0, imgw: 720, imgh: 
480, aspect: 1.33333
2006-03-10 14:44:56.806 OSDTypePositionImage::AddPosition[0](95x281  1, 1)
2006-03-10 14:44:56.806 OSDTypePositionImage::AddPosition[1](95x311  1, 1)
2006-03-10 14:44:56.807 OSDTypePositionImage::AddPosition[2](95x341  1, 1)
2006-03-10 14:44:56.807 OSDTypePositionImage::AddPosition[3](95x371  1, 1)
2006-03-10 14:44:57.118 NVP: ClearAfterSeek()
2006-03-10 14:44:57.118 VideoOutputXv: ClearAfterSeek()
2006-03-10 14:44:57.118 VideoOutputXv: DiscardFrames() 1: AAAAAAAA
2006-03-10 14:44:57.118 VideoOutputXv: DiscardFrames() 2: AAAAAAAA
2006-03-10 14:44:57.119 VideoOutputXv: DiscardFrames() 3: AAAAAAAA
2006-03-10 14:44:57.119 VideoOutputXv: DiscardFrames() 4: AAAAAAAA -- done()
2006-03-10 14:44:57.119 TV: StartPlayer(): took 3264 ms to start player.
2006-03-10 14:44:57.120 TV: Changing from None to WatchingLiveTV
2006-03-10 14:44:57.121 VideoOutputXv: DiscardFrames() 1: AAAAAAAA
2006-03-10 14:44:57.121 VideoOutputXv: DiscardFrames() 2: AAAAAAAA
2006-03-10 14:44:57.121 VideoOutputXv: DiscardFrames() 3: AAAAAAAA
2006-03-10 14:44:57.121 VideoOutputXv: DiscardFrames() 4: AAAAAAAA -- done()
2006-03-10 14:44:57.123 The realtime priority setting is not enabled.
2006-03-10 14:44:57.139 Using deinterlace method bobdeint
2006-03-10 14:44:57.246 nVidiaVideoSync: VBlank ioctl did not work, 
unimplemented in this driver?
2006-03-10 14:44:57.282 DRMVideoSync: Could not open device 
/dev/dri/card0, No such device or address
2006-03-10 14:44:57.284 OpenGLVideoSync: GLX extensions: 
GLX_EXT_visual_info GLX_EXT_visual_rating GLX_SGIX_fbconfig 
GLX_SGIX_pbuffer GLX_SGI_video_sync GLX_SGI_swap_control 
GLX_ARB_multisample GLX_NV_float_buffer GLX_ARB_fbconfig_float 
GLX_ARB_get_proc_address
2006-03-10 14:44:57.285 OpenGLVideoSync: x,y -> 401, 301
2006-03-10 14:44:57.317 Using OpenGLVideoSync
2006-03-10 14:44:57.318 Set video sync frame interval to 33366
2006-03-10 14:44:57.325 Using video as timebase
2006-03-10 14:44:57.325 Video timing method: SGI OpenGL
2006-03-10 14:44:57.326 Refresh rate: 16579, frame interval: 33366
2006-03-10 14:44:57.384 dropping back audio_buffer_unused
2006-03-10 14:44:57.392 VideoOutputXv Error: ProcessFrameXvMC: Failed to 
get OSD lock

I could have sworn I set the audio to ALSA:default (I just did that, and 
it made no difference), but other than that I think I got everything set 
right. Video seems to play fine, but CPU usage hovers at around 90% all 
the time.

I just noticed something else very odd, when I catted 
/proc/driver/nvidia/agp/status it said it was disabled. I remembered I 
had tried to enable NvAGP and had no luck with it, but the setting NvAGP 
"1" was still in my XFree86-4 config. When I fixed that, and enabled 
AGP, CPU goes pegged to 99% and LiveTV doesn't work and I have to kill 
mythfrontend. So it appears that there is something funky going on with 
AGP as well, if it's set to anything other than '1' in XFree86. Strange.

What am I missing?

Thanks
Tom



More information about the mythtv-users mailing list