Bug 110679 - va-api scaling with nv50-class cards incomplete?
Summary: va-api scaling with nv50-class cards incomplete?
Status: RESOLVED MOVED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/nouveau (show other bugs)
Version: git
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Nouveau Project
QA Contact: Nouveau Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-15 05:51 UTC by Andrew Randrianasulu
Modified: 2019-09-18 20:47 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
ffmpeg's output and command line (19.15 KB, text/x-log)
2019-05-15 05:51 UTC, Andrew Randrianasulu
Details
libva log file (with VL activated) (65.65 KB, text/plain)
2019-06-05 16:39 UTC, Andrew Randrianasulu
Details
libva log without VL (16.61 KB, text/plain)
2019-06-05 16:39 UTC, Andrew Randrianasulu
Details

Description Andrew Randrianasulu 2019-05-15 05:51:41 UTC
Created attachment 144278 [details]
ffmpeg's output and command line

Hello!

I was trying to find answer to 'good ffmpeg commandline showing how to use scale_vaapi filter' [1], but unfortunately none of my attempts worked  for me :/

Mesa/va state tarcker:
glxinfo | grep OpenGL
OpenGL vendor string: nouveau
OpenGL renderer string: NV92
OpenGL core profile version string: 3.3 (Core Profile) Mesa 19.2.0-devel (git-4fd8161773)
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.3 (Compatibility Profile) Mesa 19.2.0-devel (git-4fd8161773)
OpenGL shading language version string: 3.30
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 19.2.0-devel (git-4fd8161773)
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
OpenGL ES profile extensions:


vainfo:
vainfo
libva info: VA-API version 0.40.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/X11R7/lib/dri/nouveau_drv_video.so
libva info: Found init function __vaDriverInit_0_40
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.40 (libva )
vainfo: Driver version: Mesa Gallium driver 19.2.0-devel for NV92
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileNone                   : VAEntrypointVideoProc


First, I think EncSlice lines are invalid (or mesa can magically (shaders?) _encode_ mpeg2 videos?)

Second .. ffmpeg command failed for me :/
ffmpeg -vaapi_device /dev/dri/renderD128 -benchmark -c:v libdav1d   -i /mnt/sdb1/Stream2_AV1_720p_3.2mbps.webm  -vf format=nv12,hwupload,scale_vaapi=w=240:h=120 -map 0:v:0 -v trace -f null -
ffmpeg version N-93862-gf49cec2ba8 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 5.5.0 (GCC)

[skip]

Applying option vaapi_device (set VAAPI hardware device (DRM path or X11 display name)) with argument /dev/dri/renderD128.
[AVHWDeviceContext @ 0xaef7d00] Opened VA display via DRM device /dev/dri/renderD128.
libva info: VA-API version 0.40.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/X11R7/lib/dri/nouveau_drv_video.so
libva info: Found init function __vaDriverInit_0_40
libva info: va_openDriver() returns 0
[AVHWDeviceContext @ 0xaef7d00] Initialised VAAPI connection: version 0.40
[AVHWDeviceContext @ 0xaef7d00] Format 0x3231564e -> nv12.
[AVHWDeviceContext @ 0xaef7d00] Format 0x30313050 -> p010le.
[AVHWDeviceContext @ 0xaef7d00] Format 0x36313050 -> unknown.
[AVHWDeviceContext @ 0xaef7d00] Format 0x32315659 -> yuv420p.
[AVHWDeviceContext @ 0xaef7d00] Format 0x56595559 -> unknown.
[AVHWDeviceContext @ 0xaef7d00] Format 0x59565955 -> uyvy422.
[AVHWDeviceContext @ 0xaef7d00] Format 0x41524742 -> bgra.
[AVHWDeviceContext @ 0xaef7d00] Format 0x41424752 -> rgba.
[AVHWDeviceContext @ 0xaef7d00] Format 0x58524742 -> bgr0.
[AVHWDeviceContext @ 0xaef7d00] Format 0x58424752 -> rgb0.
[AVHWDeviceContext @ 0xaef7d00] VAAPI driver: Mesa Gallium driver 19.2.0-devel for NV92.
[AVHWDeviceContext @ 0xaef7d00] Driver not found in known nonstandard list, using standard behaviour.

[skip]

[Parsed_format_0 @ 0xaf4dcc0] Setting 'pix_fmts' to value 'nv12'
[Parsed_scale_vaapi_2 @ 0xb005a40] Setting 'w' to value '240'
[Parsed_scale_vaapi_2 @ 0xb005a40] Setting 'h' to value '120'
[graph 0 input from stream 0:0 @ 0xb006300] Setting 'video_size' to value '1280x720'
[graph 0 input from stream 0:0 @ 0xb006300] Setting 'pix_fmt' to value '0'
[graph 0 input from stream 0:0 @ 0xb006300] Setting 'time_base' to value '1/1000'
[graph 0 input from stream 0:0 @ 0xb006300] Setting 'pixel_aspect' to value '1/1'
[graph 0 input from stream 0:0 @ 0xb006300] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 0xb006300] Setting 'frame_rate' to value '25/1'
[graph 0 input from stream 0:0 @ 0xb006300] w:1280 h:720 pixfmt:yuv420p tb:1/1000 fr:25/1 sar:1/1 sws_param:flags=2
[auto_scaler_0 @ 0xb007b40] Setting 'flags' to value 'bicubic'
[auto_scaler_0 @ 0xb007b40] w:iw h:ih flags:'bicubic' interl:0
[Parsed_format_0 @ 0xaf4dcc0] auto-inserting filter 'auto_scaler_0' between the filter 'graph 0 input from stream 0:0' and the filter 'Parsed_format_0'
[AVFilterGraph @ 0xaf3ed00] query_formats: 5 queried, 3 merged, 1 already done, 0 delayed
[auto_scaler_0 @ 0xb007b40] w:1280 h:720 fmt:yuv420p sar:1/1 -> w:1280 h:720 fmt:nv12 sar:1/1 flags:0x4
[hwupload @ 0xaf4e200] Surface format is nv12.
[AVHWFramesContext @ 0xaf4e4c0] Created surface 0x1.
[AVHWFramesContext @ 0xaf4e4c0] Direct mapping disabled: deriving image does not work: 1 (operation failed).
[AVHWFramesContext @ 0xb08d2c0] Created surface 0x3.
[AVHWFramesContext @ 0xb08d2c0] Direct mapping disabled: deriving image does not work: 1 (operation failed).
[AVHWFramesContext @ 0xb08d2c0] Created surface 0x4.
[AVHWFramesContext @ 0xb08d2c0] Created surface 0x5.
[AVHWFramesContext @ 0xb08d2c0] Created surface 0x6.
[AVHWFramesContext @ 0xb08d2c0] Created surface 0x7.
[AVHWFramesContext @ 0xb08d2c0] Created surface 0x8.
[AVHWFramesContext @ 0xb08d2c0] Created surface 0x9.
[AVHWFramesContext @ 0xb08d2c0] Created surface 0xa.
[AVHWFramesContext @ 0xb08d2c0] Created surface 0xb.
[AVHWFramesContext @ 0xb08d2c0] Created surface 0xc.
[AVHWFramesContext @ 0xaf4e4c0] Map surface 0x1.
[AVHWFramesContext @ 0xaf4e4c0] Unmap surface 0x1.
[Parsed_scale_vaapi_2 @ 0xb005a40] Filter input: vaapi_vld, 1280x720 (0).
[Parsed_scale_vaapi_2 @ 0xb005a40] Using surface 0x1 for scale input.
[Parsed_scale_vaapi_2 @ 0xb005a40] Using surface 0xc for scale output.
[Parsed_scale_vaapi_2 @ 0xb005a40] Pipeline parameter buffer is 0xe.
[Parsed_scale_vaapi_2 @ 0xb005a40] Failed to render parameter buffer: 2 (resource allocation failed).
Error while filtering: Input/output error
Failed to inject frame into filter network: Input/output error
Error while processing the decoded data for stream #0:0
bench: maxrss=106420kB
[AVIOContext @ 0xaf40640] Statistics: 759514 bytes read, 0 seeks
Conversion failed!

Ow :( [full log attached]

Note, i use libva1:

libva-1.8.3

Can libva2 be installed in parallel with libva1 ?

[1] - https://lists.cinelerra-gg.org/pipermail/cin/2019-May/000665.html
Comment 1 Andrew Randrianasulu 2019-06-05 14:49:44 UTC
After adding XVMC_VL=1 variable ffmpeg command above started to work ?!
Apparently, 'normal' nouveau video allocator dislikes two differently-sized buffers (command also worked when I set "scale_vaapi=w=1280:h=720" , in other words to strictly same dimensions as input ....)
Comment 2 Ilia Mirkin 2019-06-05 15:01:09 UTC
(In reply to Andrew Randrianasulu from comment #1)
> After adding XVMC_VL=1 variable ffmpeg command above started to work ?!

I believe XVMC_VL uses shaders to do the mpeg decoding. It's not the built-in vp2 (or vpe) processor doing the decoding.

I *have* seen some weird stuff with vdpau where it looks like surfaces are sized weird and everything breaks (like something is off by 8px in width or height). I have never tried to really track it down.
Comment 3 Andrew Randrianasulu 2019-06-05 16:38:04 UTC
using those two command lines

XVMC_VL=1 LIBVA_MESSAGING_LEVEL=2 LIBVA_TRACE=/dev/shm/log_file ./ffmpeg -vaapi_device /dev/dri/renderD128 -benchmark -c:v libdav1d   -i /mnt/sdb1/Stream2_AV1_720p_3.2mbps.webm  -vf format=nv12,hwupload,scale_vaapi=w=3840:h=2160:mode=hq,hwdownload,format=yuv420p -map 0:v:0  /dev/shm/1.avi

---------working--------

 LIBVA_MESSAGING_LEVEL=2 LIBVA_TRACE=/dev/shm/log_file_no_vl ./ffmpeg -vaapi_device /dev/dri/renderD128 -benchmark -c:v libdav1d   -i /mnt/sdb1/Stream2_AV1_720p_3.2mbps.webm  -vf format=nv12,hwupload,scale_vaapi=w=3840:h=2160:mode=hq,hwdownload,format=yuv420p -map 0:v:0  /dev/shm/1.avi

--------failing----------

I got two trace files, will attach them.
Comment 4 Andrew Randrianasulu 2019-06-05 16:39:04 UTC
Created attachment 144462 [details]
libva log file (with VL activated)
Comment 5 Andrew Randrianasulu 2019-06-05 16:39:42 UTC
Created attachment 144463 [details]
libva log without VL
Comment 6 GitLab Migration User 2019-09-18 20:47:57 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/1179.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.