What I want to do is to use HDMI in to read input frame and then transfer the input frame to the FIFO in PL side and then send back to PS by DMA, and then HDMI out will display the image on the monitor. Everything is fine when I only run one image. When I process multiple frames, the HDMI out will display mostly black on my monitor and then the final frame will display on the monitor.
First, be careful when assigning array objects - doing input_buffer = frame doesn’t copy the data from frame to input_buffer instead it just changes the input_buffer reference to be that of frame thus losing handle to the input_buffer you allocated before the loop. If you want to copy the data from one buffer to another you should use input_buffer[:] = frame.
That shouldn’t be necessary in this case though. You should be able to operate on the input and output frames directly - something like:
You might be able to get a bit of a performance boost if you explicitly interleave the processing with the HDMI read and write commands but I don’t think it will make that much difference.
If you are running at 1080p60 you might want to check at a lower resolution/frame rate. The DDR bandwidth of the board is somewhat limited and you can start running into bottlenecks with two many video streams running.
One final note is that (at least with PYNQ >= 2.5) you shouldn’t need to worry about freebuffer. Buffers will get freed automatically when they go out of scope.
If you want to optimize bandwidth on the design you might consider moving the DMA engines to HP2 and HP3 and not using HP1. The reason is that HP0 and HP1 share a port on the system DDR controller, likewise HP2 and HP3. As the video block is using the same bandwidth as the two DMA engines this would help balance the load.
Hi ! Thanks to reply me these useful information! After I moved the DMA engines to HP2 and HP3, I can successfully output hdmi continuously. The fps is around 10. Are there any chance to enhance the speed?