LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   MPlayer with VDPAU support. For users with Nvidia cards (https://www.linuxquestions.org/questions/slackware-14/mplayer-with-vdpau-support-for-users-with-nvidia-cards-763614/)

Daedra 10-22-2009 12:18 AM

MPlayer with VDPAU support. For users with Nvidia cards
 
I just thought I would share this in case anybody hadn't heard about it. With Nvidia's never drivers they have implemented vdpau support. vdpau basically takes hi-definition video (720p, 1080p, etc) and passes off the processing to the video card gpu instead of your cpu thus freeing up your cpu for other tasks, this is especially useful for mythtv users and htpc's. Unfortunately I learned through trail and error that this is not as straight forward as I had hoped but now that I got it working I thought I would share my steps.

Before you start thought make sure you have a nvidia card that supports vdpau, here is a compatibility list http://www.mythtv.org/wiki/VDPAU#Supported_Cards I'm not sure how current this list is but basically any card from the geforce 8 and series and on should work.

1) Install nvidia's proprietary binary video driver. I am not going to write a howto for this since there are dozens of posts on the forums for this. Once this is installed and working correctly proceed to step two.

2) Ignore (deleted)

3) you need to recompile MPlayer for vdpau support, There are a few issues here that I have worked out that I want to explain first. I used the MPlayer slackbuild from the official release. However Slackware ships an older version of MPlayer than we need so we need to update the build to a newer version. Unfortunately I learned that the MPlayer developers have dropped there GUI support so building a newer mplayer will not have gui support, its ok we'll fix this in step 4. You can find a modified slackbuild here http://webpages.charter.net/daedra/MPlayer.tar.gz by default this will not build patented code, you need to enable patents "YES" to get support for patented code. Here is a post about the mplayer GUI http://lists.mplayerhq.hu/pipermail/...ne/061715.html

4) Now that we have a new MPlayer and installed working, we need to add a GUI. I am recommending gnome-mplayer because it works very well and you can also add on gecko-mediaplayer plugins to work with it, more on that later. To install gnome-mplayer you can just use the build over at slackbuilds.org, just make sure to change the slackbuild to use the newest version of 0.9.8. here is the link for gnome-mplayer http://slackbuilds.org/repository/12...gnome-mplayer/ and the source http://gnome-mplayer.googlecode.com/...r-0.9.8.tar.gz Once its installed launch the program either from command line "gnome-mplayer" or from your launcher. Were almost done we just to change a few options. Under preferences change video output to vdpau and audio output to alsa. Also under mplayer tab enable software volume control unless your soundcard has a hardware mixer.

Now download a test clip from here http://www.h264info.com/clips.html

If your using KDE then run "System Monitor", once the program is running then open "gnome-mplayer" and launch your downloaded test video. if your system monitor shows mplayer cpu usage at 10% or less then vdpau is working correctly, here is a screen shot of it in action, the pic looks wrong but it's just the screenshot http://webpages.charter.net/daedra/1.jpg

Before the cpu usage was around 40%, so as you can see thats a huge improvement.

5) (Optional) Once you have all the steps above working if you want you can now install the gecko-media player plugins, this is basically the mplayerplug-in package that is available in the Slackware /extra directory, however that has been depreciated for a while, the developer has switched to gecko media player plugin. I have made a slackbuild for the newest version available here http://webpages.charter.net/daedra/g...aplayer.tar.gz

Quick note = If you decided to install gecko-media package but don't want to use my build then just know that gecko will use the seamonkey libraries to build the plugin and install then to the seamoney plugins directory so it will not work with firefox, if you use my build you won't have this problem.


We'll thats all, if I missed anything or have any questions please let us know.

slackd 10-22-2009 01:01 AM

I implemented vdpau using mplayer svn when i started using slackware13. i use smplayer as a front-end for mplayer.

* - i don't like gnome-mplayer.

- I customized pat's slackbuild from the DVD and recompiled mplayer.
Code:

./configure --prefix=/usr \
            --mandir=/usr/man \
            --confdir=/etc/mplayer \
            --enable-gui \
            --enable-menu \
            --enable-largefiles \
            --enable-vdpau \
            --disable-arts \
            --codecsdir=${CODECSDIR} \
            --win32codecsdir=${CODECSDIR} \
            --realcodecsdir=${CODECSDIR} \
            --language="${LANGUAGES}" \
            ${EXTRACONFIGUREOPTIONS} \
            ${DO_PATENTED} \
            2>&1 | tee $OUTPUT/configure-${PRGNAM}.log

- I used the closed source nvidia driver <190.42>
- I used smplayer v0.6.8 (supports vdpau fully, doesn't need extra arguments against mplayer exec)

btw...good work on the tutorial, am sure people will find it useful.

EDIT: CPU Usage while playing 720p video = 1-3%
CPU Usage while playing 1080p video = 3-7%

Daedra 10-22-2009 01:42 AM

good to know, I could never get it to work without the libvdpau package, are you using that? or did you get it to work without it?

slackd 10-22-2009 01:52 AM

Quote:

Originally Posted by Daedra (Post 3728130)
good to know, I could never get it to work without the libvdpau package, are you using that? or did you get it to work without it?

nope i did not use the libvdpau package.

There are three VDPAU (Video Decode and Presentation API for Unix-like systems) libraries:
*-The top-level wrapper (/usr/X11/lib64/libvdpau.so.x.y.z),
*- a debug trace library (/usr/X11/lib64/libvdpau_trace.so.x.y.z),
*- and the NVIDIA implementation (/usr/X11/lib64/libvdpau_nvidia.so.x.y.z).

Code:

sam@Sam:/usr/X11/lib64$ ls -l | grep libvdpau
lrwxrwxrwx  1 root root      13 2009-10-22 08:27 libvdpau.so -> libvdpau.so.1*
lrwxrwxrwx  1 root root      18 2009-10-22 08:27 libvdpau.so.1 -> libvdpau.so.190.42*
-rwxr-xr-x  1 root root    5016 2009-10-22 08:27 libvdpau.so.190.42*
lrwxrwxrwx  1 root root      25 2009-10-22 08:27 libvdpau_nvidia.so -> libvdpau_nvidia.so.190.42*
-rwxr-xr-x  1 root root  1458192 2009-10-22 08:27 libvdpau_nvidia.so.190.42*
lrwxrwxrwx  1 root root      24 2009-10-22 08:27 libvdpau_trace.so -> libvdpau_trace.so.190.42*
-rwxr-xr-x  1 root root    49896 2009-10-22 08:27 libvdpau_trace.so.190.42*

did u read :this:

Daedra 10-22-2009 01:58 AM

Thanks for that, I going to go back and look at this, if it works without libvdpau then whats the point of that step. Thanks for the heads up.

slackd 10-22-2009 02:04 AM

the libs came automatically with the nvidia driver. i did not use a single extra package. try the latest .run from nvidia.

hey!..i just remembered..get the ffmpeg package with vdpau support. (kudos, Eric!)
Code:

ffmpeg: updated to r20056 snapshot (20090927). The x264 and gsm codecs were
  updated to their latest version as well. This ffmpeg has support for VDPAU
  (gpu-accelerated video decoding on recent Nvidia hardware) but I have not
  tested that.
  Note: as usual, this package comes without the patent/license encumbered
  LAME and FAAC libraries (meaning, you can not encode mp3 or aac, but you can
  playback these formats). Just rebuild the package and those will be
  automatically added.


Daedra 10-22-2009 02:18 AM

Your right, I upgrade ffmpeg using Eric's slackbuild and it worked without using the libvdpau package.

slackd 10-22-2009 02:39 AM

Congratulations! Buddy, Enjoy now!..

remember to disable Composite by running nvidia-xconfig utility.

Code:

sam@Sam:~$ cat /etc/X11/xorg.conf
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 1.0  (buildmeister@builder58)  Wed Sep  2 03:36:10 PDT 2009


Section "ServerLayout"
    Identifier    "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
    FontPath        "/usr/lib64/X11/fonts/misc/:unscaled"
    FontPath        "/usr/lib64/X11/fonts/100dpi/:unscaled"
    FontPath        "/usr/lib64/X11/fonts/75dpi/:unscaled"
    FontPath        "/usr/lib64/X11/fonts/misc/"
    FontPath        "/usr/lib64/X11/fonts/Type1/"
    FontPath        "/usr/lib64/X11/fonts/Speedo/"
    FontPath        "/usr/lib64/X11/fonts/100dpi/"
    FontPath        "/usr/lib64/X11/fonts/75dpi/"
    FontPath        "/usr/lib64/X11/fonts/cyrillic/"
    FontPath        "/usr/lib64/X11/fonts/TTF/"
EndSection

Section "InputDevice"

    # generated from default
    Identifier    "Mouse0"
    Driver        "mouse"
    Option        "Protocol" "auto"
    Option        "Device" "/dev/psaux"
    Option        "Emulate3Buttons" "no"
    Option        "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier    "Keyboard0"
    Driver        "kbd"
EndSection

Section "Monitor"
    Identifier    "Monitor0"
    VendorName    "Unknown"
    ModelName      "Unknown"
    HorizSync      28.0 - 33.0
    VertRefresh    43.0 - 72.0
    Option        "DPMS"
EndSection

Section "Device"
    Identifier    "Device0"
    Driver        "nvidia"
    VendorName    "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier    "Screen0"
    Device        "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option        "RenderAccel" "True"
    Option        "NoRenderExtension" "False"
    Option        "AllowGLXWithComposite" "True"
    Option        "MultisampleCompatibility" "True"
    Option        "AddARGBGLXVisuals" "True"
    Option        "MultiGPU" "Auto"
    Option        "Coolbits" "4"
    SubSection    "Display"
        Depth      24
    EndSubSection
EndSection

Section "Extensions"
    Option        "Composite" "Disable"
EndSection


Daedra 10-22-2009 02:46 AM

cant do that, I like my compiz fusion too much :).

vinegaroon 10-22-2009 03:11 AM

Thanks for this. I've been meaning to get this working.

slackd 10-22-2009 03:51 AM

Quote:

Originally Posted by Daedra (Post 3728192)
cant do that, I like my compiz fusion too much :).

ok..i see.

actually when i used xfce i had tearing issues with the display compositor and i had to set it to "enable". now that i use fluxbox, i set it to "disable".

Daedra 10-22-2009 04:04 AM

Quote:

Originally Posted by slackd (Post 3728236)
ok..i see.

actually when i used xfce i had tearing issues with the display compositor and i had to set it to "enable". now that i use fluxbox, i set it to "disable".

Did you have vsync enabled?

slackd 10-22-2009 04:11 AM

Quote:

Originally Posted by Daedra (Post 3728248)
Did you have vsync enabled?

yes, but that did not solve the problem. then i turned on composite.
that reduced the tearing significantly, but i finally solved it by turning off the compositor that comes with xfce.

the problem went away completely when i started using fluxbox, i couldn't care less about xfce now.

**however, i never had the problem in kde4 & compiz**

H_TeXMeX_H 10-22-2009 04:41 AM

It seems that when I build mplayer it automatically enables vdpau, I didn't have to tell it anything.

Daedra 10-22-2009 04:56 AM

Quote:

Originally Posted by H_TeXMeX_H (Post 3728285)
It seems that when I build mplayer it automatically enables vdpau, I didn't have to tell it anything.

I'm pretty sure your right, the reason I edited the build myself is because of the info I got in this post. http://www.linuxquestions.org/questi...mpile.-757310/


All times are GMT -5. The time now is 03:40 AM.