Stream encoding

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

Stream encoding

409 Views
Lunsheng
Contributor I

Hi all,

I am now using the libimxvpuapi on an imx8m plus board to do YUV2H264 encoding. I refer to example/encode-example.c. However, I encountered the failure to allocate dma buffer at the line of function call imx_dma_buffer_allocate() as below:

ctx->stream_buffer = imx_dma_buffer_allocate(
ctx->allocator,
ctx->enc_global_info->min_required_stream_buffer_size,
ctx->enc_global_info->required_stream_buffer_physaddr_alignment,
0
);

I get a exception at this call and a print "Bus error" without any detailed informaiton.

Would you please help check what the root cause it is?

Thank you!

 

0 Kudos
Reply
2 Replies

372 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

 

You are using a processor instruction with an address that does not satisfy its alignment requirements. Check your code to avoid this bus error.

 

Regards

0 Kudos
Reply

330 Views
Lunsheng
Contributor I

Thank you for your reply.

According to the comment in the code as below:

/* Creates a new DMA buffer allocator.
 *
 * This uses one of the several available i.MX DMA allocators internally. Which
 * one is used is determined by the build configuration of libimxdmabuffer.
 *
 * @Param error If this pointer is non-NULL, and if an error occurs, then the integer
 *        the pointer refers to is set to an error code from errno.h. If creating
 *        the allocator succeeds, the integer is not modified.
 * @return Pointer to the newly created DMA allocator, or NULL in case of an error.
 */
ImxDmaBufferAllocator* imx_dma_buffer_allocator_new(int *error);
 

It seems that the only thing being related to the allocation of dma buffer is the allocator. When I compiled the libimxdmabuffer, I did not specified which allocator to used because I have no idea which one I should use.

Question: I am now using imx8m plus, what allocator should I use?

 

Thank you!

0 Kudos
Reply