VPU_DecLoad() always returns VPU_DEC_RET_INVALID_PARAM

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

VPU_DecLoad() always returns VPU_DEC_RET_INVALID_PARAM

ソリューションへジャンプ
357件の閲覧回数
PiotrKrygier
Contributor II

Hello,

I am trying to use VPU API on IMX8MM board, but no matter what parameters I add to function VPU_DecLoad() I always get VPU_DEC_RET_INVALID_PARAM return code. What is interesting is that the same parameters, for some reason, work in GStreamer. For example, I hardcoded those parameters (copied from gststreamer debug output):

VpuDecOpenParam open_param;
open_param.CodecFormat = 6;
open_param.nReorderEnable = 1;
open_param.nChromaInterleave = 1;
open_param.nMapType = 0;
open_param.nTiled2LinearEnable = 0;
open_param.nPicWidth = 1920;
open_param.nPicHeight = 800;
open_param.nEnableFileMode = 0;
open_param.nEnableVideoCompressor = 0;
open_param.nPixelFormat = 1;
open_param.nSecureMode = 0;
open_param.nSecureBufferAllocSize = 0;
 
VPU_DecOpen(&handle, &open_param, &mem_info);

This will return invalid params return code. mem_info is setup using VPU_DecQueryMem and manually allocating memory in 
pVirtAddr and pPhyAddr variables.

Appreciate all the help!
ラベル(1)
0 件の賞賛
1 解決策
332件の閲覧回数
PiotrKrygier
Contributor II

I hate replying to my own requests, but I will do it in case someone else have this problem later:

Be VERY sure that you zero VpuMemDesc structure before assigning size to it and passing to VPU_DecGetMem. It's not stated anywhere in documentation, but correct way to use it is:

VpuMemDesc mem_desc;

memset(&mem_desc, 0, sizeof(VpuMemDesc));
mem_desc.nSize = <memory size got from VPU_DecQueryMem + alignment taken from the same function>;

VPU_DecGetMem(&mem_desc);
 
Cheers and good luck for anyone using this API.

元の投稿で解決策を見る

0 件の賞賛
2 返答(返信)
333件の閲覧回数
PiotrKrygier
Contributor II

I hate replying to my own requests, but I will do it in case someone else have this problem later:

Be VERY sure that you zero VpuMemDesc structure before assigning size to it and passing to VPU_DecGetMem. It's not stated anywhere in documentation, but correct way to use it is:

VpuMemDesc mem_desc;

memset(&mem_desc, 0, sizeof(VpuMemDesc));
mem_desc.nSize = <memory size got from VPU_DecQueryMem + alignment taken from the same function>;

VPU_DecGetMem(&mem_desc);
 
Cheers and good luck for anyone using this API.
0 件の賞賛
338件の閲覧回数
PiotrKrygier
Contributor II

Found something, that might be related to the issue: 

pVirtAddr of physical memory is NULL. I have to check, how that happens.
 
I found out, what's going on: 
VPU_DecGetMem
 
returns a structure, where nVirtAddr is 0. I have no idea why. Any guesses? 
0 件の賞賛