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.

vmalloc kernel boot argument and H264 video encode/decode

Guru 10685 points


I have been trying to work out why the "vmalloc=500M" boot argument is needed in order to do H264 video decode/encode using OpenMAX.

I know this argument is necessary because if I don't use it I get this error when I run "firmware_loader $HDVPSS_ID /usr/share/ti/ti-media-controller-utils/dm816x_hdvpss.xem3 start -i2c 0":

"Usage : firmware_loader <Processor Id> <Location of Firmware> <start|stop> [-mmap <memory_map_file>] [-i2c <0|1>]
===Mandatory arguments===
<Processor Id>         0: DSP, 1: Video-M3, 2: Vpss-M3
<Location of Firmware> firmware binary file
<start|stop>           to start/stop the firmware
===Optional arguments===
-mmap                  input memory map bin file name
-i2c                   0: i2c init not done by M3, 1(default): i2c init done by M3
FIRMWARE: isI2cInitRequiredOnM3: 0
FIRMWARE: Default memory configuration is used
MemCfg: DCMM (Dynamically Configurable Memory Map) Version :  2.1.2.1
FIRMWARE: Memory Configuration status : In Progress
FIRMWARE: 2 start Successful
Unable to handle kernel paging request at virtual address 059fc260
pgd = ee514000
[059fc260] *pgd=00000000
Internal error: Oops: 5 [#1] PREEMPT
last sysfs file: /sys/devices/virtual/syslinkipc/syslinkipc_RingIO/dev
Modules linked in: vpss(+) syslink
CPU: 0    Not tainted  (2.6.37+ #4)
PC is at strcmp+0x14/0x40
LR is at platform_match+0x64/0x70
pc : [<c04391cc>]    lr : [<c0480428>]    psr: 60000013
sp : ee4a1e30  ip : 059fc260  fp : ee4a1e3c
r10: 00000000  r9 : ee4a0000  r8 : c0740870
r7 : ee38e980  r6 : bf12d1b0  r5 : c02fa820  r4 : 00000000
r3 : c04803c4  r2 : 00000000  r1 : bf1298e3  r0 : 059fc260
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 10c5387d  Table: ae514019  DAC: 00000015
Process modprobe (pid: 738, stack limit = 0xee4a02e8)
Stack: (0xee4a1e30 to 0xee4a2000)
1e20:                                     ee4a1e54 ee4a1e40 c0480428 c04391c4
1e40: c02fa828 c047f320 ee4a1e74 ee4a1e58 c047f348 c04803d0 00000000 c047f320
1e60: bf12d1b0 ee38e980 ee4a1e9c ee4a1e78 c047e9b8 c047f32c ee01ccb8 ee032f30
1e80: c04351cc 00000001 bf12d19c bf12d1b0 ee4a1eac ee4a1ea0 c047f084 c047e974
1ea0: ee4a1edc ee4a1eb0 c047e290 c047f070 bf1298e3 ee4a1ec0 00000001 bf12d19c
1ec0: bf12d1b0 000a97f8 bf131000 00000000 ee4a1f04 ee4a1ee0 c047f6c0 c047e1e8
1ee0: 00000001 bf12d19c 000a9600 000a97f8 bf131000 ee4a0000 ee4a1f14 ee4a1f08
1f00: c04805e0 c047f61c ee4a1f34 ee4a1f18 c0480614 c04805a0 00000000 bf12d520
1f20: 000a9600 000a97f8 ee4a1f44 ee4a1f38 bf131030 c0480600 ee4a1f7c ee4a1f48
1f40: c0300434 bf13100c bf12d520 000a9600 000a97f8 c0305864 00000000 bf12d520
1f60: 000a9600 000a97f8 c0305864 00000000 ee4a1fa4 ee4a1f80 c035d088 c0300370
1f80: 000a97f8 000a9788 00019470 00000000 00000004 00000080 00000000 ee4a1fa8
1fa0: c03056e0 c035cff8 00019470 00000000 000a97f8 00019470 000a9600 000a9788
1fc0: 00019470 00000000 00000004 00000080 000a9718 000a97f8 000a9788 000a9738
1fe0: bee849c0 bee849b0 00019e80 401a2740 60000010 000a97f8 c0b89460 c0b89480
Backtrace:
[<c04391b8>] (strcmp+0x0/0x40) from [<c0480428>] (platform_match+0x64/0x70)
[<c04803c4>] (platform_match+0x0/0x70) from [<c047f348>] (__driver_attach+0x28/0x8c)
 r5:c047f320 r4:c02fa828
[<c047f320>] (__driver_attach+0x0/0x8c) from [<c047e9b8>] (bus_for_each_dev+0x50/0x84)
 r7:ee38e980 r6:bf12d1b0 r5:c047f320 r4:00000000
[<c047e968>] (bus_for_each_dev+0x0/0x84) from [<c047f084>] (driver_attach+0x20/0x28)
 r6:bf12d1b0 r5:bf12d19c r4:00000001
[<c047f064>] (driver_attach+0x0/0x28) from [<c047e290>] (bus_add_driver+0xb4/0x234)
[<c047e1dc>] (bus_add_driver+0x0/0x234) from [<c047f6c0>] (driver_register+0xb0/0x13c)
[<c047f610>] (driver_register+0x0/0x13c) from [<c04805e0>] (platform_driver_register+0x4c/0x60)
 r9:ee4a0000 r8:bf131000 r7:000a97f8 r6:000a9600 r5:bf12d19c
r4:00000001
[<c0480594>] (platform_driver_register+0x0/0x60) from [<c0480614>] (platform_driver_probe+0x20/0xa0)
[<c04805f4>] (platform_driver_probe+0x0/0xa0) from [<bf131030>] (init_module+0x30/0x5c [vpss])
 r7:000a97f8 r6:000a9600 r5:bf12d520 r4:00000000
[<bf131000>] (init_module+0x0/0x5c [vpss]) from [<c0300434>] (do_one_initcall+0xd0/0x1a4)
[<c0300364>] (do_one_initcall+0x0/0x1a4) from [<c035d088>] (sys_init_module+0x9c/0x1bc)
[<c035cfec>] (sys_init_module+0x0/0x1bc) from [<c03056e0>] (ret_fast_syscall+0x0/0x30)
 r7:00000080 r6:00000004 r5:00000000 r4:00019470
Code: e92dd800 e24cb004 e3a02000 e1a0c000 (e7dc0002)
---[ end trace e119577968a36405 ]---
Segmentation fault
ti81xxfb: gave up waiting for init of module vpss.
ti81xxfb: Unknown symbol vps_grpx_get_ctrl (err -16)"

My current theories are that something is causing the syslink module to run its Memory_alloc, Memory_valloc or Memory_calloc function (the ringio component of syslink commanded by the HDVPSS binary over IPC?) which would cause vmalloc to be called to allocate memory. Thing is, I can't work out what is causing vmalloc to be called to allocate such a large amount of memory.

In the capture_encode example I've also looked at, there are no more than 64MB of memory allocated as a result of the "OMX_AllocateBuffer" calls yet I see that in /proc/meminfo the "VmallocUsed" field increases by about 190MB when I run the capture_encode example.

Please could someone from TI explain to me the purpose of the "vmalloc=" kernel parameter in the context of video encode/decode and also tell me how so much memory gets allocated as a result of the capture_encode program being run?

Thanks,
Ralph

  • Hello,

    I wondered whether anyone at TI had an answer about this vmalloc question? Should I repost in the Linux forum?

    Thanks,
    Ralph

  • Anyone have any tips on this one?

  • Syslink/IPC allows creation of SharedRegions at config time. Config time means the information about the shared region is embedded in the firmware executable. When the firmware is loaded , the syslink HOST (cortex A8) side will map the SharedRegion into the kernel and user space on A8 . The bulk of the vmalloc requirement comes from the shared region size since the shared region is mapped into kernel space. Addition vmalloc space is used by the syslink when loading the firmware where each initialized section in the firmware results in a vmalloc. This will amount to a couple of MB but the bulk is due to shared region. SharedRegion is the shared memory heap from which all cores allocate frame buffers in OMX

  • Badri, thanks for your answer, it makes sense and clears up something I've been wondering about for a while now.
    Cheers!