Minor change of i.MX53 VPU decoder flow

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

Minor change of i.MX53 VPU decoder flow

897 Views
torus1000
Contributor V

Hi chip experts,

I found 2 descriptions about vpu_IsBusy() in i.MX5x_Linux_VPU_API.pdf.
  (1) Figure 4. Decoder Operation Flow on p41
  (2) 4.3.3.5 Completion of Picture Decoding on p86

Is it possible to replace vpu_IsBusy() call with vpu_WaitForInt()?
Because I prefer interrupt rather than polling.

If yes, are any modifications need except above swap?

Can anyone help me?

Thanks.

Labels (2)
Tags (2)
0 Kudos
8 Replies

660 Views
igorpadykov
NXP Employee
NXP Employee

Hi torus1000

yes it can be used, example can be found in imx-test package

(one needs to select it in ltib)

imx-test-11.09.01/test/mxc_vpu_test/dec.c

Best regards

igor

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

Note: If this post answers your question, please click the Correct Answer button. Thank you!

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

0 Kudos

660 Views
torus1000
Contributor V

Dear Igor,

Thank you for reply.

I confirmed dec.c code included 2 of vpu_WaitForInt(). I'm not sure both of them looks the same as msleep(500).
( 1st one use for vpu reset when hung around 10x500ms. 2nd one rarely use only when vpu_IsBusy==false.)

Regard to dec.c (see below),

Is it possible to replace vpu_IsBusy() with vpu_WaitForInt()?

BR

  is_waited_int = 0;

//line896

  while (vpu_IsBusy()) {

   err = dec_fill_bsbuffer(handle, dec->cmdl,

...

    /* * Suppose vpu is hang if one frame cannot be decoded in 5s,

    * then do vpu software reset. */

//line917

   if (!err) {

    vpu_WaitForInt(500);

    is_waited_int = 1;

    loop_id ++;

   }

  }

//line925

  if (!is_waited_int)

   vpu_WaitForInt(500);

0 Kudos

660 Views
igorpadykov
NXP Employee
NXP Employee

Hi torus1000

yes, I think it is possible to replace vpu_IsBusy() with vpu_WaitForInt()

Best regards

igor

0 Kudos

660 Views
torus1000
Contributor V

Dear Igor,

We customized wait flow as following;

vpu_DecStartOneFrame();

for(i=0;i<30;i++){
  if(SUCCESS == vpu_WaitForInt(Wait time)) break;
  vpu_DecGetBitstreamBuffer();
  vpu_DecUpdateBitstreamBuffer();
}
if(i<30) vpu_DecGetOutputInfo();
else  <Abnormal termination processing>

It worked for now.

(Q) Do you think our flow have no problems?

If somethig wrong, please let us know. Thank you for your kndly reply.

Best Regards.

0 Kudos

661 Views
igorpadykov
NXP Employee
NXP Employee

Hi torus1000

sorry for delay.

I think these codes have not problems.

Best regards

igor

0 Kudos

661 Views
torus1000
Contributor V


Dear Igor,

I really appreciate to your reply.

If you also have some hints about my previous questions, please let me know. (I have to make a report.)

> Why did vpu_IsBusy sometimes continue to return 1 around 25 sec?

Thanks.

0 Kudos

661 Views
igorpadykov
NXP Employee
NXP Employee

Hi torus1000

vpu_IsBusy may return even no vpu interrupt produced, just after timeout.

According to its description:

The application waits for the decoder or encoder to completed the interrupt. This function returns

immediately if the interrupt has been received, otherwise, it returns after timeout_in_ms.

Best regards

igor

0 Kudos

661 Views
torus1000
Contributor V

Dear Igor,

Actually We replaced vpu_IsBusy() with vpu_WaitForInt() but vpu sometimes stopped decoding.

Then we tried both as following order just in case; vpu_WaitForInt -> vpu_IsBusy

The result looks OK in most case. But sometimes vpu state kept in busy in spite of Operation successfully completed.

(OK)   vpu_WaitForInt                        -> vpu_IsBusy
       return RETCODE_SUCCESS    return 0

(FAIL) vpu_WaitForInt                        -> vpu_IsBusy ->      after 25 sec, vpu_IsBusy
       return RETCODE_SUCCESS    return 1                                        return 0
       "Operation successful"              "busy"                                          "idle"

Why did vpu_IsBusy sometimes continue to return 1 around 25 sec?

If you know something about this, please let us know because we need the reason to make sort of failure analysis report.

Thanks.

0 Kudos