DMA channel not started

I have created dma controller. My idea is to send image frame data to fifo using axi-dma. I tried to send an array of data to fifo from PS notebook and got the same data from fifo back to PS. Now when I am trying to send the image frame it it is giving me error of DMA channel not started.
Here I am attaching my design.

The code snippet of code I am using:
I have converted image frame into 1D array and tried to store in FIFO.

videoIn = cv2.VideoCapture(0)
videoIn.set(cv2.CAP_PROP_FRAME_WIDTH, frame_in_w);
videoIn.set(cv2.CAP_PROP_FRAME_HEIGHT, frame_in_h);
dma = overlay.axi_dma_0
data_size=4806403
input_buffer = allocate(shape=(data_size,), dtype=np.uint16)
output_buffer = allocate(shape=(data_size,), dtype=np.uint16)

while(True):
start = time.time()
ret, frame_vga = videoIn.read()

# Display webcam image via HDMI Out
if (ret):
    ###
    temp2d = np.reshape(frame_vga, (h*w*3,))
    for i in range(h*w*3):
        input_buffer[i] = temp2d[i]

    dma = overlay.axi_dma_0
    dma.sendchannel.transfer(input_buffer)
    
    dma.recvchannel.transfer(output_buffer)
    dma.sendchannel.wait()
    dma.recvchannel.wait()

    for i in range(h*w*3):
        temp2d[i] = output_buffer[i]

    temp2d1 = np.reshape(temp2d, (h,w,3))
    ###
    outframe = hdmi_out.newframe()
    outframe[0:480,0:640,:] = temp2d1[0:480,0:640,:]
    hdmi_out.writeframe(outframe)
else:
    raise RuntimeError("Failed to read from camera.")
end = time.time()
print("elapsed_time: ",end-start)
cv2.waitKey(0)

print("Capture device is open: " + str(videoIn.isOpened()))

Any solution why dma channel not started for image frame array while it is working for integer array.?
ANy help would be appreciable.

Can you get the register_map information for the DMA before and after the transfers and post it here?

Register map example video

What settings have you used for your DMA? Are the buffers too big?
If you haven’t seen it already, you may find this tutorial useful:
PYNQ DMA tutorial

Cathal

I am getting this this error when I am running HDMI configuration. Without HDMI it is not giving error. Any reason why DMA is not working with HDMI monitor.?

Below is dma.register_map before sending frame to DDR mem.

Below is dma.register_map after sending frame to DDR mem and getting DMA not started error.

You don’t have any HDMI connected in the Vivado IP Integrator block design so the HDMI_out won’t work with this design.
Can you clarify what you are doing with your overlay?

The register map “before” doesn’t look correct, as the S2MMDMASR is already showing halted=1, and DMAIntErr=1

Can you restart the board, and try run this again making sure to capture the register map before you do the DMA transfer and after?

Cathal

I am trying to capture the USB camera frame from PS and storing it in DDR memory. Then sending these frame to my FPGA PL using AXI dma, and storing in fifo for now. Then again reading back same frame from FIFO through AXI dma to my PS and trying to display image on HDMI out.
Also I want to know, for storing image pixel in DDR , I am converting my image(480*640 RGB) as 1D array. then storing in PS memory. But this way it is taking too much time(approx 5 sec). Is there any way to store image pixel into DDR mem with very less time.

HDMI out is already there in base overlay. So I am using that overlay for HDMI. Do I still need to add HDMI in my own overlay?

Hi @dpk1,

Did you verify that stream interfaces in the fifo match the stream interfaces in the DMA?, in particular the tlast.

What steps have taken to debug this?

Also I want to know, for storing image pixel in DDR , I am converting my image(480*640 RGB) as 1D array.

Why are you converting it to 1D? You can store it as-is.

HDMI out is already there in base overlay. So I am using that overlay for HDMI. Do I still need to add HDMI in my own overlay?

Yes, the overlays are mutually exclusive. You cannot have two overlays loaded at the same time. If you want to use the HDMI in your design, you will need to add the necessary logic.

Mario

Thanks for your suggestion. I got the frame as it is at output using matplot with minimal time. Can you suggest any resources for adding HDMI in my design. So that I can display image on VGA monitor.?
Thanks

Use the video blocks in the base overlay. That way you will get the proper drivers associated to these IP.

There is some documentation about this in the RTD page.

https://pynq.readthedocs.io/en/latest/pynq_libraries/video.html

https://pynq.readthedocs.io/en/latest/pynq_overlays/pynqz2/pynqz2_base_overlay.html#