This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/DRA746: Linux/DRA746: Waylansink:Video(mp4) playback hangs when playing with subtitle files

Part Number: DRA746

Tool/software: Linux

Hello Team, 

We are trying to play mp4 video file with separate subtitle file using below commands. When we play mp4 video file + external subtitle, we observed the video will hang during playback, but same file plays properly without subtitle file.

gst-launch-1.0 playbin uri=file:///tmp/USB1-1.4-sda1/2-H264\(640360_30\)MP3\(128_44\).mp4 suburi=file:///tmp/USB1-1.4-sda1/2-H264\(640360_30\)MP3\(128_44\).srt video-sink=waylandsink

Sharing you the files separately. 

Could you please suggest us on what might be going wrong?

Also,Could you please share the standard way of playing video + external subtitle with playbin and explicit pipeline for mp4 video + external subtitle.

Thanks & Regards,

Ikshwaku

  • Hi Ikshwaku,

    you have similar problem here:
    e2e.ti.com/.../680813
    and the only difference in this thread seems to be that in one case video format is .avi and in the other .mp4. Is that right?

    Ramprasad,
    Do you think that the rootcause is the same and the discussion can continue in the other thread and we can close this one?

    Regards,
    Yordan
  • Hello Yordan,

    In that thread video files are AVI and that is an always issue. But here files are MP4 and its not an always issue, it occurs sometime.

    Regards,
    Ikshwaku
  • Ikshwaku,
    I could playback your both mp4 files with subtitles enabled. It played fine till the end and subtitles are also seen on display.
    Are you seeing any error?

    Ram
  • Ikshwaku,
    Can you try with explicit pipeline

    gst-launch-1.0 filesrc location=/home/root/2-MPEG4.mp4 ! qtdemux ! mpeg4videoparse ! ducatimpeg4decvpe ! textoverlay name=txt ! waylandsink window-resolution=1920x1080 use-drm=true \
    filesrc location=/home/root/2-MPEG4.sub ! subparse ! txt.


    also try with pipeline involving Ittiam's parsers(replace qtdemux and subparse). From the png you shared, I guess their names are
    Ittmp4parser and ia_subparse

    Ram
  • Its not a always issue and once i got SIGSEGV when GST_DEBUG is enabled and video hanged. Otherwise it just hanged without any error(logs same as below without SIGSEGV)

    0:00:31.786384298 9797 0xb523af20 DEBUG waylandsink wldrm.c:92:gst_wl_drm_memory_construct_wl_buffer: create planar buffer: 0xb53ee258 (name=465)
    0:00:31.819467475 9797 0xb523af20 DEBUG waylandsink wldrm.c:92:gst_wl_drm_memory_construct_wl_buffer: create planar buffer: 0xaf720fd8 (name=466)
    0:00:31.822023544 9797 0xb523b030 ERROR GST_BUFFER gstbuffer.c:558:gst_buffer_copy_into: failed to copy meta 0xb525ad24 of API type GstMetaDucatiBufferPrivAPI
    0:00:31.891290900 9797 0xb523b030 ERROR GST_BUFFER gstbuffer.c:558:gst_buffer_copy_into: failed to copy meta 0xb53f4f44 of API type GstMetaDucatiBufferPrivAPI
    0:00:31.919815852 9797 0xb523af20 DEBUG waylandsink wldrm.c:92:gst_wl_drm_memory_construct_wl_buffer: create planar buffer: 0xb53ee258 (name=467)
    0:00:31.925086760 9797 0xb523b030 ERROR GST_BUFFER gstbuffer.c:558:gst_buffer_copy_into: failed to copy meta 0xaf701a84 of API type GstMetaDucatiBufferPrivAPI
    0:00:31.953334671 9797 0xb523af20 DEBUG waylandsink wldrm.c:92:gst_wl_drm_memory_construct_wl_buffer: create planar buffer: 0xaf74d478 (name=468)
    0:00:31.961386331 9797 0xb523b030 ERROR GST_BUFFER gstbuffer.c:558:gst_buffer_copy_into: failed to copy meta 0xb53f4cc4 of API type GstMetaDucatiBufferPrivAPI
    0:00:32.019011839 9797 0xb523af20 DEBUG waylandsink wldrm.c:92:gst_wl_drm_memory_construct_wl_buffer: create planar buffer: 0xaf73f108 (name=469)
    0:00:32.041120439 9797 0xb523b030 ERROR GST_BUFFER gstbuffer.c:558:gst_buffer_copy_into: failed to copy meta 0xb525ad24 of API type GstMetaDucatiBufferPrivAPI
    0:00:32.053950601 9797 0xb523af20 DEBUG waylandsink wldrm.c:92:gst_wl_drm_memory_construct_wl_buffer: create planar buffer: 0xaf740298 (name=470)
    0:00:32.076144432 9797 0xb523b030 ERROR GST_BUFFER gstbuffer.c:558:gst_buffer_copy_into: failed to copy meta 0xb53f4cc4 of API type GstMetaDucatiBufferPrivAPI
    0:00:32.085432359 9797 0xb523af20 DEBUG waylandsink wldrm.c:92:gst_wl_drm_memory_construct_wl_buffer: create planar buffer: 0xaf73f108 (name=471)
    0:00:32.109624279 9797 0xb523b030 ERROR GST_BUFFER gstbuffer.c:558:gst_buffer_copy_into: failed to copy meta 0xb527a224 of API type GstMetaDucatiBufferPrivAPI
    0:00:32.119720964 9797 0xb523af20 DEBUG waylandsink wldrm.c:92:gst_wl_drm_memory_construct_wl_buffer: create planar buffer: 0xaf7402c8 (name=472)
    Caught SIGSEGV

    Could you please share the standard way of playing with playbin and explicit pipeline or this case.

    Regards,
    Ikshwaku
  • Tried with explicit pipeline you shared and by inserting Ittiam's plugins, video doesn't hangs but getting these warnings :

    WARNING: from element /GstPipeline:pipeline0/GstWaylandSink:waylandsink0: A lot of buffers are being dropped.
    0:01:00.177595050 7541 0x176d80 DEBUG waylandsink wldrm.c:92:gst_wl_drm_memory_construct_wl_buffer: create planar buffer: 0x2a18c8 (name=1155)
    Additional debug info:
    /home/buildserver/work/jenkins/var/lib/jenkins/workspace/MMT2020-ADV-R3-0-Release-Builds/project/elina-distro/build-cpm-mmt-2020/tmp/work/cortexa15hf-vfp-neon-elina-linux-gnueabi/gstreamer1.0/1.6.3-r0/gstreamer-1.6.3/libs/gst/base/gstbasesink.c(2846): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstWaylandSink:waylandsink0:
    There may be a timestamping problem, or this computer is too slow.

    And when video is about to finish getting Killed message:

    0:00:52.638977309 4283 0x177b20 ERROR GST_BUFFER gstbuffer.c:558:gst_buffer_copy_into: failed to copy meta 0xb4d02b64 of API type GstMetaDucatiBufferPrivAPI
    0:00:52.670718825 4283 0x177b20 DEBUG waylandsink wldrm.c:92:gst_wl_drm_memory_construct_wl_buffer: create planar buffer: 0x2a3ab8 (name=1202)
    0:00:52.674659086 4283 0x177b20 ERROR GST_BUFFER gstbuffer.c:558:gst_buffer_copy_into: failed to copy meta 0x22f424 of API type GstMetaDucatiBufferPrivAPI
    0:00:52.703252324 4283 0x177b20 DEBUG waylandsink wldrm.c:92:gst_wl_drm_memory_construct_wl_buffer: create planar buffer: 0x200548 (name=1203)
    0:00:52.706705602 4283 0x177b20 ERROR GST_BUFFER gstbuffer.c:558:gst_buffer_copy_into: failed to copy meta 0x1a52e4 of API type GstMetaDucatiBufferPrivAPI
    0:00:52.736373796 4283 0x177b20 DEBUG waylandsink wldrm.c:92:gst_wl_drm_memory_construct_wl_buffer: create planar buffer: 0x2a3ab8 (name=1204)
    0:00:52.741263962 4283 0x177b20 ERROR GST_BUFFER gstbuffer.c:558:gst_buffer_copy_into: failed to copy meta 0xb4d02b64 of API type GstMetaDucatiBufferPrivAPI
    0:00:52.770243195 4283 0x177b20 DEBUG waylandsink wldrm.c:92:gst_wl_drm_memory_construct_wl_buffer: create planar buffer: 0x289ec0 (name=1205)
    0:00:52.773351992 4283 0x177b20 ERROR GST_BUFFER gstbuffer.c:558:gst_buffer_copy_into: failed to copy meta 0x22f5a4 of API type GstMetaDucatiBufferPrivAPI
    0:00:52.804570941 4283 0x177b20 DEBUG waylandsink wldrm.c:92:gst_wl_drm_memory_construct_wl_buffer: create planar buffer: 0x2a3ab8 (name=1206)
    0:00:52.816064865 4283 0x177b20 ERROR GST_BUFFER gstbuffer.c:558:gst_buffer_copy_into: failed to copy meta 0x1a50e4 of API type GstMetaDucatiBufferPrivAPI
    0:00:52.836217398 4283 0x177b20 DEBUG waylandsink wldrm.c:92:gst_wl_drm_memory_construct_wl_buffer: create planar buffer: 0x289ec0 (name=1207)
    0:00:52.840146476 4283 0x177b20 ERROR GST_BUFFER gstbuffer.c:558:gst_buffer_copy_into: failed to copy meta 0x1c61c4 of API type GstMetaDucatiBufferPrivAPI
    [1]+ Done layer-add-surfaces 1000 1
    Killed


    when i removed "mpeg4videoparse" in both(without and with Ittiam plugins) cases "A lot of buffers are being dropped." warning is not coming, but pipeline is getting Killed same as above.

    Regards,
    Ikshwaku
  • Hello Ram,

    Do, you have any further updates or suggestion how to debug it further.

    Regards,
    Ikshwaku

  • Add a capsfilter after vpe and then check the behaviour. I am not able to reproduce the issue here with playbin. Both mp4 files play fine with sub-titles.

    Try replacing decoder with software decoder and check behavior(avdec_h264 ,avdec_mpeg4 etc)
  • gst-launch-1.0 filesrc location=/tmp/USB1-1.4-sda1/2-MPEG4\(640360_30\)MP3\(128_44\).mp4 ! mp4parser ! mpeg4videoparse ! ducatimpeg4decvpe !  'video/x-raw, format=(string)NV12' ! textoverlay name=txt ! waylandsink filesrc location=/tmp/USB1-1.4-sda1/2-MPEG4\(640360_30\)MP3\(128_44\).sub ! subparse ! txt.

    after adding vpe capfilters not change in behavior video freeze and getting killed and getting oom .

    by adding  software decoder(avdec_mpeg4) not able to play

    gst-launch-1.0 filesrc location=/tmp/USB1-1.4-sda1/2-MPEG4\(640360_30\)MP3\(128_44\).mp4 ! qtdemux ! mpeg4videoparse ! avdec_mpeg4 ! textoverlay name=txt ! waylandsink filesrc location=/tmp/USB1-1.4-sda1/2-MPEG4\(640360_30\)MP3\(128_44\).sub ! subparse ! txt.

    Setting pipeline to PAUSED ...

    Pipeline is PREROLLING ...

    Redistribute latency...

    [destroyed object]: error 0: invalid format 0x32315559

    Pipeline is PREROLLED ...

    Setting pipeline to PLAYING ...

    New clock: GstSystemClock

    surface                : 90 created

    wl_display@1: error 0: invalid object 3

    Error communicating with wayland: Invalid argument

    Error communicating with wayland: Invalid argument

  • Hi Ram,

    Could you help here the debug further and fix this issue?

    Regards,

    Vikash

  • HI Vikash/Ikshwaku,
    The issue is with textoverlay which is base plugin, I will try to analyze.
    In above pipeline please add width and height to vpe's capsfilter like shown below, other vpe will be bypassed

    'video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720'

    Ram
  • Hello Ram,

    if we are adding width and height, then no output on the screen and pipeline hangs.


    Regards,
    Ikshwaku
  • Hi Ikshwaku/Vikash,
    Can you please apply this patch in gstvpe and give a try with playbin ?

    --- a/src/gstvpe.c
    +++ b/src/gstvpe.c
    @@ -210,8 +210,8 @@ gst_vpe_set_output_caps (GstVpe * self)
    2 : self->input_crop.c.height;
    self->output_width = self->input_crop.c.width;
    } else {
    - self->output_height = self->input_height;
    - self->output_width = self->input_width;
    + self->output_height = self->input_crop.c.height;
    + self->output_width = self->input_crop.c.width;
    }
    self->output_fourcc = GST_MAKE_FOURCC ('N', 'V', '1', '2');
    }

    I have tested this for all your avi and mp4 streams with sub-titles with this change . No issue found. No OOM killer and No timestamp issue.
    and sub-titles are also seen.

    Ram
  • Ikshwaku,

    You can add this patch to take care of one warning when playback happens.

    gstvpe.txt
    diff --git a/src/gstvpe.c b/src/gstvpe.c
    index a5ed1ff..ae0bf9c 100644
    --- a/src/gstvpe.c
    +++ b/src/gstvpe.c
    @@ -166,7 +166,7 @@ static gboolean
     gst_vpe_set_output_caps (GstVpe * self)
     {
       GstCaps *outcaps;
    -  GstStructure *s, *out_s;
    +  GstStructure *s, *out_s = NULL;
       gint fps_n, fps_d;
       gint par_width, par_height;
       const gchar *fmt = NULL;
    @@ -184,9 +184,10 @@ gst_vpe_set_output_caps (GstVpe * self)
               && gst_caps_is_strictly_equal (outcaps, self->output_caps))) {
         GST_DEBUG_OBJECT (self, "Downstream allowed caps: %s",
             gst_caps_to_string (outcaps));
    -    out_s = gst_caps_get_structure (outcaps, 0);
    -    fmt = gst_structure_get_string (out_s, "format");
    -
    +    if(gst_caps_get_size(outcaps) > 0 ) {
    +	out_s = gst_caps_get_structure (outcaps, 0);
    +	fmt = gst_structure_get_string (out_s, "format");
    +    }
         if (out_s &&
             gst_structure_get_int (out_s, "width", &self->output_width) &&
             gst_structure_get_int (out_s, "height", &self->output_height) && fmt) {
    @@ -210,8 +211,8 @@ gst_vpe_set_output_caps (GstVpe * self)
               2 : self->input_crop.c.height;
           self->output_width = self->input_crop.c.width;
         } else {
    -      self->output_height = self->input_height;
    -      self->output_width = self->input_width;
    +      self->output_height = self->input_crop.c.height;
    +      self->output_width = self->input_crop.c.width;
         }
         self->output_fourcc = GST_MAKE_FOURCC ('N', 'V', '1', '2');
       }
    

  • Hello Ram,

    After applying this patch, we are not able to see the video on the display. Pipeline is working but no video(all formats) output on the screen.

    Regards,
    Ikshwaku
  • One more update:

    With playbin pipeline is hanging.
    With explicit pipeline is not hanging, but exiting before finishing the video.
  • Hello Ram,

    Any update on this..??

    Regards,
    Ikshwaku
  • Hi Ikshwaku,
    I am not able to get why it is not working . The changes I made in vpe is to not to bypass for progressive. Now vpe will always be forced to do atleast cropping for progressive streams.
    Can you please share the changes you made in vpe plugin? I will review it once.
    Also share the logs with gst-debug enabled.
  • changes.txt
    diff --git a/src/gstvpe.c b/src/gstvpe.c
    index a5ed1ff..efe9fcc 100644
    --- a/src/gstvpe.c
    +++ b/src/gstvpe.c
    @@ -41,7 +41,6 @@
     #define MIN(a,b)     (((a) < (b)) ? (a) : (b))
     #endif
     
    -
     static void gst_vpe_class_init (GstVpeClass * klass);
     static void gst_vpe_init (GstVpe * self, gpointer klass);
     static void gst_vpe_base_init (gpointer gclass);
    @@ -166,7 +165,8 @@ static gboolean
     gst_vpe_set_output_caps (GstVpe * self)
     {
       GstCaps *outcaps;
    -  GstStructure *s, *out_s;
    +//  GstStructure *s, *out_s;
    +  GstStructure *s, *out_s = NULL;
       gint fps_n, fps_d;
       gint par_width, par_height;
       const gchar *fmt = NULL;
    @@ -184,8 +184,12 @@ gst_vpe_set_output_caps (GstVpe * self)
               && gst_caps_is_strictly_equal (outcaps, self->output_caps))) {
         GST_DEBUG_OBJECT (self, "Downstream allowed caps: %s",
             gst_caps_to_string (outcaps));
    -    out_s = gst_caps_get_structure (outcaps, 0);
    -    fmt = gst_structure_get_string (out_s, "format");
    +//    out_s = gst_caps_get_structure (outcaps, 0);
    +//    fmt = gst_structure_get_string (out_s, "format");
    +    if(gst_caps_get_size(outcaps) > 0 ) {
    +	out_s = gst_caps_get_structure (outcaps, 0);
    +	fmt = gst_structure_get_string (out_s, "format");
    +    }
     
         if (out_s &&
             gst_structure_get_int (out_s, "width", &self->output_width) &&
    @@ -210,8 +214,10 @@ gst_vpe_set_output_caps (GstVpe * self)
               2 : self->input_crop.c.height;
           self->output_width = self->input_crop.c.width;
         } else {
    -      self->output_height = self->input_height;
    -      self->output_width = self->input_width;
    +//      self->output_height = self->input_height;
    +//      self->output_width = self->input_width;
    +      self->output_height = self->input_crop.c.height;
    +      self->output_width = self->input_crop.c.width;
         }
         self->output_fourcc = GST_MAKE_FOURCC ('N', 'V', '1', '2');
       }
    
    gstreamer_logs.txtHello Ram,

    I have used this pipeline:

    gst-launch-1.0 playbin uri=file:///tmp/USB1-1.4-sda1/02_DivX6\(AVI\)_with_SRT_subtitle\(German\).AVI video-sink=waylandsink

    please find the logs and vpe changes as attachment.

    One difference i have observed:

    1. with vpe changes pipeline output shows 

    root@mmt2020-a880:~# gst-launch-1.0 playbin uri=file:///tmp/USB1-1.4-sda1/02_DivX6\(AVI\)_with_SRT_subtitle\(German\).AVI video-sink=waylandsink
    Setting pipeline to PAUSED ...
    Pipeline is PREROLLING ...

    *************************************************
    Ittiam AVI Demuxer plugged in
    *************************************************

    ***********************************************************
    ITTIAM MP3 PLUGIN
    ***********************************************************

    2. without vpe changes pipeline output:

    root@mmt2020-a880:~# gst-launch-1.0 playbin uri=file:///tmp/USB1-1.4-sda1/02_DivX6\(AVI\)_with_SRT_subtitle\(German\).AVI video-sink=waylandsink
    Setting pipeline to PAUSED ...
    Pipeline is PREROLLING ...

    *************************************************
    Ittiam AVI Demuxer plugged in
    *************************************************

    ***********************************************************
    ITTIAM MP3 PLUGIN
    ***********************************************************
    surface : 90 created
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    SetDestinationRectangle: surface ID (90), Width (800), Height (480)
    SetSourceRectangle : surface ID (90), Width (800), Height (480)
    SetVisibility : surface ID (90), ILM_TRUE
    layerAddSurface : surface ID (90) is added to layer ID (1000)
    New clock: GstAudioSinkClock

    So, basically surface is not created when we are playing with vpe changes.

  • Hi Ikshwaku,

    I am not able to get any clue why it is not working for you. I don't see any logs for vpe plugin.

    Please revert the earlier patch ,apply the attached one and check the behavior.

    7411.gstvpe.txt
    diff --git a/src/gstvpe.c b/src/gstvpe.c
    index a5ed1ff..de0fbd9 100644
    --- a/src/gstvpe.c
    +++ b/src/gstvpe.c
    @@ -209,6 +209,9 @@ gst_vpe_set_output_caps (GstVpe * self)
               (self->interlaced) ? self->input_crop.c.height *
               2 : self->input_crop.c.height;
           self->output_width = self->input_crop.c.width;
    +    } else if(self->input_crop.c.width) {
    +      self->output_height = self->input_crop.c.height;
    +      self->output_width = self->input_crop.c.width;
         } else {
           self->output_height = self->input_height;
           self->output_width = self->input_width;
    

    Note: The patch is going to work for only resolution below 1920x1080, it will not work for your 2560x1440 since vpe can support width upto 2048 only.

    Ram

  • Hello Ram,

    with latest path also getting the same behavior, no video on display.

    Regarding resolution, i am checking vpe with 2048 not 2560x1440.

    Regards,
    ikshwaku
  • Hi Ram,

    Could you please help here to resolve this issue? We are not able to play with VPE patch yet.

    @Ikshwaku,

    Could you share the exact commands you tried to test this?

    Regards,

    Vikash

  • Hello,

    I am using the simple normal playback commands. Normal playback itself is not working with the VPE patch. I have used the following commands:

    1. gst-launch-1.0 playbin uri=file:///tmp/USB1-1.4-sda1/VID20180308141120\[1\].mp4 video-sink=waylandsink
    2. gst-launch-1.0 filesrc location=/tmp/USB1-1.4-sda1/VID20180308141120\[1\].mp4 ! qtdemux ! h264parse ! ducatih264dec ! waylandsink

    I have also checked for playbin pipeline, pipeline is not going till waylandsink surface creation it self. It is stuck before waylandsink.

    Regards,
    Ikshwaku
  • Hi Ikshwaku/Vikash,
    I realized that there is a known issue with gstvpe with PSDKLA3.03.
    Refer processors.wiki.ti.com/index.php
    I guess this is the reason why vpe patch is not working.

    Can you confirm if you are seeing this error with vpe

    0:00:00.439049857 1183 0x176a00 ERROR vpe gstvpebufferpool.c:594:gst_vpe_buffer_pool_set_streaming: Cant query buffers
    0:00:00.439609918 1183 0x176a00 ERROR vpe gstvpebufferpool.c:594:gst_vpe_buffer_pool_set_streaming: Cant query buffers
    Try with --gst-debug=1 in the pipeline,it should show above errors.

    If yes, you need to revert two patches in gst-vpe repository.
    3c44b9f4769d8a2b1e3b3441d789a62047c7f940
    01575bbdc856341e971176cf2181d696a21aa090

    Revert above commits and rebuild gstvpe . Let me know the results.

    Ram
  • Hello Ram,

    Few queries:
    1. I need to check above error with VPE patch or without vpe patch?
    2. Above error logs comes with subtitle files or without subtitle files playback?

    Thanks,
    Ikshwaku
  • 1) For progressive streams , vpe will be bypassed. So you can check this error for an interlaced stream without the patch first or with vpe patch check subtitles use case.
    2) Interlaced streams this error is observed. With vpe patch applied, subtitles use case also show this error.

    Ram
  • Hello Ram,

    I am getting this error while I am playing the subtitle use case:

    0:00:00.189954487 6693 0x177d50 ERROR vpe gstvpe.c:584:gst_vpe_set_streaming:<vpe> Cant open /dev/v4l/by-path/platform-489d0000.vpe-video-index0

    I am not getting errors you mentioned.

    Regards,
    Ikshwaku
  • Hi Ikshwaku,

    Looks like vpe is configured and used from M4 . Can you confirm this?

    If it's yes, then you will not be able to use vpe from A15.

  • Hello Ram,

    Yes vpe configured with M4.

    So, we have disabled the vpe from M4, but still we are getting the same error.
    Do we need to enable the VPE on A15 core also?
    if yes, please share the steps..

    Thanks,
    Ikshwaku
  • Hi Ikshwaku,
    Yes, you need to enable vpe from A15.
    Can you check if your dts file has this statement

    /delete-node/ &vpe;
    or
    DISABLE_COMPLETE(vpe); in your dts file? If yes can you comment this and rebuild the dtb and copy to rootfs.
    Once you boot make sure you see /dev/video0 in the list of devices.

    Ramprasad
  • Hello Ram,

    I have compiled my kernel by commenting DISABLE_COMPLETE(vpe); in our DTS file. But still after that I am not able to see /dev/video0 .

    Do you have any idea why I am not able to see it. Do I need to change any other configs also?

    Regards,
    Ikshwaku

  • Hi Ikshwaku,
    Can you make sure you have disabled vpe in M4 side. Make sure you have commented "VPE_INCLUDE=yes" in cfg.mk of the vision-sdk and rebuilt everything and copied to rootfs.

    Similarly if you have commented DISABLE_COMPLETE(vpe);, this should have enabled vpe from A15.

    You add below code also in dts file to enable vpe explicitly if disabled by some other means.

    &vpe {
    status = "okay";
    }

    Can you try this and check?

    Ram
  • Hello Ram,

    we have disabled the vpe on M4 core and generated new dra7-ipu1-fw.xem4 and vsdkapps.
    Also added these line in the dts
    &vpe {
    status = "okay";
    }

    But, still not able to see /dev/video0.

    Thanks,
    Ikshwaku
  • Hi Ikshwaku,
    Just commenting the line DISABLE_COMPLETE(vpe) in dra7-evm-infoadas.dts should have enabled vpe from A15. No need to add
    &vpe {
    status = "okay";
    }
    can you confirm if you have modified dra7-evm-infoadas.dts to enable vpe?
    Can you share dmesg logs?
  • Hello Ram,

    Please find the dmesg logs as attachment.

    7737.dmesg.zip

    We are using different dts files.

    Do we need to enable any defconfig for vpe.

    Thanks,

    Ikshwaku

  • Hi Ikshwaku,
    I don't see any vpe info in the dmesg
    What is the vision-sdk version?

    Can you check
    zcat /proc/config.gz | grep VPE
    on target ?

    This should show CONFIG_VIDEO_TI_VPE
  • Hi Ikshwaku,
    Can you share your dtb file?
    or can you generate dts file from dtb bile using this command on host

    dtc -I dtb -O dts -o my.dts arch/arm/boot/dts/my.dtb
  • Hi Ikshwaku,
    dts file you shared has entry for vpe, no need to add one more node which I suggested.
    Can you check lsmod | grep vpe on target? Does it show if kernel module is inserted or not?

    you can first check ls -l /lib/modules/4.4.xxxxxxxxxxxxxxxxxx/kernel/drivers/media/platform/ti-vpe/
    if the module exists or not
  • Hello Ram ,

    What is the vision-sdk version?
    --> We are using VSDK version 3 dot 1 . This map to Kernel version 4.4.84 .
    (PROCESSOR_SDK_VISION_03_01_00_00_setuplinux.bin)

    Can you check
    zcat /proc/config.gz | grep VPE
    on target ?
    --> not getting any thing for this.

    Can you check lsmod | grep vpe on target? Does it show if kernel module is inserted or not?
    --> no vpe module

    you can first check ls -l /lib/modules/4.4.xxxxxxxxxxxxxxxxxx/kernel/drivers/media/platform/ti-vpe/
    if the module exists or not
    --> not exists.

    Thanks
    Ikshwaku
  • One more update:

    On our target this path "/lib/modules/4.4.xxxxxxxxxxxxxxxxxx/kernel/drivers/media" doesn't exists.

    Thanks,
    Ikshwaku

  • Hi Ikshwaku,
    In 4.4 kernel vpe is compiled with zImage and not as kernel module and this could be reason for lsmod not showing anything.
    But zcat /proc/config.gz | grep VPE should have shown
    CONFIG_VIDEO_TI_VPE=y in this case if vpe is enabled.

    Can you check .config in kernel source tree to confirm if this CONFIG is set or not?
    Also check if any .cfg is disabling this kconfig. In kernel source tree, ti_config_fragments directory has many cfg files which this configuration to y or m.

    Ram
  • Hello Ram,

    In .config no entry specific to VPE.
    And in ti_config_fragments vpe entry is there in these two files:

    ./audio_display.cfg:90:CONFIG_VIDEO_TI_VPE=m
    ./auto.cfg:28:CONFIG_VIDEO_TI_VPE=y

    Regards,
    Ikshwaku
  • HI Ikshwaku,
    How are you building kernel?
    Can you check when you are building kernel, these CONFIGs are applied or not?
    if you are building kernel from PSDKLA3.x, make linux will build the kernel and modules with the CONFIGs applied.

    Refer Makefile of PSDKLA3.x

    linux:
    $(MAKE) -C $(LINUXKERNEL_INSTALL_DIR) ARCH=arm $(DEFAULT_LINUXKERNEL_CONFIG)
    cd $(LINUXKERNEL_INSTALL_DIR); pwd ; ./ti_config_fragments/defconfig_builder.sh -t ti_sdk_dra7x_release
    $(MAKE) -C $(LINUXKERNEL_INSTALL_DIR) $(LINUXKERNEL_BUILD_VARS) ti_sdk_dra7x_release_defconfig
    $(MAKE) -C $(LINUXKERNEL_INSTALL_DIR) olddefconfig ARCH=arm
    $(MAKE) -C $(LINUXKERNEL_INSTALL_DIR) $(LINUXKERNEL_BUILD_VARS) zImage
    $(MAKE) -C $(LINUXKERNEL_INSTALL_DIR) $(LINUXKERNEL_BUILD_VARS) dtbs
    $(MAKE) -C $(LINUXKERNEL_INSTALL_DIR) $(LINUXKERNEL_BUILD_VARS) modules
    $(MAKE) -C $(SGX_KERNEL_MODULE_PATH) $(LINUXKERNEL_BUILD_VARS) $(SGX_BUILD_VARS)
    KERNELDIR=$(LINUXKERNEL_INSTALL_DIR) DISCIMAGE=$(EXEC_DIR)

    CONFIG_VIDEO_TI_VPE=y should be set to enable VPE from A15.
    and zcat config.gz | grep vpe will show CONFIG_VIDEO_TI_VPE
  • Hello Ram,

    I have enabled the VPE through "make menuconfig" and now i am able to see /dev/video0.

    and also getting configs through
    zcat /proc/config.gz | grep -i vpe
    CONFIG_VIDEO_TI_VPE=y
    CONFIG_VIDEO_TI_VPE_DEBUG=y

    Thanks for you help in resolving this, will update you further with this issue of external subtitle playback.

    Regards,
    Ikshwaku
  • Hi Ikshwaku,
    Could you use gstvpe plugin now? Are you able to see proper playback with subtitles ?
  • Hello Ram ,

    For testing gstvpe, do we need to specify it in pipeline, if yes, please share the pipeline or gstreamer playbin pipeline will take it by default.


    Regards,
    Ikshwaku
  • Hi Ikshwaku,
    Playbin will always select gstvpe when ducati is involved but vpe was being bypassed for progressive streams. Now with the patch I provided, vpe will not be bypassed.

    Enable debug for vpe with this
    export GST_DEBUG=vpe:6
    and then execute the pipeline. On console logs search for "Passthrough". This should be set to FALSE now indicate vpe is not in bypass mode.

    Ram
  • Hello Ram,

    After applying this patch

    git diff
    diff --git a/src/gstvpe.c b/src/gstvpe.c
    index a5ed1ff..de0fbd9 100644
    --- a/src/gstvpe.c
    +++ b/src/gstvpe.c
    @@ -209,6 +209,9 @@ gst_vpe_set_output_caps (GstVpe * self)
    (self->interlaced) ? self->input_crop.c.height *
    2 : self->input_crop.c.height;
    self->output_width = self->input_crop.c.width;
    + } else if(self->input_crop.c.width) {
    + self->output_height = self->input_crop.c.height;
    + self->output_width = self->input_crop.c.width;
    } else {
    self->output_height = self->input_height;
    self->output_width = self->input_width;

    Without subtitle files:
    -----------------------
    I am not able to play any video file with playbin pipeline for all the file playback I am getting this VPE error:

    0:00:00.183317179 1798 0x173920 ERROR vpe gstvpe.c:584:gst_vpe_set_streaming:<vpe> Cant open /dev/v4l/by-path/platform-489d0000.vpe-video-index0

    2. With explicit pipeline only mp4 file with H264 codec is playable. All other files are playing with error same as above.

    With Subtitle files:
    --------------------
    1. With playbin pipeline all files playback is hanging without showing any frame with thie error:

    0:00:00.183317179 1798 0x173920 ERROR vpe gstvpe.c:584:gst_vpe_set_streaming:<vpe> Cant open /dev/v4l/by-path/platform-489d0000.vpe-video-index0

    2. With explicit pipeline only mp4 file with H264 code is playable. All other files are playing with error same as above.

    Please let me know if you required complete debug logs.

    Regards,
    Ikshwaku
  • Hi Ikshwaku,
    Can you check if there is a node /dev/v4l/by-path/platform-489d0000.vpe-video-index0 ? This should have been created when /dev/video0 is available. This is the default device (Check gst-insepct-1.0 vpe)

    or you can try first with explicit pipeline by setting the device property of vpe as shown here

    ducatih264dec ! vpe device= /dev/video0 !

    and check if this works.

    I am still not sure if vpe from A15 is available or not.
    Please try executing file based vpe application. testvpe(it is renamed as test-v4l2-m2m in latest SDK).

    Ram
  • Hello Ram,

    /dev/v4l/by-path/platform-489d0000.vpe-video-index0 node is not created. There is no v4l folder in /dev dir.

    I have tried following explicit pipe line. Please let me know if these pipeline is proper or not.

    1. gst-launch-1.0 filesrc location=/tmp/USB1-1.4-sda1/2-MPEG4\(640360_30\)MP3\(128_44\).mp4 ! qtdemux ! mpeg4videoparse !
    ducatimpeg4decvpe ! vpe device=/dev/video0 ! waylandsink

    This pipe line is not working properly getting these errors:
    vpe gstvpebufferpool.c:462:gst_vpe_buffer_pool_import: Allocating a new input buffer index: 0/128, 0
    0:00:00.147372764 1554 0x1764c0 ERROR vpe gstvpe.c:584:gst_vpe_set_streaming:<vpe> Cant open /dev/v4l/by-path/platform-489d0000.vpe-video-index0
    0:00:00.150862303 1554 0x1764c0 WARN vpe gstvpebufferpool.c:462:gst_vpe_buffer_pool_import: Allocating a new input buffer index: 1/128, 0
    0:00:00.155024027 1554 0x1764c0 WARN vpe gstvpebufferpool.c:462:gst_vpe_buffer_pool_import: Allocating a new input buffer index: 2/128, 0
    0:00:00.159195240 1554 0x1764c0 WARN vpe gstvpebufferpool.c:462:gst_vpe_buffer_pool_import: Allocating a new input buffer index: 3/128, 0
    0:00:00.162316915 1554 0x1764c0 WARN vpe gstvpebufferpool.c:462:gst_vpe_buffer_pool_import: Allocating a new input buffer index: 4/128, 0
    0:00:05.834141019 1554 0x1764c0 WARN ducati gstducatividdec.c:570:codec_process:<decoder> err=-1, extendedError=01000000
    0:00:05.834406877 1554 0x1764c0 ERROR ducati gstducati.c:61:gst_ducati_log_extended_error_info: Bit 24 (01000000): no frame to flush

    2. gst-launch-1.0 filesrc location=/tmp/USB1-1.4-sda1/2-H264\(640360_30\)MP3\(128_44\).mp4 ! qtdemux ! h264parse ! ducatih264dec ! vpe
    device=/dev/video0 ! waylandsink

    This pipe line is working properly getting these warnings:

    0:00:27.640451471 1567 0x17b780 WARN bufferpool gstbufferpool.c:300:do_alloc_buffer:<vpebufferpool1> alloc function failed
    0:00:27.707114297 1567 0x17b780 WARN bufferpool gstbufferpool.c:300:do_alloc_buffer:<vpebufferpool1> alloc function failed
    0:00:27.773800507 1567 0x17b780 WARN bufferpool gstbufferpool.c:300:do_alloc_buffer:<vpebufferpool1> alloc function failed
    0:00:27.840447913 1567 0x17b780 WARN bufferpool gstbufferpool.c:300:do_alloc_buffer:<vpebufferpool1> alloc function failed
    0:00:27.907120736 1567 0x17b780 WARN bufferpool gstbufferpool.c:300:do_alloc_buffer:<vpebufferpool1> alloc function failed
    0:00:27.973791018 1567 0x17b780 WARN bufferpool gstbufferpool.c:300:do_alloc_buffer:<vpebufferpool1> alloc function failed


    3. gst-launch-1.0 filesrc location=/tmp/USB1-1.4-sda1/2-H264\(640360_30\)MP3\(128_44\).mp4 ! qtdemux ! h264parse ! ducatih264dec !
    waylandsink

    This pipe line is also working properly.

    Could you please help us in locating testvpe application, I am not able to file in our builds .


    Thanks,
    Ikshwaku