You are not logged in.

#1 2012-10-12 22:02:32

madchine
Member
From: Denmark
Registered: 2009-11-04
Posts: 62
Website

Is VA-API working? (Intel GMA 4500)

I've got a Lenovo ThinkPad X200 with Intel GMA 4500MHD graphics. According to the wiki I should be able to get VA-API going. I think it works but I would like to get some clarification and certainty.

I've got the libva-driver-intel-g45-h264 driver installed alongside the standard intel driver. The way I understand it the former is only in use for video playback -- it is not a replacement for the standard driver on neither 2D nor 3D (although this is partly guesswork). Therefore I figure that I can't see whether VA-API is working by checking to see what driver xorg uses, right?

(checking out xorg.log seems strongly to indicate that X is using the standard Intel driver: 

$ grep '.so' /var/log/Xorg.0.log
...
[     3.049] (II) Loading /usr/lib/xorg/modules/drivers/intel_drv.so
...

)

I have installed the mplayer-vaapi package and set vaapi to be the default video output in mplayer's config ("vo=vaapi"). This is what mplayer's output looks like, playing 720p video in an MKV container:

libavformat version 54.25.104 (internal)
libavformat file format detected.
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (ac3), -aid 0, -alang eng
[lavf] stream 2: subtitle (text), -sid 0, -slang eng
VIDEO:  [H264]  1280x720  0bpp  25.000 fps    0.0 kbps ( 0.0 kbyte/s)
Clip info:
 creation_time: 2011-05-05 22:12:23
Load subtitles in ./
libva: libva version 0.32.0
libva: va_getDriverName() returns 0
libva: Trying to open /usr/lib/dri/i965_drv_video.so
libva: va_openDriver() returns 0
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 54.53.100 (internal)
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: [pulse] 48000Hz 2ch s16le (2 bytes per sample)
Starting playback...
Unsupported PixelFormat 61
Unsupported PixelFormat 81
Unsupported PixelFormat 61
[VD_FFMPEG] Trying pixfmt=0.
Unsupported PixelFormat 61
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
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.
[VD_FFMPEG] Trying pixfmt=1.
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [vaapi] 1280x720 => 1280x720 H.264 VA-API Acceleration  [fs]
 

Although the output seems to clearly suggest that va-api is at work, a few of the messages make me uncertain: "libva: va_openDriver() returns 0" is a sign of success? And "The selected video_out device is incompatible with this codec." confounds me as surely the main point of using va-api is playing h264 video and that's what mplayer tells me it is?

For good measure here's the result of running vainfo -- though from what I understand all this confirms is that I have indeed installed the va-api driver package and as the arch wiki says my GMA 4500 does support decoding using VA-API:

[tmp] vainfo
libva: libva version 0.32.0
libva: va_getDriverName() returns 0
libva: Trying to open /usr/lib/dri/i965_drv_video.so
libva: va_openDriver() returns 0
vainfo: VA API version: 0.32
vainfo: Driver version: Intel i965 driver - 1.0.14
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileH264Baseline           :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointVLD

I do have decent h264 playback with no stuttering or anything that I can see on my laptop's native 12" screen -- although when a large external display is connected I get the sneaking suspicion that some frames are dropped every now and again.

Can anybody throw some light on this?

Last edited by madchine (2012-10-12 22:12:54)

Offline

#2 2012-10-12 22:23:45

Gusar
Member
Registered: 2009-08-25
Posts: 3,470

Re: Is VA-API working? (Intel GMA 4500)

-vo vaapi is not enough. You also need -va vaapi

Offline

#3 2012-10-13 12:47:43

madchine
Member
From: Denmark
Registered: 2009-11-04
Posts: 62
Website

Re: Is VA-API working? (Intel GMA 4500)

Gusar wrote:

-vo vaapi is not enough. You also need -va vaapi

Thanks for the suggestion. Including -va vaapi caused a few changes in the mplayer output. Here's the "-va vaapi" output (vo=vaapi is till in config):

Playing ./test.mkv.
Cache fill:  0.00% (0 bytes)   

libavformat version 54.25.104 (internal)
libavformat file format detected.
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (ac3), -aid 0, -alang eng
[lavf] stream 2: subtitle (text), -sid 0, -slang eng
VIDEO:  [H264]  1280x720  0bpp  25.000 fps    0.0 kbps ( 0.0 kbyte/s)
Clip info:
 creation_time: 2011-05-05 22:12:23
Load subtitles in ./
libva: libva version 0.32.0
libva: va_getDriverName() returns 0
libva: Trying to open /usr/lib/dri/i965_drv_video.so
libva: va_openDriver() returns 0
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 54.53.100 (internal)
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: [pulse] 48000Hz 2ch s16le (2 bytes per sample)
Starting playback...
Unsupported PixelFormat 61
[VD_FFMPEG] Trying pixfmt=1.
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [vaapi] 1280x720 => 1280x720 H.264 VA-API Acceleration  [fs]
[VD_FFMPEG] XVMC-accelerated MPEG-2.

And here's the diff (the lines appear without -va vaapi but not with -va vaapi):

[tmp] diff withoutva.txt withva.txt 
30,38d29
< Unsupported PixelFormat 81
< Unsupported PixelFormat 61
< [VD_FFMPEG] Trying pixfmt=0.
< Unsupported PixelFormat 61
< Could not find matching colorspace - retrying with -vf scale...
< Opening video filter: [scale]
< 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.

So that's it, is it? The thing is -- and this wasn't really apparent with the usual 720p videos that make up the vast majority of my HD videos -- that using vaapi brings down the CPU load greatly (compared to -vo xv), it also doesn't play anywhere near as fluidly when faced with something like 1080p (mplayer also complains of my computer being too slow).

Does anybody else get the same results? Is this a result of va-api-on-linux-is-still-a-work-in-progress? Or am i doing it wrong?

Offline

#4 2012-10-13 13:00:23

Gusar
Member
Registered: 2009-08-25
Posts: 3,470

Re: Is VA-API working? (Intel GMA 4500)

madchine wrote:

Is this a result of va-api-on-linux-is-still-a-work-in-progress?

It's a result of vaapi-on-4500 being unfinished (I won't use "work-in-progress" because that would imply someone is actively working on it, which I don't think is the case). Note how you need a vaapi driver from a branch, instead of being able to use the regular packages people with newer intel stuff can use.

Offline

#5 2012-10-13 13:24:56

madchine
Member
From: Denmark
Registered: 2009-11-04
Posts: 62
Website

Re: Is VA-API working? (Intel GMA 4500)

Gusar wrote:
madchine wrote:

Is this a result of va-api-on-linux-is-still-a-work-in-progress?

It's a result of vaapi-on-4500 being unfinished (I won't use "work-in-progress" because that would imply someone is actively working on it, which I don't think is the case). Note how you need a vaapi driver from a branch, instead of being able to use the regular packages people with newer intel stuff can use.

Good point. I am thinking some words to that effect might be relevant in the wiki, à la "Don't get your hopes up", no?

Offline

#6 2012-10-19 22:24:09

karol
Archivist
Registered: 2009-05-06
Posts: 25,432

Re: Is VA-API working? (Intel GMA 4500)

madchine wrote:

I've got a Lenovo ThinkPad X200 with Intel GMA 4500MHD graphics. According to the wiki I should be able to get VA-API going.

I found some info here: https://wiki.archlinux.org/index.php/In … n_GMA_4500

Offline

#7 2012-10-20 11:01:26

madchine
Member
From: Denmark
Registered: 2009-11-04
Posts: 62
Website

Re: Is VA-API working? (Intel GMA 4500)

Thanks, karol. It didn't tell me anything new but I figured that if my experience could be useful that was where it should be added, so I edited the wiki to add a note of caution.

Offline

Board footer

Powered by FluxBB