LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Search this Thread
Old 02-01-2010, 10:18 PM   #1
jchance
Member
 
Registered: Sep 2003
Location: New Hampshire USA
Distribution: Mandriva 2006 & 2007 Power Pack Club
Posts: 178

Rep: Reputation: 30
Talking AMD HD Series Graphics Guide: Optimizing Video Playback for MythTV, Mplayer, & Others


Hello all,

I originally created this guide on Ubuntu Forums' website under sports.car.guy. I am contemplating removing it from there thanks to an Op on a power trip and his treatment towards me. I tried to help someone, answered their question, and in the process stated how not searching could be why he received no reply and also how google is a great resource. I got written up for suggesting good habits when trying to solve a Linux problem, besides giving them the answer.

This noob did not like the response I gave or the one from another poster because we were the only two to reply and explained how it only really matters on the GPU itself not the card maker and the nVidia 8800 was well supported. So the noob blatently violated their COC went off about how we were jerks, etc. I replied that I gave him what he was looking for. I also stated because he brought up how he did search and found nothing that if he put in the GPU model and linux into a search engine it would come up, but because he used the snippet off the site he was buying it from is why he got all the website's selling the card. I ended with saying I got better things to do then help a schmuck like you, which the op being ignorent had no clue what the definition of the word is and violated me for it more then once, even after providing the definition online which I will provide here.

http://en.wikipedia.org/wiki/Schmuck_%28pejorative%29

Then he refers me to the resolution thread after racking all these points and violations on me, and my proving I didn't violate the COC, proceeded to post a link to my supposed violation which had been locked for only Ops and higher on my resolution thread, and appears he edited to make me look like the bad guy. Not only that a post I made looking to see what others in the site's community thought he violated me on and gave me two points for, and it was far from a COC violation.

Because the guy who started it all was a noob, he was excused and, didn't get written up, even after what I supposedly violated proved he did.

So I was going to just pull this guide and say to hell with everyone else. I got it working right for me, but thought of here my old stomping grounds where I know if someone is being a schmuck you can say it, It is because it is not like calling someone the F word, or anything like a slur.

I was saying how he was a contemptible obnoxious man, which is the exact definition of schmuck. I can't help I have a more diverse grasp of the English vernacular then the Op there, who too is obviously a schmuck.

Because I proved everyone of my points on why I shouldn't get violated and punished while not backing down from the internet tough guy Op, it looks like I am loosing my account there. Probably a good thing with fascists as Ops like that guy.

So before this guide gets lost in oblivion because of it, I am posting it here. Sorry for the back story, but hopefully it will steer people away from there so they don't deal with what I have, and also so hopefully another Op from their forums sees this as well. Which hopefully stops this from happening to another experienced user who was only trying to help on Ubuntu Forums and got the shaft for it.

Now on to the guide:

It is in the next post.
 
Old 02-01-2010, 10:43 PM   #2
jchance
Member
 
Registered: Sep 2003
Location: New Hampshire USA
Distribution: Mandriva 2006 & 2007 Power Pack Club
Posts: 178

Original Poster
Rep: Reputation: 30
AMD HD Series Graphics Guide: Optimizing Video Playback for MythTV, Mplayer, & Others

Please Note:

This tutorial is for Ubuntu 9.10 and its derivatives. It should be relevant to earlier releases of Ubuntu such as the 8.x generations and up. It should also be relevant to most Debian based distributions as well, along with non Debian derivatives.

Also I take no responsibility if anything you do here causes damage to your computer, causes it to blow up, or even if it leads to cats and dogs living together and mass hysteria (Sorry felt like paraphrasing that from Ghostbusters).


Introduction

A guide of this nature needed to be written for quite some time now. So many of us, myself included, have had some issues, call them quirks, with using our AMD / ATI based graphics cards. This has been regardless of us using AMD's proprietary drivers or the ones the developers in the Open Source community have graciously created for our use. For the most part with the three drivers available, the proprietary and the two available from the community, the complaints have been about the sames types of issues for the most part.

The complaints tend to center around video playback and acceleration. This really has tended to give a bad impression of AMD GPU's and Linux. This is truly not how it should be. The video cards based on AMD GPU's are far from junk.

AMD based video cards work beautifully under Windows, and that is sadly due to how Gates and Microsoft managed to leverage their places in the marketplace. This part of the history why can bring about a lot of debate. Some would say smart business decisions, others would say unfair business tactics, that is beyond the scope of this guide though. What it did do was create a large gap in hardware support for other operating systems.

Where Windows has been such the dominant OS, it was only logical to place focus on driver development with it. AMD was not the only GPU maker to go this route. nVidia has done so in the past as well. They learned from having a focus such as this as have other hardware makers.

nVidia got the head start in the Linux market, but that started to change. ATI before the buyout by AMD, changed their focus from developing two separate driver code bases. They unified the code for both Widows, Linux, and it appears MacOSx has been incorporated as well. This has allowed for jumps in driver performance that has been quite large with Linux compared to before the code consolidation. AMD has continued this focus ATI started of bringing Linux into the fold, making improvements on driver capabilities, along with adding support of hardware features the Windows and Mac worlds have had access to.

AMD is now truly giving nVidia a run for their money when it comes to Linux and the GPU market in general. As PC users, we are starting to see the results. Not only with the products on the market from AMD currently, but also in the leaps fgrlx has seen in performance compared to price point.

I have done a lot of research on the quest to get the absolute optimum from my Sapphire AMD HD 4670 video card. One reason I purchased it, was AMD's UVD and UVD2 technologies which were supposedly coming to Linux through AMD / ATI direct, with support provided through fglrx. Compared to nVidia's VDPAU, it as a technology has definite benefits. Unlike VDPAU, which is a means to support features originally intended to be supported by Windows through DirectX interfaces, XvBA is designed to have API calls that are platform and DirectX independent. XvBA had been designed to be this way from moment one, VDAPU was not, it was adapted.

Sadly, it has taken some time for the reality of XvBA being cross platform to happen. Regrettably, it had to happen after the finalizing of a new MythTV version, which would benefit greatly from adding the means to use XvBA decoding to it. This is because the interface used to access the hardware level of the GPU benefits more then just AMD users.

Accessing XvBA is done through the VA-API interface. This interface was originally designed by Intel for it's own GPU's, but it has grown to allow for nVidia to use it besides AMD. The support base for VA-API has grown including the ability for other GPU makers' technologies to share it's interface. A solution finally has arrived which now allows for code to be written once, it does not matter that each GPU being called by it has totally different coding and hardware structures. That is how it has been for the Windows world with DirectX allowing for interfacing such as this using hooks in the driver API calls. Now this capability on Linux to have code written once and interface with many GPU's allows for us AMD users to have access to hardware accelerated decoding of video and it's playback. Which is definitely something the Linux nVidia camp has rubbed in our faces.

It has allowed for AMD to keep their code for UVD proprietary, only needing a intermediary interface to acces it. This was the majority of code AMD has not been able to release. It is because in UVD / UVD+ / UVD2 capable GPU's, it appears AMD / ATI placed a lot of the hardware decoding features into them with hard linkings to the DRM on each GPU's die. There was no need to have DRM as part of it, but it does make for implementing HDCP compliant connectivity and DRM decoding such as with Blueray in theory easier, just not use under Linux thanks to NDA agreements and our community is all thieves according to groups like the MPAA. Thankfully with the use of VA-API AMD can keep the specs and code agreed to under the NDA internal and we get full hardware accelration and decoding of video.

Now we need to actually look at what you are getting into. From here there are a few things that you will need to know before starting. There are a couple of things you will need or should do before starting.


Before Getting Started:

This guide has been written for Radeon 4000 and 5000 series GPU's. Originally the drivers used in it, were the ones provieded with Catalyst Control Center 9.10 and 9.12 Hotfix. You can still use these drivers, but AMD has released version 10.1 of the Catalyst Control Center and it is the reccomended version to use. If a newer version is available then 10.1 it should be safe to choose that one where AMD is increasing it's efforts to have the VA-API access XvBA.


You can not use any drivers then the ones specified from AMD. Versions of Catalyst Control Center prior to 9.10 are not capable of hardware accelerated decoding and playback of MPEG4 base video. For version 9.12 it is necessary that it is the Hotfix version, otherwise support is broken. As stated, this guide now uses 10.1 and there should be no reason to use the older driver versions. Eventually they will be removed from this guide entirely.

You will be making some changes to your configuration files. So make sure to back them up before making any changes. This way if you do something that makes your graphic interface unusable, you can restore it back to prior the modifications easily.


Needed Files:

AMD Drivers:

Catalyst Control Center Download

*This link takes you directly to the main driver download page for AMD graphics. You can download from here any of the driver versions this guide uses. If using Catalyst Control Center 9.12 Hotfix, you still need to download the original release of it and install it before the Hotfix.

Catalyst Control Center 9.12 Hotfix
*Places a watermark in the bottom right of the screen stating "AMD Testing use only" once installed, a reason to consider 10.1.


VA-API Files:

GB's Corner (Developer's Page)
*The developer has been nice enough to include .deb files for all of the VA-API files.

You will be downloading the following files:
  • libva1
    *This link will directly download the VA-API library binary. It can be updated periodically but not to the point it could not be linked directly here. I will try to keep this link up to date, but if you want to make sure you have the latest go to the developers site using the link above.</ul>
  • libva-dev
    *This link will directly download the VA-API library development files. It can be updated periodically but not to the point it could not be linked directly here. I will try to keep this link up to date, but if you want to make sure you have the latest go to the developers site using the link above.
  • libva1-dbg
    *This link will directly download the VA-API library debug files. It can be updated periodically but not to the point it could not be linked directly here. I will try to keep this link up to date, but if you want to make sure you have the latest go to the developers site using the link above.
  • xvba-video
    *The XvBA interface for VA-API is updated quite frequently with it still being in it's infancy so to speak. I have found it to be very stable even though young, don't let it's short life so far scare you off. This link places you into the directory for it. Make sure to download the latest version.
  • mplayer-vaapi
    *MPlayer is constantly under development and it appears that the XvBA VA-API interface developer is keeping up with it. Not only for that reason, but also for stability ones I am sure with XvBA and MPlayer as well. This link places you into the directory for it. Make sure to download the latest version


File Installation:

Catalyst Control Center:

In order to install the Catalyst Control Center you need to make sure of the following:
  • This file must be made executable. You can do so through the properties window in your graphics manager or by using the command which will make it so everyone can read write or execute it. Crude but effective for new users:

    chmod 777 ati-driver-installer-10-1-xx-x86.x86_64.run
  • It is recommended to have the file saved in a directory without spaces. The reason is it can error trying to executing the installer. A way around this that should work is to enclose the path and filename in quotes.

sudo sh ati-driver-installer-10-1-xx-x86.x86_64.run --buildpkg Ubuntu/karmic
*This will create a package for installation by apt-get or one of the graphical package managers. Note for Catalyst Control Center 10.1 and Ubuntu 9.10, this option is broken but there is a work around on this forum. It is not the preferred method for this guide and should not be in general. It compiles modules to the current system kernel. If you update the kernel then you are applying old modules to it and that is not the best thing to be doing under any circumstances.

or

sudo sh ati-driver-installer-9-xx-x86.x86_64.run
*Go through the menus and choose to install the drivers without using a package. This is the way I prefer. You will have to go in under "safe mode" and rerun this command with every kernel update from the directory where you have it saved, but seems to have less issues then the drivers from packages.

If you are using Catalyst Control Center 9.12, you will have to install 9.12, then the Hotfix. You can not just install the Hotfix itself which is just the driver files. You also need the Catalyst Control Center as well for this Guide from the non Hotfix Catalyst 9.12.

Once installed you will need to run the following commands:

sudo aticonfig --initial

or

sudo aticonfig --initial -f
*Using the -f option will cause a clean xorg.conf to be written.

You will need to make sure there are two files installed with these drivers. For some reason on this pretty fresh install of Karmic they didn't get installed with Catalyst Control Center 9.12. When I upgraded to 10.1 I was unable to see if these files were installed having this setup prior.

The two files are the libraries that VA-API's XvBA interface will be calling to, and the installer seems to neglect X86_64 when installing them. Supposedly, the 32bit binaries for them get installed on both 32bit and 64bit installs but I have no way to confirm this. (If they do not please post here so others will be aware of it.)

The two files should be in either of these locations

/usr/lib

or

/usr/lib64

The missing files:

libAMDXvBA.so.1.0

and

libXvBAW.so.1.0

If they are not on your system, you will need to extract them from the driver .deb. This is easy. Use the following command in the terminal.

sh ati-driver-installer-9-xx-x86.x86_64.run --buildpkg Ubuntu/source

This will create an archive in the same directory as the driver's .deb file. You need to extract this archive, and find the lib64 directory in /x86_64/usr/X11R6/lib64. Inside of it are the files you will need if they were not installed onto your system.

These files will need to be symlinked like the following example once copied there:

sudo ln -s libXvBAW.so.1.0 libXvBAW.so.1

If this is not done, Xv Binary Acceleration errors will arise with the VA-API and it won't work. All you will get is sound and a few errors in the terminal window.

Once you are at this point there needs to be some configuration made to optimize fglrx.

This is placed in the next post. I apologize but there are limits to post character length here.
 
Old 02-01-2010, 10:48 PM   #3
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Welcome to Linux Questions.
Please read the LQ Rules. For example:
"Challenge others' points of view and opinions, but do so respectfully and thoughtfully ... without insult and personal attack. Differing opinions is one of the things that make this site great."

From your description, both you and the mod may have been in violation of this rule. I wouldn't find schmuck vulgar, but then I don't speak Yiddish. It is a disrespectful term for sure.

At least here you can use the S word. "su" that is, although some users my "respectfully" disagree.

I'm going to move this to thread to the General forum, as it isn't a question about the Desktop. Don't worry, no infraction.
 
Old 02-01-2010, 10:50 PM   #4
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
On second thought I will leave this thread here. You posted your second post as I was entering my response.
 
Old 02-01-2010, 10:56 PM   #5
jchance
Member
 
Registered: Sep 2003
Location: New Hampshire USA
Distribution: Mandriva 2006 & 2007 Power Pack Club
Posts: 178

Original Poster
Rep: Reputation: 30
AMD HD Series Graphics Guide: Optimizing Video Playback for MythTV, Mplayer, & Others

Optimizing fglrx:

First is to modify your xorg.conf. I have done a lot of research on this particular part of this guide and in your xorg.conf all you should need is the following options set in the driver section under where it says Driver "fglrx".

su gedit /etc/X11/xorg.conf

or

su kedit /etc/X11/xorg.conf

This snippet allows for OpenGL Rendering to work properly in MythTV, reduces tearing greatly if not removes it for Xv, while in part completely removes it with OpenGL as well. It specifically tells X which monitor to overlay on (Should be enabled even if a single monitor setup.), and also enables FastTLS an AMD optimization.

Code:
    Option        "TexturedVideoSync" "on" #HD4xxx & HD5xxx use textured video to render Xv. This helps to remove tearing.
    Option        "Capabilities" "0x00000800" #This option also turns on vertical syncing as well. Both can and do work well together.
    Option        "OpenGLOverlay" "off" #This is for workstations and certain commercial graphics applications for them. Nothing as Linux user that we do needs this so disabled.
    Option        "UseFastTLS" "on"
    Option        "OverlayOnCRTC2" "0" #For some reason when only using one monitor it should see this and use overlay on it correctly and does not. This I believe is what caused some of the MyThTV issues. This needs to be set to 0 for a single monitor application and in a multiple monitor to the one MythTV is displayed on.
Now it is time to reboot your machine and configure the Catalyst Control Center:

Open as administrator from your machine's launch menu or by the means below the Catalyst Control Center

$ amdxdg-su -c amdcccle

or

$ sudo amdcccle

Now we need to adjust several settings here before continuing.

Note before starting that these settings work on the HD4670 without issue. On the older GPU's supported by the proprietary driver or even a lower 4XXX model, these settings may be too much for system to handle and run smoothly. There might have to be some tweaking to your specific system.

Go to the 3D section of the options list on the left. These settings actually effect 2D rendering in Linux as well to some extent. It doesn't say it does, but they do. It is because rendering even when not using OpenGL in Linux still uses it for things like vertical syncing, also we will be using OpenGL rendering in a large part of this guide for rendering and playback.

You are going to manually override the system settings on each of the options for 3D to their max settings. I have absolutely no problems with rendering doing so and the quality difference is quite noticeable. If your system has problems handling the workload they will have to be brought back from max settings a little.

Anti-Aliasing:
Override and set to 8x

Adaptive Anti-Aliasing:
Override and set to Quality

Anisotropic Filtering:
Override and set to 16x

MipMap Detail:
Override and set to High Quality

More Settings:
Wait for Vertical Refresh
Set to on unless application specifies off
* This is the second to last option. You can set to be always on, but no need for it. If an application wants no refresh rate syncing let it. Plus having it on is actually better in my opinion. What is so great getting 10,000 frames a second if the display can't reproduce it. Visually all you will see perceive is what the display is capable of.

Enable Catalyst AI:
You want to enable and set to advanced.

You will need to at minimum log out and back in for these settings to take effect, but I would suggest a reboot to be safe. Sometimes fgrlx settings don't want to take unless there is a reboot involved, and the nature of the beast so to speak.

VA-API Files:

Install in this order. If you try to install in any other order it should throw an error.
  • libva1
  • libva-dev
  • libva1-dbg
  • xvba-video


Mplayer Compile and Install:

Before starting please note. If you are using the nightly stable or tree builds of MythTV you will encounter your package manager wanting to remove MythTV. The reason being is MythTV is using a new VDAPU library and MPlayer needs the old one to have it's dependencies met. I am currently trying to get it to work around this, but to little success. If you want to compile your own you will have to let it remove the newer MythTV, or I do have two pre-compiled versions of MPlayer that I made before switching to the nightly builds of MythTV 0.22.

One is a strict MPlayer without GUI, the other is compiled for a the GUI and because of it buggy as all hell. They have been compiled for X86_64 on an AMD AM2 based processor but should in theory run on any X86_64 system. I have created a tarred bziped file of them. It is too big to include here, but if there is enough interest I will find a place to setup a link to from here. Message me or post here if you you like me to include a link to them.


To build your own:

1. $ sudo apt-get build-dep mplayer
2. Extract the bzip2 file containing MPlayer and enter the extracted directory.
3. $ ./checkout-patch-build.sh

Let it build MPlayer. It could take a few for the compiling of MPlayer. If you smoke, now would be a good time to go have one. It took on my AM2 Dual Core less then 10 minutes, about a cigarette to be honest, and that was applying the patches besides the compile.

This is just mplayer, no gmplayer is compiled with the script. It is best for use with keyboard shortcuts and / or Lirc on the note of controls. Remember though this version of Mplayer was given to us through the generosity of the VA-API XvBA interface and it's developer so don't be going awwwww man or complaining.

To start this VA-API enabled Mplayer for Testing:
*Below was taken from the readme word for word

$ cd mplayer-vaapi
$ ./mplayer -vo vaapi -va vaapi <URI>

<URI> can be a pathname or an URL.

For OpenGL rendering:
$ ./mplayer -vo vaapi:gl -va vaapi <URI>

For OpenGL rendering with reflection effect:
$ ./mplayer -vo vaapi:gl:reflect -va vaapi <URI>

The reflect option is as it sounds, and kinda trippy..lol.

It provides a mirrored copy of the file you are playng inside the MPlayer window.

Test MPlayer at this point with an MPEG4 stream such as AVC1, WM3 aka WM9, or VC1. It uses either Xv and GL rendering, Regardless of which renderer you choose, everything should be working for you beautifully on the note of hardware acceleration. I personally find the picture quality a little bit better using the openGL renderer and it is absolutely tear free besides. Plus it actually uses a bit less processor on my system then Xv, go figure.

You can compile this version of MPlayer to use the GUI, but will have to go into the directory yourself to do so. In order to do this, you need to either manually patch the source or let the script run to do it and make the default MPlayer that it does.

Then go into the directory, and do a make clean after the script has completed. You can do the make-config, make, etc yourself now. Remember you will have to pass the options to MPlayer for it to compile with VA-API support.

This is how you would do it:
$ ./configure --enable-vaapi --disable-vdpau

Then you need to configure the GUI and OSD for it:
$ ./configure --enable-gui --enable-menu

Finally Compile it:
$ make

If you are satisfied with how it is working and want to install it:
*Remember this is experimental and I will not take responsibility for doing this. You will need to have the packaged version of MPlayer removed to do so as well.

$ make install

Please Note:

There is a patch for VLC to use the VA-API library. It has not been mainstreamed into the code at this point. If you were to want VLC you need to get this patch, apply it, and compile your own copy of it. I do not have the patch or the source code for VLC linked here. You can go to the VideoLan website for it.

I would like to setup a VA-API PPA for 9.10 and other releases as well. If someone wants to build packages of compiled versions of MPlayer in 32bit or 64bit, VLC, etc., message me here and I will get it all setup. Ubuntu really needs to have one easy setup repository for doing this.

At this Point:

Now your system is ready to have your video applications configured, in the case of this guide MythTV and Mplayer primarily. In order to do so properly lets look at what we have done up till this point and also what has been added to the fgrlx driver but not widely documented. It will all start to click with seeing everything listed here.


Hardware Decoding / Acceleration:

MPEG1&2 Decoding and Acceleration:
It is little known that as of Catalyst Control Center 9.10, maybe even before this release of it, AMD re-enabled hardware decoding of these streams through the AVIVO now UVD interface using XvMC not XvBA. It works very well, and for the most part is fully compatible with the VIA implementation that nVidia also supports in their older GPU's. HD MPEG2 streams decode on my system use almost no processor and only 30% of the GPU at peak hits to it decoding, heavy action scenes are an example, but the core is keeping itself at the minimum clocking when under 30% load. This is using MythTV, which was itself using the processors at around 10% combined on a dual core AM2.

This capability is only available on HD4xxx and higher GPU's from what some members out here are finding out. This may change at some point though and dependent on AMD supporting it through their proprietary driver. If someone on a GPU prior to the HD4xxx's tries this and it is a success let me know or post it here so this section can be corrected.

MPEG4, AVC, WM3 aka WM9, and VC1 Decoding and Acceleration:
Even though "experimental", you now have hardware accelerated decoding of MPEG4 based streams. Personally I have found the results to be far superior then ffmpeg decoding with no artifacts, not had one crash using it so far, and would not consider this to be experimental myself at this point, but who am I to argue.

Update January 29, 2010:

I have currently tested the hardware decoding with a variety of "non-supported" formats. I have tried the old Windows hacked DiVX 3 along with the legal version 5 encoded files and they playback flawless. They do have a tendency to tax the GPU a little, especially DiVX 3, but regardless play very well for me. I have also tried ffmpeg and Xvid encoded videos with great success as well. From my experience, I will say with relative safety that it will play nearly all MPEG4 formats.


No More Tearing:

Making the changes you have to your xorg.conf and Catalyst Control Center should now have tearing as a thing of the past. For Xv rendering it is substantially reduced to nearly non existent levels. You may on a rare occasion see a tear or line cutting through the picture, usually in very high speed movement, but not what it was before then.

OpenGL, whether with or without the use of XvBA hardware decoding and acceleration, will be absolutely 100% tear free. With the settings of Catalyst Control Center, the picture quality should be better then Xv as well. You may have to increase the brightness settings a little though. This is from my experience of course, and your's may vary.

With the update of this guide, you are now presented with choices in rendering using MythTV owning an AMD GPU finally. We have never been able to properly run OpenGL rendering with MythTV and I have seen posts to this extent going back several years.

No offense meant to the MythTV developers, but they have never truly addressed the owners of ATI / AMD GPU's. We are like the red headed stepchildren of the MythTV community of users. While the favorite son, nVidia, has received all of your love with us over in the corner, neglected, even ridiculed and made fun of.

When MythTV 0.22 was in development, the VA-API which would have benefited a large number of GPU's including both AMD and nVidia was neglected, yet VDAPU wasn't. This limited hardware acceleration of MPEG4 to only nVidia. That is to extent proof to this favoritism and being the red headed stepchild. This lead me to rebel like us red headed stepchildren tend to do and find my own solution, and I did eventually.


No More Pulling Your Hair Out:

Watching video without tearing, until now using AMD GPU's has been a pull your hair out, and want to scream situation. The distributions should help minimize this, and help it from not happening offering compiled binaries of these drivers for use. Yet they don't. These are settings I provided for the xorg.conf are common to nearly all AMD graphics using proprietary drivers, especially HD4xxx and higher. The other settings in the Catalyst Control Center can be set I am sure to default to what I have found to be optimal assuming detection of the GPU is done correctly. If not a pop up windows saying hey you have this driver installed and these settings should be made to not encounter tearing, etc, would be nice.

The MythTV developer's focus on nVida to an extent hasn't help with hair pulling. There is little to no documentation on getting the most out of AMD graphics with MythTV from them, yet there is post after post on many forums asking for solutions and help. Then at least in my experience, when going out actively searching for a solution or a suggestion to improve playback on the MythTV IRC channels instead of anything constructive I am told to go out and purchase an nVida card far inferior to my AMD and nearly costing the same. How is that a solution?

So to save you from pulling your hair out, I did instead. I jokingly say to some it is why I began buzzing my head down. Because my hairline couldn't take much more of dealing with getting MythTV and it was the only way to keep the hair I still got..lol.

Now it is time that we have all the components to put them all together and have them play nice.


Putting it all Together:

It is time to setup MythTV and MPlayer. The way described here does not replace the existing install of MPlayer you have. Where this software is considered experimental I deemed it best to create a bin directory in the user's home directory, and then call it like any other application from a modification to the bashrc script for the account being used. Lets see how everything goes together.

Getting MPlayer to Work with Shortcuts and by Calling it Directly:

We now need to setup this version of MPlayer to be able to be called by command line by name and also by shortcuts without providing paths.

Create a directory called bin in your home directory as follows:

~$ mkdir /home/{username)/bin

Now move your compiled MPlayer directory into the bin directory you just created:

You can do this but need to have the name change if directly in bin, otherwise the symbolic link won't work properly. The other options would be to set it inside another directory. Then there will be no issue. That is how I actually did mine.

~$ mv /home/{username}/{directory where you extracted the whole archive}/mplayer-vaapi-20100114/mplayer-vaapi /bin/mplayer

Now we need to symlink mplayer and gmplayer if you compiled a graphics enabled version to be executable the way we want. You will need to make 3 symlinks for this to work properly. One of these symlinks is needed if only using MPlayer created by the script.

All these commands are assuming that you are in the bin directory you created.

Needed Symlink:
ln -s mplayer-vaapi /mplayer/mplayer

Optional gmplayer Symlinks:
ln -s /mplayer/gmplayer /mplayer/mplayer

ln -s gmplayer-vaapi /mplayer/gmplayer
*This one can also link directly to the mplayer binary file itself as well. I figured this way it is consistent.

Now we need to make it so when you are in a terminal or click on a shortcut bash knows what to do. You need to have your bin directory declared in one of two files. It can be declared locally or globally in bashrc. If you declare it globally, regardless the account you are in, you should create a bin directory for it, even if there is nothing in it at all.

Declaring in Bash Locally:

To Open the File:

$ gedit ~/.bashrc

$ kate ~/.bashrc

Declaring in Bash Globally:

$ su gedit /etc/bash.bashrc

$ su kate /etc/bash.bashrc

Add the Following at the Bottom of bashrc:

PATH=$PATH:~/bin
export PATH

Log out or reboot. If declaring globally, to be safe I would reboot. Honestly I would just reboot regardless. Now you should be able to call Mplayer and GMplayer by the names of the symlinks that you created. To test it open up a terminal and try it.

Example (If gmplayer config was done before making the binaries)
$ gmplayer-vaapi

If you want to try MPlayer (This example uses the openGL renderer. I had an issue with the bottom of the video cut off in full screen my self):
$ mplayer-vaapi -vo vaapi:gl -va vaapi <URI>

To create shortcuts, refer to your desktop's documentation.

Now onto setting up MythTV.
 
Old 02-01-2010, 11:46 PM   #6
jchance
Member
 
Registered: Sep 2003
Location: New Hampshire USA
Distribution: Mandriva 2006 & 2007 Power Pack Club
Posts: 178

Original Poster
Rep: Reputation: 30
AMD HD Series Graphics Guide: Optimizing Video Playback for MythTV, Mplayer, & Others

Setup of MythTV 0.22:

MythTV in my opinion, is one of the best HTPC applications out there. It is not only very powerful, It is very flexible. It allows for you to configure a lot of parameters to try to get the best out of your setup. In particular we will be looking at the features associated with its decoding and playback capabilities, such as the actual decoder choices, deinterlacers, and renderers. Those are the only ones really of concern for this tutorial.

Before we start, I want to state that because of the lack of knowledge that AMD had reinstated XvMC decoding in their drivers there are some deinterlacing issues that were there for all the x2/2x deinterlacers in version .021. They have since been corrected in Xv and OpenGL rendering with 0.22, just not with XvMC with the it's releases.

MythTV also, as of the release of version 0.22 does not support as stated, the VA-API natively. I have searched to see if there has been a patched version made, but no luck on it. I may have found a patch for the source code though. As I said I would like to setup a PPA for all of this. If someone would like to compile a version that includes support for the VA-API interface I can point you in the right direction to that possible patch and we can go from there.

If it turns out not to be a patch for it, and someone has MythTV coding experience that wants to get this working, you can modify the code and I will include it in the PPA.

Now lets get into the settings of MythTV.

First off you are going to have to make some decisions at this point. These are going to be based off of personal preference, and your hardware beyond the AMD video cards this guide has been written for. If your system is slower processor wise, you are going to have to compromise obviously.

For example, I have also found a bug in OpenGL rendering with MythTV on all levels that has me making compromises, but now it is workable, not perfect, but workable. I can not get it to render properly with menus at all using the OpenGL renderer for them. It is not the distortion bug they have corrected. It is rendering on the note of placement of windows. This could be a drawing issue with OpenGL and MythTV in relation to AMD because they are the only application using OpenGL that I have seen this happen.

The new windows you go into remain under the one you are on, at least it appears to be like that. My solution to get to the next window is to switch to a terminal and then go back to my desktop session using Ctrl+Fn1 then Ctrl+Fn7. That is how I manage to go in to switch back to Qt rendering for menus.

This issue happens when you are using the Xv or other render options too with OpenGL menus it does not matter. Then with the OpenGL rendering and Qt for menus it will happen without the additions to the xorg.conf I added to it recently. What happens is the guide is rendered once if you are lucky then it does not get to be on top again at all unless you exit Live TV and then it is sketchy on seeing it again without a full restart of MythTV. You can also do the same terminal switch workaround I use with the menus to it.

I am also finding the One Field deinterlacer for XvMC renderer to be nasty when it comes to standard definition cable coming off the firewire port on my cable box. It is all pixelated and rough looking. You would think that the same would be true for high definition 4:3 as well, but it is not. It actually looks very watchable. As is high definition 16:9.

Knowing that, you may and probably will encounter these types of issues, here are my settings that I have come to tweaking things. Remember my system is more then capable of handling a heavy of load. It is an AM2 Athlon X2 5.4GHz (2.7GHz per core), 2GB of ram, with a Sapphire HD4670 sporting 1GB GDDR3. If you are working with a less powerful system these settings probably won't work the best for you. I am providing them as a baseline for you to go by.

MythTV Rendering Settings:

Here you are going to have to make a choice. If the system is under high demand say acting as both a frontend and backend with multiple connections, then you will probably want to consider the use of XvMC for MPEG2 decoding. If not, then with how OpenGL provides absolute tear free watching, you should consider it. So you may want to take a moment now, think about these types of considerations, and decide which route you will want to go. Personally the system I am using for this guide is used strictly as a frontend in regards to MythTV, so I run OpenGL and software decoding through ffmpeg for MPEG2 decoding off my cable box and ATSC/QAM tuner.

Now you can setup multiple decoder profiles with MythTV and this can be very helpful, or it can lead to the proverbially shooting yourself in the foot. You just need to make sure that you think first and not just go oh okay this should work. There are a couple of different profiles we are going to setup for MythTV in this guide, lets look at them.

On your frontend you are now going to start it and go into the settings of MythTV.

Utilities/Setup>Setup>TV Settings>Playback

Screen 1:
  • Check off picture controls
    *This will allow for you to make color corrections if necessary.
  • Optionally you can check Enable OpenGL vertical Sync for timing.
    *It may conflict with what we have set otherwise and cause the picture to get jittery even though it is supposed to stop jitter.

Screen 2:

Skip it. It does not pertain to what we are doing here.

Screen 3:
  • Current Playback Profile I have set to High Quality where I tend to watch a majority of my programming and videos in HD.
  • You should now see four playback profiles. The first two are your primary choices and the second two are the fall backs so to speak. If the video's format does not match the first two it will use the second two.
  • You are now at the point where you should have decided on how you are going to have MythTV render video. We are going to setup MythTV according to what you have decided. Below are two examples of changes to make. The first is for setting up MythTV to playback using ffmpeg for decoding and OpenGL for rendering. The other example is for setting up MythTV to use hardware decoding for MPEG2. Please note, I have depreciated the value of XvMC in this guide, but it is still relevant for those of you looking for a hardware decoding solution.
  • You can mix and match these decoder profiles to suit your needs as well. Decoding of MPEG2 HD content you may want to set to use hardware decoding because of overhead, no worries you can do that.


Changes to Playback Profiles OpenGL Rendering:
  • If rez is >= 1920x1080 (Ranked 1)
    • Decoder leave at Standard.
    • Video Renderer Set to: OpenGL
    • OSD Renderer Set to: OpenGL2
    • Next Screen (Deinterlacers)
      • Primary Deinterlacer Set to: Bob(2x,HW)
      • Fallback Deinterlacer Set to: Linear Blend(HW)
    • Click Finish.
      *Your primary profile for 1080p/i has now been created. Now to create a profile for standard definition through to 1080p/i.
  • If rez is >= 0x0 (Ranked 2)
    • Decoder leave at Standard.
    • Video Renderer Set to: OpenGL
    • OSD Renderer Set to: OpenGL2
    • Next Screen (Deinterlacers)
      • Primary Deinterlacer Set to: Bob(2x,HW)
        *You may notice occasionally some slight interlacing on standard definition content using this deinterlacer, but the picture quality out weighs this.
      • Fallback Deinterlacer Set to: Linear Blend(HW)
    • Click Finish.
      *Your primary profile for standard definition up through 1080p/i has been created.
  • If rez is >= 1920x1080 (Ranked 3)
    • Decoder leave at Standard.
    • Video Renderer Set to: xv-blit
    • OSD Renderer Set to: softblend
    • Next Screen (Deinterlacers)
      • Primary Deinterlacer Set to: Greedy HighMotion(2x)
      • Fallback Deinterlacer Set to: Greedy HighMotion
    • Click Finish.
      *Your fallback profile for 1080p/i has now been created. Now to create a profile for standard definition through to 1080p/i.
  • If rez is >= 0x0 (Ranked 4)
    • Decoder leave at Standard.
    • Video Renderer Set to: xv-blit
    • OSD Renderer Set to: softblend
    • Next Screen (Deinterlacers)
      • Primary Deinterlacer Set to: Greedy HighMotion(2x)
      • Fallback Deinterlacer Set to: Greedy HighMotion
    • Click Finish.
      *Your fallback profile for standard definition up through 1080p/i has been created.

Changes to Plaback Profiles for XvMC:
*Note these changes are presented separate because they have been depreciated in this guide to some extent, but are still pertinent and useful. It looking to lower overall system load these are the settings to consider. An example would be rendering HD MPEG2. The fallback decoders have been seet to use Xv in this example of settings but the settings for OpenGL can be substituted in their place.
  • If rez is >= 1920x1080 (Ranked 1)
    • Decoder change to VIA XvMC
      *I noticed a difference between standard XvMC and VIA XvMC so you might want to try both and judge it yourself.
    • Next Screen (Deinterlacers)
      *I had Issues with the Bob x2 deinterlacer under XvMC where it would render 2 pictures, one on top the other. Picture looks good on 1080p display using these settings. If sending to a television you may want to set to none and let the television do deinterlacing where it will probably produce better results.
      • Primary Deinterlacer set to One Field
      • Fallback Deinterlacer set to One Field
  • If rez is >= 0x0 (Ranked 2)
    • Decoder change to VIA XvMC
      *I noticed a difference between standard XvMC and VIA XvMC so you might want to try both and judge it yourself. You might want to leave this one set to standard if you watch a lot of standard definition television and choose through the deinterlacers for Xv rendering because it gets extremely pixelated using One Field. If sending to a television you may want to set to none and let the television do deinterlacing where it will probably produce better results.
    • Next Screen (Deinterlacers)
      *I had Issues with the Bob x2 deinterlacer under XvMC where it would render 2 pictures, one on top the other.
      • Primary Deinterlacer set to One Field
      • Fallback Deinterlacer set to One Field
  • If rez is >= 1920x1080 (Ranked 3)
    *Without this profile the internal player for MythTV is only capable of rendering MPEG2, technically the second ranked one if set to standard will correct that, but we are not using it on standard in the setup. This is only useful if you are using standard as the number 2 profile and I would still set the others as well to be safe.
    • Decoder leave at Standard
    • Video Renderer Set to: xv-blit
    • Next Screen:
      • Primary Deinterlacer Set to: Greedy High Motion (2x)
      • Fallback Deinterlacer Set to: Greedy High Motion
  • If rez is >= 0x0 (Ranked 4)
    • Decoder Leave at Standard
    • Video Renderer Set to: xv-blit
    • Next Screen:
      • Primary Deinterlacer Set to: Greedy High Motion (2x)
      • Fallback Deinterlacer Set to: Greedy High Motion

      Exit out of these options by clicking finish when complete.

Now that we have MythTV setup for optimal playback, and we have a version of MPlayer that takes advantage of hardware acceleration, lets make them play nice together.


MythTV and our Version of MPlayer Playing Nice Together:

This is pretty easy to accomplish, and MPlayer has been the default player in previous versions of MythTV along with as of version 0.22 the alternative player by default. This is true at least with Ubuntu variants.

We now need to change some settings in another part of MythTV. If you are still in the settings for television, back out a couple of screen to the main part of MythTV setup. From there you want to migrate to video player settings.


From the main menu:

Utilities/Setup>Setup>Media Settings>Video Settings>Player Settings

We are going to change Alternate Player, not the primary one. You are probably asking why. Simply, it is easy to have a video start playing with the alternate player, this is still experimental and may not support all of your files, and I am not going to have a bunch of people say I told them to make it the primary if they encounter issues or it doesn't play a file..lol.


Under Player Settings Change the Alternate Player to:

mplayer-vaapi -channels 6 -fs -cache 8192 -vo vaapi:gl -va vaapi

The above is assuming you have a 5.1 speaker system setup on your computer using the -channels 6 switch and if you are accessing any of your files over the network on a mounted NFS or Samba share, add the switch -cache 8192. This is so you don't have audio and video syncing issues. It is also assuming you use Alsa's default output.

That is pretty much it. If you are using PulseAudio and have it all setup, now whether you open a video with a 2.0 or 5.1 audio track, all of your speakers will work.

If you are using Alsa and don't want to have to change any settings on your device out in the video player alternate player settings, for like up-mixing, I am sorry to say there is no way around it currently except to manually specify a unique player for the file under metadata settings and tell it to pass the sound to the device you created for upmixing.


That is pretty much it for setting this up. To use the MPlayer that you have created in MythTV, when on a video in the media library click i on the keyboard or info on your remote. If you then select play it gives the choice of using the default or alternate player, choose alternate and away MPlayer goes. Nothing could be simpler on the note of being able to pick and choose when you want to use the benefits of XvBA.

Now we need to setup our other players. I have found that the OpenGL renderers tend to look better and reproduce better playback. It is tear free afterall. This means other players can benefit from the tweaks as well. Lets get into those.


Other Video Players:

Go into the settings on these other video players like VLC, Xine, etc, and select OpenGL or OpenGL2 for rendering. That is pretty much it. You can use the Xv rendering, but I noticed with all of the settings as they are from the tweaking, the quality is much better for me including absolutely fluid and and flawless playback.


At the End of it All:

I hope that someone finds this guide useful and is thankful for it, not taking it for granted. I spent a lot of time researching from multiple outlets, many untold hours actually, and decided to share my experience and knowledge in this arena. I didn't want to see anyone go through what I have looking everywhere for answers and loose time that could be better spent, like with family enjoying the HTPC. In doing so, I spent several days working on this guide besides.

If you find it useful all I ask is for you to take a second and say thank you by leaving a post in this thread. I would also like for you to let the others know if you do how it is working for you, good, bad, or otherwise. This way others will get your opinions, and also you might find settings that others could find useful, maybe even me. I still haven't tried every combination.

I hope this becomes a sticky here as well so it is easy to gain access to by other Ubuntu users and other Linux users in general so they can get the most out of their AMD HD4xxx and HD5xxx series video cards.

Enjoy
jchance
 
Old 02-02-2010, 12:06 AM   #7
jchance
Member
 
Registered: Sep 2003
Location: New Hampshire USA
Distribution: Mandriva 2006 & 2007 Power Pack Club
Posts: 178

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by jschiwal View Post
Welcome to Linux Questions.
Please read the LQ Rules. For example:
"Challenge others' points of view and opinions, but do so respectfully and thoughtfully ... without insult and personal attack. Differing opinions is one of the things that make this site great."

From your description, both you and the mod may have been in violation of this rule. I wouldn't find schmuck vulgar, but then I don't speak Yiddish. It is a disrespectful term for sure.

At least here you can use the S word. "su" that is, although some users my "respectfully" disagree.

I'm going to move this to thread to the General forum, as it isn't a question about the Desktop. Don't worry, no infraction.
Thanks for the welcome. I have been a member for years now though. I understand where you are coming from on the situation I was in totally.

The whole schmuck thing though and my getting a violation for it was well after he started handing them to me left and right. After an hour of trying to talk to him about my not violating the COC, where I did give him the answer he seeked, and only added how google is a great resource. It is when he nailed me on it because every thing he used on violating me for adding the google thing I totally blew out of the water.

I don't even think the guy had a clue what it meant, even after sending him the definition's link.

Schmuck in Yiddish is like Malacca in Greek. It is slang and they kinda mean the same thing. It is to describe someone as contemptible, obnoxious, stupid, or foolish. I worked for years in high school and college as a line cook and chef for many Greek families at their restaurants and they threw Malacca around like they were saying hello.

I am a New Englander born and bred. We are very direct and pull no punches. Up here we don't find schmuck offensive because we know the definition is unlike the Op at Ubuntu Forums, who well after the fact used it against me.

He then violated me for telling the story on the forums about how I got 6 violations at that point because I defended myself proving I didn't violate the COC with answering his question while adding in google was a great resource, and also for choosing a word that meant contemptible, obnoxious, etc. I didn't even use the word in that post either. Saying watch what you say, you could end up like me, and if you think it is wrong PM the Op.

He threatened me in a private message stating I better take a break from the site or basically be banned.

No way is some Internet tough guy like that going to intimidate me. So I took his advice from prior to this point and posted in the resolution center explaining everything he did. So he locked the post he gave me 8 violations on, put a link on my resolution thread to it, and only Ops and Admins have privleges to it. It appears he edited the whole thread to make me look like the total instigator and jerk of the situation.

How is that right?

If the guy wants to see a violation of the COC for there I can show him what one really is. Better yet, where supposedly the official source for Ubuntu support, I should let the development team know what their support is actually like. Maybe they might have a clue and say hey this op is a SCMUCK..LMAO
 
Old 02-02-2010, 12:30 AM   #8
jchance
Member
 
Registered: Sep 2003
Location: New Hampshire USA
Distribution: Mandriva 2006 & 2007 Power Pack Club
Posts: 178

Original Poster
Rep: Reputation: 30
Well the Op banned my account over on Ubuntu Forums for this and I think it is in part for saying something here about it where when I tried there he violated me for it.

I sent an email to the site and lets see if they do something. How can Ubuntu call these forums official support for their variant without keeping an eye on the Ops making sure they aren't abusing power. He didn't do squat to the noob who trashed me, another poster to his thread, and the site because in two hours in the middle of the day, he got only two replies, but both answered his question. I just added how google is a great resource.

I got almost 200 posts in a few weeks over there, all trying to help someone. Does that account for anything? I guess not.

And to think the company I started was going to be using Kubuntu on our products, probably not now. Would have been a good boost for it too.
 
Old 02-02-2010, 12:41 AM   #9
jchance
Member
 
Registered: Sep 2003
Location: New Hampshire USA
Distribution: Mandriva 2006 & 2007 Power Pack Club
Posts: 178

Original Poster
Rep: Reputation: 30
Thank God I got this tutorial out. Can someone who is a member over there as well as here place a post on the thread letting everyone know it has officially moved to this forum where I can't being banned.

It truly would be appreciated.
 
Old 02-12-2010, 06:15 AM   #10
dmitry923
LQ Newbie
 
Registered: Feb 2010
Posts: 4

Rep: Reputation: 0
Can't make HD5870 work with vaapi

Hello. First of all thank you for your guide. I am trying to make my HD5870 show h.264 movies with mplayer. I use Archlinux instead of Ubuntu and after following your guide I almost won against my AMD card. The only 2 things that I didn't do that are listed in your guide are
Quote:
MipMap Detail:
Override and set to High Quality
Enable Catalyst AI:
You want to enable and set to advanced
If I use them or compositing, I get a blank screen in mplayer with no errors in output (everything is as the file is played normaly) and no errors in Xorg.log, errors.log or messages.log. And when I try to close mplayer my computer hangs.
So here's what I get if don't use the above options in amdcccle. The movie starts, I get the sound, hardware acceleration seems to work (CPU usage drops to about 3%), but video is scrambled. Console output is as follows:
Code:
$ mplayer -vo vaapi -va vaapi BBCHD-P-40.ts 
MPlayer SVN-r30302-4.4.3 (C) 2000-2009 MPlayer Team                 
142 audio & 327 video codecs                                        
mplayer: could not connect to socket                                
mplayer: No such file or directory                                  
Failed to open LIRC support. You will not be able to use your remote control.

Playing BBCHD-P-40.ts.
TS file format detected.
VIDEO H264(pid=2318) AUDIO A52(pid=2319) NO SUBS (yet)!  PROGRAM N. 6940
FPS seems to be: 25.000000                                              
libva: libva version 0.31.0-sds4                                        
Xlib:  extension "XFree86-DRI" missing on display ":0.0".               
libva: va_getDriverName() returns 0                                     
libva: Trying to open /usr/lib/va/drivers/fglrx_drv_video.so
libva: va_openDriver() returns 0
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
[VD_FFMPEG] VA API accelerated codec.
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, s16le, 384.0 kbit/25.00% (ratio: 48000->192000)
Selected audio codec: [ffac3] afm: ffmpeg (FFmpeg AC-3)
==========================================================================
AO: [oss] 48000Hz 2ch s16le (2 bytes per sample)
Starting playback...
[VD_FFMPEG] Trying pixfmt=0.
Movie-Aspect is 1.82:1 - prescaling to correct movie aspect.
VO: [vaapi] 1440x1080 => 1964x1080 H.264 VA API Acceleration
[vo_vaapi] Using 1:1 VA surface mapping
[VD_FFMPEG] XVMC-accelerated MPEG-2.
[h264 @ 0xdb53c0]number of reference frames exceeds max (probably corrupt input), discarding one
[ac3 @ 0xdb53c0]incomplete framect: -0.684 398/398  1%  6%  0.6% 4 0
[ac3 @ 0xdb53c0]invalid frame size
A:59648.8 V:59649.2 A-V: -0.407 ct: -0.728 416/416  1%  6%  0.6% 4 0


MPlayer interrupted by signal 11 in module: uninit_vo
- MPlayer crashed by bad usage of CPU/FPU/RAM.
  Recompile MPlayer with --enable-debug and make a 'gdb' backtrace and
  disassembly. Details in DOCS/HTML/en/bugreports_what.html#bugreports_crash.
- MPlayer crashed. This shouldn't happen.
  It can be a bug in the MPlayer code _or_ in your drivers _or_ in your
  gcc version. If you think it's MPlayer's fault, please read
  DOCS/HTML/en/bugreports.html and follow the instructions there. We can't and
  won't help unless you provide this information when reporting a possible bug.
Mplayer is fully controllable. I can seek, manage volume etc. So everything looks fine except for the video itself and the output shows that mplayer crashes at the end of file and if I exit.
I tried using "mplayer -vo vaapi:gl -va vaapi BBCHD-P-40.ts", playing other h.264 files, commenting out the xorg.conf options recommended in the guide, using default settings in amdcccle. The result was the same. If I use mplayer without vaapi, everything is fine. Here's the code:
Code:
mplayer BBCHD-P-40.ts
MPlayer SVN-r30302-4.4.3 (C) 2000-2009 MPlayer Team
142 audio & 327 video codecs
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing BBCHD-P-40.ts.
TS file format detected.
VIDEO H264(pid=2318) AUDIO A52(pid=2319) NO SUBS (yet)!  PROGRAM N. 6940
FPS seems to be: 25.000000
Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory
[vdpau] Error when calling vdp_device_create_x11: 1
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, s16le, 384.0 kbit/25.00% (ratio: 48000->192000)
Selected audio codec: [ffac3] afm: ffmpeg (FFmpeg AC-3)
==========================================================================
AO: [oss] 48000Hz 2ch s16le (2 bytes per sample)
Starting playback...
[h264 @ 0xdb53c0]number of reference frames exceeds max (probably corrupt input), discarding one
Movie-Aspect is 1.82:1 - prescaling to correct movie aspect.
VO: [xv] 1440x1080 => 1964x1080 Planar YV12
[ac3 @ 0xdb53c0]incomplete framect: -0.686 398/398 82%  2%  0.8% 0 0
[ac3 @ 0xdb53c0]invalid frame size
A:59648.8 V:59649.2 A-V: -0.407 ct: -0.730 416/416 82%  2%  0.7% 0 0

Exiting... (End of file)
My system is Archlinux x86_64 2.6.32-ARCH, xorg-server 1.6.3-4, direct rendering is on.
I installed the following packages from AUR:
catalyst 10.1-4
lib32-catalyst-utils
mplayer-vaapi-pulse 20100114-1 (MPlayer SVN-r30302-4.4.3)
libva-sds 0.31.0_1_9-2
xvba-video 0.6.4-1

When I googled my problem, I found info that there are artefacts with HD5850, though HD4850 seems to do fine. So maybe the problem is that ATI drivers do not fully support HD5xxx and I have to wait for new releases. But if anyone experienced the problem, I would greatly appreciate your help.

Last edited by dmitry923; 02-12-2010 at 06:40 AM.
 
Old 02-12-2010, 06:22 AM   #11
dmitry923
LQ Newbie
 
Registered: Feb 2010
Posts: 4

Rep: Reputation: 0
Here is what my scrambled (or maybe this should be called shuffled) video look like:
http://img132.imageshack.us/img132/7...mbledvideo.jpg

Last edited by dmitry923; 02-12-2010 at 06:27 AM.
 
Old 02-13-2010, 12:04 PM   #12
dmitry923
LQ Newbie
 
Registered: Feb 2010
Posts: 4

Rep: Reputation: 0
This is a catalyst 10.1 bug. Only HD5xxx cards are affected. Here's a link to bugzilla: http://ati.cchtml.com/show_bug.cgi?id=1754
So all those who suffer from it simply have to wait for the developers to fix it.
 
Old 03-01-2010, 02:32 AM   #13
jhh
LQ Newbie
 
Registered: Mar 2010
Posts: 1

Rep: Reputation: 0
XvMC acceleration

Thanks for this great guide!

I'm using vdr with xine frontend as my htpc software and I have managed to get a little better video quality when using information you provided, but not perfect. There is still some tearing when using xv output, and on the other hand opengl uses too much resources, nearly 100% cpu utilization when watching interlaced sd mpeg-2 video.

Is there some special configuration I have to do to get XvMC acceleration to work? My fglrx drivers version is 10.2 (or 8.70) and Xorg log says it has x-video motion compensation, but when I try to use it with xine or mplayer it just segfaults. I know that XvMC is a little outdated but I would like to atleast try it and see how it performs.
Hardware is 780G integrated HD3200 with UVD2.
 
Old 03-25-2010, 02:55 PM   #14
dmitneo
LQ Newbie
 
Registered: Mar 2010
Posts: 1

Rep: Reputation: 0
VA API Version problem ?

First of all, thank you, Thank You, THANK YOU!
(and you may call me anything you like )

I am trying to drop Windoze, and am bleeding to get tear-free, cpu-relieving Video Acceleration working on my AMD-940/ATI HD4850. I too went through the research maze, but couldn't get nearly as far as you did. Congrats!

After following your tutorial, I believe I have reached a wall, that I hope you will find to be a simple "noob" problem.

In my first test of
./mplayer -vo vaapi -va vaapi <URI>
I receive the following error - right away:

./mplayer: error while loading shared libraries: libva-x11-0.31.0.4.so.1: cannot open shared object file: No such file or directory

I suspect that this was caused by a library version conflict, having installed splitted-desktop's latest lib-va api and xvba-video backend

My first guess is that there must be a way to allow older applications (mplayer) to use newer libraries. Is is by using Symlinks? Did I miss-read your tutorial? Am I totally off-base?

I tried other versions of the va-api and the xvba backend, but they produce similar errors at later points in attempting to start the video decoding process, and all (albethey rather cryptic) seem to indicate that I have the wrong versions of the API and backend installed.

Your help in this will be appreciated, and presuming I won't get banned from doing so, I will be happy to post a forwarding link in the Ubuntu form for you.

I agree that "packaging" all of this would be of great benefit to the community. I hope that someday I will be adept enough to do so.

Thanks again for all of your hard work --I know what it's like. I've been there in another life.

Last edited by dmitneo; 03-25-2010 at 06:12 PM.
 
Old 03-28-2010, 09:17 AM   #15
dmitry923
LQ Newbie
 
Registered: Feb 2010
Posts: 4

Rep: Reputation: 0
Quote:
./mplayer: error while loading shared libraries: libva-x11-0.31.0.4.so.1: cannot open shared object file: No such file or directory
This means that you don't have the library installed or the one that is installed is of different version. Anyway there is no such file in your system. In Archlinux x86_64 the package that contains the library is called libva-sds. By the name of libva1_0.31.0-1+sds11_amd64.deb I think this is probably the same package but it is called differently because the distros are different. So here's what you can do. First of all you can take a look in your /usr/lib/ and try to find libva-x11-0.31.[something else here]. The version will probably be different from 0.31.0.4.so.1. So after that to be on the safe side you can check with your package manager if the library belongs to libva1_0.31.0-1+sds11_amd64.deb. If yes, you then need to have both mplayer and libva to be of the versions that can work with each other. If you have for example /usr/lib/libva-x11-0.31.0.6.so.1 (like I do), this means that you either have to update your mplayer (remember to use the one that has vaapi interface, because as far as I know the current stable version doesn't) so that it uses the higher version of libva or downgrade libva. As a workaround that may or may not work you can create a symlink called libva-x11-0.31.0.4.so.1 to the library you already have. This will fool mplayer to use the library you have instead of the one it wanted to. Hope this will help you, good luck.

Last edited by dmitry923; 03-28-2010 at 09:21 AM.
 
  


Reply

Tags
acceleration, ati, video


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
AMD.ATI Mobility X1600 - video and flash playback flickering eXTigyroue Linux - Hardware 9 07-07-2008 10:31 AM
smooth video playback on amd geode lx800? ignarus Linux - General 0 05-04-2008 01:50 AM
LXer: AMD Radeon HD 2000 Series & Linux LXer Syndicated Linux News 0 07-12-2007 11:46 AM
MythTV - preview video in program guide is misplaced, distorted n.b.r. Linux - Software 17 04-01-2007 06:28 PM
Video playback extremely slow with Savage graphics driver moxfyre Linux - Hardware 1 04-19-2006 11:51 AM


All times are GMT -5. The time now is 02:57 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration