PDA

View Full Version : Enabling XvMC on G965? What is supported?


todd
05-12-2009, 11:44 AM
I recently re-installed Linux on an old DG965RY motherboard, to use as a MythTV frontend among other things.

I am trying to figure out the current state of video acceleration for Intel chipsets in general, and my board/GPU specifically. Because of the changing state of the drivers, I have found a lot of contradictory information, (I have seen reports of: No XvMC support, Only i815 support, only MC acceleration, XVMC but not for HD, and full XvMC). Is there someplace that has the current state of video acceleration summarized?

Mainly, I'm wondering if my G965 GPU can support HD MPEG2 acceleration with MythTV.

If so, any pointers for enabling + configuring this?

szczerb
05-13-2009, 07:56 PM
AFAIK XvMC will only do MPEG1 and 2 so mentioned HD is out of the question (unless you actually have some high resolution material in MPEG1 or 2). And as far as I remember (would it be AFAIR?) the last time intel's XvMC worked it worked only with overlay output and not with textured video, which seems to be the way to go. Anyway, decoding MPEG1 or 2 can't really get a PIII 500MHz flooded with work so I don't think we need XvMC with it's current decoding capabilites at all.

todd
05-13-2009, 08:07 PM
I am in the U.S., where MPEG-2 is used in the broadcast D-TV / HDTV standard format called ATSC. So, I've got plenty of 1080i and 720p HD material to play via my MythTV DVR.

So, XvMC is what I'm looking for. Anyone else here using it with their Intel GPU?

Sarvatt
05-13-2009, 11:09 PM
it's undergoing heavy changes and has even been pulled from git master in the name of stabilizing things. there's experimental patches on the intel-gfx mailing list to enable it under DRI2/UXA that worked last I checked it a week or two ago. I think they're working on making it work with GEM right now before it gets put back in the driver, so you'll have to be patient. There is a xvmc-vld branch on their git you could probably build if you wanted to mess with it under the older 2.6.99.1 it's based on.

http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/log/?h=xvmc-vld

todd
05-14-2009, 02:59 AM
Thanks for the response, Sarvatt. That's great info.

I will look into building my own driver, with XvMC enabled.

VLD support would be nice, but according to the table on this page: http://en.wikipedia.org/wiki/Intel_GMA#GMA_X3000 my G965 / X3000 doesn't support VLD. But, it does support iDCT + MC, so it will still be a good offload.

Sarvatt
05-14-2009, 09:27 AM
Oh I'm sorry, I thought I read you had a 4500 for some strange reason.. Must have been reading another thread at the same time :) It should work fine in 2.7.0 or 2.7.1 under EXA in both textured and overlay, what problems specifically do you have? The best place to ask would be #intel-gfx on the freenode irc server, my only intel video is 945GME which has crap for acceleration so I haven't looked into it much. It was disabled in UXA awhile back but that's the only limitation I see.

todd
05-14-2009, 04:14 PM
My X log showed that XvMC was disabled, even though I had enabled it in xorg.conf, so I was first trying to verify XvMC was possible before digging in and trying to debug it.

I was testing it on a newly installed Ubuntu 9.04 system, which is using UXA (when I configured the xorg.conf to specify the intel driver and enable XvMC, I got only a blue display. After enabling UXA in xorg.conf, everything displayed properly).

I have been using a Mac Mini for my Myth frontend for a couple years now, and Linux on the server/backend side. So, my X11 knowledge is dated.. I need to do some research to even understand what UXA and the other new variables are all about. But, this will be a good project to ramp back up. I'll check into the UXA patches you mentioned and see how that goes.

Thanks!

Sarvatt
05-14-2009, 07:49 PM
I would just try EXA on 2.7.1 drivers first to see if it works, you can add the sources here to get the drivers for jaunty

https://launchpad.net/~ubuntu-x-swat/+archive/x-updates

If that doesn't work let me know and I'll dig up a patch and build it on a PPA for you, been meaning to do that anyhow to mess around with it some.

todd
05-15-2009, 11:54 AM
Thanks, I tried EXA last night (I didn't realize the single driver supported both modes).

I also didn't have the correct Intel XvMC library referenced in /etc/X11/XvMCConfig, so I changed that.

The Xorg log now showed XvMC as being enabled.

Initially when I tried to play HD content, Mythfrontend crashed. After some googling, I found a note saying to only use one core for decoding, not two. So, I changed the MythTV settings, and tried again. But, the system locked up solid when I tried to play a video. This was late last night, so I didn't do much debugging. I'll play around with it some more this weekend.

Thanks for the help.

Sarvatt
05-15-2009, 05:25 PM
Tried going to system -- preferences -- multimedia systems selector and changing the output device on the video tab? Try intel textured video if it was on intel overlay specifically.

Sarvatt
05-18-2009, 09:21 PM
looks like dri2 (aka UXA) xvmc was merged with master in the xvmc-vld branch today, no need to hunt down the latest patches if you do end up building it :D

http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/log/?h=xvmc-vld


I compiled it incase anyone wants to test it, be sure you're using xorg-edgers repo drm and such before you try to use it :)

http://sarvatt.com/downloads/xserver-xorg-video-intel/

Just grab xserver-xorg-video-intel_2.7.99.1+git20090518+xvmc-vld.b6228604-0ubuntu0sarvatt_i386.deb if you dont need debug info or the sources to recompile it yourself.

Here's my output from xvmcinfo on a 945GMA

Xv version 2.2
XvMC version 1.1

screen number 0
info for adaptor 0 [Intel(R) Textured Video]
number of XvMC surface types: 2

info about surface 0:
max_width=720
max_height=576
subpicture_max_width=720
subpicture_max_height=576
chroma_format:
XVMC_CHROMA_FORMAT_420
mc_type:
format : MPEG2
accelaration start from : MOCOMP
flags:


info about surface 1:
max_width=720
max_height=576
subpicture_max_width=720
subpicture_max_height=576
chroma_format:
XVMC_CHROMA_FORMAT_420
mc_type:
format : MPEG1
accelaration start from : MOCOMP
flags:


xvmcinfo.c is in the same directory, compile it with gcc -o xvmcinfo xvmcinfo.c -lXvMCW if you want to check what xvmc supports on your card.

Mplayer output while its working:

robert@ubuntu-9{~/Videos}:mplayer -vo xvmc -vc ffmpeg12mc Paris-Monitoring-Yc.mpg
MPlayer SVN-r28754-4.4.0 (C) 2000-2009 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 Paris-Monitoring-Yc.mpg.
MPEG-PS file format detected.
VIDEO: MPEG2 720x576 (aspect 3) 25.000 fps 10000.0 kbps (1250.0 kbyte/s)
vo_xvmc: X-Video extension 2.2
vo_xvmc: X-Video MotionCompensation Extension version 1.1
================================================== ========================
Forced video codec: ffmpeg12mc
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
[VD_FFMPEG] XVMC accelerated codec.
[VD_FFMPEG] XVMC-accelerated MPEG-2.
[VD_FFMPEG] XVMC-accelerated MPEG-2.
Selected video codec: [ffmpeg12mc] vfm: ffmpeg (FFmpeg MPEG-1/2 (XvMC))
================================================== ========================
================================================== ========================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 48000 Hz, 2 ch, s16le, 128.0 kbit/8.33% (ratio: 16000->192000)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
================================================== ========================
AO: [oss] 48000Hz 2ch s16le (2 bytes per sample)
Starting playback...
[VD_FFMPEG] Trying pixfmt=0.
[VD_FFMPEG] XVMC-accelerated MPEG-2.
VDec: vo config request - 720 x 576 (preferred colorspace: MPEG1/2 Motion Compensation and IDCT)
vo_xvmc: Found matching surface with id=434D5658 on 62 port at 0 adapter
VDec: using MPEG1/2 Motion Compensation as output csp (no 1)
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [xvmc] 720x576 => 1024x576 MPEG1/2 Motion Compensation
vo_xvmc: Found matching surface with id=434D5658 on 62 port at 0 adapter
vo_xvmc: Using Xv Adaptor #0 (Intel(R) Textured Video)
vo_xvmc: Port 62 grabed
[intel_xvmc] info: decoder type is i915/945 MPEG2 MC decoder
vo_xvmc: Allocated Direct Context
vo_xvmc: data_blocks allocated
vo_xvmc: mv_blocks allocated
vo_xvmc: Motion Compensation context allocated - 8 surfaces
vo_xvmc: idct=0 unsigned_intra=0
vo_xvmc: looking for OSD support
vo_xvmc: No OSD support for this mode
[VD_FFMPEG] XVMC-accelerated MPEG-2.

todd
05-20-2009, 02:45 AM
I tested this some more over the last couple days, but it was a little slow going because I had to reboot after each attempt (my system was still up and accessible via ssh, but the screen was blank until I rebooted.

Thanks for posting the packages, but my system is x86-64, so I will need to compile it myself.

my xvmcinfo output is below. It confirms that the GPU is capable of HD by the max width/height stats (I had read reports that intel GPUs were SD-only).

Xv version 2.2
XvMC version 1.1

screen number 0
info for adaptor 0 [Intel(R) Textured Video]
number of XvMC surface types: 2

info about surface 0:
max_width=1936
max_height=1096
subpicture_max_width=1920
subpicture_max_height=1080
chroma_format:
XVMC_CHROMA_FORMAT_420
mc_type:
format : MPEG2
accelaration start from : MOCOMP
flags:
XVMC_INTRA_UNSIGNED

info about surface 1:
max_width=1920
max_height=1080
subpicture_max_width=1920
subpicture_max_height=1080
chroma_format:
XVMC_CHROMA_FORMAT_420
mc_type:
format : MPEG1
accelaration start from : MOCOMP
flags:
XVMC_INTRA_UNSIGNED

info for adaptor 1 [Intel(R) Video Overlay]
number of XvMC surface types: 0

Sarvatt
05-20-2009, 09:16 PM
well the easiest way to build it for x64 would be to download the .tar.gz and .dsc that I have in there, sudo apt-get build-dep xserver-xorg-video-intel, dpkg-source -x xserver-<fill in the rest here>.dsc, switch to the directory then fakeroot debian/rules binary. Just incase you didn't already know that :) Then again I see they just enabled XvMC GEM support in that branch, so you might want to git clone that and copy the debian folder from mine to the newer ones directory and use that instead.