Difference between revisions of "XvMC"

From MythTV Official Wiki
Jump to: navigation, search
(Added info on color ODS for Unichrome)
(Replaced content with "{{Warning box|XvMC has been deemed unnecessary for playback of any content it supports, and detrimental to future graphical enhancements to MythTV. It has been removed fr...")
 
(237 intermediate revisions by 88 users not shown)
Line 1: Line 1:
'''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 MPEG2 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.
+
{{Warning box|XvMC has been deemed unnecessary for playback of any content it supports, and detrimental to future graphical enhancements to MythTV. It has been removed from MythTV as of 0.25, and superseded by [[VDPAU]], [[VAAPI]], and [[Broadcom_Crystal_HD|Crystal HD]].}}
 +
{{Wikipedia}}
  
 
+
[[Category:Outdated]]
== Software ==
 
 
 
XvMC is a software library provided by the X11 system to provide user applications with a standard Application Programming Interface, or API, to hardware specific features.
 
 
 
=== Supported Video Formats ===
 
Currently, only MPEG-2 is supported. This is usually a hardware limitation. As an exception, one of the Unichrome chips is capable of XvMC accelerated MPEG-4 playback, but the Unichrome driver doesn't support that functionality at the time of this writing.
 
 
 
=== 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.
 
 
 
==== Nvidia ====
 
There are currently two X11 Nvidia drivers available: Open Source and 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 MPEG2 offload (iDCT + MC), and even MPEG4 offload not addressed in XvMC.  The GeForce4 MX and GeForce FX series cards also support full MPEG2 offload.  The GeForce 4 (non-MX) series cards and earlier support only hardware motion compensation, not the more CPU intensive iDCT offload.
 
 
 
===== Proprietary Binary =====
 
{| border=1 cellspacing=0 cellpadding=4
 
|-
 
| Status
 
| 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-02-16, the currently recommended driver version is: '''1.0.7676'''
 
|-
 
| X11 driver name
 
| nvidia
 
|-
 
| Chipset Availability
 
| 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.
 
|}
 
 
 
===== 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
 
|}
 
 
 
==== Unichrome ====
 
"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 MPEG2 acceleration - VLD (Variable Length Decoder) acceleration.  They can provide full MPEG2 decoding (limited, however, to 1024x1024 on non-pro chipsets), allowing MPEG playback with very low CPU requirements.
 
 
 
{| border=1 cellspacing=0 cellpadding=4
 
|-
 
| 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.)
 
|-
 
| Recommended Version
 
| Xorg (6.9 and 7.0)
 
|-
 
| Chipset Availability
 
| 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.
 
|}
 
 
 
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.
 
 
 
Support for MPEG4 and also IDCT/MC acceleration are currently in progress.
 
The OpenChrome project has support for a [http://wiki.openchrome.org/tikiwiki/tiki-index.php?page=Supported+hardware+and+caveats broad range] of chipsets.
 
 
 
==== Intel 8xx/9xx ====
 
The X11 i810 driver supports the full range of Intel integrated graphics chips. These 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.
 
 
 
{| border=1 cellspacing=0 cellpadding=4
 
|-
 
| Status
 
| Full featured driver. Supports 2D and 3D hardware acceleration.
 
|- bgcolor=#CCFFCC
 
| Supports XvMC?
 
| '''YES'''  (Supports offload of Motion Compensation, but not the more CPU intensive iDCT)
 
|-
 
| 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. A "test driver" is available from the maintainer's [http://www.fairlite.demon.co.uk/intel.html page]. It is updated every few weeks.
 
|-
 
| X11 driver name
 
| i810
 
|-
 
| Chipset Availability
 
| This chipset is used in some DIY motherboard kits but is more common in laptops. It's use in a MythTV setup is less than ideal due to limited decoding capabilities (see above), as well as incomplete TV-Out support in the X.org/XFree86 driver.
 
|}
 
 
 
==== ATI Radeon ====
 
 
 
The ATI display drivers for Linux do not support XvMC.  Despite the fact that all Radeon hardware has support for MPEG2 acceleration, ATI has never provided access to these capabilities in Linux.
 
 
 
=== MythTV ===
 
Before MythTV can make use of XvMC hardware support, it first has to be built with XvMC support.
 
 
 
==== Binary Distributions ====
 
The following binary linux distributions support XvMC out of the box:<br>(list distros here)
 
Mandrivia 2006 Free
 
 
 
==== Compiling ====
 
For a more hands-on approach, one can compile MythTV directly from source.
 
 
 
===== Source =====
 
If compiling manually for either nvidia or unichrome, use:
 
<code>./configure --enable-xvmc</code>
 
 
 
If you are compiling for unichrome-pro '''and''' don't have the XvMC wrapper installed, use:
 
<code>./configure --enable-xvmc-pro</code>
 
 
 
===== Gentoo =====
 
If installing MythTV on Gentoo Linux, make sure the "nvidia" or "unichrome" USE flags are set. This can usually be set on a per package basis in the following file:
 
<code>/etc/portage/package.use</code>
 
 
 
==== Configuration ====
 
After MythTV has been installed, it needs to be configured to utilize XvMC.
 
#In MythTV's frontend menus, please navigate to:<br>Setup -> TV Settings -> Playback
 
#Next, change the "Preferred MPEG2 Decoder" to "Standard XvMC"
 
#Make sure "Extra audio buffering" is checked.
 
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.
 
 
 
=== MPlayer ===
 
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 plugin is oddly named '''xxmc''' (xx instead of xv). Try this:
 
<code>xine -V xxmc </code>
 
(assuming, of course, that xine has been compiled with XvMC support.)
 
 
 
== Example CPU Savings ==
 
{| 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
 
|-
 
|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
 
|-
 
| 2.93Ghz Celeron D
 
| 1Gb DDR 3200
 
| Nvidia FX 5200
 
| SD
 
| 8-12%
 
| 10-14%
 
| NO
 
| NO
 
| 0.19
 
| SD Playback is smooth and reliable. No complaints!
 
|-
 
| 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 Athlon XP 1600
 
| 1GB DDR
 
| Nvidia 6800LE
 
| SD
 
| 15%
 
| 25%
 
| Unknown
 
| Unknown
 
| Unknown
 
|
 
|-
 
| 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.
 
|
 
|-
 
| VIA C3 Nehemiah 1GHz
 
|
 
|
 
|
 
| 20%
 
|
 
| Unknown
 
| Unknown
 
| Unknown
 
| can hardly play mpeg2 without XvMC
 
|-
 
| Intel P4 2.26
 
|
 
|
 
| HD
 
| 50%
 
| 95%+
 
| Unknown
 
| Unknown
 
| Unknown
 
|
 
|-
 
| AMD 2500+
 
| 1GB
 
| FX5500 256MB
 
| HD
 
| 50%
 
| 99%+
 
| Unknown
 
| Unknown
 
| Unknown
 
|
 
|-
 
| [http://www.krisrose.net/mythtv.html Via C3 Nehemiah 1.33GHz]
 
| 1GB
 
| VIA CN400
 
| SD
 
| 25%
 
| 90%
 
| Bob
 
| Unknown
 
| 0.18.2, 0.19
 
|
 
|-
 
| 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
 
|-
 
| 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 driver.  Significant stuttering w/o 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%
 
|-
 
| 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.
 
|-
 
| 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.
 
|-
 
| 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.
 
|-
 
| colspan="10" align="center" bgcolor="#FFCCCC" | (Please add your example Hardware stats here!)
 
|}
 
 
 
== Tips and Tricks ==
 
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 ===
 
*Try disabling '''[[OpenGL VSync]]'''.
 
*Try setting this in your "Device" section in your xorg.conf:
 
<code>Option "NVAGP" "1"</code>
 
*Use BOB (2x framerate) [[deinterlacing]]
 
 
 
=== OSD Flicker ===
 
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.
 
 
 
=== Greyscale OSD (NVidia 4 & 5) ===
 
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)
 
 
 
<font color="red">'''WARNING:''' 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.
 
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 [http://svn.mythtv.org/trac/changeset/7569 described here].
 
 
 
To enable the hack under 0.19, do this:
 
*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:
 
<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.
 
 
 
*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!
 
 
 
=== Greyscale OSD (Unichrome) ===
 
Not sure if this works, but there is a patch [http://www.openchrome.org/snapshots.html here on OpenChrome] for doing a color OSD with Unichrome XvMC.  It looks like there is also a [http://svn.mythtv.org/trac/ticket/101 feature enhancement ticket] so this will be in MythTV 0.20.
 
 
 
 
 
== Caveats ==
 
* BOB is the only [[Deinterlacing]] method that works with XvMC.
 
* Picture in Picture, or PiP, doesn't work with XvMC.
 
 
 
 
 
== Alternatives ==
 
There are alternative methods for hardware assisted MPEG-2 playback of standard definition video:
 
*[[Hauppauge PVR-350]]
 
 
 
 
 
== External Links ==
 
*[http://en.wikipedia.org/wiki/XvMC Wikipedia's XvMC Page]
 
*[http://www.openchrome.org/ openChrome Project]
 
 
 
 
 
[[Category:Glossary]] [[Category:HOWTO]] [[Category:Hardware]]
 

Latest revision as of 20:16, 11 November 2013

Warning.png Warning: XvMC has been deemed unnecessary for playback of any content it supports, and detrimental to future graphical enhancements to MythTV. It has been removed from MythTV as of 0.25, and superseded by VDPAU, VAAPI, and Crystal HD.

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