Forum Discussion

JLee25's avatar
JLee25
Icon for Contributor rankContributor
9 hours ago

How to debug VVP Frame Buffer

Hi Community,

  I am using the VVP suite and for unknown reason the video data through the frame buffer has streak issue.

 It's a customer board that we have been using production as a converter design with VIP.

Now we are upgrading it with VVP.

Device is Cyclone 10 GX 220YF672I6G

Quartus Version is Pro 25.3

Right now the VVP configuration is 4 PIP, YCC422 10-bit, Lite mode.

The frame buffer is configured as Triple-Buffer.

I tried the simple setup like TPG -> CVO -> HDMI and it works well.

But once TPG -> Frame Buffer -> CVO -> HDMI then it failed.

Print out the status every 2 seconds,

  I attached the streaks video for your reference.

BRs,

 

4 Replies

  • @ai_responder​

      No output data while change the mode to double-buffer.

    But the status is always fine.

    Strides are fixed, the line stride is 0x3000, buffer stride is 0x3000000

     

    • ai_responder's avatar
      ai_responder
      Icon for Community Manager rankCommunity Manager

      Your status registers and field counters look healthy — both Input Running and Output Running are asserted, and the Output fields counter is incrementing — but that is exactly the trap in double-buffer mode. The VFB is reading from memory and clocking out frames, yet the downstream pipeline loses sync because of how double-buffer stalls work.
      The core issue: TVALID stalls between frames
      Double-buffering is selected by turning off both Enable dropping of input frames and Enable repeating of output frames. It uses only two frame buffers, with base addresses calculated from the base address and interbuffer stride you specify. If no free buffers are available and a new frame is pending at the input, frame writing stalls — the IP holds off the input by de-asserting TREADY until a free buffer becomes available. If the IP finishes creating output from one buffer and the other buffer does not hold a complete, new frame, the IP stalls its output by lowering TVALID. Video Frame Buffer IP Functional Description
      That last sentence is the problem. In double-buffer mode the VFB periodically drives TVALID low between successive output frames while it waits for the write path to complete the next frame. Any Clocked Video Output or similar downstream IP that expects a continuous, uninterrupted stream will lose sync at those gaps and produce no visible video — even though the VFB's own status and field counter look fine. Triple-buffer mode (Enable dropping = ON, Enable repeating = ON) eliminates those TVALID gaps because there is always a third "spare" buffer ready to read while the other two are in use.
      Dropped/Invalid fields in one of your screenshots
      Select triple-buffering by turning on both Enable dropping of input frames and Enable repeating of output frames in the GUI. For triple-buffering, the frame buffer uses three frame buffers, with base addresses calculated from the base address and interbuffer stride you select. The stride is the separation between frames in memory and is always fixed to the parameterized value regardless of the size of frames the IP receives. Video Frame Buffer IP Functional Description
      The 287 Dropped / 287 Invalid count visible in your left screenshot is consistent with a prior triple-buffer run; in true double-buffer mode those counters should stay at 0 because the IP stalls rather than drops.
      Things to verify before concluding it is a pure stall problem
      1. OUTPUT_CONTROL must be set. Write a 1 to register 0x015C for the frame buffer to start producing buffered frames; write a 0 to stop producing buffered frames. Table 899. Video Frame Buffer IP Registers In the software API the register names appear with a pref — Video and Vision Processing Suite IP User Guide Confirm this is 1 after every reset.
      2. Lite-mode width/height registers. When you turn on lite mode, register IMG_INFO_WIDTH (0x0120) holds the expected width of the incoming video fields; when you turn off lite mode, the received width in the IP derives from the image information packets. Table 899. Video Frame Buffer IP Registers In the software API the register names appear with a pref — Video and Vision Processing Suite IP User Guide Same applies to IMG_INFO_HEIGHT (0x0124), IMG_INFO_INTERLACE, IMG_INFO_COLORSPACE, and IMG_INFO_SUBSAMPLING. If any of these are zero or mis-programmed after a recompile, the downstream IP will not form a valid video stream even though the VFB output counter is incrementing.
      3. Buffer stride sanity check. Inter-buffer stride depends on video frame format and maximum frame size; set a stride (in bytes) large enough to separate frames of the specified maximum height and width. The GUI gives an error if the stride is too low. Table 896. Video Frame Buffer Performance and Resources The table shows ALM usage and fMAX for a des — Video and Vision Processing Suite IP User Guide Your 0x3000000 (48 MB) inter-buffer stride with a 0x3000 (12,288-byte) line stride gives ~4,096 lines of separation, which is well above a 1080-line frame, so stride is not the issue here.
      Bottom line: the TVALID stall between frames in double-buffer mode is the most likely reason a downstream CVO or display IP loses video even while the VFB status registers read healthy. If your input and output clocks are not genlocked, switch back to triple-buffer mode (compile with both Enable dropping and Enable repeating turned on) so there is always a fully-written spare buffer available at the output side.


      Note: To continue using AI Responder, please start your next inquiry with ai_responder

      Disclaimer: AI-generated responses may contain errors or omissions. Please verify technical guidance with official Altera documentation before implementation.

      Thank you very much.

  • ai_responder's avatar
    ai_responder
    Icon for Community Manager rankCommunity Manager

    The key diagnostic signal here is that Dropped fields = Invalid fields = 287, and both are static — they accumulated at startup and are no longer growing. That rules out an ongoing frame-dimension mismatch and points to two separate problems: a startup sequencing gap, and something causing the visible streaks at steady state.
    Startup invalid/dropped fields (the 287 count)
    In lite mode, the IP has no image information packets to refer to, so it detects broken frames by checking received frame dimensions against the expected dimensions, and discards them if "Enable the dropping of broken frames" is on. Video Frame Buffer IP Functional Description The IMG_INFO_WIDTH register (address 0x0120) is RW in lite mode and sets the expected width of incoming video fields. Table 899. Video Frame Buffer IP Registers In the software API the register names appear with a pref — Video and Vision Processing Suite IP User Guide Similarly, IMG_INFO_HEIGHT (0x0124) sets the expected height in lite mode. Table 899. Video Frame Buffer IP Registers In the software API the register names appear with a pref — Video and Vision Processing Suite IP User Guide
    If those registers are written *after* the TPG has already started sending frames, the first N frames will all be flagged invalid and dropped. Write IMG_INFO_WIDTH, IMG_INFO_HEIGHT, IMG_INFO_SUBSAMPLING, IMG_INFO_COLORSPACE, and IMG_INFO_COSITING to the correct values before you assert OUTPUT_CONTROL and before the video source is live.
    The steady-state streak issue
    Since dropped/invalid fields are no longer growing but streaks persist, the most likely causes are:
    1. Inter-buffer stride too small. The inter-buffer stride depends on video frame format and maximum frame size; set it large enough to separate frames of the specified maximum height and width — the GUI gives an error if the stride is too low. Table 896. Video Frame Buffer Performance and Resources The table shows ALM usage and fMAX for a des — Video and Vision Processing Suite IP User Guide For YCC422 10-bit at 4 PIP verify the stride in the MEM_BUFFER_STRIDE register (0x0028) covers the full frame including any line-stride padding. If read and write buffers overlap even slightly you will see horizontal tear artifacts that look like streaks.
    2. Memory bandwidth / backpressure. The frame buffer latency depends on the availability of the external memory interfaces, which may backpressure the IP's read and write host interfaces via the av_mm_mem_read_host_waitrequest and av_mm_mem_write_host_waitrequest signals; the streaming video output also experiences backpressure via axi4s_vid_out_tready. Video Frame Buffer IP Functional Description With triple buffering doing simultaneous read and write to the same DDR interface, if the EMIF can't sustain the aggregate bandwidth for 4-PIP 10-bit YCC422 at your frame rate, partial lines get written or read, producing horizontal streaks. Add SignalTap on the waitrequest signals to see if they are asserting frequently during active video.
    3. OUTPUT_CONTROL sequencing. The IP starts producing output frames only when you set the OUTPUT_CONTROL bit, and selects which frame to output based on the buffer behavior parameters. Video Frame Buffer IP Functional Description Received frames are available for output only when the Avalon memory-mapped agent accepts the last beat of the last line. Video Frame Buffer IP Functional Description If OUTPUT_CONTROL is set before the first complete frame is in memory, the first frame the IP reads may be partially written, producing an initial streak that persists until the triple-buffer state machine settles.
    Recommended next steps:

    • Read back MEM_BUFFER_STRIDE (0x0028) and MEM_LINE_STRIDE (0x002C) and manually verify they are consistent with your resolution, bits-per-sample, number of color planes, pixels-in-parallel, and packing mode for YCC422 10-bit 4-PIP.
    • Instrument the EMIF waitrequest signals with SignalTap to quantify backpressure during active video.
    • Ensure IMG_INFO_WIDTH/HEIGHT/SUBSAMPLING/COLORSPACE/COSITING are all written and stable, then assert OUTPUT_CONTROL only after the INPUT_STATUS register (0x0140) has gone high at least once, confirming the first frame is being written.
    • As a sanity check, temporarily switch to double-buffer mode (turn off both drop and repeat) to see if the streaks disappear — if they do, the issue is bandwidth-related contention under triple-buffer simultaneous read/write.


    Note: To continue using AI Responder, please start your next inquiry with ai_responder

    Disclaimer: AI-generated responses may contain errors or omissions. Please verify technical guidance with official Altera documentation before implementation.

    Thank you very much.