VPU Encoder Failing with Timeout Error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

VPU Encoder Failing with Timeout Error

1,668 Views
sandy123
Contributor II

Hi Everyone,

We have interfaced OV8825 Camera Module with our custom iMX6 solo board running on Android Kitkat 4.4.2.

While performing YUV to JPEG Conversion using VPU(fw version 3.1.1_r46058),  we are facing "vpu encode frame failure"error and Camera Application crashes following it.

We cant locate the cause behind this error.

Does VPU has the ablity to encode images with large resolution like 8MP(3,264 x 2,448) or Is this error related with VPU Configuration ?

Following is the logcat message,

I/vpu-lib ( 3621): Product Info: i.MX6Q/D/S

I/FslCameraHAL( 3621): vpu lib version : major.minor.rel=5.4.25

I/FslCameraHAL( 3621): vpu fw version : major.minor.rel_rcode=3.1.1_r46058

I/vpu-lib ( 3621): <gpu> alloc handle: 0x4225cd80, paddr: 0x4a9bd000, vaddr: 0x48eb5000

I/vpu-lib ( 3621): <gpu> alloc handle: 0x4000b8b0, paddr: 0x46df2000, vaddr: 0x452ea000

I/vpu-lib ( 3621): <gpu> alloc handle: 0x40d22648, paddr: 0x4def8000, vaddr: 0x4c3f0000

I/vpu-lib ( 3621): <gpu> alloc handle: 0x40d22660, paddr: 0x4ec4f000, vaddr: 0x4d147000

I/vpu-lib ( 3621): <gpu> alloc handle: 0x40bcc650, paddr: 0x1e000000, vaddr: 0x52028000

VPU blocking: timeout.

VPU blocking: timeout.

VPU blocking: timeout.

VPU blocking: timeout.

E/FslCameraHAL( 3621): vpu_encode, vpu encode frame failure: ret=0x8 // What does this return value specify?

I/vpu-lib ( 3621): vpu_SWReset

E/FslCameraHAL( 3621): vpu_encode, vpu encode frame failure: no output,  ret=0x0

I/vpu-lib ( 3621): <gpu> free handle: 0x4000b8b0, paddr: 0x46df2000, vaddr: 0x452ea000

I/vpu-lib ( 3621): <gpu> free handle: 0x4225cd80, paddr: 0x4a9bd000, vaddr: 0x48eb5000

I/vpu-lib ( 3621): <gpu> free handle: 0x40d22648, paddr: 0x4def8000, vaddr: 0x4c3f0000

I/vpu-lib ( 3621): <gpu> free handle: 0x40d22660, paddr: 0x4ec4f000, vaddr: 0x4d147000

I/vpu-lib ( 3621): <gpu> free handle: 0x40bcc650, paddr: 0x1e000000, vaddr: 0x52028000

E/FslCameraHAL( 3621): makeJpegImage encodeImage failed

E/FslCameraHAL( 3621): processFrame makeJpegImage failed

E/FslCameraHAL( 3621): handleRequest:No more requests available

I/FslCameraHAL( 3621): handleRequest exiting

I/FslCameraHAL( 3621): stopAllStreams running

I/FslCameraHAL( 3621): CaptureStream::stop

I/FslCameraHAL( 3621): StreamAdapter stop running

E/FslCameraHAL( 3621):  frame->release();

F/libc    ( 3621): Fatal signal 11 (SIGSEGV) at 0xd1da97b0 (code=1), thread 3776 (RequestHandle)

I/DEBUG   ( 2317): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

Regards,

Sandheep

Labels (4)
0 Kudos
3 Replies

865 Views
joanxie
NXP TechSupport
NXP TechSupport

VPU supports up to full HD 1920x1080 60i or 30p decoding and 1920x1088 encoding.

if you need to change the video fomat, you should use IPU first.

0 Kudos

865 Views
sandy123
Contributor II

Hi Guan,

I would like to add some more information. While performing Image Capture, we are able to do YUV to JPEG Conversion using VPU, for both 5MP and 8MP resolutions under normal cases. This issue  arises only under certain circumstances like using Test Pattern images. This conversion is performed in Camera HAL that comes with freescale BSP and we didnt change anything in it.

Reference,

hardware/imx/mx6/libcamera2/YuvToJpegEncoder.cpp

//use vpu to encode

    if((inWidth == outWidth) && (inHeight == outHeight)){

  int size;
  size=vpu_encode(inYuv, inYuvPhy, outWidth, outHeight,quality,color,outBuf,outSize);
  return size;

    }

int vpu_encode (...........){

     ---------------------------------------------------------------------------------------------------------------------

ret=VPU_EncEncodeFrame(handle, &sEncEncParam);

    if(VPU_ENC_RET_SUCCESS!=ret){

   FLOGE("%s, vpu encode frame failure: ret=0x%X ",__FUNCTION__,ret);
   if(VPU_ENC_RET_FAILURE_TIMEOUT==ret){
   VPU_EncReset(handle);
   }

    }

    if((sEncEncParam.eOutRetCode & VPU_ENC_OUTPUT_DIS)||(sEncEncParam.eOutRetCode & VPU_ENC_OUTPUT_SEQHEADER)){

   size=sEncEncParam.nOutOutputSize;
   //FLOGI("encode succeed, output size: %d ",size);

    }

    else{

   FLOGE("%s, vpu encode frame failure: no output,  ret=0x%X ",__FUNCTION__,sEncEncParam.eOutRetCode);

---------------------------------------------------------------------------------------------------------------------

   }

Moreover,

iMX6 Reference Manual states that, for MJPEG Maximum resolution support is 8192 x 8192 for VPU Encoding.

Can this issue be solved by using IPU ?

Thanks,

Sandheep

0 Kudos

865 Views
chenguoyin
NXP Employee
NXP Employee

The ‘ret=0x8’ mean vpu timeout

In general, vpu can support up to 8192x8192 for jpeg encoder

For this case, I think customer need to enlarge output buffer size accordingly

Please advise them to modify one macro defined in vpu_wrapper.c:

#define VPU_ENC_BITS_BUF_SIZE (1024*1024)       //enlarge it to 2M or 4M

0 Kudos