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.

Video Texture rendering with SGX on omap3530 platform

Other Parts Discussed in Thread: OMAP3530

hi

recently I build a Qt application with SGX Opengles support to rendering video with QGLwidget, but

find the performance is not good, and I get to know that there is a way to make it faster with

OMAP35x_AM35x_Video_Texture_Streaming( link:http://software-dl.ti.com/dsps/dsps_public_sw/apps_processors/OMAP35x_AM35x_Video_Texture_Streaming/1_0/index_FDS.html)

I had tried to build the example bc_cat-0.2, but when run the test. if failded as the below:

# ./gles2_bc_mmap

gles2_bc_mmap: page allocation failure. order:5, mode:0xd0
[<c0343730>] (dump_stack+0x0/0x14) from [<c0095af0>] (__alloc_pages_internal+0x398/0x3b8)
[<c0095758>] (__alloc_pages_internal+0x0/0x3b8) from [<c0095b7c>] (__get_free_pages+0x20/0x54)
[<c0095b5c>] (__get_free_pages+0x0/0x54) from [<c0095be4>] (alloc_pages_exact+0x34/0xa0)
[<c0095bb0>] (alloc_pages_exact+0x0/0xa0) from [<bf0697a4>] (bc_ioctl+0x2ec/0x488 [bc_cat])
 r7:becffa50 r6:c5c16320 r5:00000038 r4:c5c16bc0
[<bf0694b8>] (bc_ioctl+0x0/0x488 [bc_cat]) from [<c00c0634>] (vfs_ioctl+0x68/0x78)
[<c00c05cc>] (vfs_ioctl+0x0/0x78) from [<c00c0b4c>] (do_vfs_ioctl+0x4dc/0x520)
 r7:c59ed6c0 r6:c0086703 r5:c59ed6c0 r4:00000003
[<c00c0670>] (do_vfs_ioctl+0x0/0x520) from [<c00c0bd0>] (sys_ioctl+0x40/0x64)
[<c00c0b90>] (sys_ioctl+0x0/0x64) from [<c0031e40>] (ret_fast_syscall+0x0/0x2c)
 r7:00000036 r6:becffa50 r5:00000000 r4:ffffffff
Mem-info:
Normal per-cpu:
CPU    0: hi:   42, btch:   7 usd:   0
Active_anon:109 active_file:918 inactive_anon:171
 inactive_file:7200 unevictable:0 dirty:11 writeback:0 unstable:0
 free:778 slab:935 mapped:299 pagetables:36 bounce:0
Normal free:3112kB min:1268kB low:1584kB high:1900kB active_anon:436kB inactive_anon:684kB active_file:3672kB inactive_file:28800kB unevictable:0kB present:100584kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0
Normal: 54*4kB 34*8kB 50*16kB 27*32kB 13*64kB 1*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB 0*8192kB = 3112kB
8143 total pagecache pages
0 pages in swap cache
Swap cache stats: add 0, delete 0, find 0/0
Free swap  = 0kB
Total swap = 0kB
25344 pages of RAM
2023 free pages
13122 reserved pages
935 slab pages
4927 pages shared
0 pages swap cached
Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = c5e84000
[00000000] *pgd=85e1a031, *pte=00000000, *ppte=00000000
Internal error: Oops: 0 [#1]
Modules linked in: cmemk bc_cat omaplfb pvrsrvkm sdmak lpm_omap3530 dsplinkk [last unloaded: cmemk]
CPU: 0    Not tainted  (2.6.29-rc3-omap1 #1)
PC is at 0x0
LR is at BM_CreateContext+0xe8/0x1d0 [pvrsrvkm]
pc : [<00000000>]    lr : [<bf04329c>]    psr: a0000013
sp : c5f61dd0  ip : c5805a00  fp : c5f61e04
r10: c5f61e14  r9 : 00000000  r8 : c5f61e5c
r7 : c5f81a60  r6 : 00000000  r5 : c5dac740  r4 : c5f81ac0
r3 : c5f81ae0  r2 : c5f61e14  r1 : c5f81ac0  r0 : c5dac740
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 10c5387d  Table: 85e84019  DAC: 00000015
Process gles2_bc_mmap (pid: 1809, stack limit = 0xc5f602e0)
Stack: (0xc5f61dd0 to 0xc5f62000)
1dc0:                                     bf044a24 bf03f324 c5b975a0 c5f81ac0
1de0: 00000000 c5df1da0 00000000 c5ea2000 c5ea300c 00000000 c5f61e44 c5f61e08
1e00: bf046d2c bf0431c0 c5ea3008 c5f61e60 00000021 c5df1da0 c5ea2000 c5ea3000
1e20: c5df1da0 00000000 c5ea2000 00000003 c5f60000 00000000 c5f61e84 c5f61e48
1e40: bf051250 bf046d04 c5ea300c c5f61e5c bf05bb6c c5f61eb0 c5df1da0 00000000
1e60: 00000003 c5dac740 c5ea2000 c5f61eb0 c5df1da0 c5ea3000 c5f61eac c5f61e88
1e80: bf04e0a8 bf0511d0 becff314 c01c6703 00000711 c5990f20 becff314 c5f60000
1ea0: c5f61eec c5f61eb0 bf049d4c bf04dfe0 00000003 0000001c becff5d0 00000008
1ec0: becff344 0000028c 00000002 c5df1da0 00000201 c5990f20 becff314 c01c6703
1ee0: c5f61f0c c5f61ef0 c00c0634 bf049c94 00000004 c5990f20 c01c6703 c5990f20
1f00: c5f61f7c c5f61f10 c00c0b4c c00c05d8 00000000 00000000 fffffffd 00000000
1f20: c5f61f54 c5f61f30 c0076350 c0052f14 c598a01c c59b2980 00000017 c5db5e20
1f40: c5f60000 c0031e94 c5f61f6c c5f61f58 c00763e0 00000004 becff314 c01c6703
1f60: c5990f20 c0031fe8 c5f60000 00000000 c5f61fa4 c5f61f80 c00c0bd0 c00c067c
1f80: c0343ee4 00000000 40289860 becff94c becff344 00000036 00000000 c5f61fa8
1fa0: c0031e40 c00c0b9c 40289860 becff94c 00000004 c01c6703 becff314 0000001c
1fc0: 40289860 becff94c becff344 00000036 becff5f4 00000000 00000000 00000100
1fe0: 402897d0 becff310 4028c6d4 40158aec a0000010 00000004 00000000 00000000
Backtrace:
[<bf0431b4>] (BM_CreateContext+0x0/0x1d0 [pvrsrvkm]) from [<bf046d2c>] (PVRSRVCreateDeviceMemContextKM+0x34/0x11c [pvrsrvkm])
[<bf046cf8>] (PVRSRVCreateDeviceMemContextKM+0x0/0x11c [pvrsrvkm]) from [<bf051250>] (PVRSRVCreateDeviceMemContextBW+0x8c/0x1a4 [pvrsrvkm])
[<bf0511c4>] (PVRSRVCreateDeviceMemContextBW+0x0/0x1a4 [pvrsrvkm]) from [<bf04e0a8>] (BridgedDispatchKM+0xd4/0x144 [pvrsrvkm])
 r7:c5ea3000 r6:c5df1da0 r5:c5f61eb0 r4:c5ea2000
[<bf04dfd4>] (BridgedDispatchKM+0x0/0x144 [pvrsrvkm]) from [<bf049d4c>] (PVRSRV_BridgeDispatchKM+0xc4/0xec [pvrsrvkm])
 r9:c5f60000 r8:becff314 r7:c5990f20 r6:00000711 r5:c01c6703
r4:becff314
[<bf049c88>] (PVRSRV_BridgeDispatchKM+0x0/0xec [pvrsrvkm]) from [<c00c0634>] (vfs_ioctl+0x68/0x78)
 r6:c01c6703 r5:becff314 r4:c5990f20
[<c00c05cc>] (vfs_ioctl+0x0/0x78) from [<c00c0b4c>] (do_vfs_ioctl+0x4dc/0x520)
 r7:c5990f20 r6:c01c6703 r5:c5990f20 r4:00000004
[<c00c0670>] (do_vfs_ioctl+0x0/0x520) from [<c00c0bd0>] (sys_ioctl+0x40/0x64)
[<c00c0b90>] (sys_ioctl+0x0/0x64) from [<c0031e40>] (ret_fast_syscall+0x0/0x2c)
 r7:00000036 r6:becff344 r5:becff94c r4:40289860
Code: bad PC value.

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

my platform env is : Linux-psp-02.01.03.11,  OMAP35x_Graphics_SDK_3_00_00_09.

note that INSTALL said that it should patch sgx-gfx-sdk with


--- ./GFX_Linux_KM/services4/system/omap3430/sysinfo.h.orig     2009-10-30 01:13:26.000000000 -0500
+++ ./GFX_Linux_KM/services4/system/omap3430/sysinfo.h  2010-02-12 11:20:59.000000000 -0600
@@ -38,7 +38,7 @@

 } SYS_DEVICE_TYPE;

-#define SYS_DEVICE_COUNT 3
+#define SYS_DEVICE_COUNT 15

 #define PRM_REG32(offset)        (offset)
 #define CM_REG32(offset)         (offset

--- ./GFX_Linux_KM/services4/srvkm/common/deviceclass.c.orig    2009-10-30 01:13:26.000000000 -0500
+++ ./GFX_Linux_KM/services4/srvkm/common/deviceclass.c 2010-02-12 11:19:55.000000000 -0600
@@ -417,7 +417,12 @@
        psDeviceNode->psSysData = psSysData;


-       AllocateDeviceID(psSysData, &psDeviceNode->sDevId.ui32DeviceIndex);
+    if (AllocateDeviceID(psSysData, &psDeviceNode->sDevId.ui32DeviceIndex)
+            != PVRSRV_OK) {
+        PVR_DPF((PVR_DBG_ERROR,"PVRSRVRegisterBCDeviceKM: Failed deviceId alloc"));
+        goto ErrorExit;
+    }
+
        psBCInfo->ui32DeviceID = psDeviceNode->sDevId.ui32DeviceIndex;
        if (pui32DeviceID)
        {


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

I tried it but failed.

anybody can help me make bc_cat example succeed to run?

thanks

  • 1. Please upgrade to the latest Graphics SDK and kernel available at,

    http://processors.wiki.ti.com/index.php/OMAP35x_Graphics_SDK_Getting_Started_Guide

    2. Please mention the graphics environment using the below script,

  • it seems like kernel has not enough memory for video texture buffers. I had not seen this issue.

    Since you already have cmem.ko loaded, can you please try to run loadmodules.sh in the test folder and run gles2_bc_cmem to use external CMEM buffers for the video textures. If that runs fine we can ensure you all setup is correct. then we can figure out gles2_bc_mmap later.

    BTY, what do you mean it failed when you patch the code? you cannot patch the driver or gles2_bc_mmap still fails with the patch?

  • hi Liu Bin

    thanks for your reply, I tried to load cmem.ko, but when run gles2_bc_cmem

    same phenomenon happen. about the patch, note that it is just delete some lines

    so I do it directly to the source, but after the changes,  the same problem happen.

    my command line for boot kernel is :

    setenv bootargs mem=88M console=ttyS2,115200n8 noinitrd root=/dev/mmcblk0p2 rw rootwait mpurate=600 proto=tcp vram=10M omapfb.vram=0:4M,1:4M,2:2M omapfb.rotate=1 omapfb.rotate_type=1 omap_vout.vid1_static_vrfb_alloc=y

    kernel is 2.6.29-rc3-omap1,

    any suggestion?

     

  • There are a couple of things to try:

    1. please remove rotation from bootargs. I never tried that rotation;

    2. can you run any Gfx SDK demos? such as 'gles1test1  0'

    please follow Prabu's intruction above to get your graphics setup info and post it here.  is it possible for you to upgrade to the latest gfx SDK? PSP as while?

  • HI Liu Bin

    I had removed rotation bootargs, the gfxdemo and bc-cat-0.1(gles1_cat_*) texture stream work well,

    but gles1_cat_webcam show scratched video cube.  any binary generated by bc-cat-0.2 corrupt just like before.

    there are two more concerning about it

    1. if rotate disabled at bootargs, OSD or omapfb overlay will not work,  so dvsdk interface can't work. how to make it work at such circumstance?

    2. how to make gles2_bc_**  work?  I think the situation is just as http://e2e.ti.com/support/dsp/omap_applications_processors/f/42/p/40394/149000.aspx#149000

    What is the difference between SGX -sdk3.0.0.9 and the current release you used?

    sorry, as my framework is based on Gstreamer-ti, which is based linux-2.01.03.11, and sgx-sdk-3.0.0.9, qt4.6 dependency matched, so it is not easy to change the

    kernel and gfx sdk version.   can you have better suggestion?

    by the way, can you show me how to make interface demo and gfx/video blend example worked on dvsdk-3.00.02.44 environment?

    especially gfx framebuffer/video blending or OSD example,  if it work, I can give up  pvr gfx texture streaming.

    thanks

  • I assume you want OpenGLES rendering to framebuffer overlay (/dev/fb0), video stream to video overlay (/dev/video1 or /dev/video2), and use DSS alpha blending to blend the two layers together. Can you please confirm if it is true, and provide more details what your project is trying to do. I have a solution without texture streaming for that and will give you the details.

    Or if you just want to make a transparent video window in framebuffer OSD to show the video in video overlay, not translucent gfx overlay, you can even simply use DSS color-keying.

  • my project is aimed to show a  video streaming at background, and on the foreground, show some control widget(with Qt),and embedded

    another channel video display, used gstreamer as framework to integration DSP CODEC and networking streaming. as dmai gstream plugin

    is just stable at the release version, so kernel and gfxsdk version is impossible to change to the latest.   and yes, the first way you mentioned

    is what I prefer, and also interesting with the second, can you show me some example code that worked at OMAP3530 board with the specified

    linux and gfxsdk version that I mentioned? the dvsdk demo can't run at my board. 

  • DSS can do alpha blending or color keying on gfx overlay and video overlay. The PSP user guide (http://processors.wiki.ti.com/index.php/UserGuideDisplayDrivers_PSP_03.00.00.05) has details how to enable it. also src/examples/examples.tar.gz in PSP package has example how to use it.