This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

dqueue buffer failed

Hi all,

Our model is Blaze_tablet, Android Version is 4.0.4.

When we try to decoding one bit stream with different resolution such 1280*720(350 frames)->1024*576(300 frames)-> 1280*720(350 frames), when we try to dequeue first buffer for red parts, dequeue buffer is failed.

As we know, when reslution is changed in input bit stream, port setting changed event will be callback. Then we need to do flush output buffer, disable, deallocate, enable, reallocate operations. Before to dequeue buffer, we use cancelBuffer to cancel buffers for former resolutions.

Error information from GraphicBufferAllocator is as following, following blue parts is allocated for former 1024*576(300 frames).

08-16 05:19:38.377: W/GraphicBufferAllocator(107): alloc(1408, 832, 256, 00000b00, ...) failed -12 (Out of memory)
08-16 05:19:38.377: D/GraphicBufferAllocator(107): Allocated buffers:
08-16 05:19:38.377: D/GraphicBufferAllocator(107):   0x6036a8: 2208.00 KiB | 1024 (1024) x  552 |        1 | 0x00000933
08-16 05:19:38.377: D/GraphicBufferAllocator(107):   0x60da98: 2400.00 KiB | 1024 (1024) x  600 |        1 | 0x00000933
08-16 05:19:38.377: D/GraphicBufferAllocator(107):   0x60f590:  192.00 KiB | 1024 (1024) x   48 |        5 | 0x00000b00
08-16 05:19:38.377: D/GraphicBufferAllocator(107):   0x6101b0: 6400.00 KiB | 1569 (1600) x 1024 |        5 | 0x00000b00
08-16 05:19:38.377: D/GraphicBufferAllocator(107):   0x610d98: 2208.00 KiB | 1024 (1024) x  552 |        1 | 0x00000933
08-16 05:19:38.377: D/GraphicBufferAllocator(107):   0x611d38:  192.00 KiB | 1024 (1024) x   48 |        5 | 0x00000b00
08-16 05:19:38.377: D/GraphicBufferAllocator(107):   0x614260: unknown     | 1152 (4096) x  672 |      100 | 0x00000b00
08-16 05:19:38.377: D/GraphicBufferAllocator(107):   0x614430:    0.12 KiB |    1 (  32) x    1 |        1 | 0x00000933
08-16 05:19:38.377: D/GraphicBufferAllocator(107): Total allocated (estimate): 13600.12 KB
08-16 05:19:38.377: D/GraphicBufferAllocator(107): IMG Graphics HAL state:
08-16 05:19:38.377: D/GraphicBufferAllocator(107):   Dumping all active sync objects..
08-16 05:19:38.377: D/GraphicBufferAllocator(107):     ID=1635, 0xP...FHWR=0x00000b00, WOP/WOC=0x0/0x0, ROP/ROC=0x0/0x0, ROP2/ROC2=0xe/0xd, WOC DevVA=0x0d8006a4, ROC DevVA=0x0d8006ac, ROC2 DevVA=0x0d8006b4
08-16 05:19:38.377: D/GraphicBufferAllocator(107):     ID=1603, 0xP...FHWR=0x00000933, WOP/WOC=0x0/0x0, ROP/ROC=0x13/0x13, ROP2/ROC2=0x0/0x0, WOC DevVA=0x0d804804, ROC DevVA=0x0d80480c, ROC2 DevVA=0x0d804814
08-16 05:19:38.377: D/GraphicBufferAllocator(107):     ID=1602, 0xP...FHWR=0x00000933, WOP/
08-16 05:19:38.377: E/SurfaceFlinger(107): GraphicBufferAlloc::createGraphicBuffer(w=1408, h=832) failed (Out of memory), handle=0x0
08-16 05:19:38.377: E/SurfaceTexture(107): [SurfaceView] dequeueBuffer: SurfaceComposer::createGraphicBuffer failed 

Can anyone tell us why malloc is out of memory? Thx.

regards,

guangx

  • Hi Guang,

    Can you share the logcat output while you are switching from one resolution to other with Port Setting Event being serviced for further clues and hints?

    Also, could you please check the tiler memory by using the following sysfs command for both working and non-working scenarios.

    cat /d/tiler/map/2x2

    Thanks & Best Regards,

    Venkat

  • hi Venkat

    we do "cat /d/tiler/map/2x2" about four times.

    1. non-working

    2.working in resolution 1.

    3.working in resolution 2.

    4.dequeue buffer is failed when port setting changed event appear during working in resolution 2.

    the attachment is the result about "cat /d/tiler/map/2x2"

    Best Regards

    shaoyuan8446.result.txt

  • Hi Shaoyuan,

    As per the tiler allocation output attached, I can see that the allocated buffers are not getting freed up during Port Reconfiguration which involves free buffers and allocate new buffers as per the new resolution requirements.

    Could you please check from this view point why the free buffers is not taking effect during port reconfiguration?

    Thanks & Best Regards,

    Venkat

  • hi Venkat,

    thanks for your reply.

    we checked our code, we do as follow during Port Reconfiguration:

    1.flush output port.

    2.disable output  port.

    3. use OMX_FreeBuffer and cancelBuffer to cancel output  port buffers.

    4.enable output port and reallocate buffers for it.

    we find that it is likely the cancelBuffer did not taking effect (the return of  cancelBuffer  is ok), and we did not find the reason .

    could you give we some advice about how to check the function "cancelBuffer " is effective.

    Best Regards

    shaoyuan


  • Hi Shaoyuan,

    Is it possible for you to monitor the output of cat /d/tiler/map/2x2 before and after the cancelBuffer calls which would indicate whether there are any buffers got freed up after cancelBuffer in the tiler memory space?

    Which android ICS release are you using currently? Can you try the same thing on the latest 4AI.1.7 ICS release and see if it makes any difference?

    Thanks & Best Regards,

    Venkat

  • Hi Shaoyuan,

    Please share the tiler allocation outputs for further analysis.

    Do you have any update with respect to testing on latest 4AI.1.7 ICS release?

    Thanks & Best Regards,

    Venkat

  • Hi Venkat

    we do not try  4AI.1.7. the os we use is relatively new,but the problem will be appear again.