How to install r600_drv_video.so for Radeon HD 3000 in Debian wheezy?

Using VDPAU feature in graphic card reduce CPU load while playing high resolution video files, i.e. 720p, 1080p.

Excerpt http://en.wikipedia.org/wiki/VDPAU
VDPAU (Video Decode and Presentation API for Unix) is a non-proprietary and royalty-free open source library (libvdpau) and API originally designed by Nvidia for its GeForce 8 series and later GPU hardware,[1][2] targeted at the X Window System on Unix-Like operating systems (including Linux, FreeBSD, and Solaris).[3][4][5] This VDPAU API allows video programs to offload portions of the video decoding process and video post-processing to the GPU video hardware.[6]

r600_drv_video.so is one of core files of VDPAU implementation in Xorg. Debian should provide it as Open Source Radeon driver but it has not been added in official Debian package repository. Debian offers VDPAU packages for fglrx driver ((AMD Catalyst) though.


VLC media player 2.0.6 Twoflower (revision 2.0.6-0-gbe9623c)
[0xc2a108] main libvlc: Running vlc with the default interface. Use 'cvlc' to
use vlc without interface.
libva info: VA-API version 0.34.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/r600_drv_video.so
libva info: va_openDriver() returns -1

I wanted quick solution to install r600_drv_video.so instead source build. I found VDPAU r600.so installation guide (http://habrahabr.ru/sandbox/66792/) in the net. It’s written in Russia but the instruction is pretty simple and straightforward, which is to install Radeon VDPAU files of Arch Linux in Debian system. ^^

Download and install Radeon VDPAU files

For AMD 64 bit binary files, download
http://mirror.us.leaseweb.net/archlinux/extra/os/x86_64/ati-dri-9.2.4-1-x86_64.pkg.tar.xz

Make temporary directory to extract the tar ball.

$ mkdir vdpau
$ cd vdpau
$ tar xvf ati-dri-9.2.4-1-x86_64.pkg.tar.xz

Copy r600* files to the 64 bit library directory.

$ sudo cp usr/lib/vdpau/libvdpau_r600* /usr/lib/x86_64-linux-gnu/

Make another temporary directory named libllvm and download http://mirror.us.leaseweb.net/archlinux/extra/os/x86_64/llvm-libs-3.3-1-x86_64.pkg.tar.xz

$ mkdir libllvm
$ cd libllvm
$ tar xvf llvm-libs-3.3-1-x86_64.pkg.tar.xz

Copy the shared library file that libvdpau_600* uses.

$ sudo cp usr/lib/libLLVM-3.3.so /usr/lib/x86_64-linux-gnu/

You should see below files in /usr/lib/x86_64-linux-gnu/
-rwxr-xr-x 1 root root 2.9M Dec 6 19:04 /usr/lib/x86_64-linux-gnu/libvdpau_r600.so
-rwxr-xr-x 1 root root 2.9M Dec 6 19:04 /usr/lib/x86_64-linux-gnu/libvdpau_r600.so.1
-rwxr-xr-x 1 root root 2.9M Dec 6 19:04 /usr/lib/x86_64-linux-gnu/libvdpau_r600.so.1.0.0
lrwxrwxrwx 1 root root 17 Aug 16 2012 /usr/lib/x86_64-linux-gnu/libvdpau.so.1 -> libvdpau.so.1.0.0
-rw-r–r– 1 root root 15K Aug 16 2012 /usr/lib/x86_64-linux-gnu/libvdpau.so.1.0.0
-rw-r–r– 1 root root 23M Dec 6 19:24 /usr/lib/x86_64-linux-gnu/libLLVM-3.3.so

Set environment variable for VDPAU so that VLC or mplayer uses it when playing video files.
Put below two lines in .bashrc or init file of Xorg.
VDPAU_DRIVER=r600
LIBVA_DRIVER_NAME=vdpau

To check VDPAU operation, you can set the two variables in bash.
$ export VDPAU_DRIVER=r600
$ LIBVA_DRIVER_NAME=vdpau
$ vdpauinfo

display: :0.0 screen: 0
API version: 1
Information string: G3DVL VDPAU Driver Shared Library version 1.0

Video surface:

name width height types
-------------------------------------------
420 8192 8192 NV12 YV12
422 8192 8192 NV12 YV12 UYVY YUYV
444 8192 8192 NV12 YV12 Y8U8V8A8 V8U8Y8A8

Decoder capabilities:
...
...
parameter name sup min max
-----------------------------------------------------
VIDEO_SURFACE_WIDTH y 48 8192
VIDEO_SURFACE_HEIGHT y 48 8192
CHROMA_TYPE y
LAYERS y 0 4

attribute name sup min max
-----------------------------------------------------
BACKGROUND_COLOR y
CSC_MATRIX y
NOISE_REDUCTION_LEVEL y 0.00 1.00
SHARPNESS_LEVEL y -1.00 1.00
LUMA_KEY_MIN_LUMA y
LUMA_KEY_MAX_LUMA y

Inconsistency detected by ld.so: dl-close.c: 765: _dl_close: Assertion `map->l_init_called' failed!

Testing vlc for VDPAU call
$ vlc TheRocket.mp4
VLC media player 2.0.6 Twoflower (revision 2.0.6-0-gbe9623c)
[0x25f2108] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
libva info: VA-API version 0.34.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'vdpau'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/vdpau_drv_video.so
libva info: Found init function __vaDriverInit_0_32
libva info: va_openDriver() returns 0

As you see from above screen dump, it calls vdpau_drv_video.so instead r600_drv_video.so.

Testing mplayer for VDPAU call
$ mplayer TheRocket.mp4
Failed to read /etc/mplayer/mplayer.conf.local: No such file or directory
Warning unknown option include at line 177
MPlayer UNKNOWN-4.8 (C) 2000-2013 MPlayer Team
Can't open joystick device /dev/input/js0: No such file or directory
Can't init input joystick
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 TheRocket.mp4.
libavformat version 55.21.100 (internal)
libavformat file format detected.
[lavf] stream 0: video (mpeg4), -vid 0
VIDEO: [MP4V] 640x480 24bpp 23.970 fps 1678.5 kbps (204.9 kbyte/s)
Clip info:
major_brand: isom
minor_version: 512
compatible_brands: isomiso2mp41
creation_time: 2012-06-05 13:10:33
encoder: Lavf51.12.1
Load subtitles in ./
open: No such file or directory
[MGA] Couldn't open: /dev/mga_vid
open: No such file or directory
[MGA] Couldn't open: /dev/mga_vid
[VO_TDFXFB] This driver only supports the 3Dfx Banshee, Voodoo3 and Voodoo 5.
s3fb: Couldn't map S3 registers: Operation not permitted
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 55.41.100 (internal)
[VD_FFMPEG] Trying pixfmt=0.
[VD_FFMPEG] XVMC-accelerated MPEG-2.
The selected video_out device is incompatible with this codec.
Try appending the scale filter to your filter list,
e.g. -vf spp,scale instead of -vf spp.
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
Audio: no sound
Starting playback...
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [vdpau] 640x480 => 640x480 Planar YV12
V: 0.0 0/ 0 ??% ??% ??,?% 0 0
[VD_FFMPEG] DRI failure.
V: 12.0 0/ 0 3% 2% 0.0% 0 0

Exiting... (End of file)
Inconsistency detected by ld.so: dl-close.c: 765: _dl_close: Assertion `map->l_init_called' failed!

VLC fails to play MP4 file sometimes especially video without audio on it. When it happens in most of time, the screenn is freezed.

[0x7fc278001248] main vout display error: Failed to resize display
[0x7fc298c06db8] avcodec decoder error: more than 5 seconds of late video ->
dropping frame (computer too slow ?)
[h264 @ 0x7fc298da5aa0] mmco: unref short failure

Quick solution is to turn on Use GPU accelerated decoding in Input & Codecs Settings – Codecs menu.

About janpenguin

Email: janpenguin [at] riseup [dot] net Every content on the blog is made by Free and Open Source Software in GNU/Linux.
This entry was posted in GNU/Linux and tagged , , , , . Bookmark the permalink.

2 Responses to How to install r600_drv_video.so for Radeon HD 3000 in Debian wheezy?

  1. Joe says:

    Hi, Thank you(and the original Russian writer) very much for this very informative post! Now I can enjoy smooth 1080p video in my Asus EEE netbook with RS880M [Mobility Radeon HD 4225/4250] GPU in Debian Jessie! 🙂

  2. Thanks very much for these tips, which I used when I had problems with fglrx and GNOME 3 in a multi-monitor setup.

    A few improvements:

    1. Before downloading the files, run “umask 000″, so they are unpacked without any restrictions on file permissions, so that when they are copied they are user-readable (my umask is “0027″).

    2. To unpack the files, run “apt-get install atool”, then simply use “aunpack”. No need to create a temporary directory &c.

    3. The file versions you mention have already updated since you wrote the article, so give a link to the download directory (which is still valid), and just indicate the filenames.

    4. Use “cp -d” to copy the files, so that the links are copied as links.

    5. In the section starting “To check VDPAU operation”, you need to “export” *both* variables, or the vlc test won’t work.

    Thanks again!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s