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: 
Highlighted
1,284 Views
Registered: ‎01-15-2018

Video Processing on Zynq (baremetal): VDMA trouble

Jump to solution

Hi all,

 

I need some help to understand how to implement a video processing algorithm (a 3x3 convolution) on the Zynq PS with no O.S.

 

I am using a design with a VDMA IP core (circular triple buffer mode) that realize a passthrough system:

1) the incoming HDMI video frames are written by VDMA to external memory 

2) the VDMA reads the stored frames and send them to HDMI out 

 

Now, I want to do some image processing (in software) on the frames before they are read by VDMA (accepting a reduction of the number of frames per second).

 

I have tried simple operation like copying the content of the buffer (through memcpy function), but this operation is too much slower than the VDMA read operations so I obtain weird hdmi output.

 

I think that i have to process one frame at time and slow down the speed of the VDMA write/read operations to allow the software to do the image processing properly, so I have to (for each frame):

 

1) write the n-th frame coming from Programmable Logic to external memory [trough VDMA]

2) access the external memory where the video buffer is allocated [through Processor]

3) elaborate the n-th frame and write it to the video buffer [through Processor]

4) read the n-th elaborated frame and send it out to Programmable Logic [through VDMA]

Clearly the data throughput would be very slow but i don't care about it.

 

Do I have to use interrupts or there are other settings of the VDMA core to do this job in the right way? 

 

What is the best way to do this?

 

 

Thank you in advance,

Valentina

 

P.S.: Sorry for my bad English ;)

Tags (4)
0 Kudos
1 Solution

Accepted Solutions
Moderator
Moderator
1,768 Views
Registered: ‎11-09-2015

Re: Video Processing on Zynq (baremetal): VDMA trouble

Jump to solution

Hi @vale_tesi2017,

 

Is this correct? What is the best practice to do this?

Yes this is correct. The VDMA should have an input and and output for synchronization. You can use them for the VDMA side. On the zynq side, I would use an interrupt and a GPIO output.

 

You also might be able to write only one frame with the VDMA (I think there is a counter). It should create an interrupt that you will catch on the zynq. Then when you processing is done on the zynq, you just re-start the VDMA

 

Regards,


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
5 Replies
Scholar hbucher
Scholar
1,278 Views
Registered: ‎03-22-2016

Re: Video Processing on Zynq (baremetal): VDMA trouble

Jump to solution

@vale_tesi2017  Yes, as you found, the Zynq ARM is VERY slow - if compared to even midsized Intel CPUs. But it is much faster than running a processor in fabric (Microblaze etc). 

If you use framebuffers then you can keep the frame rate but it will show. You can keep the same framebuffer and then flip.

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
Moderator
Moderator
1,239 Views
Registered: ‎11-09-2015

Re: Video Processing on Zynq (baremetal): VDMA trouble

Jump to solution

Hi @vale_tesi2017,

 

The question here is why aren't you doing the processing in the PL?

 

Regards,

 

Florent


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
1,226 Views
Registered: ‎01-15-2018

Re: Video Processing on Zynq (baremetal): VDMA trouble

Jump to solution

Hi guys,

thank you for your replies. 

 

@florentw: I have already implemented an architecture in PL to process the pixel stream (sobel filter). I know that it is the best way to elaborate high speed rate video in PL but my purpose is to compare the hardware processing with the software one.

 

I have chosen a convolution example but it could be something else much more tailored to PS.

Despite the choice of the algorithm, I think I have to implement some operations of synchronization between the VDMA and the PS (correct me if i am wrong).

 

I think that I have to cycle these operations: start the write channel of the VDMA, so write just one frame, let the PS know that the frame is available in memory, elaborate it with the PS, let the VDMA know that the PS elaboration is done and then start the read channel of the VDMA to send out that frame.

Is this correct? What is the best practice to do this?

 

There aren't any reference designs with software elaboration (for example Sobel) with no O.S., there are only under Linux.

 

@hbucher: I am new to software programming, could you be more clear?

 

Thank you,

 

Valentina

 

 

0 Kudos
Moderator
Moderator
1,769 Views
Registered: ‎11-09-2015

Re: Video Processing on Zynq (baremetal): VDMA trouble

Jump to solution

Hi @vale_tesi2017,

 

Is this correct? What is the best practice to do this?

Yes this is correct. The VDMA should have an input and and output for synchronization. You can use them for the VDMA side. On the zynq side, I would use an interrupt and a GPIO output.

 

You also might be able to write only one frame with the VDMA (I think there is a counter). It should create an interrupt that you will catch on the zynq. Then when you processing is done on the zynq, you just re-start the VDMA

 

Regards,


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
Moderator
Moderator
1,084 Views
Registered: ‎11-09-2015

Re: Video Processing on Zynq (baremetal): VDMA trouble

Jump to solution

Hi @vale_tesi2017,

 

Is everything clear for you on this? If yes please kindly mark a reply as accepted solution to close the topic

 

Regards,


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