Post Go back to editing

BF609 + EPPI + H264 + problem

Hi there,

I use BF609 with camera (PAL) and external video decoder (TW2964).
My configuration looks like:

section("sdram_bank1") t_frame image_UYVY_A[FRAME_BUF_LEN];
section("sdram_bank2") t_frame image_UYVY_B[FRAME_BUF_LEN];
volatile unsigned int imageAB = 0;
volatile unsigned int framerate_ppi_A = 0;
volatile unsigned int framerate_ppi_B = 0;

void init()
{
    adi_eppi_Open(0, ADI_EPPI_DIRECTION_RX, driverMemoryEPPI, (uint32_t)ADI_EPPI_MEMORY_SIZE, &hDeviceEPPI);
    
    adi_eppi_SetDataLength(hDeviceEPPI, ADI_EPPI_8BIT);
    adi_eppi_SetITUMode(hDeviceEPPI, ADI_EPPI_ACTIVE);
    adi_eppi_SetInternalClk(hDeviceEPPI, false);
    
    adi_eppi_SetSamplesPerLine(hDeviceEPPI, FRAME_X_UYVY + FRAME_BLANKING_X);
    adi_eppi_SetHorizontalCount(hDeviceEPPI, FRAME_X_UYVY);
    adi_eppi_SetHorizontalDelay(hDeviceEPPI, 0);
    
    adi_eppi_SetLinesPerFrame(hDeviceEPPI, FRAME_Y_UYVY + FRAME_BLANKING_Y);
    adi_eppi_SetVerticalCount(hDeviceEPPI, FRAME_Y_UYVY);
    adi_eppi_SetVerticalDelay(hDeviceEPPI, 0);
    
    adi_eppi_SetDmaTransferSize(hDeviceEPPI, ADI_EPPI_DMA_TRANSFER_8BIT);
    adi_eppi_SetDMAConfig(hDeviceEPPI, true);
    adi_eppi_RepetiveBufferEnable(hDeviceEPPI, true);
    adi_eppi_StreamingEnable(hDeviceEPPI, true);
    
    adi_eppi_RegisterCallback(hDeviceEPPI, EPPI_Callback, NULL);
    adi_eppi_SubmitBuffer(hDeviceEPPI, image_UYVY_A, FRAME_X_UYVY * FRAME_Y_UYVY * FRAME_BUF_LEN);
    adi_eppi_SubmitBuffer(hDeviceEPPI, image_UYVY_B, FRAME_X_UYVY * FRAME_Y_UYVY * FRAME_BUF_LEN);
    
    adi_eppi_Enable(hDeviceEPPI, true);
}

void EPPI_Callback(void* pHandle, uint32_t u32Arg, void* pArg)
{
    if(imageAB==0) 	// A -> B
	{
		imageAB = 1;
		framerate_ppi_A++;
		adi_eppi_SubmitFrameUpdate(hDeviceEPPI, image_UYVY_A);
	}
	else			// B -> A
	{
		imageAB = 0;
		framerate_ppi_B++;
		adi_eppi_SubmitFrameUpdate(hDeviceEPPI, image_UYVY_B);
	}
}
 

I think, it works fine. I have correct picture in both frame buffers. 

But when I want to use h264 coder and I run pEncHndl->pProcess, I get glitches, invalid frame, shifted bytes in frame (sometimes different colors, green glitches, beginning in another place).
Even there is a problem, when in pProcess I use different buffer than EPPI used.

BR

Jakub

  • Hi again,

    there was a problem with configuration of DMA, there should be:
    adi_eppi_SetDmaTransferSize(hDeviceEPPI, ADI_EPPI_DMA_TRANSFER_32BIT);

    Now I have some problem with online streaming via TCP and VLC media player.
    At the start I run pProcessSequence and pGetConfig with ADI_CODEC_CONFIG_SEQHDR to save SPS header in RAM for future.
    Process with H264 coder is still running on the second core and on the first core there is a TCP server, which sends to client SPS header and current packets with NAL Unit from process with coder (pProcess)

    Problems with:
    - smooth reading/playing, stream is played in VLC with 4 seconds delay and every few seconds jammed on moment.
    Configuration in code:
    iFramerate=6; 
    iWidth=352; 
    iHeight=288;

    - no video for next requests from VLC, there is only video at the first request. 
    Configuration in code:
    iGopSize = 2*6-1;

    If someone has an example with online streaming, it may help. 

    BR
    Jakub