omap3530 ,就在一个程序里面实验,打开Engine_open,打开了七次之后,第八次,就起不来了,请专家帮忙看看。错误信息如下:
vmap allocation failed: use vmalloc=<size> to increase size.
DSP_init status [0x8000800c]Unable to handle kernel paging request at virtual address c66d8000
pgd = c245c000
[c66d8000] *pgd=8437f011, *pte=00000000, *ppte=00000000
Internal error: Oops: 7 [#1]
Modules linked in: lpm_omap3530 dsplinkk cmemk
CPU: 0 Not tainted (2.6.28-rc9-omap1 #1)
PC is at OMAP3530_exit+0x5c/0x14c [dsplinkk]
LR is at DSP_exit+0x28/0x30 [dsplinkk]
pc : [<bf00c9b4>] lr : [<bf00c0fc>] psr: 80000013
sp : c269dd98 ip : c269ddd8 fp : c269ddd4
r10: bf026864 r9 : bf026860 r8 : c6fe5000
r7 : c6fdc000 r6 : 00008000 r5 : 00000000 r4 : c66d8000
r3 : 00000000 r2 : c6fe2000 r1 : bf026864 r0 : 00000000
Flags: Nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
Control: 10c5387d Table: 8245c018 DAC: 00000015
Process encode (pid: 1505, stack limit = 0xc269c2e0)
Stack: (0xc269dd98 to 0xc269e000)
dd80: bf018dd8 c004146cdda0: c6fe5000 c6fdc000 c269ddf4 c269ddb8 00000000 bf026894 00008000 00000000ddc0: 00000000 8000800c c269dde4 c269ddd8 bf00c0fc bf00c964 c269de04 c269dde8dde0: bf00e2bc bf00c0e0 bf026894 00000000 00000028 00000000 c269de4c c269de08de00: bf00e5b0 bf00e274 c269de34 bf026894 bf026584 c6fd9000 bf027ea4 00000000de20: c269de4c 00000000 00008000 00000000 00000000 bf027e9c 00000001 00000000de40: c269de8c c269de50 bf01c430 bf00e310 00000001 c75b5000 00000000 00000000de60: 00000000 00006c08 00008000 40bafd7c c4f4cec0 40bafd7c c269c000 00000000de80: c269def4 c269de90 bf01d234 bf01c350 c0093994 c008533c c245c000 00000000dea0: 00000000 c43ab958 00000000 0000004e 00056000 c04b9920 00000000 00008000dec0: 00000000 00000000 00000000 000ba874 000b9c14 c245c000 c269df3c 00006c08dee0: 40bafd7c 00006c08 c269df0c c269def8 c00b4e1c bf01cd80 c4f4cec0 00000009df00: c269df7c c269df10 c00b529c c00b4dc0 c269df2c ffffffff 00000200 c2475d30df20: c269df3c c269df30 c0074338 c019d928 c269df7c c269df40 c0035df0 c0074334df40: 00000000 c043a57c 0000000b 00000000 00000000 00000009 40bafd7c 00006c08df60: c4f4cec0 c002ff28 c269c000 00000000 c269dfa4 c269df80 c00b531c c00b4e64df80: c269c000 00000001 00008000 000bb2a0 000bcd68 00000036 00000000 c269dfa8dfa0: c002fd80 c00b52e8 00008000 000bb2a0 00000009 00006c08 40bafd7c 00000009dfc0: 00008000 000bb2a0 000bcd68 00000036 000000c8 0000000a 000b8c7c 40bafd6cdfe0: 000bcd34 40bafca0 0004fc90 4028c29c 80000010 00000009 697d807d 677d7d7dBacktrace:[<bf00c958>] (OMAP3530_exit+0x0/0x14c [dsplinkk]) from [<bf00c0fc>] (DSP_exit+0x28/0x30 [dsplinkk])
[<bf00c0d4>] (DSP_exit+0x0/0x30 [dsplinkk]) from [<bf00e2bc>] (LDRV_PROC_exit+0x54/0x9c [dsplinkk])
[<bf00e268>] (LDRV_PROC_exit+0x0/0x9c [dsplinkk]) from [<bf00e5b0>] (LDRV_PROC_init+0x2ac/0x2f4 [dsplinkk])
r7:00000000 r6:00000028 r5:00000000 r4:bf026894
[<bf00e304>] (LDRV_PROC_init+0x0/0x2f4 [dsplinkk]) from [<bf01c430>] (PMGR_PROC_attach+0xec/0x2fc [dsplinkk])
[<bf01c344>] (PMGR_PROC_attach+0x0/0x2fc [dsplinkk]) from [<bf01d234>] (DRV_Ioctl+0x4c0/0x7d8 [dsplinkk])
[<bf01cd74>] (DRV_Ioctl+0x0/0x7d8 [dsplinkk]) from [<c00b4e1c>] (vfs_ioctl+0x68/0x78)
r6:00006c08 r5:40bafd7c r4:00006c08
[<c00b4db4>] (vfs_ioctl+0x0/0x78) from [<c00b529c>] (do_vfs_ioctl+0x444/0x484)
r5:00000009 r4:c4f4cec0
[<c00b4e58>] (do_vfs_ioctl+0x0/0x484) from [<c00b531c>] (sys_ioctl+0x40/0x64)
[<c00b52dc>] (sys_ioctl+0x0/0x64) from [<c002fd80>] (ret_fast_syscall+0x0/0x2c)
r7:00000036 r6:000bcd68 r5:000bb2a0 r4:00008000
Code: e5973068 e3530003 83a06902 8a000013 (e594c000)
Jing Cui:
注意在下一次打开Engine之前正确关掉前一次打开的Engine.参考下面的顺序
idevfd = open(“/dev/xxx”, O_RDONLY); // get input device
ofilefd = open(“./fname”, O_WRONLY);// get output device
ioctl(idevtfd, CMD, &args); // initialize IO devices…
CERuntime_init(); // Called once in any CE app
myCE = Engine_open(“vcr”, myCEAttrs); // prepare VISA environment
myVE = VIDENC_create(myCE,”videnc”,params);// prepare to use video encoder
while( doRecordVideo == 1 ) { // Execute phase
read(idevfd, &rd, sizeof(rd));// read/swap buffer with Input device
VIDENC_control(myVE, …); // option: perform VISA std algo ctrl
VIDENC_process(myVE, …);// run algo with new buffer
write(ofilefd, &wd, sizeof(wd));// pass results to Output device
}
close(idevfd);// Delete phase
close(ofilefd);// return IO devices back to OS
VIDENC_delete(myVE);// algo RAM back to heap
Engine_close(myCE);// close VISA framework
zou Samen:
回复 Jing Cui:
谢谢jing,顺序对过了,没有差错,也实验过,还是同样的现象,我估计是server分配的内存问题呢因为,只执行Engine_open 和 engine close 也是同样的现象,Engine_open执行,是否已经调用all.64x 库 了??
Jing Cui:
回复 zou Samen:
你可以看到Engine_open的源码,应该没调all.64x。
另外,注意Engine open的一些原则,还可以找更多的资源:processors.wiki.ti.com/…/Category:Codec_Engine
Only one Engine can be open at a time*
The Engine can:Only be accessed from within a single process *be accessed across multiple threads within a single process
All threads must open the same Engine (i.e. Engine’s name must match)
Each thread should obtain its own Engine handle
Often, main thread creates environment variable – with engine “name” – to passto each thread which uses CE