04-09-2018 08:47 AM - edited 04-09-2018 09:08 AM
I have a ZCU102 card with IMX274 video sensor and I use the reVISION stack as a basis to implement a real-time video compression system.
I have a proprietary video compression/decompression IP core at my disposal.
So far I managed to integrate video compression encoding/decoding in the video processing workflow (in mipi_csi_rx, just after the scaler) in the hardware platform and that seems to work nicely in real-time.
(NB: at first I wanted to integrate compression/decompression as a C-callable IP in the SDSoC application but I did not managed to make it work so far: https://forums.xilinx.com/t5/SDSoC-Environment-and-reVISION/Use-of-sample-C-Callable-library-on-custom-platform/td-p/843402).
Now I want to find a way to output the compressed bitstreams (at the output of the video encoder) so that I can store it (either by transfering it to my computer or by directly storing it on local volatile memory). A rough block diagram of the problem is attached.
Regarding the bitrates, the system must be able to support 4K60 8-bit 422 content (~ 1GB/s) at typical constant compression ratios of maximum 10:1. It means that the compressed bitstream will have a minimum bitrate of ~100 MB/s.
Here are are the options I'm considering so far (I'm not sure what's the best way):
-> Storage on the SD card (my favourite option). Recent SD cards supports 100MB/s easily. Nonetheless, as far I've seen, SD card is connected to PS so I guess that the data transfer will not be straightforward (is there a way to DMA the stream from PL to SD card ?)
-> Transfer via ethernet to my computer. I guess, it will be quite complicated to implement on both ZCU102 and computer sides.
-> Transfer via SATA. I really do not know how difficult it can be.
Alternatively, one other option would be to enable DisplayPort and HDMI at the same time so that I can output uncompressed (pristine) video stream on one output and compressed/decompressed video stream on the other and grab both these streams on my computer. I do not favour this option.
Could you please indicate what would be the best option (taking into account implementation time and available bandwidth) and give me some hints about the way I should implement it?
04-09-2018 09:19 AM
There is yet another possibility, which is to transfer the data to a PCIe flash card plugged into the PCIe socket. It might require finding a Linux driver for the card.
But the easiest way? Why not implement a 10G Ethernet interface on the SFP+ cage, and then use a fiber (or copper cable) to your PC. Gigabit ethernet tends to be limited to 80 to 85 Mbytes/sec, but the 10GE connection should run over 800 Mbytes/sec.
07-17-2018 04:57 AM
Thanks to jmcclusk for his answer.
Nonetheless, it turns out that I must output the compressed video stream on a SD card ...
Unfortunately, it does not look that simple because 1) the SD card is connected to the PS and 2) access to SD card are not straightforward (because of the initialization etc.).
Does somebody have any clue about how I can store a stream available in the PL directly on a SD card without requiring the PS to handle it ?
07-17-2018 12:49 PM
The SDIO controllers are only accessible via AXI interfaces (see UG1085). Frankly, your first attempt should be to simply see if you can run Linux on the card, and if some simple shell transfer commands are fast enough. The SDIO controllers have DMA built in, so if you can transfer the compressed video stream to system memory, the DMA engines can grab it and send it to the SD card. You'll need to use a fast SD card, of course.
07-18-2018 08:59 AM
Thanks for your suggestion.
I made some tests when the PS takes care of transfer from DDR to SD card using simply this function :
fwrite(frm_data_in, sizeof(unsigned short), pcnt, record_file);
and I measured the time needed to perform the transfer for different pcnt (array size).
Apparently, the average rate it gives is around 5 MB/s. Since the SD card I use is supposed to reach 25 MB/s in write accesses, I guess the bottleneck is not the SD card here. Apparently, the CPU does not perform the transfer fast enough.
Higher-end SD cards reachs up to >200 MB/s apparently.
Do I try what you suggested? Do you have any other suggestion?
07-18-2018 11:48 AM
I'd try a file based benchmark test on your SD card, since that ought to be using the DMA engine if things are setup properly. create a Ramdisk, and then just run "cat" to copy a file from the ramdisk to the SD card. you might want to look at how the Ultra96 board is setup, because their user guide says this:
Ultra96 provides a microSD card socket as the primary boot device. VCCO for MIO1 is 1.80V thus a level shifter is required. A Maxim MAX13035E is used. When available, the Ultra96 kit ships with a Delkin Devices “Utility” 16 GB Industrial MLC microSD card, pre-programmed with Linux boot. The Delkin Part Number is S416APG49-U3000-3, rated at Read Performance = 95MB/s and Write Performance = 55MB/s (measured using CrystalDiskMark). There are several advantages to using MLC over the typical retail TLC that is readily available.