UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor pfarrokhi
Visitor
780 Views
Registered: ‎10-31-2019

Transcode video by VCU using PL RAM

Jump to solution

Hi. I tried to use VCU for transcoding video using PL RAM but it stucks. Details of what ever I did is like below:

I'm using UltraScale+ ZCU104 board.

I refer to H.264/H.265 Video Codec Unit v1.2, PG252 May 22, 2019

I use xilinx-zcu104-v2018.3-final-v2.bsp to build a PetaLinux project using this command:

petalinux-create -t project -s xilinx-zcu104-v2018.3-final-v2.bsp -n new_pl_ram

Edit system-user.dtsi in project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi and its contents are like below:

/include/ "system-conf.dtsi"
/ {
};

&amba_pl {
    video_m2m {
        compatible = "xlnx,mem2mem";
        dmas = <&v_frmbuf_rd_0 0>, <&v_frmbuf_wr_0 0>;
        dma-names = "tx", "rx";
    };
};

&vcu_ddr4_controller_0 {
    compatible = "xlnx,ddr4-2.2";
    reg = <0x00000048 0x00000000 0x0 0x80000000>;
    ranges;
    #address-cells = <2>;
    #size-cells = <2>;
    plmem_vcu_dec: pool@0 {
    reg = <0x48 0x00000000 0x0 0x70000000>;
    };
};

&decoder {
    xlnx,dedicated-mem = <&plmem_vcu_dec>;
};

Then build my PetaLinux project using below commad:

petalinux-build

After its building, I entered into directory images/linux/ and run below command:

petalinux-package --boot --force --fsbl images/linux/zynqmp_fsbl.elf --u-boot u-boot.elf --pmufw pmufw.elf --fpga

Then I boot the petalinux and make a directory in /var/volatile/ and run the following commands in the directory:

devmem 0xfd3b0008 w 0x3
devmem 0xfd3b001c w 0x3
devmem 0xfd3b0004 w 0xf
devmem 0xfd3b0018 w 0xf

devmem 0xfd390008 w 0x3
devmem 0xfd39001c w 0x3
devmem 0xfd390004 w 0xf
devmem 0xfd390018 w 0xf

devmem 0xfd3a0008 w 0x3
devmem 0xfd3a001c w 0x3
devmem 0xfd3a0004 w 0xf
devmem 0xfd3a0018 w 0xf

devmem 0xfd360008 w 0x3
devmem 0xfd36001c w 0x3
devmem 0xfd360004 w 0x7
devmem 0xfd360018 w 0x7

And this command too:

v4l2-ctl -d /dev/video0 --set-fmt-video=width=3840, height=2160, pixelformat='XV20'

What ever I did untill now is exactly what is told in that datasheet. Then I try commads from datasheet, but I got following problems:

There is no file named "1600frames.h264" in /run/ so I use my own .h264 file named input.h264 that is a .h264 created by ffmpeg using following command:

ffmpeg -i test1_cut.mp4 input.h264

Its original .mp4 details are like below:

1785 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc 225KB 1080p

Then when I use command I write below, I recive error attached below it:

command:

gst-launch-1.0 filesrc location=input.h264 ! h264parse ! queue ! omxh264dec internal-entropy-buffers=7 ! queue max-size-bytes=0 ! v4l2video0convert output-io-mode=5 capture-io-mode=4 disable-passthrough=1 import-buffer-alignment=true ! omxh265enc num-slices=8 prefetch-buffer=true ! filesink location=out.h265

error:

[ 8101.615612] xilinx-mem2mem amba_pl@0:video_m2m: Created instance ffffffc007472218, m2m_ctx: ffffffc007aec000
WARNING: erroneous pipeline: no property "import-buffer-alignment" in element "v4l2video0convert0"

I try to change my source file to make sure its format is ok by using directly my .mp4 video and write the following command:

gst-launch-1.0 filesrc location=test1_1080p.mp4 ! qtdemux name=demux demux.video_0 !  h264parse ! queue ! omxh264dec internal-entropy-buffers=7 ! queue max-size-bytes=0 ! v4l2video0convert output-io-mode=5 capture-io-mode=4 disable-passthrough=1 import-buffer-alignment=true ! omxh265enc num-slices=8 prefetch-buffer=true ! filesink location=out.h265 location=out.h265

And get same error:

[ 8963.466623] xilinx-mem2mem amba_pl@0:video_m2m: Created instance ffffffc01f691718, m2m_ctx: ffffffc026b52000
WARNING: erroneous pipeline: no property "import-buffer-alignment" in element "v4l2video0convert0"

I can tell you what ever missing if you want. Just ask if still something to say. Here are my questions:

1. What is wrong with what I did?

2. What is the correct prodecure to use pl-ram in transcoding video?

3. How can I test PL-RAM alone in petalinux to make sure there is no problem with my pl-ram?

Thanks in advance,

Regards

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
319 Views
Registered: ‎08-01-2007

Re: Transcode video by VCU using PL RAM

Jump to solution

Glad to see you made some progress here.  The problem seems to be down to getting the DisplayPort sink device to working.


A good test is to start by just using the modetest tool to test your display.  Then using the suggested GStreamer pipeline once you have verified that your monitor can support the output resolution of the video you are trying to decode.  For example if you monitor only supports 1080p and you are trying to decode a 4Kp30 video then you will have trouble getting it to display.

The ZynqMP DisplayPort Linux driver Wiki page has a lot of good debug information on debuging and testing.  I recommend reading the full page, but particullary the DRM section.


I also wanted to add a few addtional notes:

Here are a few things I noticed:

First, before you spend too much time trying the PL-DDR, it would also be useful to know if you have trouble when default BSP with the PS-DDR.

Second, I was looking over the errors and noticed that you are using the 2018.3 BSP.  This is over a year old now.  Because there have been numerous fixes to the solution including some in the PL IP as well as to the VCU software stack.  I recommend you look at using the 2019.2 BSP which was just recently released.  If you continue to see issues after trying the latest version, then reply with the most recent errors.

Thrid, I noticed that you have a v4l2video0convert in your pipeline.  It isn't recommend to use components like this, as they will typically result in software memory copies, which are inefficient and will adversely affect performance.  I recommend you look at some of the example Pipelines in the Zynq UltraScale+ MPSoC VCU Product Guide PG252.  Or by looking at some of the examples used with the Zynq UltraScale+ MPSoC VCU ZCU106 TRD.  Even though you are not using this particular board, you can at least see how some of the GStreamer pipelines were constructed as there are several designs that use the PL-DDR and PS-DDR.

Fourth you didn't mention it for sure, but I believe you were looking at the PG252 on what modifications need to be made to the BSP designs to enable PL-DDR.  If you haven't, then I recommend you review this information as well when moving to a new PL-DDR design.

Chris
Video Design Hub | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------

View solution in original post

15 Replies
Voyager
Voyager
755 Views
Registered: ‎07-06-2016

Re: Transcode video by VCU using PL RAM

Jump to solution

Hi,

Have you tried to run the pipeline wihout the "import-buffer-alignment" property?

If you run: "gst-inspect-1.0 v4l2video0convert"  do you get that property?

 

0 Kudos
Visitor pfarrokhi
Visitor
745 Views
Registered: ‎10-31-2019

Re: Transcode video by VCU using PL RAM

Jump to solution

Hi. Thank you for your reply. There are your answers:

1) When I remove it from pipeline, I get so many massages that include a error like previous one. But at last it stuck and don't return. I think we must not remove it from pipe.

2) I write the command you said and here is its responses:

[13858.812065] xilinx-mem2mem amba_pl@0:video_m2m: Created instance ffffffc01f691018, m2m_ctx: ffffffc006f3b000
Factory Details:
  Rank                     none (0)
  Long-name                V4L2 Video Co[13858.827722] xilinx-mem2mem amba_pl@0:video_m2m: Created instance ffffffc026b02618, m2m_ctx: ffffffc006f3b000
nverter
  Klass                    Filter/Converter/Video/Scaler
  Description              Transform streams via V4L2 API
  Author                   Nicolas Dufresne <nicolas.dufresne@collabora.com>

Plugin Details:
  Name                     video4linux2
  Description              elements for Video 4 Linux
  Filename                 /usr/lib/gstreamer-1.0/libgstvideo4linux2.so
  Version                  1.12.2
  License                  LGPL
  Source module            gst-plugins-good
  Source release date      2017-07-14
  Binary package           GStreamer Good Plug-ins source release
  Origin URL               Unknown package origin

GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstBaseTransform
                         +----GstV4l2Transform
                               +----v4l2video0convert

Pad Templates:
  SINK template: 'sink'
    Availability: Always
    Capabilities:
      video/x-raw
                 format: NV16_10LE32
                  width: [ 1, 32768 ]
                 height: [ 1, 32768 ]
              framerate: [ 0/1, 2147483647/1 ]

  SRC template: 'src'
    Availability: Always
    Capabilities:
      video/x-raw
                 format: NV16_10LE32
                  width: [ 1, 32768 ]
                 height: [ 1, 32768 ]
              framerate: [ 0/1, 2147483647/1 ]


Element Flags:
  no flags set

Element Implementation:
  Has change_state() function: gst_v4l2_transform_change_state

Element has no clocking capabilities.
Element has no URI handling capabilities.

Pads:
  SINK: 'sink'
    Pad Template: 'sink'
  SRC: 'src'
    Pad Template: 'src'

Element Properties:
  name                : The name of the object
                        flags: readable, writable
                        String. Default: "v4l2video0convert0"
  parent              : The parent of the object
                        flags: readable, writable
                        Object of type "GstObject"
  qos                 : Handle Quality-of-Service events
                        flags: readable, writable
                        Boolean. Default: true
  device              : Device location
                        flags: readable
                        String. Default: "/dev/video0"
  device-name         : Name of the device
                        flags: readable
                        String. Default: "xilinx-mem2mem"
  device-fd           : File descriptor of the device
                        flags: readable
                        Integer. Range: -1 - 2147483647 Default: -1 
  output-io-mode      : Output side I/O mode (matches sink pad)
                        flags: readable, writable
                        Enum "GstV4l2IOMode" Default: 0, "auto"
                           (0): auto             - GST_V4L2_IO_AUTO
                           (1): rw               - GST_V4L2_IO_RW
                           (2): mmap             - GST_V4L2_IO_MMAP
                           (3): userptr          - GST_V4L2_IO_USERPTR
                           (4): dmabuf           - GST_V4L2_IO_DMABUF
                           (5): dmabuf-import    - GST_V4L2_IO_DMABUF_IMPORT
  capture-io-mode     : Capture I/O mode (matches src pad)
                        flags: readable, writable
                        Enum "GstV4l2IOMode" Default: 0, "auto"
                           (0): auto             - GST_V4L2_IO_AUTO
                           (1): rw               - GST_V4L2_IO_RW
                           (2): mmap             - GST_V4L2_IO_MMAP
                           (3): userptr          - GST_V4L2_IO_USERPTR
                           (4): dmabuf           - GST_V4L2_IO_DMABUF
                           (5): dmabuf-import    - GST_V4L2_IO_DMABUF_IMPORT
  extra-controls      : Extra v4l2 controls (CIDs) for the device
                        flags: readable, writable
                        Boxed pointer of type "GstStructure"
  disable-passthrough : Forces passing buffers through the converter
                        flags: readable, writable
                        Boolean. Default: false
0 Kudos
Voyager
Voyager
732 Views
Registered: ‎07-06-2016

Re: Transcode video by VCU using PL RAM

Jump to solution

Hi, 

The "import-buffer-alignment"  property is not listed in the Element properties of the v4l2video0convert element, so it might be stopping the pipeline as it can't find it, I would remove that property anyway and see what the other messages say.

The problem might be somewhere else, what the messages say when you remove import-buffer-alignment?

0 Kudos
Visitor pfarrokhi
Visitor
725 Views
Registered: ‎10-31-2019

Re: Transcode video by VCU using PL RAM

Jump to solution

I remove most of its options and now its like that:

gst-launch-1.0 filesrc location=input.h264 ! h264parse ! queue ! omxh264dec internal-entropy-buffers=7 ! queue max-size-bytes=0 ! v4l2video0convert output-io-mode=5 capture-io-mode=4 ! omxh265enc num-slices=8 prefetch-buffer=true ! filesink location=out.h265

But still stuck after these messages:

[15858.039707] xilinx-mem2mem amba_pl@0:video_m2m: Created instance ffffffc006c80d18, m2m_ctx: ffffffc006ff3000
Setting pipeline to PAUSED ...
[15858.064497] xilinx-mem2mem amba_pl@0:video_m2m: Created instance ffffffc007845818, m2m_ctx: ffffffc006ff3000
Pipeline is PREROLLING ...
Redistribute latency...
[15858.084941] Unable to handle kernel paging request at virtual address ffffffc800108000
[15858.092857] Mem abort info:
[15858.095633]   Exception class = DABT (current EL), IL = 32 bits
[15858.101546]   SET = 0, FnV = 0
[15858.104586]   EA = 0, S1PTW = 0
[15858.107714] Data abort info:
[15858.110589]   ISV = 0, ISS = 0x00000145
[15858.114421]   CM = 1, WnR = 1
[15858.117384] swapper pgtable: 4k pages, 39-bit VAs, pgd = ffffff80090d8000
[15858.124170] [ffffffc800108000] *pgd=0000000000000000, *pud=0000000000000000
[15858.131124] Internal error: Oops: 96000145 [#9] SMP
[15858.135986] Modules linked in: al5d(O) al5e(O) allegro(O) xlnx_vcu_clk xlnx_vcu xlnx_vcu_core mali(O) uio_pdrv_genirq
[15858.146596] CPU: 1 PID: 3840 Comm: gst-launch-1.0 Tainted: G      D    O    4.14.0-xilinx-v2018.3 #1
[15858.155715] Hardware name: ZynqMP ZCU104 RevC (DT)
[15858.160490] task: ffffffc0263cc580 task.stack: ffffff8010610000
[15858.166398] PC is at __clean_dcache_area_poc+0x20/0x38
[15858.171525] LR is at __swiotlb_map_sg_attrs+0x78/0xa8
[15858.176565] pc : [<ffffff8008095ba8>] lr : [<ffffff8008093820>] pstate: 80000145
[15858.183942] sp : ffffff80106138a0
[15858.187241] x29: ffffff80106138a0 x28: ffffffc0263cc580 
[15858.192536] x27: ffffff8008a67000 x26: ffffffc007456600 
[15858.197830] x25: ffffffc007456e80 x24: ffffff8008d21000 
[15858.203125] x23: 0000000000000000 x22: ffffffc02604ac10 
[15858.208420] x21: 0000000000000001 x20: 0000000000000001 
[15858.213715] x19: ffffffc007456e80 x18: 0000000000000530 
[15858.219009] x17: 0000007f8963b738 x16: ffffff80081afe98 
[15858.224304] x15: 0000007f8a4d3d00 x14: 0000007f8a4e0d98 
[15858.229599] x13: 000000000000270f x12: 0000000000000030 
[15858.234894] x11: 0101010101010101 x10: 7f7f7f7f7f7f7f7f 
[15858.240189] x9 : 0000000000000000 x8 : ffffffc007456ea0 
[15858.245483] x7 : 0000000000000002 x6 : 0000000000001000 
[15858.250778] x5 : ffffff80080937a8 x4 : 0000000000000000 
[15858.256073] x3 : 000000000000003f x2 : 0000000000000040 
[15858.261368] x1 : ffffffc800109000 x0 : ffffffc800108000 
[15858.266664] Process gst-launch-1.0 (pid: 3840, stack limit = 0xffffff8010610000)
[15858.274041] Call trace:
[15858.276473] Exception stack(0xffffff8010613760 to 0xffffff80106138a0)
[15858.282897] 3760: ffffffc800108000 ffffffc800109000 0000000000000040 000000000000003f
[15858.290708] 3780: 0000000000000000 ffffff80080937a8 0000000000001000 0000000000000002
[15858.298521] 37a0: ffffffc007456ea0 0000000000000000 7f7f7f7f7f7f7f7f 0101010101010101
[15858.306333] 37c0: 0000000000000030 000000000000270f 0000007f8a4e0d98 0000007f8a4d3d00
[15858.314145] 37e0: ffffff80081afe98 0000007f8963b738 0000000000000530 ffffffc007456e80
[15858.321956] 3800: 0000000000000001 0000000000000001 ffffffc02604ac10 0000000000000000
[15858.329769] 3820: ffffff8008d21000 ffffffc007456e80 ffffffc007456600 ffffff8008a67000
[15858.337581] 3840: ffffffc0263cc580 ffffff80106138a0 ffffff8008093820 ffffff80106138a0
[15858.345393] 3860: ffffff8008095ba8 0000000080000145 ffffffc007456e80 ffffffc007456600
h-buffer=true ! filesink location=out.h265enc num-slices=8 prefetch
[15872.575539] xilinx-mem2mem amba_pl@0:video_m2m: Created instance ffffffc01f633b18, m2m_ctx: ffffffc026b52000
Setting pipeline to PAUSED ...
[15872.600195] xilinx-mem2mem amba_pl@0:video_m2m: Created instance ffffffc00750d518, m2m_ctx: ffffffc026b52000
Pipeline is PREROLLING ...
Redistribute latency...
[15872.620475] Unable to handle kernel paging request at virtual address ffffffc800109000
[15872.628393] Mem abort info:
[15872.631170]   Exception class = DABT (current EL), IL = 32 bits
[15872.637081]   SET = 0, FnV = 0
[15872.640122]   EA = 0, S1PTW = 0
[15872.643251] Data abort info:
[15872.646125]   ISV = 0, ISS = 0x00000145
[15872.649957]   CM = 1, WnR = 1
[15872.652921] swapper pgtable: 4k pages, 39-bit VAs, pgd = ffffff80090d8000
[15872.659696] [ffffffc800109000] *pgd=0000000000000000, *pud=0000000000000000
[15872.666651] Internal error: Oops: 96000145 [#10] SMP
[15872.671601] Modules linked in: al5d(O) al5e(O) allegro(O) xlnx_vcu_clk xlnx_vcu xlnx_vcu_core mali(O) uio_pdrv_genirq
[15872.682211] CPU: 2 PID: 3853 Comm: gst-launch-1.0 Tainted: G      D    O    4.14.0-xilinx-v2018.3 #1
[15872.691330] Hardware name: ZynqMP ZCU104 RevC (DT)
[15872.696105] task: ffffffc007908100 task.stack: ffffff8010650000
[15872.702014] PC is at __clean_dcache_area_poc+0x20/0x38
[15872.707141] LR is at __swiotlb_map_sg_attrs+0x78/0xa8
[15872.712180] pc : [<ffffff8008095ba8>] lr : [<ffffff8008093820>] pstate: 80000145
[15872.719557] sp : ffffff80106538a0
[15872.722855] x29: ffffff80106538a0 x28: ffffffc007908100 
[15872.728150] x27: ffffff8008a67000 x26: ffffffc026a86f00 
[15872.733445] x25: ffffffc026a86e80 x24: ffffff8008d21000 
[15872.738740] x23: 0000000000000000 x22: ffffffc02604ac10 
[15872.744035] x21: 0000000000000001 x20: 0000000000000001 
[15872.749329] x19: ffffffc026a86e80 x18: 0000000000000530 
[15872.754624] x17: 0000007f883f9738 x16: ffffff80081afe98 
[15872.759919] x15: 0000007f89291d00 x14: 0000007f8929ed98 
[15872.765214] x13: 000000000000270f x12: 0000000000000000 
[15872.770509] x11: ffffff8008e075e8 x10: ffffff8008e075ef 
[15872.775803] x9 : 0000000000000000 x8 : ffffffc026a86ea0 
[15872.781098] x7 : 0000000000000002 x6 : 0000000000001000 
[15872.786393] x5 : ffffff80080937a8 x4 : 0000000000000000 
[15872.791688] x3 : 000000000000003f x2 : 0000000000000040 
[15872.796983] x1 : ffffffc80010a000 x0 : ffffffc800109000 
[15872.802279] Process gst-launch-1.0 (pid: 3853, stack limit = 0xffffff8010650000)
[15872.809655] Call trace:
[15872.812088] Exception stack(0xffffff8010653760 to 0xffffff80106538a0)
[15872.818512] 3760: ffffffc800109000 ffffffc80010a000 0000000000000040 000000000000003f
[15872.826323] 3780: 0000000000000000 ffffff80080937a8 0000000000001000 0000000000000002
[15872.834135] 37a0: ffffffc026a86ea0 0000000000000000 ffffff8008e075ef ffffff8008e075e8
[15872.841947] 37c0: 0000000000000000 000000000000270f 0000007f8929ed98 0000007f89291d00
[15872.849759] 37e0: ffffff80081afe98 0000007f883f9738 0000000000000530 ffffffc026a86e80
[15872.857571] 3800: 0000000000000001 0000000000000001 ffffffc02604ac10 0000000000000000
[15872.865384] 3820: ffffff8008d21000 ffffffc026a86e80 ffffffc026a86f00 ffffff8008a67000
[15872.873196] 3840: ffffffc007908100 ffffff80106538a0 ffffff8008093820 ffffff80106538a0
[15872.881008] 3860: ffffff8008095ba8 0000000080000145 ffffffc026a86e80 ffffffc026a86f00
[15872.888820] 3880: 0000008000000000 ffffffc007908100 ffffff80106538a0 ffffff8008095ba8
[15872.896632] [<ffffff8008095ba8>] __clean_dcache_area_poc+0x20/0x38
[15872.902812] [<ffffff8000ad5464>] al5_dmabuf_map+0x10c/0x1d0 [allegro]
[15872.909238] [<ffffff80085b9d48>] dma_buf_map_attachment+0x20/0x48
[15872.915326] [<ffffff8000ad5754>] al5_dmabuf_get_address+0x4c/0xc8 [allegro]
[15872.922278] [<ffffff8000ad4278>] al5_ioctl_get_dma_fd+0x80/0xd0 [allegro]
[15872.929054] [<ffffff8000aed3ec>] al5d_ioctl+0x19c/0x4a8 [al5d]
[15872.934877] [<ffffff80081af764>] do_vfs_ioctl+0xa4/0x7d8
[15872.940178] [<ffffff80081afedc>] SyS_ioctl+0x44/0x80
[15872.945125] Exception stack(0xffffff8010653ec0 to 0xffffff8010654000)
[15872.951550] 3ec0: 000000000000000a 00000000c00c710d 0000007f70003800 0000000000001000
[15872.959362] 3ee0: 0000000000000080 0000000000004554 0000000000000000 0000000000000000
[15872.967174] 3f00: 000000000000001d 0000007f86b058e0 0101010101010101 0000000000000000
[15872.974986] 3f20: 0000000000000001 000000000000270f 0000007f8929ed98 0000007f89291d00
[15872.982798] 3f40: 0000007f89352ef0 0000007f883f9738 0000000000000530 0000007f70003800
[15872.990610] 3f60: 0000000000000080 000000000c3b3890 0000000000000080 0000007f7e7fc818
[15872.998422] 3f80: 0000007f7dfc63f8 0000007f7dfc6010 000000000c3b3890 0000007f7dfc6118
[15873.006234] 3fa0: 0000007f7dfc6140 0000007f86b046c0 0000007f883d6874 0000007f86b046c0
[15873.014046] 3fc0: 0000007f89352efc 0000000080000000 000000000000000a 000000000000001d
[15873.021857] 3fe0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[15873.029670] [<ffffff80080837b0>] el0_svc_naked+0x24/0x28
[15873.034966] Code: 9ac32042 8b010001 d1000443 8a230000 (d50b7a20) 
[15873.041049] ---[ end trace 95bae29aec4af1fc ]---
0 Kudos
Voyager
Voyager
717 Views
Registered: ‎07-06-2016

Re: Transcode video by VCU using PL RAM

Jump to solution

It looks like a memory segmentation issue.

I would try the next:

- Set "output-io-mode" and "capture-io-mode" to 4.

- If still doesn't work I would remove the v4l2video0convert element  from the pipeline and check what it's causing the segmentation issue.

0 Kudos
Visitor pfarrokhi
Visitor
699 Views
Registered: ‎10-31-2019

Re: Transcode video by VCU using PL RAM

Jump to solution

I remove the element compeletly and here is its answer:

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Redistribute latency...
[19696.196141] Unable to handle kernel paging request at virtual address ffffffc80010b000
[19696.204058] Mem abort info:
[19696.206836]   Exception class = DABT (current EL), IL = 32 bits
[19696.212747]   SET = 0, FnV = 0
[19696.215784]   EA = 0, S1PTW = 0
[19696.218914] Data abort info:
[19696.221786]   ISV = 0, ISS = 0x00000145
[19696.225615]   CM = 1, WnR = 1
[19696.228577] swapper pgtable: 4k pages, 39-bit VAs, pgd = ffffff80090d8000
[19696.235355] [ffffffc80010b000] *pgd=0000000000000000, *pud=0000000000000000
[19696.242316] Internal error: Oops: 96000145 [#12] SMP
[19696.247267] Modules linked in: al5d(O) al5e(O) allegro(O) xlnx_vcu_clk xlnx_vcu xlnx_vcu_core mali(O) uio_pdrv_genirq
[19696.257877] CPU: 2 PID: 4140 Comm: gst-launch-1.0 Tainted: G      D    O    4.14.0-xilinx-v2018.3 #1
[19696.266996] Hardware name: ZynqMP ZCU104 RevC (DT)
[19696.271771] task: ffffffc026bd8f00 task.stack: ffffff8010bf8000
[19696.277679] PC is at __clean_dcache_area_poc+0x20/0x38
[19696.282807] LR is at __swiotlb_map_sg_attrs+0x78/0xa8
[19696.287846] pc : [<ffffff8008095ba8>] lr : [<ffffff8008093820>] pstate: 80000145
[19696.295223] sp : ffffff8010bfb8a0
[19696.298522] x29: ffffff8010bfb8a0 x28: ffffffc026bd8f00 
[19696.303817] x27: ffffff8008a67000 x26: ffffffc025f20900 
[19696.309111] x25: ffffffc01f5b5e00 x24: ffffff8008d21000 
[19696.314406] x23: 0000000000000000 x22: ffffffc02604ac10 
[19696.319701] x21: 0000000000000001 x20: 0000000000000001 
[19696.324996] x19: ffffffc01f5b5e00 x18: 0000000000000530 
[19696.330290] x17: 0000007fb8956738 x16: ffffff80081afe98 
[19696.335585] x15: 0000007fb94f8d00 x14: 0000007fb9505d98 
[19696.340880] x13: 000000000000270f x12: 0000000000000030 
[19696.346175] x11: 0101010101010101 x10: 7f7f7f7f7f7f7f7f 
[19696.351469] x9 : 0000000000000000 x8 : ffffffc01f5b5e20 
[19696.356764] x7 : 0000000000000002 x6 : 0000000000001000 
[19696.362059] x5 : ffffff80080937a8 x4 : 0000000000000000 
[19696.367354] x3 : 000000000000003f x2 : 0000000000000040 
[19696.372649] x1 : ffffffc80010c000 x0 : ffffffc80010b000 
[19696.377945] Process gst-launch-1.0 (pid: 4140, stack limit = 0xffffff8010bf8000)
[19696.385322] Call trace:
[19696.387754] Exception stack(0xffffff8010bfb760 to 0xffffff8010bfb8a0)
[19696.394178] b760: ffffffc80010b000 ffffffc80010c000 0000000000000040 000000000000003f
[19696.401989] b780: 0000000000000000 ffffff80080937a8 0000000000001000 0000000000000002
[19696.409802] b7a0: ffffffc01f5b5e20 0000000000000000 7f7f7f7f7f7f7f7f 0101010101010101
[19696.417613] b7c0: 0000000000000030 000000000000270f 0000007fb9505d98 0000007fb94f8d00
[19696.425426] b7e0: ffffff80081afe98 0000007fb8956738 0000000000000530 ffffffc01f5b5e00
[19696.433237] b800: 0000000000000001 0000000000000001 ffffffc02604ac10 0000000000000000
[19696.441050] b820: ffffff8008d21000 ffffffc01f5b5e00 ffffffc025f20900 ffffff8008a67000
[19696.448862] b840: ffffffc026bd8f00 ffffff8010bfb8a0 ffffff8008093820 ffffff8010bfb8a0
[19696.456673] b860: ffffff8008095ba8 0000000080000145 ffffffc01f5b5e00 ffffffc025f20900
[19696.464486] b880: 0000008000000000 ffffffc026bd8f00 ffffff8010bfb8a0 ffffff8008095ba8
[19696.472298] [<ffffff8008095ba8>] __clean_dcache_area_poc+0x20/0x38
[19696.478470] [<ffffff8000ad5464>] al5_dmabuf_map+0x10c/0x1d0 [allegro]
[19696.484895] [<ffffff80085b9d48>] dma_buf_map_attachment+0x20/0x48
[19696.490983] [<ffffff8000ad5754>] al5_dmabuf_get_address+0x4c/0xc8 [allegro]
[19696.497935] [<ffffff8000ad4278>] al5_ioctl_get_dma_fd+0x80/0xd0 [allegro]
[19696.504712] [<ffffff8000aed3ec>] al5d_ioctl+0x19c/0x4a8 [al5d]
[19696.510534] [<ffffff80081af764>] do_vfs_ioctl+0xa4/0x7d8
[19696.515836] [<ffffff80081afedc>] SyS_ioctl+0x44/0x80
[19696.520783] Exception stack(0xffffff8010bfbec0 to 0xffffff8010bfc000)
[19696.527207] bec0: 0000000000000007 00000000c00c710d 0000007f980037c0 0000000000001000
[19696.535019] bee0: 0000000000000080 0000000000004554 0000000000000000 0000000000000000
[19696.542831] bf00: 000000000000001d 0000007fb70628e0 0101010101010101 0000000000000000
[19696.550643] bf20: 0000000000000001 000000000000270f 0000007fb9505d98 0000007fb94f8d00
[19696.558455] bf40: 0000007fb95b9ef0 0000007fb8956738 0000000000000530 0000007f980037c0
[19696.566267] bf60: 0000000000000080 000000000186b260 0000000000000080 0000007fa6ffd818
[19696.574079] bf80: 0000007fa67c73f8 0000007fa67c7010 000000000186b260 0000007fa67c7118
[19696.581891] bfa0: 0000007fa67c7140 0000007fb70616c0 0000007fb8933874 0000007fb70616c0
[19696.589703] bfc0: 0000007fb95b9efc 0000000080000000 0000000000000007 000000000000001d
[19696.597515] bfe0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[19696.605327] [<ffffff80080837b0>] el0_svc_naked+0x24/0x28
[19696.610623] Code: 9ac32042 8b010001 d1000443 8a230000 (d50b7a20) 
[19696.616706] ---[ end trace 95bae29aec4af1fe ]---
0 Kudos
Voyager
Voyager
689 Views
Registered: ‎07-06-2016

Re: Transcode video by VCU using PL RAM

Jump to solution

Ok, So it looks like the v4l2video0convert element is not causing the issue...

Have you tried to simplify more the pipeline? like only decode de file? in order to shortcut the error.

Where is the file located?  it might be worth it to try different memory locations...

Visitor pfarrokhi
Visitor
670 Views
Registered: ‎10-31-2019

Re: Transcode video by VCU using PL RAM

Jump to solution

Thank you for your good advise. It looks like have problem even with simple decode. I coppy decode code from that pdf. The code is:

gst-launch-1.0 filesrc location=test1_cut.mp4 ! qtdemux name=demux demux.video_0 ! h264parse ! omxh264dec ! queue max-size-bytes=0 ! kmssink bus-id=fd4a0000.zynqmp-display fullscreen-overlay=1

But it stuck again with this message:

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Redistribute latency...
[ 3282.132853] Unable to handle kernel paging request at virtual address ffffffc800101000
[ 3282.140770] Mem abort info:
[ 3282.143548]   Exception class = DABT (current EL), IL = 32 bits
[ 3282.149458]   SET = 0, FnV = 0
[ 3282.152503]   EA = 0, S1PTW = 0
[ 3282.155629] Data abort info:
[ 3282.158500]   ISV = 0, ISS = 0x00000145
[ 3282.162326]   CM = 1, WnR = 1
[ 3282.165290] swapper pgtable: 4k pages, 39-bit VAs, pgd = ffffff80090d8000
[ 3282.172065] [ffffffc800101000] *pgd=0000000000000000, *pud=0000000000000000
[ 3282.179020] Internal error: Oops: 96000145 [#2] SMP
[ 3282.183883] Modules linked in: al5e(O) al5d(O) allegro(O) xlnx_vcu xlnx_vcu_clk xlnx_vcu_core mali(O) uio_pdrv_genirq
[ 3282.194493] CPU: 2 PID: 2819 Comm: gst-launch-1.0 Tainted: G      D    O    4.14.0-xilinx-v2018.3 #1
[ 3282.203612] Hardware name: ZynqMP ZCU104 RevC (DT)
[ 3282.208387] task: ffffffc00795c600 task.stack: ffffff800f288000
[ 3282.214296] PC is at __clean_dcache_area_poc+0x20/0x38
[ 3282.219423] LR is at __swiotlb_map_sg_attrs+0x78/0xa8
[ 3282.224462] pc : [<ffffff8008095ba8>] lr : [<ffffff8008093820>] pstate: 80000145
[ 3282.231839] sp : ffffff800f28b8a0
[ 3282.235138] x29: ffffff800f28b8a0 x28: ffffffc00795c600 
[ 3282.240433] x27: ffffff8008a67000 x26: ffffffc025c25980 
[ 3282.245728] x25: ffffffc025c25480 x24: ffffff8008d21000 
[ 3282.251022] x23: 0000000000000000 x22: ffffffc007800c10 
[ 3282.256317] x21: 0000000000000001 x20: 0000000000000001 
[ 3282.261612] x19: ffffffc025c25480 x18: 0000000000000530 
[ 3282.266907] x17: 0000007f8f3bc738 x16: ffffff80081afe98 
[ 3282.272202] x15: 0000007f90044d00 x14: 0000007f90051d98 
[ 3282.277496] x13: 000000000000270f x12: 0000000000000030 
[ 3282.282791] x11: 0101010101010101 x10: 7f7f7f7f7f7f7f7f 
[ 3282.288086] x9 : 0000000000000000 x8 : ffffffc025c254a0 
[ 3282.293381] x7 : 0000000000000002 x6 : 0000000000001000 
[ 3282.298676] x5 : ffffff80080937a8 x4 : 0000000000000000 
[ 3282.303970] x3 : 000000000000003f x2 : 0000000000000040 
[ 3282.309265] x1 : ffffffc800102000 x0 : ffffffc800101000 
[ 3282.314561] Process gst-launch-1.0 (pid: 2819, stack limit = 0xffffff800f288000)
[ 3282.321938] Call trace:
[ 3282.324370] Exception stack(0xffffff800f28b760 to 0xffffff800f28b8a0)
[ 3282.330794] b760: ffffffc800101000 ffffffc800102000 0000000000000040 000000000000003f
[ 3282.338606] b780: 0000000000000000 ffffff80080937a8 0000000000001000 0000000000000002
[ 3282.346418] b7a0: ffffffc025c254a0 0000000000000000 7f7f7f7f7f7f7f7f 0101010101010101
[ 3282.354230] b7c0: 0000000000000030 000000000000270f 0000007f90051d98 0000007f90044d00
[ 3282.362042] b7e0: ffffff80081afe98 0000007f8f3bc738 0000000000000530 ffffffc025c25480
[ 3282.369854] b800: 0000000000000001 0000000000000001 ffffffc007800c10 0000000000000000
[ 3282.377666] b820: ffffff8008d21000 ffffffc025c25480 ffffffc025c25980 ffffff8008a67000
[ 3282.385478] b840: ffffffc00795c600 ffffff800f28b8a0 ffffff8008093820 ffffff800f28b8a0
[ 3282.393290] b860: ffffff8008095ba8 0000000080000145 ffffffc025c25480 ffffffc025c25980
[ 3282.401102] b880: 0000008000000000 ffffffc00795c600 ffffff800f28b8a0 ffffff8008095ba8
[ 3282.408914] [<ffffff8008095ba8>] __clean_dcache_area_poc+0x20/0x38
[ 3282.415086] [<ffffff8000ad5464>] al5_dmabuf_map+0x10c/0x1d0 [allegro]
[ 3282.421520] [<ffffff80085b9d48>] dma_buf_map_attachment+0x20/0x48
[ 3282.427608] [<ffffff8000ad5754>] al5_dmabuf_get_address+0x4c/0xc8 [allegro]
[ 3282.434560] [<ffffff8000ad4278>] al5_ioctl_get_dma_fd+0x80/0xd0 [allegro]
[ 3282.441337] [<ffffff8000af43ec>] al5d_ioctl+0x19c/0x4a8 [al5d]
[ 3282.447159] [<ffffff80081af764>] do_vfs_ioctl+0xa4/0x7d8
[ 3282.452461] [<ffffff80081afedc>] SyS_ioctl+0x44/0x80
[ 3282.457407] Exception stack(0xffffff800f28bec0 to 0xffffff800f28c000)
[ 3282.463832] bec0: 0000000000000008 00000000c00c710d 0000007f780022d0 0000000000001000
[ 3282.471644] bee0: 0000000000000080 0000000000004554 0000000000000000 0000000000000000
[ 3282.479456] bf00: 000000000000001d 0000007f8f2cb8e0 0101010101010101 0000000000000000
[ 3282.487268] bf20: 0000000000000001 000000000000270f 0000007f90051d98 0000007f90044d00
[ 3282.495080] bf40: 0000007f90105ef0 0000007f8f3bc738 0000000000000530 0000007f780022d0
[ 3282.502892] bf60: 0000000000000080 00000000191b4300 0000000000000080 0000007f7f7fe818
[ 3282.510704] bf80: 0000007f7efc83f8 0000007f7efc8010 00000000191b4300 0000007f7efc8118
[ 3282.518516] bfa0: 0000007f7efc8140 0000007f8f2ca6c0 0000007f8f399874 0000007f8f2ca6c0
[ 3282.526328] bfc0: 0000007f90105efc 0000000080000000 0000000000000008 000000000000001d
[ 3282.534140] bfe0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[ 3282.541953] [<ffffff80080837b0>] el0_svc_naked+0x24/0x28
[ 3282.547248] Code: 9ac32042 8b010001 d1000443 8a230000 (d50b7a20) 
[ 3282.553331] ---[ end trace 2f221f277ac90864 ]---
0 Kudos
Mentor watari
Mentor
585 Views
Registered: ‎06-16-2013

Re: Transcode video by VCU using PL RAM

Jump to solution

Hi @pfarrokhi 

 

I'd like to clarify my undestanding about your situation.

 

What monitor do you use via DP cable ?

Is it supported 4K@30Hz and 10bit color depth or XV20 ?

 

Also, what version are you using petalinux ?

 

Best regards,

0 Kudos
Visitor pfarrokhi
Visitor
534 Views
Registered: ‎10-31-2019

Re: Transcode video by VCU using PL RAM

Jump to solution

Hi. Thank you for reply. I don't use monitor. If you read codes attached, I just decode a file and encode it to another file or a dummy sink. I don't care about its output to my monitor.

But I used it on my last code. sorry. thank you for finding my last code problem. I replace it by dummy sink and tell its answer.

0 Kudos
Mentor watari
Mentor
501 Views
Registered: ‎06-16-2013

Re: Transcode video by VCU using PL RAM

Jump to solution

Hi @pfarrokhi 

 

OK.

Would you try the following command with gst-shark to investigate the route cause ?

 

## Generate graphic pipeline

$ export GST_SHARK_LOCATION=/tmp/profile

$ GST_DEBUG="GST_TRACER:7" GST_TRACERS="graphic" gst-launch-1.0 <snip>

 

## Generate debug log

$ gst-launch-1.0 --gst-debug-level=5 <snip>

 

I suspect there are changing state with some wrong parameter.

 

Best regards,

Visitor pfarrokhi
Visitor
444 Views
Registered: ‎10-31-2019

Re: Transcode video by VCU using PL RAM

Jump to solution

I tested the vcu decoder alone with the following command and everything was fine:

gst-launch-1.0 filesrc location=test1_cut.mp4 ! qtdemux name=demux demux.video_0 ! h264parse ! omxh265dec ! queue max-size-bytes=0 ! filesink location=tt.yuv

I think there is no problem with vcu. Where else should i check?

0 Kudos
Voyager
Voyager
376 Views
Registered: ‎07-06-2016

Re: Transcode video by VCU using PL RAM

Jump to solution

 

Between this previous pipeline:

gst-launch-1.0 filesrc location=test1_cut.mp4 ! qtdemux name=demux demux.video_0 ! h264parse ! omxh264dec ! queue max-size-bytes=0 ! kmssink bus-id=fd4a0000.zynqmp-display fullscreen-overlay=1

And this last working one:

gst-launch-1.0 filesrc location=test1_cut.mp4 ! qtdemux name=demux demux.video_0 ! h264parse ! omxh265dec ! queue max-size-bytes=0 ! filesink location=tt.yuv 

the only difference is the sink used, so in this case we can say that the problem is the sink used, I would try to run the whole pipeline using first a fakesink element and if it works I'd try different sinks/memory locations (SD card, USB, SATA...) and compare results...

0 Kudos
Xilinx Employee
Xilinx Employee
320 Views
Registered: ‎08-01-2007

Re: Transcode video by VCU using PL RAM

Jump to solution

Glad to see you made some progress here.  The problem seems to be down to getting the DisplayPort sink device to working.


A good test is to start by just using the modetest tool to test your display.  Then using the suggested GStreamer pipeline once you have verified that your monitor can support the output resolution of the video you are trying to decode.  For example if you monitor only supports 1080p and you are trying to decode a 4Kp30 video then you will have trouble getting it to display.

The ZynqMP DisplayPort Linux driver Wiki page has a lot of good debug information on debuging and testing.  I recommend reading the full page, but particullary the DRM section.


I also wanted to add a few addtional notes:

Here are a few things I noticed:

First, before you spend too much time trying the PL-DDR, it would also be useful to know if you have trouble when default BSP with the PS-DDR.

Second, I was looking over the errors and noticed that you are using the 2018.3 BSP.  This is over a year old now.  Because there have been numerous fixes to the solution including some in the PL IP as well as to the VCU software stack.  I recommend you look at using the 2019.2 BSP which was just recently released.  If you continue to see issues after trying the latest version, then reply with the most recent errors.

Thrid, I noticed that you have a v4l2video0convert in your pipeline.  It isn't recommend to use components like this, as they will typically result in software memory copies, which are inefficient and will adversely affect performance.  I recommend you look at some of the example Pipelines in the Zynq UltraScale+ MPSoC VCU Product Guide PG252.  Or by looking at some of the examples used with the Zynq UltraScale+ MPSoC VCU ZCU106 TRD.  Even though you are not using this particular board, you can at least see how some of the GStreamer pipelines were constructed as there are several designs that use the PL-DDR and PS-DDR.

Fourth you didn't mention it for sure, but I believe you were looking at the PG252 on what modifications need to be made to the BSP designs to enable PL-DDR.  If you haven't, then I recommend you review this information as well when moving to a new PL-DDR design.

Chris
Video Design Hub | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------

View solution in original post

Moderator
Moderator
222 Views
Registered: ‎11-21-2018

Re: Transcode video by VCU using PL RAM

Jump to solution

Hi @pfarrokhi 

If your question is answered or your issue is solved, please kindly mark the response which helped as a solution (click on "Accept as solution" button below the reply).

 

If this is not solved/answered, please reply in the topic giving more information on your current status.

 

Thanks and Regards,

Aoife
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos