Hi guys,
I'm trying to get gstreamer-vaapi to work with the VPU codec driver I'm working (for Rockchip platforms). However, despite having a seemingly working vaapi driver: # vainfo error: can't connect to X server! libva info: VA-API version 1.2.0 libva info: va_getDriverName() returns -1 libva info: User requested driver 'v4l2_request' libva info: Trying to open /usr/lib/va/v4l2_request_drv_video.so libva info: Found init function __vaDriverInit_1_2 libva info: va_openDriver() returns 0 vainfo: VA-API version: 1.2 (libva 2.2.0) vainfo: Driver version: v4l2-request vainfo: Supported profile and entrypoints v4l2-request: Unable to set MG2S format for type 10: Invalid argument VAProfileH264Main : VAEntrypointVLD VAProfileH264High : VAEntrypointVLD VAProfileH264ConstrainedBaseline: VAEntrypointVLD VAProfileH264MultiviewHigh : VAEntrypointVLD VAProfileH264StereoHigh : VAEntrypointVLD Gstreamer-vaapi don't output any elements: # LIBVA_DRIVER_NAME=v4l2_request gst-inspect-1.0 vaapi Plugin Details: Name vaapi Description VA-API based elements Filename /usr/lib/gstreamer-1.0/libgstvaapi.so Version 1.14.2 License LGPL Source module gstreamer-vaapi Source release date 2018-07-20 Binary package gstreamer-vaapi Origin URL http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer 0 features: Any hints on how I can debug this? Thanks! -- Ezequiel García, VanguardiaSur www.vanguardiasur.com.ar _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Ezequiel,
As v4l2 driver is not in the whitelist of VA driver backends you should disable the backend test, setting the environment variable $ export GST_VAAPI_ALL_DRIVERS=1 For more info you can glance this post: https://blogs.igalia.com/vjaquez/2018/03/28/gstreamer-va-api-troubleshooting/ vmjl On Wed, 15 Aug 2018 at 19:58, Ezequiel Garcia wrote: > Hi guys, > > I'm trying to get gstreamer-vaapi to work with the VPU codec driver > I'm working (for Rockchip platforms). > However, despite having a seemingly working vaapi driver: > > # vainfo > error: can't connect to X server! > libva info: VA-API version 1.2.0 > libva info: va_getDriverName() returns -1 > libva info: User requested driver 'v4l2_request' > libva info: Trying to open /usr/lib/va/v4l2_request_drv_video.so > libva info: Found init function __vaDriverInit_1_2 > libva info: va_openDriver() returns 0 > vainfo: VA-API version: 1.2 (libva 2.2.0) > vainfo: Driver version: v4l2-request > vainfo: Supported profile and entrypoints > > v4l2-request: Unable to set MG2S format for type 10: Invalid argument > VAProfileH264Main : VAEntrypointVLD > VAProfileH264High : VAEntrypointVLD > VAProfileH264ConstrainedBaseline: VAEntrypointVLD > VAProfileH264MultiviewHigh : VAEntrypointVLD > VAProfileH264StereoHigh : VAEntrypointVLD > > Gstreamer-vaapi don't output any elements: > > # LIBVA_DRIVER_NAME=v4l2_request gst-inspect-1.0 vaapi > Plugin Details: > Name vaapi > Description VA-API based elements > Filename /usr/lib/gstreamer-1.0/libgstvaapi.so > Version 1.14.2 > License LGPL > Source module gstreamer-vaapi > Source release date 2018-07-20 > Binary package gstreamer-vaapi > Origin URL > http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer > > > 0 features: > > Any hints on how I can debug this? > > Thanks! gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
On 16 August 2018 at 06:22, Víctor Jáquez <[hidden email]> wrote:
> Ezequiel, > > As v4l2 driver is not in the whitelist of VA driver backends you should disable > the backend test, setting the environment variable > > $ export GST_VAAPI_ALL_DRIVERS=1 > > For more info you can glance this post: > > https://blogs.igalia.com/vjaquez/2018/03/28/gstreamer-va-api-troubleshooting/ > Hey Victor, The above didn't work, but tracing with some debugging levels I found this: 0:00:00.060866458 1435 0x22788600 ERROR default gstvaapi.c:254:plugin_init: Cannot create a VA display Which seems to be the reason why is not working. So I guess the next step is look at my backend and libva and see why it refuses to create the display. Two things I am wondering are: * Is there any "easy" way to build and use the master branch? I'm using Buildroot to generate this rootfs. AFAICS, I will have to build gstreamer (and all the plugins to use master too), and there is no way to use 1.14.2 for everything and master branch for vaapi. * Any easy way to turn on libva messages? Thanks, -- Ezequiel García, VanguardiaSur www.vanguardiasur.com.ar _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
On Thu, 16 Aug 2018 at 20:15, Ezequiel Garcia wrote:
> On 16 August 2018 at 06:22, Víctor Jáquez <[hidden email]> wrote: > > Ezequiel, > > > > As v4l2 driver is not in the whitelist of VA driver backends you should disable > > the backend test, setting the environment variable > > > > $ export GST_VAAPI_ALL_DRIVERS=1 > > > > For more info you can glance this post: > > > > https://blogs.igalia.com/vjaquez/2018/03/28/gstreamer-va-api-troubleshooting/ > > > > Hey Victor, > > The above didn't work, but tracing with some debugging levels I found this: > > 0:00:00.060866458 1435 0x22788600 ERROR default > gstvaapi.c:254:plugin_init: Cannot create a VA display > > Which seems to be the reason why is not working. So I guess the next > step is look at my backend > and libva and see why it refuses to create the display. What's your pipeline? > > Two things I am wondering are: > * Is there any "easy" way to build and use the master branch? I'm > using Buildroot to generate > this rootfs. AFAICS, I will have to build gstreamer (and all the > plugins to use master too), and there > is no way to use 1.14.2 for everything and master branch for vaapi. I guess there are two options: 1) compile all gstreamer in the board, using gst-build[1] or gst-uninstalled (I used to do that in different boards) or tell buildroot to use a local git clone [2]. 1. https://blogs.igalia.com/vjaquez/2018/04/17/how-to-setup-a-gst-build-environment-with-intels-va-api-stack/ 2. https://buildroot.org/downloads/manual/manual.html#_using_buildroot_during_development > > * Any easy way to turn on libva messages? exporting the variable LIBVA_TRACE=/path/to/trace_file_template > > Thanks, _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
On 17 August 2018 at 06:04, Víctor Jáquez <[hidden email]> wrote:
> On Thu, 16 Aug 2018 at 20:15, Ezequiel Garcia wrote: >> On 16 August 2018 at 06:22, Víctor Jáquez <[hidden email]> wrote: >> > Ezequiel, >> > >> > As v4l2 driver is not in the whitelist of VA driver backends you should disable >> > the backend test, setting the environment variable >> > >> > $ export GST_VAAPI_ALL_DRIVERS=1 >> > >> > For more info you can glance this post: >> > >> > https://blogs.igalia.com/vjaquez/2018/03/28/gstreamer-va-api-troubleshooting/ >> > >> >> Hey Victor, >> >> The above didn't work, but tracing with some debugging levels I found this: >> >> 0:00:00.060866458 1435 0x22788600 ERROR default >> gstvaapi.c:254:plugin_init: Cannot create a VA display >> >> Which seems to be the reason why is not working. So I guess the next >> step is look at my backend >> and libva and see why it refuses to create the display. > > What's your pipeline? > Oh, no real pipeline, just: $ gst-inspect-1.0 vaapi >> >> Two things I am wondering are: >> * Is there any "easy" way to build and use the master branch? I'm >> using Buildroot to generate >> this rootfs. AFAICS, I will have to build gstreamer (and all the >> plugins to use master too), and there >> is no way to use 1.14.2 for everything and master branch for vaapi. > > I guess there are two options: 1) compile all gstreamer in the board, using > gst-build[1] or gst-uninstalled (I used to do that in different boards) or tell > buildroot to use a local git clone [2]. > > 1. https://blogs.igalia.com/vjaquez/2018/04/17/how-to-setup-a-gst-build-environment-with-intels-va-api-stack/ > 2. https://buildroot.org/downloads/manual/manual.html#_using_buildroot_during_development > Yes, I found those posts and I was planning to follow them. Guess it won't get any easier than that. >> >> * Any easy way to turn on libva messages? > > exporting the variable LIBVA_TRACE=/path/to/trace_file_template > Nice, thanks! -- Ezequiel García, VanguardiaSur www.vanguardiasur.com.ar _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Victor,
Found some time to pick up my investigation on vaapi on v4l, using bootlin's vaapi backend. I am using gst-build to get latest sources, and set the env variables as you suggested. The vaapi backend is properly detected: # gst-inspect-1.0 vaapi Plugin Details: Name vaapi Description VA-API based elements Filename /root/gst-build/build/subprojects/gstreamer-vaapi/gst/vaapi/libgstvaapi.so Version 1.15.0.1 License LGPL Source module gstreamer-vaapi Binary package gstreamer-vaapi Origin URL http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer vaapimpeg2dec: VA-API MPEG2 decoder vaapipostproc: VA-API video postprocessing vaapidecodebin: VA-API Decode Bin vaapisink: VA-API sink 4 features: +-- 4 elements The pipeline I am trying now is (see full log below): GST_DEBUG=vaapi*:4 gst-launch-1.0 filesrc location=~/big_buck_bunny_480p_MPEG2_MP2_25fps_1800K.MPG ! mpegpsdemux ! vaapimpeg2dec ! video/x-raw,width=854,height=480 ! kmssink Now, my question is: is it possible to connect a vaapi decoder to a non-vaapi sink? Judging from this traces: 0:00:01.230428590 32630 0x555350 INFO vaapidecode gstvaapipluginbase.c:959:gst_vaapi_plugin_base_decide_allocation:<vaapidecode_mpeg2-0> ignoring non-VAAPI pool: <kmsbufferpool1> 0:00:01.270321791 32630 0x555350 ERROR vaapi gstvaapibufferproxy.c:228:gst_vaapi_buffer_proxy_new_from_object: failed to acquire the underlying VA buffer handle 0:00:01.270796060 32630 0x555350 ERROR default gstvaapisurface_drm.c:54:gst_vaapi_surface_get_drm_buf_handle: failed to allocate export buffer proxy I think not. So, I need to add proper support for a vaapisink DRM display, right? Full log: 0:00:00.523691738 32630 0x5444a0 INFO vaapi gstvaapiutils.c:94:gst_vaapi_log: VA-API version 1.2.0 0:00:00.523944582 32630 0x5444a0 INFO vaapi gstvaapiutils.c:94:gst_vaapi_log: va_getDriverName() returns -1 0:00:00.524014085 32630 0x5444a0 INFO vaapi gstvaapiutils.c:94:gst_vaapi_log: User requested driver 'v4l2_request' 0:00:00.524069254 32630 0x5444a0 INFO vaapi gstvaapiutils.c:94:gst_vaapi_log: Trying to open /usr/local/lib/dri/v4l2_request_drv_video.so 0:00:00.525787325 32630 0x5444a0 INFO vaapi gstvaapiutils.c:94:gst_vaapi_log: Found init function __vaDriverInit_1_2 0:00:00.526316514 32630 0x5444a0 INFO vaapi gstvaapiutils.c:94:gst_vaapi_log: va_openDriver() returns 0 0:00:00.526417727 32630 0x5444a0 INFO vaapi gstvaapiutils.c:121:vaapi_initialize: VA-API version 1.2 0:00:00.529891496 32630 0x5444a0 INFO vaapi gstvaapiutils.c:94:gst_vaapi_log: VA-API version 1.2.0 0:00:00.530034794 32630 0x5444a0 INFO vaapi gstvaapiutils.c:94:gst_vaapi_log: va_getDriverName() returns -1 0:00:00.530087879 32630 0x5444a0 INFO vaapi gstvaapiutils.c:94:gst_vaapi_log: User requested driver 'v4l2_request' 0:00:00.530138798 32630 0x5444a0 INFO vaapi gstvaapiutils.c:94:gst_vaapi_log: Trying to open /usr/local/lib/dri/v4l2_request_drv_video.so 0:00:00.530358432 32630 0x5444a0 INFO vaapi gstvaapiutils.c:94:gst_vaapi_log: Found init function __vaDriverInit_1_2 0:00:00.530611109 32630 0x5444a0 INFO vaapi gstvaapiutils.c:94:gst_vaapi_log: va_openDriver() returns 0 0:00:00.530683362 32630 0x5444a0 INFO vaapi gstvaapiutils.c:121:vaapi_initialize: VA-API version 1.2 0:00:00.530875412 32630 0x5444a0 INFO vaapidisplay gstvaapidisplay.c:903:gst_vaapi_display_create:<vaapidisplaydrm1> new display addr=0x551120 Setting pipeline to PAUSED ... 0:00:01.152873739 32630 0x5444a0 INFO vaapidecode gstvaapipluginbase.c:1226:gst_vaapi_plugin_base_create_gl_context:<vaapidecode_mpeg2-0> creating a new GstGL context libEGL warning: DRI3: xcb_connect failed libEGL warning: DRI2: xcb_connect failed libEGL warning: DRI2: xcb_connect failed 0:00:01.175417343 32630 0x5444a0 INFO vaapi gstvaapiutils.c:94:gst_vaapi_log: VA-API version 1.2.0 0:00:01.175594476 32630 0x5444a0 INFO vaapi gstvaapiutils.c:94:gst_vaapi_log: va_getDriverName() returns -1 0:00:01.175656395 32630 0x5444a0 INFO vaapi gstvaapiutils.c:94:gst_vaapi_log: User requested driver 'v4l2_request' 0:00:01.175715814 32630 0x5444a0 INFO vaapi gstvaapiutils.c:94:gst_vaapi_log: Trying to open /usr/local/lib/dri/v4l2_request_drv_video.so 0:00:01.175929781 32630 0x5444a0 INFO vaapi gstvaapiutils.c:94:gst_vaapi_log: Found init function __vaDriverInit_1_2 0:00:01.176429344 32630 0x5444a0 INFO vaapi gstvaapiutils.c:94:gst_vaapi_log: va_openDriver() returns 0 0:00:01.176532056 32630 0x5444a0 INFO vaapi gstvaapiutils.c:121:vaapi_initialize: VA-API version 1.2 0:00:01.176969866 32630 0x5444a0 INFO vaapi gstvaapiutils.c:94:gst_vaapi_log: VA-API version 1.2.0 0:00:01.177134540 32630 0x5444a0 INFO vaapi gstvaapiutils.c:94:gst_vaapi_log: va_getDriverName() returns -1 0:00:01.177198001 32630 0x5444a0 INFO vaapi gstvaapiutils.c:94:gst_vaapi_log: User requested driver 'v4l2_request' 0:00:01.177285213 32630 0x5444a0 INFO vaapi gstvaapiutils.c:94:gst_vaapi_log: Trying to open /usr/local/lib/dri/v4l2_request_drv_video.so 0:00:01.177597059 32630 0x5444a0 INFO vaapi gstvaapiutils.c:94:gst_vaapi_log: Found init function __vaDriverInit_1_2 0:00:01.177905780 32630 0x5444a0 INFO vaapi gstvaapiutils.c:94:gst_vaapi_log: va_openDriver() returns 0 0:00:01.177988617 32630 0x5444a0 INFO vaapi gstvaapiutils.c:121:vaapi_initialize: VA-API version 1.2 0:00:01.178058870 32630 0x5444a0 INFO vaapidisplay gstvaapidisplay.c:903:gst_vaapi_display_create:<vaapidisplaydrm2> new display addr=0x551330 0:00:01.178185042 32630 0x5444a0 INFO vaapidecode gstvaapipluginbase.c:55:plugin_set_display:<vaapidecode_mpeg2-0> set display <vaapidisplaydrm2> Pipeline is PREROLLING ... Got context from element 'vaapidecode_mpeg2-0': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayEGL\)\ gldisplayegl0"; Got context from element 'vaapidecode_mpeg2-0': gst.vaapi.Display=context, gst.vaapi.Display=(GstVaapiDisplay)"\(GstVaapiDisplayDRM\)\ vaapidisplaydrm2"; 0:00:01.187767982 32630 0x555350 INFO vaapidecode gstvaapidecode.c:208:gst_vaapidecode_update_sink_caps:<vaapidecode_mpeg2-0> new sink caps = video/mpeg, mpegversion=(int)2, systemstream=(boolean)false, parsed=(boolean)false 0:00:01.192352048 32630 0x555350 INFO vaapidecode gstvaapidecode.c:208:gst_vaapidecode_update_sink_caps:<vaapidecode_mpeg2-0> new sink caps = video/mpeg, mpegversion=(int)2, systemstream=(boolean)false, parsed=(boolean)false, framerate=(fraction)25/1 0:00:01.192665477 32630 0x555350 INFO vaapidecode gstvaapidecode.c:208:gst_vaapidecode_update_sink_caps:<vaapidecode_mpeg2-0> new sink caps = video/mpeg, mpegversion=(int)2, systemstream=(boolean)false, parsed=(boolean)false, framerate=(fraction)25/1, width=(int)854, height=(int)480 0:00:01.225596055 32630 0x555350 WARN vaapidecode gstvaapidecode.c:245:gst_vaapidecode_ensure_allowed_srcpad_caps:<vaapidecode_mpeg2-0> failed to create raw sink caps 0:00:01.226870567 32630 0x555350 INFO vaapidecode gstvaapidecode.c:373:gst_vaapidecode_update_src_caps:<vaapidecode_mpeg2-0> new src caps = video/x-raw, format=(string)NV12, width=(int)854, height=(int)480, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)bt601, framerate=(fraction)25/1 Redistribute latency... 0:00:01.230428590 32630 0x555350 INFO vaapidecode gstvaapipluginbase.c:959:gst_vaapi_plugin_base_decide_allocation:<vaapidecode_mpeg2-0> ignoring non-VAAPI pool: <kmsbufferpool1> 0:00:01.270321791 32630 0x555350 ERROR vaapi gstvaapibufferproxy.c:228:gst_vaapi_buffer_proxy_new_from_object: failed to acquire the underlying VA buffer handle 0:00:01.270796060 32630 0x555350 ERROR default gstvaapisurface_drm.c:54:gst_vaapi_surface_get_drm_buf_handle: failed to allocate export buffer proxy ** (gst-launch-1.0:32630): CRITICAL **: gst_vaapi_mini_object_unref: assertion 'object->ref_count > 0' failed 0:00:01.271160284 32630 0x555350 ERROR vaapivideomemory gstvaapivideomemory.c:1047:gst_vaapi_dmabuf_memory_new: failed to export VA surface to DMABUF 0:00:01.271354542 32630 0x555350 INFO vaapidecode gstvaapipluginbase.c:524:create_dmabuf_srcpad_allocator:<vaapidecode_mpeg2-0> dmabuf allocator generates unmappable buffers 0:00:01.280201326 32630 0x555350 ERROR vaapivideomemory gstvaapivideomemory.c:278:map_vaapi_memory: failed to make image current 0:00:01.280398710 32630 0x555350 ERROR default video-frame.c:162:gst_video_frame_map_id: failed to map video frame plane 0 (gst-launch-1.0:32630): GStreamer-CRITICAL **: gst_buffer_resize_range: assertion 'bufmax >= bufoffs + offset + size' failed 0:00:01.280846937 32630 0x555350 INFO vaapidecode gstvaapidecode.c:673:gst_vaapidecode_push_decoded_frame:<vaapidecode_mpeg2-0> downstream element rejected the frame (error [-5]) ERROR: from element /GstPipeline:pipeline0/GstMpegPSDemux:mpegpsdemux0: Internal data stream error. Additional debug info: ../subprojects/gst-plugins-bad/gst/mpegdemux/gstmpegdemux.c(2944): gst_ps_demux_loop (): /GstPipeline:pipeline0/GstMpegPSDemux:mpegpsdemux0: streaming stopped, reason error (-5) ERROR: pipeline doesn't want to preroll. Setting pipeline to NULL ... 0:00:01.285980192 32630 0x5444a0 WARN vaapi gstvaapisurface.c:90:gst_vaapi_surface_destroy: failed to destroy surface 0x4000003 0:00:01.286143449 32630 0x5444a0 WARN vaapi gstvaapisurface.c:90:gst_vaapi_surface_destroy: failed to destroy surface 0x4000004 0:00:01.286205451 32630 0x5444a0 WARN vaapi gstvaapisurface.c:90:gst_vaapi_surface_destroy: failed to destroy surface 0x4000005 0:00:01.286276829 32630 0x5444a0 WARN vaapi gstvaapisurface.c:90:gst_vaapi_surface_destroy: failed to destroy surface 0x4000000 0:00:01.286326248 32630 0x5444a0 WARN vaapi gstvaapisurface.c:90:gst_vaapi_surface_destroy: failed to destroy surface 0x4000001 0:00:01.286369833 32630 0x5444a0 WARN vaapi gstvaapisurface.c:90:gst_vaapi_surface_destroy: failed to destroy surface 0x4000002 Freeing pipeline ... -- Ezequiel García, VanguardiaSur www.vanguardiasur.com.ar _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Hi,
On Fri, 12 Oct 2018 at 16:58, Ezequiel Garcia wrote: > Victor, > > Found some time to pick up my investigation on vaapi on v4l, using > bootlin's vaapi backend. > I am using gst-build to get latest sources, and set the env variables > as you suggested. > The vaapi backend is properly detected: > > # gst-inspect-1.0 vaapi > Plugin Details: > Name vaapi > Description VA-API based elements > Filename > /root/gst-build/build/subprojects/gstreamer-vaapi/gst/vaapi/libgstvaapi.so > Version 1.15.0.1 > License LGPL > Source module gstreamer-vaapi > Binary package gstreamer-vaapi > Origin URL > http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer > > vaapimpeg2dec: VA-API MPEG2 decoder > vaapipostproc: VA-API video postprocessing > vaapidecodebin: VA-API Decode Bin > vaapisink: VA-API sink > > 4 features: > +-- 4 elements > > The pipeline I am trying now is (see full log below): > > GST_DEBUG=vaapi*:4 gst-launch-1.0 filesrc > location=~/big_buck_bunny_480p_MPEG2_MP2_25fps_1800K.MPG ! mpegpsdemux > ! vaapimpeg2dec ! video/x-raw,width=854,height=480 ! kmssink > > Now, my question is: is it possible to connect a vaapi decoder to a > non-vaapi sink? Judging from this traces: > > 0:00:01.230428590 32630 0x555350 INFO vaapidecode > gstvaapipluginbase.c:959:gst_vaapi_plugin_base_decide_allocation:<vaapidecode_mpeg2-0> > ignoring non-VAAPI pool: <kmsbufferpool1> > 0:00:01.270321791 32630 0x555350 ERROR vaapi > gstvaapibufferproxy.c:228:gst_vaapi_buffer_proxy_new_from_object: > failed to acquire the underlying VA buffer handle > 0:00:01.270796060 32630 0x555350 ERROR default > gstvaapisurface_drm.c:54:gst_vaapi_surface_get_drm_buf_handle: failed > to allocate export buffer proxy > > I think not. So, I need to add proper support for a vaapisink DRM > display, right? Nope, you should be capable to use (almost) any sink. For example, I have a blog post, using an atom board, playing a video with vaapi and kmssink https://blogs.igalia.com/vjaquez/2016/07/01/va-api-and-drmkms-in-minnowboard/ If I understand correctly the logs, vaapi decides to use the dmabuf allocator for the src allocator but when the decode wants to use those surfaces, the cannot be allocated. I would recommend, as a test, to change the code to use the surface allocator and use the vaapi mapping when copying the frames to kmssink. https://cgit.freedesktop.org/gstreamer/gstreamer-vaapi/tree/gst/vaapi/gstvaapipluginbase.c#n532 Is dmabuf supported bye the v4l2 vaapi driver?? vmjl _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
On Mon, 15 Oct 2018 at 10:07, Víctor Jáquez <[hidden email]> wrote:
> > Hi, > > On Fri, 12 Oct 2018 at 16:58, Ezequiel Garcia wrote: > > Victor, > > > > Found some time to pick up my investigation on vaapi on v4l, using > > bootlin's vaapi backend. > > I am using gst-build to get latest sources, and set the env variables > > as you suggested. > > The vaapi backend is properly detected: > > > > # gst-inspect-1.0 vaapi > > Plugin Details: > > Name vaapi > > Description VA-API based elements > > Filename > > /root/gst-build/build/subprojects/gstreamer-vaapi/gst/vaapi/libgstvaapi.so > > Version 1.15.0.1 > > License LGPL > > Source module gstreamer-vaapi > > Binary package gstreamer-vaapi > > Origin URL > > http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer > > > > vaapimpeg2dec: VA-API MPEG2 decoder > > vaapipostproc: VA-API video postprocessing > > vaapidecodebin: VA-API Decode Bin > > vaapisink: VA-API sink > > > > 4 features: > > +-- 4 elements > > > > The pipeline I am trying now is (see full log below): > > > > GST_DEBUG=vaapi*:4 gst-launch-1.0 filesrc > > location=~/big_buck_bunny_480p_MPEG2_MP2_25fps_1800K.MPG ! mpegpsdemux > > ! vaapimpeg2dec ! video/x-raw,width=854,height=480 ! kmssink > > > > Now, my question is: is it possible to connect a vaapi decoder to a > > non-vaapi sink? Judging from this traces: > > > > 0:00:01.230428590 32630 0x555350 INFO vaapidecode > > gstvaapipluginbase.c:959:gst_vaapi_plugin_base_decide_allocation:<vaapidecode_mpeg2-0> > > ignoring non-VAAPI pool: <kmsbufferpool1> > > 0:00:01.270321791 32630 0x555350 ERROR vaapi > > gstvaapibufferproxy.c:228:gst_vaapi_buffer_proxy_new_from_object: > > failed to acquire the underlying VA buffer handle > > 0:00:01.270796060 32630 0x555350 ERROR default > > gstvaapisurface_drm.c:54:gst_vaapi_surface_get_drm_buf_handle: failed > > to allocate export buffer proxy > > > > I think not. So, I need to add proper support for a vaapisink DRM > > display, right? > > Nope, you should be capable to use (almost) any sink. > results. Still not working fully. > For example, I have a blog post, using an atom board, playing a video with vaapi > and kmssink > > https://blogs.igalia.com/vjaquez/2016/07/01/va-api-and-drmkms-in-minnowboard/ > > If I understand correctly the logs, vaapi decides to use the dmabuf allocator > for the src allocator but when the decode wants to use those surfaces, the > cannot be allocated. > > I would recommend, as a test, to change the code to use the surface allocator > and use the vaapi mapping when copying the frames to kmssink. > > https://cgit.freedesktop.org/gstreamer/gstreamer-vaapi/tree/gst/vaapi/gstvaapipluginbase.c#n532 > > Is dmabuf supported bye the v4l2 vaapi driver?? > However, I found a few things that seemed off: 1. On this particular platform, the library requires PRIME_2 buffer type for AcquireBufferHandle. It's done only if the pixel format is tiled, but I have relaxed the requirement, since it doesn't seem needed to acquire the buffer. See: https://github.com/bootlin/libva-v4l2-request/blob/master/src/buffer.c#L212 2. Also, since there is no GetImage implementation I have enabled GST_VAAPI_ENABLE_DIRECT_RENDERING=1, so DeriveImage is used. Although there are some artifacts, see image attached, and also there's a SIGSEGV somewhere in v4l library. However, I think this will prevent proper zero-copy to work, since DeriveImage is effectively memcpying the surface into an image. Does gst-vaapi support zero-copy VAAPI to DRM ? Do you know what hooks should I implement in the vaapi backend? GetImage is not implemented, but I suspect it would be another memcpy, or am I wrong? Thanks a lot! -- Ezequiel García, VanguardiaSur www.vanguardiasur.com.ar _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel unnamed (1).jpg (866K) Download Attachment |
Le lundi 15 octobre 2018 à 17:04 -0300, Ezequiel Garcia a écrit :
> On Mon, 15 Oct 2018 at 10:07, Víctor Jáquez <[hidden email]> > wrote: > > > > Hi, > > > > On Fri, 12 Oct 2018 at 16:58, Ezequiel Garcia wrote: > > > Victor, > > > > > > Found some time to pick up my investigation on vaapi on v4l, > > > using > > > bootlin's vaapi backend. > > > I am using gst-build to get latest sources, and set the env > > > variables > > > as you suggested. > > > The vaapi backend is properly detected: > > > > > > # gst-inspect-1.0 vaapi > > > Plugin Details: > > > Name vaapi > > > Description VA-API based elements > > > Filename > > > /root/gst-build/build/subprojects/gstreamer- > > > vaapi/gst/vaapi/libgstvaapi.so > > > Version 1.15.0.1 > > > License LGPL > > > Source module gstreamer-vaapi > > > Binary package gstreamer-vaapi > > > Origin URL > > > http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer > > > > > > vaapimpeg2dec: VA-API MPEG2 decoder > > > vaapipostproc: VA-API video postprocessing > > > vaapidecodebin: VA-API Decode Bin > > > vaapisink: VA-API sink > > > > > > 4 features: > > > +-- 4 elements > > > > > > The pipeline I am trying now is (see full log below): > > > > > > GST_DEBUG=vaapi*:4 gst-launch-1.0 filesrc > > > location=~/big_buck_bunny_480p_MPEG2_MP2_25fps_1800K.MPG ! > > > mpegpsdemux > > > ! vaapimpeg2dec ! video/x-raw,width=854,height=480 ! kmssink > > > > > > Now, my question is: is it possible to connect a vaapi decoder to > > > a > > > non-vaapi sink? Judging from this traces: > > > > > > 0:00:01.230428590 32630 0x555350 INFO vaapidecode > > > gstvaapipluginbase.c:959:gst_vaapi_plugin_base_decide_allocation: > > > <vaapidecode_mpeg2-0> > > > ignoring non-VAAPI pool: <kmsbufferpool1> > > > 0:00:01.270321791 32630 0x555350 ERROR vaapi > > > gstvaapibufferproxy.c:228:gst_vaapi_buffer_proxy_new_from_object: > > > failed to acquire the underlying VA buffer handle > > > 0:00:01.270796060 32630 0x555350 ERROR default > > > gstvaapisurface_drm.c:54:gst_vaapi_surface_get_drm_buf_handle: > > > failed > > > to allocate export buffer proxy > > > > > > I think not. So, I need to add proper support for a vaapisink DRM > > > display, right? > > > > Nope, you should be capable to use (almost) any sink. > > > > OK, cool. So I have dig it further and managed to get some > results. Still not working fully. > > > For example, I have a blog post, using an atom board, playing a > > video with vaapi > > and kmssink > > > > > > > > If I understand correctly the logs, vaapi decides to use the dmabuf > > allocator > > for the src allocator but when the decode wants to use those > > surfaces, the > > cannot be allocated. > > > > I would recommend, as a test, to change the code to use the surface > > allocator > > and use the vaapi mapping when copying the frames to kmssink. > > > > > > > > Is dmabuf supported bye the v4l2 vaapi driver?? > > > > Yes, it does. > > However, I found a few things that seemed off: > > 1. On this particular platform, the library requires > PRIME_2 buffer type for AcquireBufferHandle. > It's done only if the pixel format is tiled, > but I have relaxed the requirement, since it > doesn't seem needed to acquire the buffer. > > See: > https://github.com/bootlin/libva-v4l2-request/blob/master/src/buffer.c#L212 > > 2. Also, since there is no GetImage implementation > I have enabled GST_VAAPI_ENABLE_DIRECT_RENDERING=1, > so DeriveImage is used. > > Although there are some artifacts, see image attached, > and also there's a SIGSEGV somewhere in v4l library. > > However, I think this will prevent proper zero-copy to work, > since DeriveImage is effectively memcpying > the surface into an image. > > Does gst-vaapi support zero-copy VAAPI to DRM ? exportation need to be ported to PRIME_2 in order to expose the modifiers. Whenever there is no modifiers, normal DMABuf will be used and then kmssink could work. > > Do you know what hooks should I implement in the vaapi backend? > GetImage is not implemented, but I suspect it would > be another memcpy, or am I wrong? > > Thanks a lot! > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel signature.asc (201 bytes) Download Attachment |
I am not sure if LibDRM got ported for the rockchip MESA drivers. I tip my hat to you. I tried getting GStreamer to work with my board and the only thing I could get working was the very low-level ffmpeg commands. Even that was touchy. If you need help testing it out, let me know. Thanks, ~Ben On Mon, Oct 15, 2018 at 5:49 PM Nicolas Dufresne <[hidden email]> wrote: Le lundi 15 octobre 2018 à 17:04 -0300, Ezequiel Garcia a écrit : _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by Nicolas Dufresne-5
On Mon, 15 Oct 2018 at 18:57, Nicolas Dufresne <[hidden email]> wrote:
> > Le lundi 15 octobre 2018 à 17:04 -0300, Ezequiel Garcia a écrit : > > On Mon, 15 Oct 2018 at 10:07, Víctor Jáquez <[hidden email]> > > wrote: > > > > > > Hi, > > > > > > On Fri, 12 Oct 2018 at 16:58, Ezequiel Garcia wrote: > > > > Victor, > > > > > > > > Found some time to pick up my investigation on vaapi on v4l, > > > > using > > > > bootlin's vaapi backend. > > > > I am using gst-build to get latest sources, and set the env > > > > variables > > > > as you suggested. > > > > The vaapi backend is properly detected: > > > > > > > > # gst-inspect-1.0 vaapi > > > > Plugin Details: > > > > Name vaapi > > > > Description VA-API based elements > > > > Filename > > > > /root/gst-build/build/subprojects/gstreamer- > > > > vaapi/gst/vaapi/libgstvaapi.so > > > > Version 1.15.0.1 > > > > License LGPL > > > > Source module gstreamer-vaapi > > > > Binary package gstreamer-vaapi > > > > Origin URL > > > > http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer > > > > > > > > vaapimpeg2dec: VA-API MPEG2 decoder > > > > vaapipostproc: VA-API video postprocessing > > > > vaapidecodebin: VA-API Decode Bin > > > > vaapisink: VA-API sink > > > > > > > > 4 features: > > > > +-- 4 elements > > > > > > > > The pipeline I am trying now is (see full log below): > > > > > > > > GST_DEBUG=vaapi*:4 gst-launch-1.0 filesrc > > > > location=~/big_buck_bunny_480p_MPEG2_MP2_25fps_1800K.MPG ! > > > > mpegpsdemux > > > > ! vaapimpeg2dec ! video/x-raw,width=854,height=480 ! kmssink > > > > > > > > Now, my question is: is it possible to connect a vaapi decoder to > > > > a > > > > non-vaapi sink? Judging from this traces: > > > > > > > > 0:00:01.230428590 32630 0x555350 INFO vaapidecode > > > > gstvaapipluginbase.c:959:gst_vaapi_plugin_base_decide_allocation: > > > > <vaapidecode_mpeg2-0> > > > > ignoring non-VAAPI pool: <kmsbufferpool1> > > > > 0:00:01.270321791 32630 0x555350 ERROR vaapi > > > > gstvaapibufferproxy.c:228:gst_vaapi_buffer_proxy_new_from_object: > > > > failed to acquire the underlying VA buffer handle > > > > 0:00:01.270796060 32630 0x555350 ERROR default > > > > gstvaapisurface_drm.c:54:gst_vaapi_surface_get_drm_buf_handle: > > > > failed > > > > to allocate export buffer proxy > > > > > > > > I think not. So, I need to add proper support for a vaapisink DRM > > > > display, right? > > > > > > Nope, you should be capable to use (almost) any sink. > > > > > > > OK, cool. So I have dig it further and managed to get some > > results. Still not working fully. > > > > > For example, I have a blog post, using an atom board, playing a > > > video with vaapi > > > and kmssink > > > > > > > https://blogs.igalia.com/vjaquez/2016/07/01/va-api-and-drmkms-in-minnowboard/ > > > > > > If I understand correctly the logs, vaapi decides to use the dmabuf > > > allocator > > > for the src allocator but when the decode wants to use those > > > surfaces, the > > > cannot be allocated. > > > > > > I would recommend, as a test, to change the code to use the surface > > > allocator > > > and use the vaapi mapping when copying the frames to kmssink. > > > > > > > https://cgit.freedesktop.org/gstreamer/gstreamer-vaapi/tree/gst/vaapi/gstvaapipluginbase.c#n532 > > > > > > Is dmabuf supported bye the v4l2 vaapi driver?? > > > > > > > Yes, it does. > > > > However, I found a few things that seemed off: > > > > 1. On this particular platform, the library requires > > PRIME_2 buffer type for AcquireBufferHandle. > > It's done only if the pixel format is tiled, > > but I have relaxed the requirement, since it > > doesn't seem needed to acquire the buffer. > > > > See: > > https://github.com/bootlin/libva-v4l2-request/blob/master/src/buffer.c#L212 > > > > 2. Also, since there is no GetImage implementation > > I have enabled GST_VAAPI_ENABLE_DIRECT_RENDERING=1, > > so DeriveImage is used. > > > > Although there are some artifacts, see image attached, > > and also there's a SIGSEGV somewhere in v4l library. > > > > However, I think this will prevent proper zero-copy to work, > > since DeriveImage is effectively memcpying > > the surface into an image. > > > > Does gst-vaapi support zero-copy VAAPI to DRM ? > > Not at the moment. There is no VAAPI DRM backend, and the dmabuf > exportation need to be ported to PRIME_2 in order to expose the > modifiers. Whenever there is no modifiers, normal DMABuf will be used > and then kmssink could work. > Maybe this is something we can kickoff during next hackfest. It doesn't sound like we are too far away, and with cedrus driver about to be merged, it'd be interesting to have this pieces in place. -- Ezequiel García, VanguardiaSur www.vanguardiasur.com.ar _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
On Mon, 15 Oct 2018 at 20:46, Ezequiel Garcia wrote:
> On Mon, 15 Oct 2018 at 18:57, Nicolas Dufresne <[hidden email]> wrote: > > > > Is dmabuf supported bye the v4l2 vaapi driver?? > > > > > > > > > > Yes, it does. > > > > > > However, I found a few things that seemed off: > > > > > > 1. On this particular platform, the library requires > > > PRIME_2 buffer type for AcquireBufferHandle. > > > It's done only if the pixel format is tiled, > > > but I have relaxed the requirement, since it > > > doesn't seem needed to acquire the buffer. > > > > > > See: > > > https://github.com/bootlin/libva-v4l2-request/blob/master/src/buffer.c#L212 > > > > > > 2. Also, since there is no GetImage implementation > > > I have enabled GST_VAAPI_ENABLE_DIRECT_RENDERING=1, > > > so DeriveImage is used. > > > > > > Although there are some artifacts, see image attached, > > > and also there's a SIGSEGV somewhere in v4l library. > > > > > > However, I think this will prevent proper zero-copy to work, > > > since DeriveImage is effectively memcpying > > > the surface into an image. > > > > > > Does gst-vaapi support zero-copy VAAPI to DRM ? > > > > Not at the moment. There is no VAAPI DRM backend, and the dmabuf > > exportation need to be ported to PRIME_2 in order to expose the > > modifiers. Whenever there is no modifiers, normal DMABuf will be used > > and then kmssink could work. We need to implement in gstreamer-vaapi the new API to export dmabufs, without the need to use derived images, which also expose, if I understand correctly, the modifiers required by drm. > Maybe this is something we can kickoff during next hackfest. > It doesn't sound like we are too far away, and with cedrus > driver about to be merged, it'd be interesting to have this > pieces in place. Might be one task, yes, though right now I'm more focused in gstreamer-rs ;) vmjl _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |