Difference between revisions of "XvMC"

From MythTV Official Wiki
Jump to: navigation, search
(Extensive cleanup of XvMC information including some updates for 0.21)
Line 1: Line 1:
 +
== Introduction ==
 +
 
{{Wikipedia}}
 
{{Wikipedia}}
 
'''X-Video Motion Compensation''', or '''XvMC''', is a part of [[The X Window System]] which allows video programs to offload motion compensation and iDCT (Inverse Discrete Cosine Transform) portions of [[MPEG-2]] decoding to the GPU hardware. XvMC can greatly reduce CPU utilization when playing back MPEG-2 video. In theory it should also reduce bus bandwidth requirements. Savings will be most dramatic with slow CPUs or when playing [[HDTV]]. [[SDTV]] will benefit as well, but most modern CPUs can already play back SDTV without XvMC. MythTV can be compiled to use XvMC for native playback. External players such as Xine and Mplayer can also be compiled to support XvMC.
 
'''X-Video Motion Compensation''', or '''XvMC''', is a part of [[The X Window System]] which allows video programs to offload motion compensation and iDCT (Inverse Discrete Cosine Transform) portions of [[MPEG-2]] decoding to the GPU hardware. XvMC can greatly reduce CPU utilization when playing back MPEG-2 video. In theory it should also reduce bus bandwidth requirements. Savings will be most dramatic with slow CPUs or when playing [[HDTV]]. [[SDTV]] will benefit as well, but most modern CPUs can already play back SDTV without XvMC. MythTV can be compiled to use XvMC for native playback. External players such as Xine and Mplayer can also be compiled to support XvMC.
Line 4: Line 6:
 
Currently, only [[MPEG-2]] is supported. This is usually a hardware limitation, but can also in some chips case be a device driver limitation. As an exception, one of the newer VIA Unichrome chips is capable of XvMC accelerated [[MPEG-4]] playback, but it is not supported by the [http://sourceforge.net/projects/unichrome/ official UniChrome] driver at the time of writing this, instead you have to turn to the [http://www.openchrome.org openChrome project] drivers (which has an updated forked version of libxvmc).
 
Currently, only [[MPEG-2]] is supported. This is usually a hardware limitation, but can also in some chips case be a device driver limitation. As an exception, one of the newer VIA Unichrome chips is capable of XvMC accelerated [[MPEG-4]] playback, but it is not supported by the [http://sourceforge.net/projects/unichrome/ official UniChrome] driver at the time of writing this, instead you have to turn to the [http://www.openchrome.org openChrome project] drivers (which has an updated forked version of libxvmc).
  
A new video acceleration API is being developed, in an effort lead by Intel.  This new API supports more complete offload (VLD) as well as iDCT+MC, and can support acceleration of MPEG-4 ASP (H.263), MPEG-4 AVC (H.264), VC-1/VMW3, as well as MPEG-2. The website for this effort is located at: http://www.freedesktop.org/wiki/Software/vaapi
+
A new video acceleration API is being developed, in an effort lead by Intel.  This new API supports more complete offload (VLD) as well as iDCT+MC, and can support acceleration of [[MPEG-4]] ASP (H.263), MPEG-4 AVC ([[H.264]]), VC-1/VMW3, as well as [[MPEG-2]]. The website for this effort is located at: http://www.freedesktop.org/wiki/Software/vaapi
 +
 
 +
Some users have also provided [[XvMC:Example_CPU_Savings|a chart of example CPU savings]]
  
 
== Drivers ==
 
== Drivers ==
 +
 
Each hardware video card capable of XvMC video acceleration requires a software driver to enable these features. Below is a list of the recommended software drivers and driver versions for each supported hardware type.
 
Each hardware video card capable of XvMC video acceleration requires a software driver to enable these features. Below is a list of the recommended software drivers and driver versions for each supported hardware type.
  
=== Nvidia ===
+
{| border=1 cellpadding=5 cellspacing=1
There are currently three X11 Nvidia drivers available: Two open source and one proprietary binary. However, most, if not all people running an Nvidia card with MythTV use the binary driver. See below for an explanation of each driver.  Recent NVidia cards have support for full [[MPEG-2]] offload (iDCT + MC), and even [[MPEG-4]] offload but that is not addressed in XvMC.  The GeForce4 MX and GeForce FX series cards also support full MPEG-2 offload.  The GeForce 4 (non-MX) series cards and earlier support only hardware motion compensation, not the more CPU intensive iDCT offload.
+
|- style="background-color: black; color:white"
 
+
! Chipset
==== Proprietary Binary ====
+
! XvMC?
{| border=1 cellspacing=0 cellpadding=4
+
! Source
|-
+
! Version
| Status
+
! Driver
| This driver is full featured and actively maintained and developed directly by Nvidia Corp. Unless otherwise noted, any mention of Nvidia hardware on the MythTV wiki, forums, or mailing lists usually imply the use of the binary Nvidia driver.
 
|- bgcolor=#CCFFCC
 
| Supports XvMC?
 
| '''YES'''
 
|-
 
| How to Obtain?
 
| This driver is '''not''' included with the XOrg X11 Server for licensing reasons. It is available as a third party download. Usually your linux distribution will have a package available in RPM, Deb, ebuild, or other format.
 
|-
 
| Recommended Version
 
| As of 2006-04-7, the currently recommended driver version is: '''1.0.8756''' as it fixes the [[OpenGL Vsync]] issues present in earlier versions, as well as fixing the AGP + XvMC issues on 6200 series cards.<br>
 
Versions between '''1.0.7676''' and '''1.0.8756''' (exclusive) have broken [[OpenGL Vsync]]. These versions are still usable so long as OpenGL Vsync is disabled in mythfrontend's settings. One user, [[User:trevarthan|Trevarthan]], reports that version greater than '''1.0.8178''' prevent a kernel panic while running [[Configuring_MythGame_Emulation#Nintendo:_N64|mupen64]].
 
 
 
I tested XvMC with the 8756 driver on a Geforce 6150 based motherboard (the Asus A8N-VM CSM) and it works fine with MythTV at about 10% CPU usage using a Athlon64 3200+ --[[User:Seanyseansean|Seanyseansean]] 11:04, 10 April 2006 (UTC)
 
 
 
The 9631 version is the final release that supports integrated Geforce 4 MX graphics chipsets. It's also the first driver I've tried that doesn't cause hardware lockups during XvMC playback on my hardware, so I'm happy with it.
 
 
 
 
|-
 
|-
| X11 driver name
+
! style="background-color: lightyellow" | '''NVIDIA'''
 +
! style="background-color: lightgreen" | Yes
 +
| [http://www.nvidia.com www.nvidia.com]
 +
| Any recent version of the driver is acceptable.  See the Nvidia page for more details
 
| nvidia
 
| nvidia
 
|-
 
|-
| Chipset Availability
+
! style="background-color: lightyellow" | '''NVIDIA'''
| Nvidia Chipsets are widely available and can be found commonly on PCI, AGP, and PCI-e cards, as well as on motherboards with integrated video, though significantly less common on the latter.
+
! style="background-color: pink" | No
|}
+
| Included with Xorg distribution
 
+
| Included version
==== Open Source ====
 
{| border=1 cellspacing=0 cellpadding=4
 
|-
 
| Status
 
| Basic functionality. Only supports 2D hardware acceleration. (no 3D/OpenGL acceleration)
 
|- bgcolor=#FFCCCC
 
| Supports XvMC?
 
| ''NO''
 
|-
 
| How to Obtain?
 
| Included with the XOrg X11 Server.
 
|-
 
| X11 driver name
 
 
| nv
 
| nv
|}
 
 
==== Open Source ====
 
{| border=1 cellspacing=0 cellpadding=4
 
 
|-
 
|-
| Status
+
! style="background-color: lightyellow" | '''Unichrome'''
| Basic functionality. Only supports 2D hardware acceleration. (no 3D/OpenGL acceleration yet, but it is in development)
+
! style="background-color: lightgreen" | Yes
|- bgcolor=#FFCCCC
+
| Included in Xorg 6.9 and above distributions
| Supports XvMC?
+
| Included version
| ''NO'' (not yet, but development has begone by [http://nouveau.freedesktop.org/wiki/jb17bsome jb17bsome])
+
| openchrome
 
|-
 
|-
| How to Obtain?
+
! style="background-color: lightyellow" | '''Intel'''
| Nouveau WIKI http://nouveau.freedesktop.org/wiki/FrontPage
+
! style="background-color: lightgreen" | Yes
 +
| Included in Xorg distribution
 +
| Included version
 +
| i810 or intel
 
|-
 
|-
| X11 driver name
+
! style="background-color: lightyellow" | <center>'''ATI'''</center>
| nouveau
+
! style="background-color: pink" | No
 +
| At this time, there is no XvMC support for ATI cards in Linux drivers
 +
| N/A
 +
| N/A
 
|}
 
|}
  
=== Unichrome ===
+
== Enabling XvMC ==
"Unichrome" is the [http://www.s3graphics.com/en/products/unichrome/index.jsp product] name for the onboard graphics of Via chipsets.  The Unichrome chips can provide MPEG processing beyond standard XvMC [[MPEG-2]] acceleration. This is called VLD (Variable Length Decoder) acceleration and is commonly referred to as XvMC VLD.  XvMC VLD can provide full MPEG2 decoding, allowing MPEG playback with very low CPU requirements.  Most chipsets are limited to 1024x1024 playback resolution, and thus cannot support HDTV.  This includes many of the chipsets sold as "Pro" models, so take care to confirm HD support before purchase.
 
  
The Xorg via driver includes support for XvMC for both unichrome and unichrome-pro chipsets, however new chipset support is implemented in the [http://www.openchrome.org/ openchrome] [http://www.openchrome.org/trac svn] first. As  of July 2007, the openchrome project driver has been renamed to openchrome_drv.so and the Driver line in xorg.conf should say 'Driver "openchrome". The via driver continues to exist and the libraries are still 'libvia...'.
+
=== Installing the drivers ===
  
Support for [[MPEG-4]] and also IDCT/MC acceleration are currently in progress.
+
In order for MythTV to utilize the XvMC feature of your video chipset, you need to install the appropriate driver for your distribution. This process will vary by chipset and distribution but some general recommendations can be made.
The OpenChrome project has support for a [http://wiki.openchrome.org/tikiwiki/tiki-index.php?page=Supported+hardware+and+caveats broad range] of chipsets.
 
  
CN400 and PM800 chipsets are reported to support [[HDTV]] resolutions on [[VGA]]/[[DVI]] outputs. These are usually referred to as "Pro" chipsets. Many Pro chipsets ship with TV encoder chips that are not capable of displaying HDTV resolutions. These chipsets can typically playback HDTV on VGA/DVI, but not [[TV_Out | TVOUT]]. Pro chipsets that include a vt1625 HDTV encoder are physically capable of displaying HDTV resolutions via Component and SVid/Composite outputs. However, the openchrome project does not yet support the vt1625 so this functionality cannot be used. Of the TVOUT interfaces mentioned above, only Component is actually capable of displaying HDTV resolutions. Composite and S-video do not have the bandwidth, so your HDTV video will be scaled to [[SDTV]] resolutions. Note also that a response to a pre-sales technical support inquiry regarding the DVI daughterboards indicates they are limited to a maximum resolution of 1600x1200. Thus it seems that if you planning on using DVI that you will be limited to a maximum standard HD resolution of 720p (1280x720) output.
+
For nvidia chipsets, go to [http://www.nvidia.com www.nvidia.com] and download the binary driver installer package from their website. Follow the instructions there for executing the package and installing the modules. Also, the [http://www.atrpms.net ATRPMS] site packages nvidia drivers for installation on new Fedora distributions and the [http://rpm.livna.org Livna] site has packages for some older distributions as well as newer.  
  
Preliminary testing shows that using MythTV 0.20-fixes SVN revision {{changeset|12290}} with XvMC-VLD for 720p ATSC source material playback is working on a SP13000 EPIA board which includes a CN400 chipset.  The system is running FC6 with the [http://www.openchrome.org/ openchrome] driver that it ships with and the output is via VGA. CPU utilization is currently less than 40%.  Many tweaks were performed to get acceptable playback and testing is taking place to determine exactly which ones were really necessary.  At this point it seems like the single most important change was using the [http://www.mythtv.org/wiki/index.php/XvMC#Greyscale_OSD_.28Unichrome.29 Greyscale OSD (Unichrome)] tip which dramatically decreased CPU utilization and was a major factor in eliminating dropped frames and cleaning up the audio.  The system is still a work in progress and work is not complete but the system has been perfectly stable although it has seen limited use to date.  Unfortunately, 1080i source material playback does not appear to work as the video appears as a solid blue image.  The same system is able to play both 720p and 1080i source material from an NFS mount without any problems when using Xine and the CPU utilization is under 20%. According to ticket {{ticket|3035}} at the reason for the failure with 1080I is that Myth attempts to create 16 buffers, and this cannot be done within the available memory. However, a patch which reduces the buffers to 12 or even 10 allows 1080i playback. To make use of the patch you basically need to be running SVN as the code must be altered.
+
For other chipsets, the driver should already be included in your Xorg installation.
  
(Compilation of mythtv can fail with ld reporting that it cannot find either -lviaXvMCPro or -lviaXvMC. This is a bug in ld where it looks for a file named 'libviaXvMCPro.so' and ignores 'libviaXvMCPro.so.1.0.0. To correct this make a sym-link to libviaXvMcPro.so.1.0.0 called libviaXvMCPro.so.)
+
=== Configuring chipset drivers ===
  
[[Users:Trevarthan|Trevarthan]] has tested HDTV on SP8000E and SP13000 EPIA boards which include a CN400 chipset. HDTV playback via VGA works without audio in Xine (a bug in Xine?). In mplayer, video and audio work, but playback isn't as smooth as in Xine, and the audio and video quickly lose sync. In MythTV 0.19, HDTV playback using XvMC VLD is broken. Audio can be heard, but the video appears as a blank or noisy dark blue screen.
+
Each chipset driver may have specific configuration options that work better with XvMC
  
SDTV playback on these boards works fine in Xine/mplayer/MythTV.
+
==== NVIDIA ====
  
[[Users:Trevarthan|Trevarthan]] has also noticed considerable instability on the SP series boards with the CN400 chipset. The instability is much worse in Xine, but appears to be present in mplayer and MythTV also. It manifests as a complete hardware lockup. One of the openchrome project's developers, Ivor, has confirmed that this is a known issue with CN400 support. [[Users:Guzzloid|Guzzloid]] confirms this and recommends the use of a well-supported PCI graphics card (e.g. nVidia FX5200) and a dual-PCI riser instead until the driver has been fixed. (Also, do not use an active riser on SP motherboards if you are using a Hauppauge tuner card -- use the VIA EXT-PCI instead.)
+
Use the 'nvidia-settings' control panel to disable Video Texture Adapter and/or Video Blitter Adapter "Sync to VBlank" checkboxes (on the "X Server XVideo Settings" page)
  
{| border=1 cellspacing=0 cellpadding=4
+
These xorg.conf options can also affect usage or performance
|-
 
| Status
 
| 2D, 3D and Xv supported in Xorg [http://xorg.freedesktop.org/releases/X11R7.0/doc/html/via.4.html via] driver for CLE266, KM400/KN400, K8M800/K8N800, PM800, P4M800, P4M800PRO, and CN400 chipsets. PM8X0 likely but not available yet.
 
|- bgcolor=#CCFFCC
 
| Supports XvMC?
 
| '''YES'''
 
|-
 
| How to Obtain?
 
| Included in recent versions of Xorg (6.9 and 7.0) (Newer chipsets supported in openchrome-svn first.)
 
[http://www.linpvr.org/forum/viewtopic.php?t=491 minimyth] is also a good source of openchrome support as it is designed to run on Via EPIA boards with Unichrome chipsets.
 
|-
 
| Recommended Version
 
| Xorg (6.9 and 7.0)
 
|-
 
| Chipset Availability
 
| <strike>A common frustration among MythTV users is that while these chipsets have Open Source drivers available, they aren't available in PCI, AGP, or PCI-e cards. They can '''only''' be found on motherboards with integrated video chipsets.<br> The DeltaChrome graphics cards should fill this gap but aren't widely available yet.</strike><br>
 
A standalone card is currently available on PCI-e capable boards:  [http://www.s3graphics.com/en/products/chrome_s27 S3_Chrome-s27] is its current homepage.
 
|}
 
  
=== Intel 8xx/9xx ===
+
Section "Driver"
The X11 i810 driver supports nearly the full range of Intel integrated graphics chips. More recently, the xf86-video-intel driver added support for the  [http://lists.freedesktop.org/archives/xorg-announce/2007-July/000318.html G33, Q33, and Q35] chipsets.  Chipsets through the G35 (X3500, and all derivatives of the X3000) should also be [http://lists.freedesktop.org/archives/xorg/2007-December/031557.html supported], depending on the version of your driver. The Intel GMA chipsets are common in midmarket laptops and also on a number of motherboards. Their graphics capabilities are modest but underestimated by many. A binary driver containing additional functionality is [http://developer.intel.com/design/intarch/swsup/graphics_drivers.htm available] from Intel but the vast majority of the chipset's features are available from the in-tree driver. More updated information on Intel drivers/chipsets can be obtained from [http://intellinuxgraphics.org Intel], or [http://en.wikipedia.org/wiki/Intel_GMA#Linux Wikipedia].
+
      Option "UseEvents" "true"
 +
      Option "XvmcUsesTextures" "false"
 +
      Option "NVAGP" "1" (some users report 2 works better, may not be applicable to newer driver versions)
 +
  End Section
  
{| border=1 cellspacing=0 cellpadding=4
+
  Section "Extensions"
|-
+
      Option "Composite" "Disabled"
| Status
+
  End Section
| Full featured driver. Supports 2D and 3D hardware acceleration.
 
|- bgcolor=#CCFFCC
 
| Supports XvMC?
 
| '''YES''' (Current drivers, both i810 and intel, support Motion Compensation ''only'' on the i810 and i815 chipsets.  Most chipsets have hardware support for offload of Motion Compensation, but only the [http://en.wikipedia.org/wiki/Intel_GMA#Table_of_GMA_graphics_cores_and_chipsets most recent] support the more CPU intensive iDCT.  There is currently work being performed on an intel-xvmc branch that aims to add XvMC driver support for all chipsets.)
 
|-
 
| How to Obtain?
 
| Included with both the X.Org and XFree86 server software.
 
|-
 
| Recommended Version
 
| Unless you are having problems, use the driver included with your distribution. The current development drivers can be [http://www.intellinuxgraphics.com downloaded] and built from source, but may require a new build of Xorg.
 
|-
 
| X11 driver name
 
| i810 or intel
 
|-
 
| Chipset Availability
 
| This chipset is used in some DIY motherboard kits but is more common in laptops. Its use in a MythTV setup is less than ideal due to limited decoding capabilities (see above, and be patient or download and test to help development - a change is in progress), as well as incomplete TV-Out support in the X.org/XFree86 driver.
 
|}
 
This driver needs 'Option "XvMCSurfaces" "7"' in the Device section of xorg.conf to enable xvmc. This applies to the intel driver also. If you get a blue screen but you can hear the soundtrack, you will need to add 'Option "LinearAlloc" "16384"' to the Device section. This increases the allocated memory above the default of 6144. Note that if Xorg.0.log reports that it ignores the XvMCSurfaces line in xorg.conf, XvMC is not supported by the driver for your hardware. 'Option "Cachelines" "2048"' is reported to help with certain versions of both the i810 and intel drivers. Its presence appears to cause no adverse affects on other versions.
 
  
When set up, this driver is quite efficient. Top gave the following loading, on an Asus P5L-MX, with an Intel Core 2 Duo E6600 cpu while showing an OTA recorded 1080i HD recording.
+
=== Installing the XvMC libraries ===
  
  PID USER      PR NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
+
For many distributions, a separate XvMC library package needs to be installed. This is the library that MythTV will use to hook into the XvMC support in the driver. It provides a common interface for application wishing to use XvMC.
  
  4266 root      20  0  662m 442m 205m S  47 22.1  58:56.75 mythfrontend
+
  yum install libXvMC
3614 root      37  17  172m 116m  12m S  43  5.8  68:36.79 mythcommflag
 
4981 root      37  17  100m  49m  12m R  24  2.5  4:35.57 mythcommflag
 
3879 root      20  0  472m 155m  62m S  10  7.8  8:41.56 X
 
  
=== ATI Radeon ===
+
is probably appropriate for most.  This may already be installed by your distribution
  
The ATI display drivers for Linux do not support XvMC.  Despite the fact that all Radeon hardware has support for [[MPEG-2]] acceleration, ATI has never provided access to these capabilities in Linux.
+
=== Enabling the chipset library ===
  
== Application Support ==
+
Each chipset provides an interface between the XvMC library and the actual driver.  This is usually handled by what is called the XvMC wrapper library.  A text configuration file directs the XvMC library to the driver interface.
  
=== Binary Distributions ===
+
The wrapper configuration script is usually found at /etc/X11/XvMCConfig
The following binary linux distributions support XvMC out of the box:
 
  
* Mandrivia 2006 Free
+
It contains a single line of the driver library name
* Debian
 
* Ubuntu
 
  
=== MythTV ===
+
'''NVIDIA'''
Before MythTV can make use of XvMC hardware support, it first has to be built with XvMC support.
+
<div><code>libXvMCNVIDIA_dynamic.so.1</code></div>
 +
 +
'''unichrome'''
 +
<div><code>libXvMCVIA or libXvMCVIAPro (depending on the chipset)</code></div>
 +
 +
'''intel'''
 +
<div><code>libI810XvMC</code></div>
  
==== Compiling ====
+
These will change with different driver chipsets.  If you find a new one, please add it here. If you used a package (atrpms, livna) based driver installation, you might also be able to find the library name by doing
For a more hands-on approach, one can compile MythTV directly from source.
 
  
===== Source =====
+
rpm -ql <driver-package> | grep -i xvmc
XvMC depends upon the 'x11', 'xrandr' and 'xv' choices being enabled in configure. These are enabled by default, but you may want to specifically list them. The configure program checks for the correct libraries and files and the results are listed by the program when it exits.
 
  
If compiling manually for either nvidia, I810 or unichrome, use:
+
and look for library names that include the XvMC text.  
<code>./configure --enable-xvmc</code>
 
  
If you are compiling for unichrome-pro, use:
+
== MythTV XvMC Support ==
<code>./configure --enable-xvmc --enable-xvmc-pro --enable-xvmc-vld</code>
 
  
If you have the libXvMCW wrapper installed, then it will be automatically enabled by the configure program and all of the available library assets will be utilized. However, double-check your ./configure output during MythTV configuration state whether it says "yes" after "XvMC support" (or XvMC pro support) or not, since some distributions do not enable XvMC automatically regardless of XvMC library found in /usr/lib.
+
=== Packages and Distributions ===
  
 +
Most package and distributions of MythTV should have XvMC enabled by default.  You can check your version by doing
  
===== Debian =====
+
mythfrontend --version
You may receive an error saying that the compiler cannot find xvmc.h or xvlib.h, you will need to make sure that the right packages are installed.
 
  
This can be installed using:
+
and looking for
  
  <code>apt-get install libxvmc-dev
+
  Options compiled in:
  apt-get install libxv-dev</code>
+
  linux release using_oss using_alsa using_jack using_backend using_dbox2 using_dvb using_firewire using_frontend   
 +
using_hdhomerun using_iptv using_ivtv using_joystick_menu using_lirc using_v4l using_x11 using_xrandr
 +
using_xv '''using_xvmc''' '''using_xvmcw''' '''using_xvmc_vld''' using_bindings_perl using_bindings_python using_opengl
 +
using_ffmpeg_threads using_libavc_5_3 using_live
  
===== Gentoo =====
+
If you see options like <code>using_xvmc</code> and <code>using_xvmcw</code> then your Myth system is prepared for XvMC.
If installing MythTV on Gentoo Linux, make sure [http://www.gentoo.org/doc/en/xorg-config.xml#doc_chap2 VIDEO_CARDS] is properly configured in /etc/make.conf to include, "i810", "nvidia" or "via". The "xvmc" USE flag is also required.  These flags can usually be set on a per package basis in /etc/portage/package.use, for example:
 
$ cat /etc/portage/package.use
 
media-tv/mythtv xvmc
 
  
Or globally for all packages in /etc/make.conf via USE="xvmc"
+
=== Compiling from source ===
  
==== Configuration ====
+
When you run configure, if you have the proper XvMC development files installed (libXvMC-devel, libXvMCW-devel) , you should see this type of output from the configure script:
After MythTV has been installed, it needs to be configured to utilize XvMC.
 
#Add your XvMC library module name to the /etc/X11/XvMCConfig file, creating a new one if necessary
 
##For binary Nvidia drivers, the contents of XvMCConfig should be "libXvMCNVIDIA_dynamic.so.1"
 
##For i810 use 'libI810XvMC'. For Via chipsets use 'libviaXvMC' or 'libviaXvMCPro'.
 
  
#In MythTV's frontend menus, please navigate to:<br>Setup -> TV Settings -> Playback
+
# Video Output Support
#Next, change the "Preferred MPEG2 Decoder" to "Standard XvMC"
+
x11 support              yes
#For the Via Unichrome or Unichrome-Pro chipsets, select "Via XvMC"
+
xrandr support            yes
#Make sure "Extra audio buffering" is checked.
+
xv support                yes
That's it! XvMC should be enabled. Now play a few Recordings and see what happens. If problems occur, check the [[XvMC#Tips and Tricks|Tips and Tricks]] section below for more info.
+
XvMC support              yes
 +
XvMC VLD support          yes
 +
XvMC pro support          yes
 +
XvMC OpenGL sup.         no
 +
XvMC libs                -lXvMCW
  
=== MPlayer ===
+
The last libs line will tell you which libraries that MythTV is compiling against.  In this case, it is the XvMC wrapper mentioned above. For some, it may be the nvidia libraries.  But regardless, you need to see ''yes'' before building MythTV.
MPlayer includes an XvMC output plugin. To use it, try this:
 
<code>mplayer -vo xvmc -vc ffmpeg12mc</code>
 
(assuming you are running mplayer with XvMC support compiled in)
 
* Note - unichrome support in mplayer requires a [http://www.openchrome.org/snapshots.html patch].
 
  
=== Xine ===
+
If installing MythTV on Gentoo Linux, make sure [http://www.gentoo.org/doc/en/xorg-config.xml#doc_chap2 VIDEO_CARDS] is properly configured in /etc/make.conf to include, "i810", "nvidia" or "via". The "xvmc" USE flag is also required.  These flags can usually be set on a per package basis in /etc/portage/package.use, for example:
Xine's has two plugins for XvMC support, the first is named '''xvmc''' as you would expect, however to take advantage of XvMC acceleration on nVidia graphics cards using the nVidia binary drivers they have a seperate plugin named '''xxmc''' (xx instead of xv).
+
$ cat /etc/portage/package.use
 +
media-tv/mythtv xvmc
  
To use Xine with XvMC support for most graphics cards use:
+
Or globally for all packages in /etc/make.conf via USE="xvmc"
<code>xine -V xvmc </code>
 
  
To use Xine with XvMC support for nVidia graphics cards use:
+
=== Configuring MythTV ===
<code>xine -V xxmc </code>
 
  
(assuming, of course, that xine has been compiled with XvMC support.)
+
{{Note box|When running mythfrontend for the first time to test XvMC, try running it from a command window so you can see the output from mythfrontend.  If mythfrontend cannot load the XvMC library, you will see a line in the logs about this when starting playback and you will see log entries about xvmc not being available}}
  
== Example CPU Savings ==
+
XvMC usage is controlled using the [[Playback profiles]] feature of MythTV as of version 0.21In previous versions, you simply set the Preferred MPEG-2 Decoder to one of the XvMC methods appropriate for your chipset.  With 0.21, this is a more flexible configuration allowing for different decoders depending on the contentFor XvMC, the Bob deinterlacer provides the best deinterlacing but with some performance penalty.
{| border=1 cellspacing=0 cellpadding=4
 
|-
 
! CPU
 
! RAM
 
! Video Card
 
! Content
 
! CPU w/XvMC
 
! CPU w/o XvMC
 
! XvMC Deinterlace
 
! Non-XvMC Deinterlace
 
! MythTV Version
 
! Notes
 
|-
 
| C7 Esther 1.2 GHz (Via EN12000-EG fanless)
 
| DDR2 512MB
 
| Unichrome Pro IGP (CN700) TV encoder VT1625
 
| SD (TV-Out: PAL, S-Video@1024x768, LCD-Out: VGA@1680x1050)
 
| 25%-30%
 
| 70-80%
 
| bob 2x
 
| Kernel ?
 
| svn rev ?? don't remember (0.20 svn dev)
 
| This is a combined Front/Back-end system. Stable, reliable and smooth playback with libviaXvMCPro from openchrome. Some prebuffering pauses when switching channels or OSD text, but not systematic (using realtime video thread capability).
 
|-
 
| [http://www.digit-life.com/articles/viacyrix3/index.html C3 Samuel 2 600Mhz]
 
| 256MB
 
| Via CLE266 w/ VGA Out to 960x600 (ws-LCD)
 
| SD
 
| 45%-50%
 
| 100%
 
| bob
 
| No
 
| svn rev 10180
 
| This is a combined Front/Back-end system. Stable, reliable and smooth playback with XvMC, unusable without.
 
|-
 
| AMD Athlon 800
 
| 768MB PC100
 
| Nvidia Geforce4 MX440
 
| SD
 
| 15%-20%
 
| 45-50%
 
| Bob/Kernel
 
| Kernel
 
| 0.18.1
 
| A little jumpy for ~15 seconds after entering LiveTV/Recording, then smooth.
 
|-
 
| 750mhz P3 w/256k cache
 
| 384M PC100
 
| 128M Nvidia 5200 AGP 2x w/S-video Out to CRT TV
 
| SD
 
| 60%
 
| 75%
 
| Bob 2x
 
| Linear Blend
 
| 0.20 release
 
| This is R5E50 KnoppMyth.  SD Playback is smooth and reliable.
 
|-
 
| 933mhz P3 w/256k cache
 
| 512M PC133
 
| 128M Nvidia 5200 AGP 4x w/VGA Out to 1280x1024 CRT
 
| SD
 
| 32%
 
| 40-46%
 
| NO
 
| NO
 
| 0.19 SVN fixes rev 9591
 
| SD Playback is smooth and reliable. Frontend is remote via 100BaseTX and complains of constant prebuffer pauses.  Using nvidia driver version 8756 and OpenGL VSync. XV picture controls ON.
 
|-
 
| 933mhz P3 w/256k cache
 
| 512M PC133
 
| 128M Nvidia 5200 AGP 4x w/VGA Out to 1280x1024 CRT
 
| HD 1080i
 
| 100%
 
| 100%
 
| NO
 
| NO
 
| 0.19 SVN fixes rev 9591
 
| This machine is too slow for 1080i, even with XvMC. 1080i is choppy and unwatchable. Frontend is remote via 100BaseTX and complains of constant prebuffer pausesUsing nvidia driver version 8756 and OpenGL VSync. XV picture controls ON.
 
|-
 
| AMD Duron(tm) 950
 
| 512MB
 
| GeForce4 MX 440 AGP 8x
 
| SD
 
| 12-14%
 
| 28-32%
 
| No
 
| No
 
| 0.19
 
| Slackware 10.2 I needed to add a newer version of the X11-devel package to get the xvmc include files.
 
|-
 
| 1 Ghz AMD TBird
 
| 256MB DDR
 
| 64MB GeForce4 MX 440
 
| HD (1080i)
 
| 65-70%
 
| 100%
 
| Bob
 
| Bob
 
| LFS & compiled .19 fixes branch
 
| OSD is in B&W, but 1080 is smooth and watchable, with the occasional stutter when switching channels on live, or the OSD is on.  Frontend still complains of the occasional prebuffer pause.  Without XvMC, HD stutters a lot.
 
|-
 
| VIA C3 Nehemiah 1GHz
 
|
 
|
 
|
 
| 20%
 
|
 
| Unknown
 
| Unknown
 
| Unknown
 
| can hardly play mpeg2 without XvMC
 
|-
 
| [http://www.krisrose.net/mythtv.html Via C3 Nehemiah 1.33GHz]
 
| 1GB
 
| VIA CN400
 
| SD
 
| 25%
 
| 90%
 
| Bob
 
| Unknown
 
| 0.18.2, 0.19
 
|
 
|-
 
| AMD Athlon XP 1600
 
| 1GB DDR
 
| Nvidia 6800LE
 
| SD
 
| 15%
 
| 25%
 
| Unknown
 
| Unknown
 
| N/A, tested with MPlayer
 
|
 
|-
 
| AMD Athlon(tm) XP 1900+
 
| 512 MB
 
| NV25 [GeForce4 Ti 4400]
 
| SD
 
| 55%
 
| 44%
 
| Bob
 
| Kernel
 
| 0.19
 
| Debian Unstable Nvidia 8178. Picture stuttered after 0.18.1 -> 0.19 upgrade, tried XvMC fixes picture, but uses more CPU (?) Using ChromaKey Hack with success. Prebuffer pause only at begining of watching TV.
 
|-
 
| 2 Ghz Celeron
 
| 512MB DDR
 
| 128MB NVidia 6200 AGP 8X
 
| HD (1080i)
 
| 65-70%
 
| 100%
 
| Bob
 
| Bob
 
| FC4 & ATRPMS 0.18.1 / LFS & compiled .19 fixes branch
 
| OSD is in B&W, but 1080 is smooth and watchable, with the occasional stutter when switching channels on live, or the OSD is on.  Also had to turn on NvAGP to get XvMC working with this video card.  Frontend still complains of the occasional prebuffer pause.  Without XvMC, HD stutters a lot.
 
|-
 
| 2 Ghz Celeron
 
| 512MB DDR
 
| 64MB GeForce4 MX 440
 
| SD
 
| 12-14%
 
| 22-24%
 
| Bob
 
| Bob
 
| ATRPMS 0.18.1
 
| AverMedia M179 tuner card, NVidia driver 7676, OSD is B&W
 
|-
 
| Athlon XP 2000+
 
| 512MB PC2700
 
| GeForce4 MX440
 
| SD
 
| 13%-19%
 
| 25%-28%
 
| NO
 
| NO
 
| 0.18.1
 
|
 
|-
 
| Athlon XP 2000+
 
| 512MB PC2700
 
| GeForce4 MX440
 
| HD
 
| 52%-62%
 
| 99%+
 
| NO
 
| NO
 
| 0.18.1
 
|-
 
| Intel P4 2.26
 
| 512MB
 
| GeForce 5200
 
| 1080i
 
| 50%
 
| 100%
 
| Bob
 
| Any
 
| 0.19
 
| 1080 unwatchable without XvMC. 720 and below are OK withouth XvMC
 
|-
 
| AMD Athlon XP 2400
 
| 512mb DDR 3200
 
| Nvidia FX 6200
 
| HD (1080i)
 
| 20-25%
 
| 80%
 
| BOB
 
| Unknown
 
| 0.18
 
| of course XvMC still likes to lock on "prebuffer" a lot
 
|-
 
| AMD 2500+
 
| 1GB
 
| FX5500 256MB
 
| HD
 
| 50%
 
| 99%+
 
| Unknown
 
| Unknown
 
| Unknown
 
|-
 
| AMD 2500+ OC'ed to 3200
 
| 512 MB@252 mHz
 
| FX5200 128MB
 
| HD
 
| 90+%
 
| N/A
 
| Linear
 
| N/A
 
| .2
 
| bareley plays 1080i, and wont at all if i use anything other than linear deinterlacing.  cant watch live tvonly prerecorded shows.
 
|-
 
| Sempron64 2500
 
| 256 MB PC 3200
 
| FX 5200
 
| HD
 
| 30%
 
| 90%
 
| Bob
 
| Bob
 
| 0.19
 
| FC4 i386 build (still can't get x64 build to install properly). 1080 content unwatchable without XVMC, 720 / 480 content watchable w/o XVMC. With XVMC: 1080 watchable while also recording two additional 1080 channels.
 
|-
 
| P4 @ 2.67GHz
 
| 512 MB PC 3200
 
| FX 5200
 
| HD 1080i
 
| 45%
 
| 95%
 
| Bob
 
| Bob
 
| 0.19
 
| FC3 ATRPMS NVidia 7676.  Unwatchable without XVMC; slight, but occasionally noticable audio stutter with XVMC.
 
|-
 
| Athlon XP 2800+
 
| 512 MB 3200
 
| GeForce4 MX440
 
| SD
 
| 7%-8%
 
| 9%-10%
 
| Bob
 
| Bob
 
| 0.19
 
| Gentoo kernel 2.6.15 with NVidia 7676 driver.  Tried 8178 driver, but CPU usage went to 85%
 
|-
 
| 2.93Ghz Celeron D
 
| 1Gb DDR 3200
 
| 128M Nvidia FX 5200 AGP 8x w/TV OUT to 800x600 SD TV
 
| SD
 
| 8-12%
 
| 10-14%
 
| NO
 
| NO
 
| 0.19
 
| SD Playback is smooth and reliable. No complaints!
 
|-
 
| 2.93Ghz Celeron D
 
| 2Gb DDR 3200
 
| 256M Nvidia 6200 AGP 8x w/DVI Out to 1360x768 LCD
 
| SD
 
| 14%
 
| 17%
 
| NO
 
| NO
 
| 0.19 SVN fixes rev 9591
 
| OSD is in B&W, but SD is smooth and watchable, with a very brief stutter when switching channels on LiveTV. No prebuffer pauses. Without XvMC, SD playback is smooth. Using nvidia driver version 8756 and using OpenGL Vsync. Can't reliably run Bob deinterlace for unknown reasons. XV picture controls ON.
 
|-
 
| 2.93Ghz Celeron D
 
| 2Gb DDR 3200
 
| 256M Nvidia 6200 AGP 8x w/DVI Out to 1360x768 LCD
 
| HD 1080i
 
| 50%
 
| 100%
 
| NO
 
| NO
 
| 0.19 SVN fixes rev 9591
 
| OSD is in B&W, but 1080i is smooth and watchable, with the occasional stutter when switching channels on LiveTV, or the OSD is on. Frontend still complains of the occasional prebuffer pause.  Without XvMC, HD stutters a lot. Using nvidia driver version 8756 and using OpenGL Vsync. Can't reliably run Bob deinterlace for unknown reasons. XV picture controls ON.
 
|-
 
| Athlon 64 3200+
 
| 768MB PC2700
 
| GeForce FX 5200
 
| HD 720P
 
| 20%
 
| 51%
 
| Bob
 
| No
 
| Pre 0.19 SVN
 
| Running in 64 bit mode, with NVidia 7676 driver
 
|-
 
| Athlon 64 3200+
 
| 768MB PC2700
 
| GeForce FX 5200
 
| HD 1080i
 
| 42%
 
| 70%
 
| Bob
 
| No
 
| Pre 0.19 SVN
 
| Running in 64 bit mode, with NVidia 7676 driver
 
|-
 
| Athlon 3200+
 
| 512MB PC3200
 
| GeForce FX 5500
 
| HD 1080i
 
| 45%
 
| 100%
 
| Bob
 
| Bob
 
| Pre 0.19 SVN (8922)
 
| 720p Playback with NVidia 7676 driverSignificant stuttering w/o XvMC.
 
|-
 
| Athlon 64 X2 3800+
 
| 512MB DDR400
 
| GeForce 6150 on-board an Asus A8N-VM CSM
 
| HD 1080i
 
| 20%
 
| 50%
 
| Bob
 
| Kernel
 
| 0.19
 
| XvMC has some glitches. Perfect without XvMC.
 
|-
 
| Athlon 64 2400+
 
| 512MB DDR266
 
| Nvidia FX5200 & Asus A7V-266EX
 
| SD
 
| 20%
 
| 70%
 
| Bob
 
| Kernel
 
| 0.19 svn
 
| Picture quality is flawless, no problems. Slight errors and pauses with HD material (CPU 100%)
 
|-
 
| AMD Sempron 3400+
 
| 768MB PC3200
 
| Nvidia Geforce 6100 onboard (410)
 
| HD 1080i
 
| 75%
 
| 100%
 
| Linear
 
| none
 
| 0.19.129
 
| FC5, unwatchable without Xvmc, needs latest Nvidia drivers (8756) for onboard 6100.  %75 is just to play, takes another ~%10 to record the HD from the firewire on an LVM.  OSD is in color, overlay causes slight audio corruption but goes away once the overlay stops.
 
|-
 
| AMD Athlon XP 3000+
 
| 512MB PC3200
 
| Nvidia FX5200
 
| HD 720p
 
| ~33%
 
| ~70%
 
| Bob
 
| Bob
 
| svn 10469
 
| As above, audio stutters when OSD is diplayed but otherwise smooth and nice looking.  Using Chromakey hack for color OSD.
 
|-
 
| AMD Athlon XP-M 3000+ (2.2GHz)
 
| 768MB PC133
 
| Nvidia 6200 128MB DDR
 
| HD 1080i/720p
 
| 55/38%
 
| 100/90%
 
| Bob
 
| Bob
 
| 0.20 svn 11499
 
| 1080i: studders badly w/o XvMC. Minor tearing even with OpenGL sync. Displayed at 1080i w/o bob fails to consistently order interlaced fields correctly. 720p: perfect displayed at 720p w/ or w/o XvMC. Monitor: 1080i/720p/480p CRT.
 
|-
 
| AMD Athlon XP 3000+
 
| 512MB PC3200
 
| Nvidia FX5200
 
| HD 1080i
 
| ~70%
 
| 100%
 
| Bob
 
| Bob
 
| svn 10469
 
| Stuttering w/o XVMC, but with XVMC smooth and nice looking.
 
|-
 
| AMD Athlon XP 1600+
 
| 512MB
 
| Nvidia FX5200 AGP
 
| HD 1080i/HD 720p
 
| ~60-80%
 
| 100%
 
| Onefield
 
| Onefield
 
| 0.19-fixes 10686
 
| Haven't tried Bob deint yet. HD stutters badly without XVMC, with XVMC 1080i plays back perfectly.
 
|-
 
|-
 
| AMD Athlon XP 2500+
 
| 1GB
 
| FX5200 256MB
 
| HD
 
| 33.5%
 
| 67%+
 
| Bob
 
| Bob
 
| 0.19-fixes Knoppmyth R5C7
 
| Using latest Nvidia drivers 1.0-8756
 
|-
 
|-
 
| AMD Athlon XP 3200+
 
| 512MB PC3200
 
| FX5500 256MB
 
| HD 720p/1080i
 
| 30-40%
 
| 99%
 
| Bob
 
| No
 
| 0.19-fixes
 
| Nvidia driver: 8774. B/W OSD w/ audio stuttering during OSD. Turning off "extra audio buffering" reduced audio buffer underruns. Not using NvAGP (enabling it made my CPU 90%+). Other than OSD problems, XvMC works great!
 
|-
 
|-
 
|AMD 64 3500+ (2.2GHz)
 
|1024MB DDR 400
 
|nV 6600GT 256MB
 
|SD
 
|~24%
 
|? (will check later)
 
|Linear blend
 
|
 
|0.20+SVN09-10-2006
 
|nVidia drivers: 8774. The cpu is running at 1000MHz (cool 'n' quiet activated) during the whole time watching tv, so it is 24% @ 1000MHz. No audio buffer underruns with and without "extra audio buffering". I have to enable the "interleaved Normal" mode while watching tv to watch it perfectly. "Auto(E)" doesnt recognize the tv input as interleaved.
 
|-
 
|-
 
|AMD Athlon XP 2500+
 
|1024MB DDR 400
 
|nV 6200 128MB
 
|SD/HD
 
|
 
|
 
|Bob
 
|Bob
 
|svn rev 11529
 
|Have to disable OpenGL vsync to handle 60fps progressive or 30fps interlaced (w/ bob deinterlacing) content. OpenGL vsync works fine with 24/30fps playback. OpenGL vsync with 60fps playback causes stuttering w/ prebuffering pauses, but only when OSD is not displayed - seems like a bug?
 
|-
 
! P4-2.4GHz
 
! 512MB PC2700 DDR
 
! NVidia 6200
 
! HD
 
! Never got working
 
! 30-70%
 
! default
 
! default
 
! 0.19, 0.20
 
! Never got XvMXC to work - it dropped every 2nd frame.  FC5, complied 0.19 and 0.20 from source with --enable-proc-opt.  Makes a massive difference.
 
|-
 
|-
 
| AMD Athlon 2800
 
| 512MB
 
| Nvidia Geforce4 FX5200
 
| HD
 
| 10%-15%
 
| 15-20%
 
| Bob
 
| Bob
 
| 0.20
 
| Very smooth playback with XvMC. Stutters a little without XvMC. Didn't get Chromakey hack working. NOTE: I had 'Option "NvAGP" "3"' in my Xorg.conf, which caused the machine to crash when exiting from the EPG. (running Edgy Eft, on kernel 2.6.17-10-generic). Also had to set vsync to blank in nvidia-settings, for a smooth playback.
 
|-
 
|-
 
| AMD Athlon 1800+ (1.5Ghz)
 
| 512MB
 
| Nvidia 6600GT w/Component out
 
| HD (1080i & 720p)
 
| 75%
 
| 100%
 
| Bob
 
| Bob
 
| 0.20
 
| Without XvMC HD is choppy with audio out of sync (AC3 Pass-Through) runs at 100% CPU.  With XvMC enabled 75% cpu usage and great quality. Test done with a [[Silicondust_HDHomeRun|HDHomeRun]]. 
 
|-
 
| [http://www.thegreenavenger.com/weblog AMD Athlon XP 2600+]
 
| 1024 MB
 
| XFX 6600GT w/Component out dongle
 
| HD 1080i/480p
 
| 50-60%
 
|
 
| none
 
| none
 
| 0.20
 
| Using XvMC and Option "NVAGP" "2", without the NVAGP option, I got terrible tearing.
 
|-
 
| AMD Sempron 2400+ Thoroughbred 1.667GHz
 
| 512 MB
 
| GeForce FX 5200 w/ S-video out
 
| HD
 
| 50-80%
 
| 99%
 
| Bob 2X
 
| none
 
| 0.20
 
| Knoppmyth R5E50, Used for recording HD and watching on my parents SDTV.  Can't do live TV and the OSD is almost unusable.  But with XvMC playback is smooth and watchable with only occasional hiccups.
 
|-
 
| AMD Athlon XP Barton 2.0GHz (512k L2)
 
| 512 MB PC2100 (266MHz), dual channel
 
| NVidia GeForce 6200 AGP
 
| HD
 
| ~50%
 
| N/A
 
| Bob 2X
 
| N/A
 
| 0.20
 
| XvMC, no OpenGL vsync (caused stuttering).  Combined frontend/backend machine, remote mysql.  Displaying on 1360x768 LCD tv, VGA cable. nForce2 motherboard.  Gentoo, gcc 3.4.6, glibc 2.5, nvidia-drivers-1.0.9755-r1 (lower CPU usage), kernel 2.6.20, preempt, 300Hz timer frequency, AC-3 passthrough via SBLive card.
 
|-
 
| colspan="10" align="center" bgcolor="#FFCCCC" | (Please add your example Hardware stats here!)
 
|-
 
| AMD64 Sempron 3000+
 
| 512 MB PC3200
 
| GeForce 6200 (AGP) 256 MB Fanless
 
| HD
 
| 50-80%
 
| 100%
 
| Bob 2X
 
| Bob 2X
 
| 0.20.2
 
| Separate frontend and backend machines. Displaying 720p via a DVI to HDMI cable. Running Fedora 7 w/ atrpms and optical audio out w/ AC3 passthrough.  Without XvMC, HD was unwatchable. Option "UseEvents" "true" and Option "NvAGP" "2" set for the nvidia drivers within xorg.
 
|-
 
| AMD64 X2 AM2 3800+ EE SFF
 
| 1024 MB DDR2-800 Single Channel
 
| GeForce 6150 (integrated on Asus M2NPV-VM)
 
| SD
 
| 23%
 
| 59%
 
| Bob 2X
 
| Bob 2X
 
| SVN (r14586)
 
| Backend/Frontend together on one machine. S-Video connection to TV. OSD is black and white. NvAGP=1
 
|-
 
| AMD Athlon 64 X2 6000+
 
| 2GB PC2 6400
 
| Nvidia 7300LE
 
| HD 720p & 1080i
 
| NA
 
| 35-40%
 
| NA
 
| Bob
 
| Mythdora 4.0 / MythTV 0.20.2
 
| No problems playing back HDTV sources at 1080p resolution.
 
|}
 
  
== Tips and Tricks ==
+
Sometimes the [[OpenGL VSync]] feature can affect XvMC use and performance. This can be enabled or disabled in the frontend configuration if compiled into your MythTV system.
XvMC sounds like a dream come true for those wanting to play HD content with a slower system, but unfortunately it's not always perfect. Even with XvMC and low CPU usage, many still experience problems with prebuffering pauses, mild to moderate audio or video stuttering, problems with the OSD, and other issues. If their CPU is fast enough, many simply turn off XvMC as a last resort. But this guide hopes to help the reader make the most of XvMC and avoid frustration. Here are some suggestions that may help:
 
  
=== Prebuffering Pause or stutter with Nvidia ===
+
==== OSD ====
*Try disabling '''[[OpenGL VSync]]''' (this is a parameter that you can set when compiling mythtv from source - it defaults to off in v0.19)
 
*Try using the 'nvidia-settings' control panel to disable Video Texture Adapter and/or Video Blitter Adapter "Sync to VBlank" checkboxes (on the "X Server XVideo Settings" page)
 
*Try setting this in your "Device" section in your xorg.conf:
 
<code>Option "NVAGP" "1"</code>
 
Note, some users have had better success setting NVAGP to 2 rather than 1.
 
* NVidia setting:  Option "UseEvents" "True"    has helped many people with XvMC. Appears to lower X server CPU usage.
 
*Use BOB (2x framerate) [[deinterlacing]]
 
*Try disabling 'Use video as timebase' (TV Settings -> Playback)
 
*Try using 'Seperate video modes for GUI and TV playback' to set your resolution to match the resolution of the recording.
 
Note that this section is for '''Video Stutter''', not audio stutter.
 
  
=== OSD Flicker ===
+
'''softblend'''
If you are using MythTV version 0.18 and you experience severe OSD stutter or flicker when XvMC is enabled, try upgrading to 0.19. The OSD flicker is fixed for the author in 0.19 with an Nvidia FX 5200.<BR>
 
Flicker can also be a side effect of using bob deinterlacing when the refresh rate of the monitor doesn't
 
match the video. Check if you are using the bob deinterlacer and if so try a different one.
 
  
=== Greyscale OSD (NVidia 4 & 5) ===
+
If your on screen display is greyscale, then XvMC is working and you are using the softblend OSD. If you are experiencing performance issues related to the OSD (on screen display), disabling the OSD fade will improve this greatly. You can also try using the Chromakey OSD
MythTV version 0.19 ships with a hack to enable full color OSD with XvMC enabled '''on Nvidia 4 & 5 series cards ONLY'''.<br>(i.e. Nvidia FX 5200 is a 5 series card, 6000 is a 6 series card)
 
  
{{Warning box|if you have a non-nvidia card or an nvidia 6 or 7 series card '''this hack won't help.''' The nvidia 6 and 7 series cards lack the chroma keying and color & contrast adjust features that the older 4 and 5 series cards had.
+
'''Chromakey'''
That is why this guide refers to this feature in 0.19 as a "hack".</font><br>(Thanks to Daniel Kristjansson, the author of the chromakey code, for this info!}}
 
  
If you have an nvidia 4 or 5 series card, please read on:<br>The hack is disabled by default. The code change is described here {{changeset|7569}}.
+
{{Warning box|if you have a non-nvidia card or an nvidia 6 or 7 series card '''this feature will not work''' The nvidia 6 and 7 series cards lack the chroma keying and color & contrast adjust features that the older 4 and 5 series cards had.
 +
}}
  
To enable the hack under 0.19, do this:
+
The chromakey OSD will provide a color OSD and for many chipsets, this also uses far less CPU resources, making playback smoother.
*Make a change to your xorg.conf file. Add this to your Devices section:
 
Option "XvmcUsesTextures" "false"
 
*Make a change to the "settings" table in MythTV's MySQL database. You can access your MySQL mythconverg database from the command line like this:
 
<code>mysql -u root -p mythconverg</code>
 
You will be prompted for a password. If you don't remember setting one up, try just pressing the '''ENTER''' key.
 
  
Here is the SQL statement you should use to make the change:
+
=== Using other applications ===
<code>INSERT INTO settings SET value='UseChromaKeyOSD',data='1',hostname='yourhost';</code>
 
  
But change 'yourhost' to the hostname that your frontend is running on. If you're not sure what your hostname is, run `hostname` on the command line to find out.
+
If you use other applications for playback in MythVideo such as mplayer or xine, each has its own configuration options for using XvMC
  
Make sure you have the Composite/Damage X11 extension disabled. In your xorg.conf file (/etc/X11/xorg.conf) look for a line like this:
+
'''MPlayer'''
<code>Section "Extensions"
 
  Option "Composite" "true"
 
EndSection</code>
 
and change it to this:
 
<code>Section "Extensions"
 
    Option "Composite" "false"
 
EndSection</code>
 
See [http://www.mythtv.org/pipermail/mythtv-users/2006-April/133589.html this thread] for details.
 
  
 +
MPlayer includes an XvMC output plugin. To use it, try this:
 +
<code>mplayer -vo xvmc -vc ffmpeg12mc</code>
 +
(assuming you are running mplayer with XvMC support compiled in)
 +
* Note - unichrome support in mplayer requires a [http://www.openchrome.org/snapshots.html patch].
  
 +
'''Xine'''
  
 +
Xine's has two plugins for XvMC support, the first is named '''xvmc''' as you would expect, however to take advantage of XvMC acceleration on nVidia graphics cards using the nVidia binary drivers they have a seperate plugin named '''xxmc''' (xx instead of xv).
  
 +
To use Xine with XvMC support for most graphics cards use:
 +
<code>xine -V xvmc </code>
  
*Now restart X11 (for the xorg.conf change to take effect) and your frontend (for the SQL change to take effect) and see if it works!
+
To use Xine with XvMC support for nVidia graphics cards use:
 +
<code>xine -V xxmc </code>
  
=== Greyscale OSD (Unichrome) ===
+
(assuming, of course, that xine has been compiled with XvMC support.)
The hack for Nvidia cards described above and shipped with MythTV version 0.19 will also work if you are using a Unichrome chipset. The hack has been verified on a Via EPIA M10000 board with the CLE266 chipset with viaXvMC enabled.
 
 
 
At least on UnichromePro (CN400) with 0.20-fixes SVN revision {{changeset|12290}}, this hack seems to make a tremendous difference in the CPU utilization even during normal playback when no OSD is being displayed.  Enough so that it seems to be a necessary part of making HDTV playback possible on the system.
 
 
 
=== Use XvMC For HD Only ===
 
To use ffmpeg as your decoder for all content less than 720x*, insert a row into settings where
 
''value'' = 'UseXvMCForHDOnly' and ''data'' = '1' such as with the following SQL command:
 
 
 
<code>INSERT INTO settings (value,data,hostname) VALUES ('UseXvMCForHDOnly', '1', 'yourhost');</code>
 
 
 
Naturally, substitute your frontend's host name for 'yourhost'. Be sure your frontend has '''PreferredMPEG2Decoder''' set to ''Standard XvMC''.
 
 
 
== Caveats ==
 
* BOB and onefield are the only [[Deinterlacing]] methods that work with XvMC.
 
* Picture in Picture, or PiP, doesn't work with XvMC.
 
* Editing a video is difficult to impossible with XvMC.
 
* Stepping though the video frame by frame can cause artifacts with XvMC.
 
* Don't enable multiple cores for the XvMC decoder (it will cause a segfault). It only works with one
 
  
 
== Hardware acceleration processes not yet supported by XvMC ==
 
== Hardware acceleration processes not yet supported by XvMC ==

Revision as of 16:40, 11 April 2008

Introduction

Wikipedia-logo-en.png
Wikipedia has an article on:

X-Video Motion Compensation, or XvMC, is a part of The X Window System which allows video programs to offload motion compensation and iDCT (Inverse Discrete Cosine Transform) portions of MPEG-2 decoding to the GPU hardware. XvMC can greatly reduce CPU utilization when playing back MPEG-2 video. In theory it should also reduce bus bandwidth requirements. Savings will be most dramatic with slow CPUs or when playing HDTV. SDTV will benefit as well, but most modern CPUs can already play back SDTV without XvMC. MythTV can be compiled to use XvMC for native playback. External players such as Xine and Mplayer can also be compiled to support XvMC.

Currently, only MPEG-2 is supported. This is usually a hardware limitation, but can also in some chips case be a device driver limitation. As an exception, one of the newer VIA Unichrome chips is capable of XvMC accelerated MPEG-4 playback, but it is not supported by the official UniChrome driver at the time of writing this, instead you have to turn to the openChrome project drivers (which has an updated forked version of libxvmc).

A new video acceleration API is being developed, in an effort lead by Intel. This new API supports more complete offload (VLD) as well as iDCT+MC, and can support acceleration of MPEG-4 ASP (H.263), MPEG-4 AVC (H.264), VC-1/VMW3, as well as MPEG-2. The website for this effort is located at: http://www.freedesktop.org/wiki/Software/vaapi

Some users have also provided a chart of example CPU savings

Drivers

Each hardware video card capable of XvMC video acceleration requires a software driver to enable these features. Below is a list of the recommended software drivers and driver versions for each supported hardware type.

Chipset XvMC? Source Version Driver
NVIDIA Yes www.nvidia.com Any recent version of the driver is acceptable. See the Nvidia page for more details nvidia
NVIDIA No Included with Xorg distribution Included version nv
Unichrome Yes Included in Xorg 6.9 and above distributions Included version openchrome
Intel Yes Included in Xorg distribution Included version i810 or intel
ATI
No At this time, there is no XvMC support for ATI cards in Linux drivers N/A N/A

Enabling XvMC

Installing the drivers

In order for MythTV to utilize the XvMC feature of your video chipset, you need to install the appropriate driver for your distribution. This process will vary by chipset and distribution but some general recommendations can be made.

For nvidia chipsets, go to www.nvidia.com and download the binary driver installer package from their website. Follow the instructions there for executing the package and installing the modules. Also, the ATRPMS site packages nvidia drivers for installation on new Fedora distributions and the Livna site has packages for some older distributions as well as newer.

For other chipsets, the driver should already be included in your Xorg installation.

Configuring chipset drivers

Each chipset driver may have specific configuration options that work better with XvMC

NVIDIA

Use the 'nvidia-settings' control panel to disable Video Texture Adapter and/or Video Blitter Adapter "Sync to VBlank" checkboxes (on the "X Server XVideo Settings" page)

These xorg.conf options can also affect usage or performance

Section "Driver"
     Option "UseEvents" "true"
     Option "XvmcUsesTextures" "false"
     Option "NVAGP" "1" (some users report 2 works better, may not be applicable to newer driver versions)
End Section
Section "Extensions"
     Option "Composite" "Disabled"
End Section

Installing the XvMC libraries

For many distributions, a separate XvMC library package needs to be installed. This is the library that MythTV will use to hook into the XvMC support in the driver. It provides a common interface for application wishing to use XvMC.

yum install libXvMC

is probably appropriate for most. This may already be installed by your distribution

Enabling the chipset library

Each chipset provides an interface between the XvMC library and the actual driver. This is usually handled by what is called the XvMC wrapper library. A text configuration file directs the XvMC library to the driver interface.

The wrapper configuration script is usually found at /etc/X11/XvMCConfig

It contains a single line of the driver library name

NVIDIA

libXvMCNVIDIA_dynamic.so.1

unichrome

libXvMCVIA or libXvMCVIAPro (depending on the chipset)

intel

libI810XvMC

These will change with different driver chipsets. If you find a new one, please add it here. If you used a package (atrpms, livna) based driver installation, you might also be able to find the library name by doing

rpm -ql <driver-package> | grep -i xvmc

and look for library names that include the XvMC text.

MythTV XvMC Support

Packages and Distributions

Most package and distributions of MythTV should have XvMC enabled by default. You can check your version by doing

mythfrontend --version

and looking for

Options compiled in:
linux release using_oss using_alsa using_jack using_backend using_dbox2 using_dvb using_firewire using_frontend    
using_hdhomerun using_iptv using_ivtv using_joystick_menu using_lirc using_v4l using_x11 using_xrandr 
using_xv using_xvmc using_xvmcw using_xvmc_vld using_bindings_perl using_bindings_python using_opengl
using_ffmpeg_threads using_libavc_5_3 using_live

If you see options like using_xvmc and using_xvmcw then your Myth system is prepared for XvMC.

Compiling from source

When you run configure, if you have the proper XvMC development files installed (libXvMC-devel, libXvMCW-devel) , you should see this type of output from the configure script:

# Video Output Support
x11 support               yes
xrandr support            yes
xv support                yes
XvMC support              yes
XvMC VLD support          yes
XvMC pro support          yes
XvMC OpenGL sup.          no
XvMC libs                 -lXvMCW

The last libs line will tell you which libraries that MythTV is compiling against. In this case, it is the XvMC wrapper mentioned above. For some, it may be the nvidia libraries. But regardless, you need to see yes before building MythTV.

If installing MythTV on Gentoo Linux, make sure VIDEO_CARDS is properly configured in /etc/make.conf to include, "i810", "nvidia" or "via". The "xvmc" USE flag is also required. These flags can usually be set on a per package basis in /etc/portage/package.use, for example:

$ cat /etc/portage/package.use
media-tv/mythtv xvmc

Or globally for all packages in /etc/make.conf via USE="xvmc"

Configuring MythTV

Important.png Note: When running mythfrontend for the first time to test XvMC, try running it from a command window so you can see the output from mythfrontend. If mythfrontend cannot load the XvMC library, you will see a line in the logs about this when starting playback and you will see log entries about xvmc not being available

XvMC usage is controlled using the Playback profiles feature of MythTV as of version 0.21. In previous versions, you simply set the Preferred MPEG-2 Decoder to one of the XvMC methods appropriate for your chipset. With 0.21, this is a more flexible configuration allowing for different decoders depending on the content. For XvMC, the Bob deinterlacer provides the best deinterlacing but with some performance penalty.

Sometimes the OpenGL VSync feature can affect XvMC use and performance. This can be enabled or disabled in the frontend configuration if compiled into your MythTV system.

OSD

softblend

If your on screen display is greyscale, then XvMC is working and you are using the softblend OSD. If you are experiencing performance issues related to the OSD (on screen display), disabling the OSD fade will improve this greatly. You can also try using the Chromakey OSD

Chromakey

Warning.png Warning: if you have a non-nvidia card or an nvidia 6 or 7 series card this feature will not work The nvidia 6 and 7 series cards lack the chroma keying and color & contrast adjust features that the older 4 and 5 series cards had.

The chromakey OSD will provide a color OSD and for many chipsets, this also uses far less CPU resources, making playback smoother.

Using other applications

If you use other applications for playback in MythVideo such as mplayer or xine, each has its own configuration options for using XvMC

MPlayer

MPlayer includes an XvMC output plugin. To use it, try this:

mplayer -vo xvmc -vc ffmpeg12mc

(assuming you are running mplayer with XvMC support compiled in)

  • Note - unichrome support in mplayer requires a patch.

Xine

Xine's has two plugins for XvMC support, the first is named xvmc as you would expect, however to take advantage of XvMC acceleration on nVidia graphics cards using the nVidia binary drivers they have a seperate plugin named xxmc (xx instead of xv).

To use Xine with XvMC support for most graphics cards use:

xine -V xvmc 

To use Xine with XvMC support for nVidia graphics cards use:

xine -V xxmc 

(assuming, of course, that xine has been compiled with XvMC support.)

Hardware acceleration processes not yet supported by XvMC

XvMC does have the potential for more than it currently features it supports today. Modern graphic processors (since the DirectX 9 generation and newer) support more than just accelerating motion compensation and iDCT, and they can support more video formats than only MPEG-2 as XvMC does today. NVIDIA's PureVideo Technology and ATI's AVIVO Technology support hardware accelerated video decoding for MPEG-2, MPEG-4 AVC (H.264), and WMV3 (often referred to as WMV9 because Microsoft released it as the same time as Windows Media Player 9). Unfortunate, neither NVIDIA or ATI have yet to open up those technologies to Linux nor the API documentations to the open source community, and no publicly known attempt to reverse engineer access to those APIs have been made.

As a temporary (or permanent) solution to this, shaders in and/or Cg code could be written for these processes and added to the XvMC library to gain some of the additional advantages that GPU assisted video decoding brings and Shader Model 3.0 based GPUs can support today. (Best would be if FFmpeg was used as a reference codec and player/utility). Both NVIDIA and ATI have extensive tools for creating and maintaining the process of developing shaders easier than it has been in the past.

Processes that can be accelerated for most video formats

  • Motion compensation (mo comp)
  • Inverse Discrete Cosine Transform (iDCT)
    • Inverse Telecine 3:2 and 2:2 pull-down correction
  • Inverse modified discrete cosine transform (iMDCT)
  • in-loop deblocking
  • intra-frame prediction
  • inverse quantization (IQ)
  • Variable Length Decoding (VLD)
    • More commonly known as slice level acceleration
  • Spatial-Temporal De-Interlacing
    • Plus automatic interlace/progressive source detection
  • Bitstream processing (CAVLC/CABAC)

Alternatives

There are alternative methods for hardware assisted MPEG-2 playback of standard definition video:


External Links