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: LayerManagerControl dump surface is not working, when we tries to take the surface dump for video playback.

Part Number: DRA746

Tool/software: Linux

Hello Team, 

We use custom h/w and software based on DRA746 and SDK 3.02.00.03 with wayland 1.11 

When we run a video file through gstreamer pipeline then 

1. Not able to take the surface dump with LayerManagerControl command.

Command used : LayerManagerControl dump surface 90 to surface.png  Only getting a dot when we zoom in the generated image file.

2. But able to get the screen dump for video playback

Command used: LayerManagerControl dump screen 0 to screen.png 

When we run EGLWLMockNavigation and then both surface and screen dumps are working properly.

Could you help us in finding the root cause of this issue.

Thanks & Regards,

Ikshwaku

  • Hi Ikshwaku,
    This seems to be issue with wayland-ivi-extension. I will check and confirm this.
  • Hello Ram,

    Any update for this issue?

    Regards,
    Ikshwaku
  • Hi Ikshwaku,

    TI's PSDKLA3.x is based on weston 1.9.0 and wayland-ivi-extension 1.9. SDK doesn't support waylandsink with ivi-shell.

    Only desktop-shell is supported. We have a decode and display application viddec3test from omapdrmtest.

    With this application, I am seeing proper output for surface and screen dump both.

    What is the version of wayland-ivi-extension  used in your case?

    I have attached the application I tested but there may be dependency on libraries and version is also different in your case. Not sure if you can execute this. Please give a try once.

    viddec3test.zip

  • Hello Ram,

    We are using weston 1.11 and wayland-ivi-extension 1.11.

    I am not able to execute the app. because library mismatch:
    root@mmt2020-a880:~# ./viddec3test
    ./viddec3test: error while loading shared libraries: libavcodec.so.57: cannot open shared object file: No such file or directory

    Could you please share the source for the app, so that we can compile it at our end and run?

    Thanks & Regards,
    Ikshwaku
  • HI Ikshwaku,
    Please share your commit-id on omapdrmtest. I will share you the patch.
    Can you check if below cases give proper surface dumps?
    a) GStreamer explicit pipeline
    b) Gstreamer explicilit pipeline with software codecs
  • Hello Ram,

    we are using "SRCREV = "116c940c2b06b221c13be28bb79af49233ba462a"" for omapdrmtest.

    I have used following pipelines but no surface dump:

    1. gst-launch-1.0 filesrc location=/tmp/USB1-1.4-sda1/Videos/B01_Baseline1.0_1280_720.MP4 ! qtdemux ! h264parse ! avdec_h264 ! waylandsink use-drm=true

    2. gst-launch-1.0 filesrc location=/tmp/USB1-1.4-sda1/Videos/B01_Baseline1.0_1280_720.MP4 ! qtdemux ! h264parse ! ducatih264dec ! waylandsink

    Regards,
    Ikshwaku

  • Hi Ikshwaku,

    On this commit-id, apply these patches and rebuild omapdrmtest and copy viddec3test to targetfs.

    With this application, surface dump works.

    patches.zip

  • Hello Ram,

    We have included the changes shared by you in our build. But I am not able to run the test app. Getting following error:

    root@mmt2020-a880:~# viddec3test
    0x2e008: Opening Display..
    using 0 connectors, 0x0 display, multiplanar: 1
    ERROR:alloc_buffer:182: drmModeAddFB2 failed: Invalid argument (-22)
    ERROR:alloc_buffers:226: allocation failed
    Segmentation fault (core dumped

    Could you please share the steps or any other configuration is required.

    Note: I am testing with M4 configuration.

    Regards,
    Ikshwaku
  • Hi Ikshwaku,
    Execute viddec3test -w 1280x800 stream.mp4 .

    Surface-id will be 9000+ pid.
    Let me know if you can execute this first.
  • Hello Ram,

    Getting this output and no display output:

    root@mmt2020-a880:~# viddec3test -w 1280x800 /tmp/USB1-1.1-sda1/Videos/B01_Baseline1.0_1280_720.MP4
    0x2e008: Opening Display..
    wayland display opened

    wayland registries obtained

    create ivi_client_surface with surface ID 9999 done.

    0x2e008: Opening Demuxer..
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/tmp/USB1-1.1-sda1/Videos/B01_Baseline1.0_1280_720.MP4':
    Metadata:
    major_brand : mp42
    minor_version : 1
    compatible_brands: isommp423gp5
    creation_time : 2011-12-29 08:22:24
    title : Toy Story 3 - Sample_AAC_faac_DolbyProLogicII.mp4.MP4
    artist : created with SUPER(C).v2011.bld.49
    encoder : eRightSoft
    comment : 16:22:45
    Duration: 00:01:02.92, start: 0.000000, bitrate: 8567 kb/s
    Stream #0.0(und): Video: h264 (Constrained Baseline), yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 8498 kb/s, 29.97 fps, 29.97 tbr, 2997 tbn, 59.94 tbc
    Metadata:
    creation_time : 2011-12-30 08:21:33
    Stream #0.1(und): Audio: aac, 32000 Hz, stereo, fltp, 63 kb/s
    Metadata:
    creation_time : 2011-12-29 08:22:28
    Stream #0.2(und): Data: mp4s / 0x7334706D, 0 kb/s
    Metadata:
    creation_time : 2011-12-29 08:22:33
    Stream #0.3(und): Data: mp4s / 0x7334706D, 0 kb/s
    Metadata:
    creation_time : 2011-12-29 08:22:33
    initializing bitstream filter
    0x2e008: infile=/tmp/USB1-1.1-sda1/Videos/B01_Baseline1.0_1280_720.MP4, width=1280, height=720
    0x2e008: padded_width=1408, padded_height=816, num_buffers=12
    ERROR:post_buffer:245: post_buffer not supported
    0x2e008: uv_offset=1148928
    0x2e008: Opening Engine..
    displayBufsMode: 1
    0x2e008: end of input
    ERROR:decoder_process:415: 0x2e008: process returned error: -1
    ERROR:decoder_process:416: 0x2e008: extendedError: 00040000

    Regards,
    Ikshwaku

  • Hi Ikshwaku,
    Since we don't have HMI, we use the utilities provided by wayland-ivi-extension to execute applications in ivi-shell.
    Below is the steps we followed
    a) Launch weston with ivi-shell
    b) Execute layer-add-surfaces 1000 1 & ---> This is to add one surface one layer with id 1000
    c) Execute viddec3test -w 1280x800 /tmp/USB1-1.1-sda1/Videos/B01_Baseline1.0_1280_720.MP4 &
    It will show the surface-id created on console and video will be seen on display. It is 9999 in your case.
    d) LayerManagerControl dump surface 9999 to surface.png
    surface.png will have the screen shot taken for the surface.

    Please try this and let me know if output png has proper image.
  • Hello Ram,

    Yes with the commands you shared I am able to get the proper surface dump.
    Any idea why its not working when we are running it through gstreamer pipeline.

    Regards,
    Ikshwaku
  • Hi Ikshwaku,
    I am not sure why this can happen with gstreamer. Did you get chance to try with these options I mentioned?
    1) If you are using playbin, try with explicit pipeline (with and without vpe element after ducati) and
    2) Check with explicit pipeline with software decoder
    3) Check if any other gstreamer pipeline which doesn't involve video playback shows the dump. For ex:
    gst-launch-1.0 videotestsrc ! 'video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720' ! waylandsink use-drm=true
    and
    gst-launch-1.0 videotestsrc ! 'video/x-raw, format=(string)NV12, width=(int)640, height=(int)480' ! vpe ! 'video/x-raw, format=(string)NV12, width=(int)1280, height=(int)800' ! waylandsink use-drm=true
  • Hello Ram,

    I have used following pipelines:

    1. gst-launch-1.0 playbin uri=file:///tmp/USB1-1.1-sda1/Videos/B01_Baseline1.0_1280_720.MP4 video-sink=waylandsink
    2. gst-launch-1.0 filesrc location=/tmp/USB1-1.4-sda1/Videos/B01_Baseline1.0_1280_720.MP4 ! qtdemux ! h264parse ! ducatih264dec ! waylandsink
    3. gst-launch-1.0 filesrc location=/tmp/USB1-1.1-sda1/Videos/B01_Baseline1.0_1280_720.MP4 ! qtdemux ! h264parse ! ducatih264decvpe ! waylandsink
    4. gst-launch-1.0 filesrc location=/tmp/USB1-1.1-sda1/Videos/B01_Baseline1.0_1280_720.MP4 ! qtdemux ! h264parse ! avdec_h264 ! waylandsink use-drm=true
    5. gst-launch-1.0 videotestsrc ! 'video/x-raw, format=(string)NV12, width=(int)640, height=(int)480' ! vpe ! 'video/x-raw, format=(string)NV12, width=(int)1280, height=(int)800' ! waylandsink use-drm=true
    6. gst-launch-1.0 videotestsrc ! 'video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720' ! waylandsink use-drm=true

    But, surface dump is not coming for any of the above pipelines.

    one more thing how you are playing the video with viddec3test?

  • Hi Ikshwaku,
    Can you get details if how ivi-shell is enabled with waylandsink? TI provided waylandsink supports only desktop-shell.
  • Hello Ram,

    Shared the details with you through portal.

    Regards,
    Ikshwaku
  • Hello Ram,

    I have configured my target for desktop-shell by using the following steps:

    File: /etc/xdg/weston/weston.ini

    For ivi-shell:

    [core]
    shell=ivi-shell.so
    modules=systemd-notify.so
    #shell=desktop-shell.so

    [ivi-shell]
    ivi-module=ivi-controller.so
    #ivi-module=hmi-controller.so
    ivi-input-module=ivi-input-controller.so
    #ivi-shell-user-interface=/usr/lib/weston/weston-ivi-shell-user-interface

    For desk-top shell (changes marked in yellow)

    [core]
    #shell=ivi-shell.so
    modules=systemd-notify.so
    shell=desktop-shell.so

    #[ivi-shell]
    #ivi-module=ivi-controller.so
    #ivi-module=hmi-controller.so
    #vi-input-module=ivi-input-controller.so
    #ivi-shell-user-interface=/usr/lib/weston/weston-ivi-shell-user-interface



    For desktop shell to work on latest SDK2 which have M4 display server solution , you need following changes too in addition to above configuration. Previously we just needed above change in weston.ini.

    1. path is different so , you need to copy

    #mkdir /usr/libexec
    #cp -f /usr/lib/weston/weston-desktop-shell /usr/libexec/
    #sync

    2. need libpng.so. Attached here libs. Or can be copied from sdk2 build.
    cp -arvpf /usb/MMT2020/libjpeg_image/usr/lib/* /usr/lib
    mkdir /usr/share/weston

    3. Somehow images are missing in /usr/share/weston, so you need to copy

    cp -f /mnt/swdl/usr/share/weston/*.png /usr/share/weston/
    sync

    but after that when I am running gstreamer pipeline getting these errors:

    gst-launch-1.0 playbin uri=file:///tmp/USB3-1.4-sda1/Videos/B01_Baseline1.0_1280_720.MP4 video-sink=waylandsink
    Setting pipeline to PAUSED ...

    (gst-launch-1.0:1839): GLib-CRITICAL **: g_thread_join: assertion 'thread' failed
    Caught SIGSEGV
    #0 0xb6cd3d64 in waitpid () from /lib/libpthread.so.0
    #1 0xb6d067f0 in g_on_error_stack_trace () from /usr/lib/libglib-2.0.so.0
    #2 0xb6d067f0 in g_on_error_stack_trace () from /usr/lib/libglib-2.0.so.0
    #3 0xb6d067f0 in g_on_error_stack_trace () from /usr/lib/libglib-2.0.so.0
    #4 0xb6d067f0 in g_on_error_stack_trace () from /usr/lib/libglib-2.0.so.0
    #5 0xb6d067f0 in g_on_error_stack_trace () from /usr/lib/libglib-2.0.so.0

    Any idea about this.

    Regards,
    Ikshwaku
  • Hi Ikshwaku,
    Did you revert your ilm patch on waylandsink ?
  • Hello Ram,

    Thanks for the input I missed the waylandsink.Now it is playing.
    With desktop-shell how we can take the surface dump?

    Thanks,
    Ikshwaku
  • Hi Ikshwaku,
    I think in desktop shell we don't have option to take snapshot because there doesn't exist LayerManagerControl.
    but weston supports the actual function gl_renderer_surface_copy_content() which does the actual function when surface dump is called but not sure how this can be called from client in desktop-shell.

    I applied your patch, I see only 86 bytes of png generated and a dot at the center. Not sure if the issue is with a) waylandsink,or b) wayland-ivi-extension or c)weston.

    LayerManagerControl doesn't throw any error also.
  • Hello Ram,

    Do we have any other videosink plugin that we can use for play back, If yes please share the pipeline and steps to use it.


    Thanks,
    Ikshwaku
  • Hi Ikshwaku,
    kmssink is available as one more videosink. Just set video-sink=kmssink in your pipleline.
    But kmssink to work, weston needs to stopped first. If you have more than one display connected, then use "connector" property to set the connector-id of first or second display.
    Run modetest to know the connector-ids available in your system
  • Hello Ram,

    I wants to take surface dump of the video playback and downsize the issue, if it is specific to waylandsink or not.
    If weston is stopped then LayerManagerControl command will not work.

    We also have video4linux2, for using this plugin do we need any specific changes or it will work with existing system.

  • Hi Ikshwaku,
    Surface dump screenshot option is available only with waylandsink with ivi-shell.
    There is option to take the screenshot in desktop-shell by connecting a key-board to the board and CTRL+S or some key would take the dump but this will be for full screen.

    Can you let me know what is the usecase which requires to take surface dump?
  • Hello Ram,

    we need this for debugging some screen lag issues.