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.

DMVA2IPNC-MT5 problem : Error - 3 while decompressing

Hi,

I rebuilt the kernel and cramfs for DMVA2IPNC-MT5 (dm368 board), using appro's software. After re-flashing the kernel and cramfs to the camera, I set the following environment variables:

setenv bootcmd 'nand read 0x82000000 0x700000 0x1000000; nboot 0x80700000 0 0x500000; bootm 0x80700000'

setenv bootargs 'mem=48M console=ttyS1, 115200n8 root=/dev/ram0 rw initrd=0x82000000, 16M ip=dhcp etch=$(ethaddr)'

After reflashing, when I reboot, I don't get a successful boot and the booting is stuck with the error "Error - 3 while decompressing". I am using an old version of appro's software (beta version). The complete boot log is as follows:

 

DM36x initialization passed!

TI UBL Base Version: 1.50

Boot Loader BootMode = NAND

Starting NAND Copy...

Valid magicnum, 0xA1ACED66, found in block 0x00000008.

Boot Mode Task Completed

 IPNC UBL Version: 1.1.0

Platform: DM368

 Reset RTC Fail..

 

Jumping to entry point at 0x81080000

 

U-Boot 1.3.4 (Dec  9 2010 - 17:44:14) DM368-IPNC-1.0.1

 

I2C:   ready

DRAM:  128 MB

NAND:  NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,

3V 8-bit)

Bad block table found at page 65472, version 0x01

Bad block table found at page 65408, version 0x01

128 MiB

In:    serial

Out:   serial

Err:   serial

ARM Clock :- 432MHz

DDR Clock :- 340MHz

Ethernet PHY: GENERIC @ 0x01

Hit any key to stop autoboot:  0

 

NAND read: device 0 offset 0x700000, size 0x1000000

 16777216 bytes read: OK

 

Loading from NAND 128MiB 3,3V 8-bit, offset 0x500000

   Image Name:   Linux-2.6.18_pro500-davinci_IPNC

   Image Type:   ARM Linux Kernel Image (uncompressed)

   Data Size:    1865160 Bytes =  1.8 MB

   Load Address: 80008000

   Entry Point:  80008000

## Booting kernel from Legacy Image at 80700000 ...

   Image Name:   Linux-2.6.18_pro500-davinci_IPNC

   Image Type:   ARM Linux Kernel Image (uncompressed)

   Data Size:    1865160 Bytes =  1.8 MB

   Load Address: 80008000

   Entry Point:  80008000

   Verifying Checksum ... OK

   Loading Kernel Image ... OK

OK

 

Starting kernel ...

 

Linux version 2.6.18_pro500-davinci_IPNC_DM368_2.0.0 (root@umair-HP-Compaq-nc843

0-RF591UC-ACF) (gcc version 4.2.0 (MontaVista 4.2.0-16.0.32.0801914 2008-08-30))

 #1 PREEMPT Fri Apr 22 16:50:05 EDT 2011

CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177

Machine: DaVinci DM368 IPNC

Memory policy: ECC disabled, Data cache writeback

DaVinci DM0365 variant 0x8

PLL0: fixedrate: 24000000, commonrate: 170000000, vpssrate: 340000000

PLL0: vencrate_sd: 75555555, ddrrate: 340000000 mmcsdrate: 48571428

PLL1: armrate: 432000000, voicerate: 20571428, vencrate_hd: 27000000

CPU0: D VIVT write-back cache

CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets

CPU0: D cache: 8192 bytes, associativity 4, 32 byte lines, 64 sets

Built 1 zonelists.  Total pages: 12288

Kernel command line: mem=48M console=ttyS1,115200n8 root=/dev/ram0 rw initrd=0x8

2000000,15M eth=$(ethaddr)

TI DaVinci EMAC: kernel boot params Ethernet address: $(ethaddr)

PID hash table entries: 256 (order: 8, 1024 bytes)

Clock event device timer0_0 configured with caps set: 07

Console: colour dummy device 80x30

Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)

Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)

Memory: 48MB = 48MB total

Memory: 29220KB available (3193K code, 653K data, 184K init)

Security Framework v1.0.0 initialized

Capability LSM initialized

Mount-cache hash table entries: 512

CPU: Testing write buffer coherency: ok

checking if image is initramfs...it isn't (bad gzip magic numbers); looks like a

n initrd

Freeing initrd memory: 15360K

NET: Registered protocol family 16

DaVinci: 104 gpio irqs

MUX: initialized GPIO20

MUX: initialized I2C_SCL

Generic PHY: Registered new driver

ch0 default output "COMPOSITE", mode "NTSC"

VPBE Encoder Initialized

SCSI subsystem initialized

NET: Registered protocol family 2

IP route cache hash table entries: 512 (order: -1, 2048 bytes)

TCP established hash table entries: 2048 (order: 1, 8192 bytes)

TCP bind hash table entries: 1024 (order: 0, 4096 bytes)

TCP: Hash tables configured (established 2048 bind 1024)

TCP reno registered

VFS: Disk quotas dquot_6.5.1

Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)

squashfs: version 3.1 (2006/08/19) Phillip Lougher

JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.

yaffs Apr 22 2011 16:47:31 Installing.

SGI XFS with no debug enabled

Initializing Cryptographic API

io scheduler noop registered

io scheduler anticipatory registered (default)

LTT : ltt-facilities init

LTT : ltt-facility-core init in kernel

DAVINCI-WDT: DaVinci Watchdog Timer: heartbeat 60 sec

Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing disabled

serial8250.0: ttyS0 at MMIO map 0x1c20000 mem 0xfbc20000 (irq = 40) is a 16550A

serial8250.0: ttyS1 at MMIO map 0x1d06000 mem 0xfbd06000 (irq = 41) is a 16550A

RAMDISK driver initialized: 1 RAM disks of 32768K size 1024 blocksize

Davinci EMAC MII Bus: probed

MAC address is $(ethaddr)

TI DaVinci EMAC Linux version updated 4.0

netconsole: not configured, aborting

Linux video capture interface: v2.00

Trying to register davinci display video device.

layer=c2ed5000,layer->video_dev=c2ed5160

Trying to register davinci display video device.

layer=c1338e00,layer->video_dev=c1338f60

davinci_init:DaVinci V4L2 Display Driver V1.0 loaded

i2c /dev entries driver

nand_davinci nand_davinci.0: Using 4-bit hardware ECC

NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bi

t)

Creating 6 MTD partitions on "nand_davinci.0":

0x00000000-0x00300000 : "bootloader"

0x00300000-0x00500000 : "params"

0x00500000-0x00700000 : "kernel"

0x00700000-0x01f00000 : "filesystem"

0x01f00000-0x02100000 : "data1"

0x02100000-0x08000000 : "data2"

nand_davinci nand_davinci.0: hardware revision: 2.3

musb_hdrc: version 6.0, cppi-dma, peripheral, debug=0

musb_hdrc musb_hdrc: No DMA interrupt line

musb_hdrc: USB Peripheral mode controller at c3866000 using DMA, IRQ 12

rtc_davinci_dm365 rtc_davinci_dm365.0: rtc intf: proc

rtc_davinci_dm365 rtc_davinci_dm365.0: rtc intf: dev (254:0)

rtc_davinci_dm365 rtc_davinci_dm365.0: rtc core: registered rtc_davinci_dm365 as

 rtc0

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

davinci-mmc davinci-mmc.0: Supporting 4-bit mode

davinci-mmc davinci-mmc.0: Using DMA mode

Advanced Linux Sound Architecture Driver Version 1.0.12rc1 (Thu Jun 22 13:55:50

2006 UTC).

ASoC version 0.13.1

CQ0093 Voice Codec 0.1

asoc: cq93vc <-> davinci-vcif mapping ok

ALSA device list:

  #0: On-chip voice codec (cq93vc)

IPv4 over IPv4 tunneling driver

TCP bic registered

NET: Registered protocol family 1

NET: Registered protocol family 17

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

rtc wait time out !!!!!

Time: timer0_1 clocksource has been installed.

Clock event device timer0_0 configured with caps set: 08

Switched to high resolution mode on CPU 0

rtc_davinci_dm365 rtc_davinci_dm365.0: setting the system clock to 2000-09-14 01

:01:01 (968893261)

Sending DHCP and RARP requests .., OK

IP-Config: Got DHCP answer from 143.205.64.31, my address is 143.205.116.248

IP-Config: Complete:

      device=eth0, addr=143.205.116.248, mask=255.255.255.0, gw=143.205.116.1,

     host=143.205.116.248, domain=nes.uni-klu.ac.at, nis-domain=(none),

     bootserver=143.205.64.31, rootserver=143.205.64.31, rootpath=

RAMDISK: cramfs filesystem found at block 0

RAMDISK: Loading 16560KiB [1 disk] into ram disk... done.

VFS: Mounted root (cramfs filesystem) readonly.

Freeing init memory: 184K

Warning: unable to open an initial console.

Error -3 while decompressing!

c03de3a8(-721392)->c1bfc000(4096)

CSL: Module install successful, device major num = 253

CSL: Module version 0.10.00, built on Apr 22 2011 16:51:55

I2C: Module install successful, device major num = 252

DMA: Module install successful, device major num = 251

DRV: Module install successful

DRV: Module built on Apr 22 2011 16:51:58

DRV: EDMACC.QUEPRI  = 00000777

DRV: SYSTEM.MSTPRI0 = 00550011

DRV: SYSTEM.MSTPRI1 = 00000444

DRV: ISP.BCR        = 00000002

DRV: SYSTEM.MISC = 00000391

CMEMK module: built on Apr 22 2011 at 16:51:33

  Reference Linux version 2.6.18

  File /home/umair/IPNetCam/dvsdk_2_10_01_18/linuxutils_2_24_03/packages/ti/sdo/

linuxutils/cmem/src/module/cmemk.c

allocated heap buffer 0xc4000000 of size 0x5000000

CMEM Range Overlaps Kernel Physical - allowing overlap

CMEM phys_start (0x1000) overlaps kernel (0x80000000 -> 0x83000000)

cmemk initialized

EDMAK module: built on Apr 22 2011 at 16:51:35

  Reference Linux version 2.6.18

  File /home/umair/IPNetCam/dvsdk_2_10_01_18/linuxutils_2_24_03/packages/ti/sdo/

linuxutils/edma/src/module/edmak.c

IRQK module: built on Apr 22 2011 at 16:51:36

  Reference Linux version 2.6.18

  File /home/umair/IPNetCam/dvsdk_2_10_01_18/linuxutils_2_24_03/packages/ti/sdo/

linuxutils/irq/src/module/irqk.c

irqk initialized

io scheduler deadline registered

io scheduler cfq registered

 sbulla: unknown partition table

Installing knfsd (copyright (C) 1996 okir@monad.swb.de).

loop: loaded (max 8 devices)

tun: Universal TUN/TAP device driver, 1.6

tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>

CSLIP: code copyright 1989 Regents of the University of California

PPP generic driver version 2.4.2

PPP Deflate Compression module registered

Loading iSCSI transport class v1.1-646.<5>iscsi: registered transport (tcp)

Error -3 while decompressing!

c03deaac(-4197814)->c134a000(4096)

Error -3 while decompressing!

c03ddcf6(3152859)->c0cc0000(4096)

...................

...................

The booting stops with these messages. 

Regards,

  • One more thing to add. The UBL version that the current camera uses is 1.1.0 and the u-boot version is 1.3.4.  Since I am using the old appro's software, can it be the problem? Which appro's software should I use to support these versions of UBL and U-Boot?

  • Hi Umair,

    Reason can be wrong boot arguments, or incomplete cramfs flashing.
    Since your cramfs now might be bigger then original, you may have to change bootargs, or flashing size  accordingly.

    Check your new cramfs file length, and set appropriate bootargs:

    1.)
    setenv bootargs 'mem=48M console=ttyS1, 115200n8 root=/dev/ram0 rw initrd=0x82000000, 16M ip=dhcp etch=$(ethaddr)'
    // here 16M is  cramfs length,
    //48M for Linux is probably OK, but if cramfs is very large, you must increase Linux memory, and then accordingly decrease start addres for cmem.ko in /opt/ipnc/av_capture_load.sh.

    setenv bootcmd 'nand read 0x82000000 0x700000 0x1000000; nboot 0x80700000 0 0x500000; bootm 0x80700000' 
      // here the number 0x1000000 is at least cramfs length

    2.)
    Check your SD_BOOT utility if your cramfs size is OK.
    Look at  dm3xx_sd_boot-6.1/sdcard_flash/sdboot_flash_cfg.h

     

    If your cramfs size is bigger than default defined 14MB, then change it.

    #define KERNEL_SIZE (2*MB)
    #define ROOTFS_SIZE (14*MB)

    If your cramfs size is between 14M and 16M, then this is probably your case, so increase ROOTFS_SIZE to 16MB.

     

    Regards,
    Marko.

  • Markov,

    The size of my new cramfs file is 16.7M (which is bigger than the old cramfs). I changed the cramfs size in bootargs to 18M, but the problem is not resolved. With this cramfs size, what should be the bootargs? Should I still need to do changes in dm3xx_sd_boot-6.1/sdcard_flash/sdboot_flash_cfg.h? 

    Moreover, using appro's old software with latest UBL and U-BOOT is OK?

    Regards,

  • Umair,

    Filesystem is not flashed completely if you are using SD_BOOT default 14MB define, so increase it to 17MB,
    #define ROOTFS_SIZE (17*MB)

    Your bootargs may be OK, but check your exact file size.
    You have 0x1000000 in bootcmd, which is just about 16,7M. So check if your fs is not above 0x1000000.
    If it is then increase bootcmd to e.g. 0x1100000

    Regards,
    Marko.

  • Thanks Markov. I will try it out in the morning. But just for curiosity, it comes in my mind why to change something in SD_BOOT? I am not booting with SDCARD. I am doing a NAND boot. Moreover, just for knowledge....Is it OK to use old appro's software with latest UBL and U-BOOT?

    Regards,

     

  • Umair,

    You are probably using SD_BOOT utility (dm3xx_sd_boot-6.1) for flashing, is that correct ?
    If you do, then you have to set the cramfs size, that you are going to flash.
    Default 14MB define is too small for your filesystem, so you are not  flashing complete 17MB filesystem.

     

    And one more thing.

    Check  in kernel if filesystem partition is large enough for you new filesystem :
    /DM368IPNC_MT5_2.6.0/ipnc/ti-davinci/arch/arm/mach-davinci/board-dm368-ipnc.c   (or configuration file that you are using for your camera)

    static struct mtd_partition nand_partitions[] = {
    ...

        {
            .name = "filesystem",
            .offset = MTDPART_OFS_APPEND,
            .size = SZ_16M + SZ_8M,          //check if this size is OK in your file
            .mask_flags = 0
        },


    If you change this, then rebuild kernel, and flash new uImage.

    Regards,
    Marko.

  • Marko,

    I am not using SDCARD flashing. I am flashing the kernel and file system with serial console. 

    so you mean that the .size variable in this file should be  .size = SZ_16M + SZ_8M. If this is not like this, I should change it like this?

    Regards,

  • Umair,

    Sorry, i thought you were using using sd_boot flashing tool.

    If you are using serial then :
    nand write 0x82000000 0x700000 0x1100000    //where 0x1100000 is at least  filesystem size


    Filesystem partition size in kernel should be large enough for your filesystem.
    You could use that defines (.size = SZ_16M + SZ_8M), or define you own, just make sure that partition size is large enough.

     

    I think that new UBL and uBoot is not the reason for your error.

     

    Regards,
    Marko.

     

     

  • Marko,

    I changed the filesize as described by you. I erased and wrote the kernel and filesystem as follows:

    nand erase 0x200000 0x1200000

    nand write 0x80700000 0x500000 0x200000

    nand write 0x82000000 0x700000 0x1100000 (the old size was 0x1000000)

    I set the bootcmd and bootargs as follows:

    setenv bootcmd 'nand read 0x82000000 0x700000 0x1100000;nboot 0x80700000 0 0x500000;bootm 0x80700000'

    setenv bootargs 'mem=56M console=ttyS1,115200n8 root=/dev/ram0 rw initrd=0x82000000,17M ip=dhcp eth=00:0C:0C:A0:07:40'

    the size of my crafms image is 16.5MB and that of kernel is 1.8MB. In /DM368IPNC_MT5_2.6.0/ipnc/ti-davinci/arch/arm/mach-davinci/board-dm368-ipnc.c  , .size variable is:

           .size = SZ_16M + SZ_8M

    I didn't change it because I don't know what value to give here. 

    I, again, get the same error (Error -3 while decompressing). 

    Regards,

  • Umair,

    Maybe you cramfs filesystem is not OK.

    If you can get it work with original filesystem, then check the following :
    Unpack your original cramfs filesystem, then pack it again (with mkcramfs), without any changes to original filesystem.
    Then flash it, so you will see if you can make working filesystem.

     

     

    Your filesystem partition seems fine:  .size = SZ_16M + SZ_8M. It is 24M, so it is sufficient. You don't have to change it.

    You are erasing :  nand erase 0x200000 0x1200000,
    but you should:     nand erase 0x500000 0x1300000,
    since your kernel starts at 0x500000, and erase size should be  0x200000+ 0x1100000=0x1300000

    tftpboot 0x80700000 uImage_ipnc_dm36x_xxx
    tftpboot 0x82000000 cramfsImage_ipnc_dm36x_xxx
    nand erase 0x500000 0x1300000
    nand write 0x80700000 0x500000 0x200000
    nand write 0x82000000 0x700000 0x1100000

    Try to play with different values at : 
    setenv bootargs 'mem=56M console=ttyS1,115200n8 root=/dev/ram0 rw initrd=0x82000000,17M ip=dhcp eth=00:0C:0C:A0:07:40'

    56M seems OK,
    17M , try to change it between e.g 9M and 18M

     

     


    Regards,
    Marko.

  • Marko,

    I tried out your suggestions, but nothing seems to work. Now the booting process stops at the following message:

    Loading iSCSI transport class v.1.1-646. <5> iscsi: registered transport (tcp)

    This is the place after which the decompressing error used to appear. But now the booting stops right here. Can you please tell me:

    1) any other alternative/possibility to remove this problem?

     

    2) If I use the old kernel and filesystem (sizes: 1.76MB and 14.9MB), then would it be OK if I use the following commands:

    nand erase 0x500000 0x1200000
    nand write 0x80700000 0x500000 0x200000
    nand write 0x82000000 0x700000 0x1000000

    Remember that I already wrote bigger files. So my question is "if I erase and write on smaller area, so will it be OK and the uboot/ubl will not read the old values (stored on larger area before)?"

    Regards,

  • Umair,

    1. Try first to unpack and pack cramfs, without change it, so you will see if that part works. Then reflash it unchanged, but created by yourself.  
     
    If you don't have dhcp server on the same network, then set static ip in bootargs:
    instead : ip=dhcp use     ip=192.168.1.10:192.168.1.20:192.168.2.1:255.255.255.0:::off      (cameraip, serverip, gateway ...)

    - Try different values in bootargs.
    - Flash it  with  sd_boot utility, so the whole flash will be erased.
    - Say a little prayer.

    2. This is OK.  uBoot just passes the execution to kernel entry point, which is at 0x500000.
         However it's no harm to erase larger portion before writting.

    Regards,
    Marko.

     

     

  • Thanks Marko. I will try all this.

    Can you please let me know how do I flash by TFTP. The document says:

    Set <installDir>/Application/bin folder as the path to tftpboot directory at <TFTP SERVER UTILITY>

    What is this TFTP server utility? 

    Regards,

  • OK. I setup the TFTP server.

  • Marko,

    I think the filesystem is not correctly built. I use following commands to unpack the filesystem. 

    mount -t cramfs -o loop cramfsImage_ipnc_DMVA2 rdmnt2/

    cd rdmnt2

    tar -cf - . | tar -C ../filesys/ -xpf -

    During the tar, I get following error in all the files:

    implausibly old time stamp 1969-12-31  19:00:00

    at the end, I get the error message: 

    tar: exiting with failure status due to previous errors

    However, it produces all the directories in file system. Can it be the cause of error? How to remove this error?

    Regards,

     

  • Umair,

    I tried that and also got the same error.
    Doing  tar -cf - . | tar -C ../filesys/ -xpf -   as normal user, even with sudo, always returns me  failure at the end : tar: exiting with failure status due to previous errors
    If i log on as "sudo su", than tar command is executed without that error message at the end, but still there are "implausibly old time stamp"  messages.
    However this seems doesn't affect filesystem functionality.

    So try  log on as "sudo su" in terminal, before mount / tar.

    Regards,
    Marko.

  • Marko,

    I unpacked and packed the original filesystem as you suggested. Here are the steps:

    mount -t cramfs -o loop cramfsImage_ipnc_dmva2 rdmnt2/

    cd rdmnt2

    tar -cf - . | tar -C ../filesys/ -xpf -

    cd ..

    mkcramfs filesys cramfs_ipnc (I also tried "mkcramfs rdmnt2 cramfs_ipnc")

    I, then, flash the created cramfs (cramfs_ipnc) to the camera along with the kernel image. I, now, don't have the decompressing problem as I am erasing, writing and setting memories properly. But now I have some different errors, e.g., 

    CMEM Error: init: Failed to open /dev/cmem: 'No such file or directory'    (This file/moduel actually does not exist at this place)

    Similarly, there are many errors like this, e.g., 

    insmod: cannot insert `cmemk.ko': Invalid module format (-1): Exec format error

    I have not changed anything in the filesystem. I just unpacked and packet it as you suggested. I really can't figure out what is the problem. There is also no error in the re-building of kernel and filesystem, neither in the unpacking and packing of original filesystem. 

    Regards,

     

     

  • Umair,

    Use your build of those kernel driver modules : cmem.ko, edmak.ko, irqk.ko.

    They are in /DM368IPNC_MT5_2.6.0/dvsdk_2_10_01_18/linuxutils_2_24_03/packages/ti/sdo/linuxutils/
    Copy cmem.ko, edmak.ko, irqk.ko from there to your new filsystem/opt/ipnc/
    cmem.ko is in : /DM368IPNC_MT5_2.6.0/dvsdk_2_10_01_18/linuxutils_2_24_03/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.ko

     

    If you are using kernel with NFS, you have to enable static build of network driver.
    Open /DM368IPNC_MT5_2.6.0/ipnc/ti-davinci/arch/arm/configs/davinci_dm368_ipnc_defconfig,
    and change from CONFIG_TI_DAVINCI_EMAC=m    to   CONFIG_TI_DAVINCI_EMAC=y
    then rebuild kernel.

    Regards,
    Marko.

  • Marko,

    Doing this, brings more errors. I am not using NFS. 

    Can you please have a look at my boot log so that you can have some better idea about the problem? Here it is:

     

    Starting kernel ...

     

    Linux version 2.6.18_pro500-davinci_IPNC_DM365_2.0.0 (harmeet@mapplinux03.india.

    ti.com) (gcc version 4.2.0 20070126 (prerelease) (MontaVista 4.2.0-3.0.0.0702771

     2007-03-10)) #1 PREEMPT Fri Sep 24 12:36:13 IST 2010

    CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177

    Machine: DaVinci DM365 IPNC

    Memory policy: ECC disabled, Data cache writeback

    DaVinci DM0365 variant 0x8

    PLL0: fixedrate: 24000000, commonrate: 170000000, vpssrate: 340000000

    PLL0: vencrate_sd: 75555555, ddrrate: 340000000 mmcsdrate: 48571428

    PLL1: armrate: 432000000, voicerate: 20571428, vencrate_hd: 27000000

    CPU0: D VIVT write-back cache

    CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets

    CPU0: D cache: 8192 bytes, associativity 4, 32 byte lines, 64 sets

    Built 1 zonelists.  Total pages: 14336

    Kernel command line: mem=56M console=ttyS1,115200n8 root=/dev/ram0 rw initrd=0x8

    2000000,17M ip=192.168.1.168:192.168.1.20:192.168.2.1:255.255.255.0:::off eth=00

    :0C:0C:A0:07:40

    PID hash table entries: 256 (order: 8, 1024 bytes)

    Clock event device timer0_0 configured with caps set: 07

    Console: colour dummy device 80x30

    Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)

    Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)

    Memory: 56MB = 56MB total

    Memory: 35340KB available (3105K code, 643K data, 180K init)

    Security Framework v1.0.0 initialized

    Capability LSM initialized

    Mount-cache hash table entries: 512

    CPU: Testing write buffer coherency: ok

    checking if image is initramfs...it isn't (bad gzip magic numbers); looks like a

    n initrd

    Freeing initrd memory: 17408K

    NET: Registered protocol family 16

    DaVinci: 104 gpio irqs

    MUX: initialized GPIO20

    MUX: initialized I2C_SCL

    Generic PHY: Registered new driver

    ch0 default output "COMPOSITE", mode "NTSC"

    VPBE Encoder Initialized

    SCSI subsystem initialized

    NET: Registered protocol family 2

    IP route cache hash table entries: 512 (order: -1, 2048 bytes)

    TCP established hash table entries: 2048 (order: 1, 8192 bytes)

    TCP bind hash table entries: 1024 (order: 0, 4096 bytes)

    TCP: Hash tables configured (established 2048 bind 1024)

    TCP reno registered

    VFS: Disk quotas dquot_6.5.1

    Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)

    squashfs: version 3.1 (2006/08/19) Phillip Lougher

    JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.

    yaffs Sep 24 2010 12:33:12 Installing.

    SGI XFS with no debug enabled

    Initializing Cryptographic API

    io scheduler noop registered

    io scheduler anticipatory registered (default)

    LTT : ltt-facilities init

    LTT : ltt-facility-core init in kernel

    DAVINCI-WDT: DaVinci Watchdog Timer: heartbeat 60 sec

    Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing disabled

    serial8250.0: ttyS0 at MMIO map 0x1c20000 mem 0xfbc20000 (irq = 40) is a 16550A

    serial8250.0: ttyS1 at MMIO map 0x1d06000 mem 0xfbd06000 (irq = 41) is a 16550A

    RAMDISK driver initialized: 1 RAM disks of 32768K size 1024 blocksize

    Linux video capture interface: v2.00

    Trying to register davinci display video device.

    layer=c30d3a00,layer->video_dev=c30d3b60

    Trying to register davinci display video device.

    layer=c30d3800,layer->video_dev=c30d3960

    davinci_init:DaVinci V4L2 Display Driver V1.0 loaded

    i2c /dev entries driver

    nand_davinci nand_davinci.0: Using 4-bit hardware ECC

    NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bi

    t)

    Creating 5 MTD partitions on "nand_davinci.0":

    0x00000000-0x00080000 : "bootloader"

    0x00080000-0x00200000 : "params"

    0x00200000-0x00400000 : "kernel"

    0x00400000-0x01c00000 : "filesystem1"

    0x01c00000-0x08000000 : "filesystem2"

    nand_davinci nand_davinci.0: hardware revision: 2.3

    rtc_davinci_dm365 rtc_davinci_dm365.0: rtc intf: proc

    rtc_davinci_dm365 rtc_davinci_dm365.0: rtc intf: dev (254:0)

    rtc_davinci_dm365 rtc_davinci_dm365.0: rtc core: registered rtc_davinci_dm365 as

     rtc0

    Advanced Linux Sound Architecture Driver Version 1.0.12rc1 (Thu Jun 22 13:55:50

    2006 UTC).

    ASoC version 0.13.1

    CQ0093 Voice Codec 0.1

    asoc: cq93vc <-> davinci-vcif mapping ok

    ALSA device list:

      #0: On-chip voice codec (cq93vc)

    IPv4 over IPv4 tunneling driver

    TCP bic registered

    NET: Registered protocol family 1

    NET: Registered protocol family 17

    rtc_davinci_dm365 rtc_davinci_dm365.0: setting the system clock to 2000-01-01 01

    :58:37 (946691917)

    Time: timer0_1 clocksource has been installed.

    Clock event device timer0_0 configured with caps set: 08

    Switched to high resolution mode on CPU 0

    IP-Config: No network devices available.

    RAMDISK: cramfs filesystem found at block 0

    RAMDISK: Loading 16560KiB [1 disk] into ram disk... done.

    VFS: Mounted root (cramfs filesystem) readonly.

    Freeing init memory: 180K

    INIT: version 2.86 booting

    0

    mkdir: Cannot create directory `/dev/.test': Read-only file system

    Starting the hotplug events dispatcher: udevd.

    Synthesizing the initial hotplug events...done.

    Waiting for /dev to be fully populated...done.

    0

    csl: disagrees about version of symbol struct_module

    insmod: cannot insert `./csl.ko': Invalid module format (-1): Exec format error

    drv: disagrees about version of symbol struct_module

    insmod: cannot insert `./drv.ko': Invalid module format (-1): Exec format error

    cmemk: disagrees about version of symbol struct_module

    BusyBox v1.2.2 (2007.03.11-00:56+0000) multi-call binary

     

    Usage: mknod [OPTIONS] NAME TYPE MAJOR MINOR

     

    Create a special file (block, character, or pipe).

     

    Options:

            -m      create the special file using thedmak: disagrees about version o

    f symbol struct_module

    e specified mode (default a=rw)

     

    TYPEs include:

            b:      Make a block (buffered) device

            c or u: Make a character (un-buffered) device

            p:      Make a named pipe. MAJOR and MINOR are ignored for named pipes

     

    Busirqk: disagrees about version of symbol struct_module

    yBox v1.2.2 (2007.03.11-00:56+0000) multi-call binary

     

    Usage: mknod [OPTIONS] NAME TYPE MAJOR MINOR

     

    Create a special file (block, character, or pipe).

     

    Options:

            -m      create the special file using the sdm365mmap: disagrees about ve

    rsion of symbol struct_module

    pecified mode (default a=rw)

     

    TYPEs include:

            b:      Make a block (buffered) device

            c or u: Make a character (un-buffered) device

            p:      Make a named pipe. MAJOR and MINOR are ignored for named pipes

     

    insmod: cannot insert `cmemk.ko': Invalid module format (-1): Exec format error

    insmod: cannot insert `edmak.ko': Invalid module format (-1): Exec format error

    insmod: cannot insert `irqk.ko': Invalid module format (-1): Exec format error

    insmod: cannot insert `dm365mmap.ko': Invalid module format (-1): Exec format er

    ror

    Creat queue id:0

    queue id:0

    Creat queue id:32769

    queue id:32769

    IPNC_DM365_2.0.0 (harmeet@mapplinux03.india.ti.com) (gcc versio

    Creat queue id:65538

    queue id:65538

    queue id:32769

    queue id:65538

    Starting mounting local filesystems: mount none on /dev/shm type tmpfs (rw,size=

    5M)

    none on /var/run type tmpfs (rw)

    none on /tmp type tmpfs (rw,sync)

     

    CPU is DM368

    DEMOCFG Value   : 0

    Videocodecmode  : 0

    Videocodecres   : 1

    ./av_server.out FD OSD DM368 APPRO2A AEWB D1 H264 4000000 VBR AUTO MENUOFF &

    CPU CurrentStatus is = 1

    Check_device_version : DEVICE VER = 1 !!

     

    AVSERVER UI: Initializing.

     ERROR  (drv.c|DRV_init|31): CSL init

     ERROR  (drv.c|DRV_init|102): DRV_init()

     ERROR  (avServerApi.c|AVSERVER_init|602): DRV_init()

     ERROR  (avServerUi.c|UI_start|54): AVSERVER_init()

    Setting up networking ...ApproDrvInit: 7

    CMEM Error: init: Failed to open /dev/cmem: 'No such file or directory'

    Error: ApproDrvInit fail

     DMVA SCH > created Dmva semaphore with handle = 567688

     DMVA SCH > schedule thread create successful

    rm: unable to remove `/etc/network/run': Read-only file system

    Starting hotplug subsystem:

       pci

       pci      [success]

       usb

       usb      [success]

       isapnp

       isapnp   [success]

       ide

       ide      [success]

       input

       input    [success]

       scsi

       scsi     [success]

    done.

    Starting portmap daemon: portmap.

    Starting internet superserver: inetdcrc_ccitt: disagrees about version of symbol

     struct_module

    .

    libcrc32c: disagrees about version of symbol struct_module

    insmod: cannot insert `/opt/ipnc/modules/crc-ccitt.ko': Invalid module format (-

    1): Exec format error

    insmod: cannot insert `/opt/ipnc/modules/libcrc32c.ko': Invalid module format (-

    1): Exec format error

    deadline_iosched: disagrees about version of symbol struct_module

    cfq_iosched: disagrees about version of symbol struct_module

    insmod: cannot insert `/opt/ipnc/modules/deadline-iosched.ko': Invalid module fo

    rmat (-1): Exec format error

    insmod: cannot insert `/opt/ipnc/modules/cfq-iosched.ko': Invalid module format

    (-1): Exec format error

    sbull: disagrees about version of symbol struct_module

    insmod: /opt/ipnc/modules/i2c-emac.ko: No such file or directory

    insmod: cannot insert `/opt/ipnc/modules/sbull.ko': Invalid module format (-1):

    Exec format error

    crc32c: disagrees about version of symbol struct_module

    deflate: disagrees about version of symbol struct_module

    insmod: cannot insert `/opt/ipnc/modules/crc32c.ko': Invalid module format (-1):

     Exec format error

    insmod: cannot insert `/opt/ipnc/modules/deflate.ko': Invalid module format (-1)

    : Exec format error

    des: disagrees about version of symbol struct_module

    md5: disagrees about version of symbol struct_module

    insmod: cannot insert `/opt/ipnc/modules/des.ko': Invalid module format (-1): Ex

    ec format error

    insmod: cannot insert `/opt/ipnc/modules/md5.ko': Invalid module format (-1): Ex

    ec format error

    sha1: disagrees about version of symbol struct_module

    nls_ascii: disagrees about version of symbol struct_module

    insmod: cannot insert `/opt/ipnc/modules/sha1.ko': Invalid module format (-1): E

    xec format error

    insmod: cannot insert `/opt/ipnc/modules/nls_ascii.ko': Invalid module format (-

    1): Exec format error

    nls_utf8: disagrees about version of symbol struct_module

    exportfs: disagrees about version of symbol struct_module

    insmod: cannot insert `/opt/ipnc/modules/nls_utf8.ko': Invalid module format (-1

    ): Exec format error

    insmod: cannot insert `/opt/ipnc/modules/exportfs.ko': Invalid module format (-1

    ): Exec format error

    nfsd: disagrees about version of symbol struct_module

    loop: disagrees about version of symbol struct_module

    insmod: cannot insert `/opt/ipnc/modules/nfsd.ko': Invalid module format (-1): E

    xec format error

    insmod: cannot insert `/opt/ipnc/modules/loop.ko': Invalid module format (-1): E

    xec format error

    tun: disagrees about version of symbol struct_module

    slhc: disagrees about version of symbol struct_module

    insmod: cannot insert `/opt/ipnc/modules/tun.ko': Invalid module format (-1): Ex

    ec format error

    insmod: cannot insert `/opt/ipnc/modules/slhc.ko': Invalid module format (-1): E

    xec format error

    insmod: /opt/ipnc/modules/netconsole.ko: No such file or directory

    ppp_generic: disagrees about version of symbol struct_module

    ppp_synctty: disagrees about version of symbol struct_module

    insmod: cannot insert `/opt/ipnc/modules/ppp_generic.ko': Invalid module format

    (-1): Exec format error

    insmod: cannot insert `/opt/ipnc/modules/ppp_synctty.ko': Invalid module format

    (-1): Exec format error

    ppp_async: disagrees about version of symbol struct_module

    ppp_deflate: disagrees about version of symbol struct_module

    insmod: cannot insert `/opt/ipnc/modules/ppp_async.ko': Invalid module format (-

    1): Exec format error

    insmod: cannot insert `/opt/ipnc/modules/ppp_deflate.ko': Invalid module format

    (-1): Exec format error

    insmod: /opt/ipnc/modules/davinci_emac.ko: No such file or directory

    insmod: /opt/ipnc/modules/mmc_core.ko: No such file or directory

    insmod: /opt/ipnc/modules/mmc_block.ko: No such file or directory

    insmod: /opt/ipnc/modules/davinci-mmc.ko: No such file or directory

    insmod: /opt/ipnc/modules/usbcore.ko: No such file or directory

    insmod: /opt/ipnc/modules/musb_hdrc.ko: No such file or directory

    insmod: /opt/ipnc/modules/usbmon.ko: No such file or directory

    scsi_transport_iscsi: disagrees about version of symbol struct_module

    libiscsi: disagrees about version of symbol struct_module

    insmod: cannot insert `/opt/ipnc/modules/scsi_transport_iscsi.ko': Invalid modul

    insmod: cannot insert `/opt/ipnc/modules/scsi_transport_iscsi.ko': Invalid modul

    insmod: cannot insert `/opt/ipnc/modules/libiscsi.ko': Invalid module format (-1

    ): Exec format error

    iscsi_tcp: disagrees about version of symbol struct_module

    sbull: disagrees about version of symbol struct_module

    insmod: cannot insert `/opt/ipnc/modules/iscsi_tcp.ko': Invalid module format (-

    1): Exec format error

    insmod: cannot insert `sbull.ko': Invalid module format (-1): Exec format error

    mkdosfs 3.0.6 (04 Oct 2009)

    queue id:0

    umount: /mnt/mmc: not mounted

    net_get_hwaddr: ioctl SIOCGIFHWADDR: No such device

    Error: Error on get MAC address

    Error: Network Init Fail

     

    SystemServer:Fail at SYS_MSG_DO_BOOT_PROC

    Error SysDoBootProc control fail.

    ApproDrvInit: 3

    CMEM Error: init: Failed to open /dev/cmem: 'No such file or directory'

    Failed to get index for interface name 'eth0': No such device

    INIT: Entering runlevel: 3

     

    MontaVista(R) Linux(R) Professional Edition 5.0.0 (0702774)

     

    DM368_IPNC login:

  • Markov,

    It can't load some of the files from the filesystem, e.g., 

     

    insmod: /opt/ipnc/modules/mmc_core.ko: No such file or directory

    insmod: /opt/ipnc/modules/mmc_block.ko: No such file or directory

    ................

    I manually copied these files to /opt/ipnc/modules/ along with cmemk.ko, irqk.ko and edmak.ko. But it seems that it still cannot load these files. Another major error is:

    CMEM Error: init: Failed to open /dev/cmem: 'No such file or directory'

    At the end, kernel is loaded but av_server doesn't run. Doing all these changes in filesystem and manually copying all the missing files, I re-built the whole system, but to no use. The same errors keep appearing. This is really amazing that the original kernel and filesystem runs perfectly on the camera. But when I uncompress and compress the filesystem back, then I have these problems. 

    Another thing that I noticed is that when I mount the original file system to a folder rdmnt2 and tar this mounted folder to another folder filesys, then I see some difference in the file structure, i.e., some of the files/modules are missing in the filesys folder. I create a cramfs image with the folder filesys after manually copying the missing files. I have tried both of the following commands:

    1) mkcramfs filesys cramfs_ipnc

    2) make cramfs

    Is there anything else to try? :-(

    Regards,

  • Marko,

    I think I, now, know what is the problem. 

    1) Since the filesystem does not contains these files/modules, I  have to manually copy these files to the file system. Using the old kernel, if I flash the new file system, It disagrees about the format of many files  e.g., 

    ppp_deflate: disagrees about version of symbol struct_module

    This can be due to using the updated file system with the old kernel. It still does not find these files (e.g., /dev/cmem). 

    2) If I copy these files manually and re-build the entire system (make sysall), the current filesystem is deleted and the new one is generated again with the same configuration (missing the required files). I, then, create the file system with:

    make cramfs 

    (OR)

    mkcramfs filesys cramfs_ipnc

    Again, the file system misses the required files. I am using ubuntu for building the application and the IPNC software is DMVAxIPNC (from appro).


  • Umair,

    Only unpacking and packing filesystem should work without problems, and without missing files.
    Check file sizes, they must be the same for both files. There must be no differences in files.
    Don't copy anything in your new filesystem, first try to create just the same filesystem.
    You should copy cmem.ko etc. only if you are using your new kernel build.

    In your last log file there is :

    0x00200000-0x00400000 : "kernel"
    0x00400000-0x01c00000 : "filesystem1"

    But in previous post there are different values.

    0x00500000-0x00700000 : "kernel"
    0x00700000-0x01f00000 : "filesystem"

    You have to set boot arguments, according to partitions start addresses.

    It seems you are also using incompatible kernel and filesystem, since there are so many messages : "drv: disagrees about version of symbol struct_module"

    About :

    1) mkcramfs filesys cramfs_ipnc

    2) make cramfs

     

    These commands are the same. If you look at the top makefile in /ipnc/Makefile, you can see those commands, under cramfs:

    And you can also try command:  mkfs.cramfs, instead mkcramfs.

     

    Regards,

    Marko.

  • Umair,

    /dev/cmem will be created at runtime, when  insmod cmem.ko is called.
    If it is not, it probably means your adresses are wrong in "/opt/ipnc/av_capture_load.sh"
    phys_start should be high enough. If you give Linux more memory at command arguments (like mem=56),
    then phys_start (memory to cmem.ko) must also change.

    Regards,

    Marko.

  • Marko,

    I successfully flashed the new file system and now it works fine :-) Thanks to your advices.    (mem=48M, size = 16M)

    Now I wanna change the code (motion detection part). As the changed code results in an increased file system size (16.4MB), how should I set the sizes and addresses? I intend to use the following settings for the updated file system. 

    nand erase 0x500000 0x1300000

    nand write 0x80700000 0x500000 0x200000

    nand write 0x8200000 0x700000 0x1100000 (before it was 0x1000000)

    Bootcmd & Bootargs:

    setenv bootcmd 'nand read 0x82000000 0x700000 0x1100000;nboot 0x80700000 0 0x500000;bootm 0x80700000'

    setenv bootargs 'mem=56M console=ttyS1,115200n8 root=/dev/ram0 rw initrd=0x82000000, 17M ip=192.168.1.168:192.168.1.20:192.168.2.1:255.255.255.0:::off eth=00:0C:0C:A0:07:40'

    Now, I wanna ask "if I change the code, will it be necessary to build the entire system, or just the application part (make all)". If I just change the code, build the application part and create the cramfs again (keeping the kernel same), would it be OK?

    Regards,

  • Umair,

    You can try with those arguments you mentioned.

    If you change only application, then only :

    make exe

    or at most:

    make clean
    make exe

    If you increase Linux memory as you mentioned (mem=56 instead mem=48), then you will have to increase phys_start value in "/opt/ipnc/av_capture_load.sh",
    or your cmem.ko will not load, since you gave additional part of memory to Linux.
    You will see in console error message, which  address you can use, or calculate it from how much you gave it to Linux.
    It is Linux mem + cmem.ko mem= size of your RAM (128MB)

    Regards,
    Marko.

  • Marko,

    The variables in /opt/ipnc/av_capture.sh are:

    insmod cmemk.ko phys_start=0x83000000 phys_end=0x88000000 allowOverlap=1 phys_start_1=0x00001000 phys_end_1=0x00008000 pools_1=1x28672. 

    What address for phys_start should I use for mem=56M. Actually, I just compiled the application by (make exe) and then created the cramfs. The size of the new cramfs is 16.4M (old:14.3M), so I also increased the size in bootargs from 16 to 17. 

    Since the kernel is of the same size, so I decided to use  mem=48 with 17M. But I got following error during boot, and the booting stops. 

    Kernel Panic - not syncing: VFS: unable to mount root fs on unknown-block (1.0). 

    When I use mem=56M with 17M cramfs size, I got /dev/cmem error (as you told). 

    1) So please let me know how to increase the size of phys_start? The booting tells about following address:

    0x00000000 - 0x00080000 : "bootloader"

    0x00080000 - 0x00200000 : "params"

    0x00200000 - 0x00400000 : "kernel"

    0x00400000 - 0x01c00000: "filesystem1"

    0x01c00000 - 0x08000000: "filesystem2"

    2) I also get "insmode: Invalid module format (-1)" error on several places.

    Regards, 

  • Umair,

    If you didn't change Linux memory (mem=48) you don't have to change av_capture.sh.
    But if you will, increase phys_start by that much, that you increased Linux mem (56-48=8MB = 0x800000 -> phys_start=83800000.
    Anyway you will get correct value in error log, somewhere around where /dev/cmem error is printed.

    But since you changed filesystem, you also have to use kernel that is build together with that filesystem.
    That's why you are getting  "insmode: Invalid module format (-1)" errors.
    So use your kernel build along with a new filesystem.
    Also copy new cmem.ko, edmak.ko, irqk.ko  to  new filesystem as mentioned earlier post.

    Regards,
    Marko.

     

  • OK. got it. So after I modify the filesystem (make exe), should I use "make sysall" to build the entire system including kernel and filesystem (and then copy cmemk.ko etc to the new filesysem), or should I build only the kernel? What I understand is as follows:

    1) modify the code 

    2) build the entire system (kernel + file system) using "make sysall"

    3) copy cmemk.ko etc to the new file system

    4) increase phy_start

    5) make cramfs of the new file system

    Please correct if I am wrong.

    Regards,

  • Umair,

    If you didn't change kernel  code (ipnc/ti-davinci/), you don't have to rebuild kernel again.
    make exe is sufficient if you only changed application code.

    make sysall (or make lsp for only kernel build) is necessary,  when you change kernel code.

    Other steps seems OK.

    Regards,
    Marko.

     

     

  • Marko,

    I am glad to tell you that I am now able to successfully build and run my updated file system. This is all due to you help and support. I am grateful to you. 

    I print a message at the console when motion is detected. But the message is not printed continuously for each motion detected. It waits for some time and then prints messages for the frames with motion. I think this problem is due to the alarm time. As long as the alarm remains high, it doesn't prints messages. The minimum alarm duration in the web interface is 10 sec. But I need a very short alarm duration (let's say 1 or even less). I wanna detect motion in all the frames and report this to other camera through UDP. 

    In ProcAlarmThread(void *arg), I also tried with disabling dm355_gio_write() and set_AlarmDuration() functions, but this doesn't help:

    I set all other parameters in browser as follows:

    motionenable=1
    motionblock=FFF
    motionsensitivity=1
    alarmenable=1
    extalarm=1
    alarmduration=1
    exttriggeroutput=1

    What variable/parameter I need to change so that the motion is detected continuously (as soon as it occurs) and I can see continuous messages at console?

    Regards,

  • Marko,

    I solved the problem of sending continuous motions signals to console. I included printf ("Motion Detected");  in videoMotionThr.c in the function VIDEO_motionTskRun(). 

    In the function, I disabled SendAlarmMotionrDetec() function. So, at the detection of motion, it just sends a signal to the console. 

    I decided to add the UDP code in the same function. The problem is that the camera doesn't connect to the PC for sending UDP messages at motion detection. My code is as follows:

     

         int sockfd, portno, n;

        struct sockaddr_in serv_addr;

        struct hostent *server;

        portno = 50026;

        sockfd = socket(AF_INET, SOCK_STREAM, 0);

        if (sockfd < 0) 

            error("ERROR opening socket");

        server = gethostbyname("192.168.1.20");

        if (server == NULL) {

            printf("ERROR, no such host\n");

            exit(0);

        }

        bzero((char *) &serv_addr, sizeof(serv_addr));

        serv_addr.sin_family = AF_INET;

        bcopy((char *)server->h_addr, 

        (char *)&serv_addr.sin_addr.s_addr, server->h_length);

        serv_addr.sin_port = htons(portno);

        if (connect(sockfd,(struct sockaddr *) &serv_addr,sizeof(serv_addr)) < 0) 

            error("ERROR connecting");


    I initialize these variables and create connection in the beginning of VIDEO_motionTskRun() function. Further in the code, I use following piece of code to write a simple message the port which will be read by the PC connected: 

    n = write(sockfd,"hello",strlen("hello"));

    But with this peice of code, the camera doesn't connect to the PC for sending UDP packet. I run a server program at the PC that listens for the packets from the camera. Can you please figure out what may be the problem?

    Regards,

     

     

  • Umair,

    You are using TCP socket not UDP.
    I think it would be much easier to start with UDP, since it is simpler. UDP socket is created with SOCK_DGRAM type.
    Google around for "linux c udp socket example" or something, and you will find a lot of working examples.
    I suggest you first to try both client and server on PC.

    Create socket only once, somewhere at beginning (maybe at VIDEO_motionTskCreate),  and then call send on each alarm detection.

    Regards,
    Marko.

  • Marko,

    The problem is solved. Thanks a lot man.

    This was not possible without your help. I really appreciate your sincerity and devotion. I also wonder why all these things are not properly documented from appro. Building the kernel and the file system is not without problems. There are many necessary things that you told, e.g., setting phys_start address etc. From their documents, it appears as if all this is the easiest job on earth. 

    Regards, 

  • Marko,

    I got another problem. With the last known configuration,  I changed the resolution from the web interface to H.264 1080p. Since then, the camera doesn't work. The av_server is not leaded. However, the camera is connected to the network and kernel is also loaded. I reflashed the kernel and file system, but it doesn't help. It seems, it is loading the same configurations from the web interface. 

    The new error that I get now is:

    Error: WaitStreamReady Fail.

    Here is the booting log:

     

    Starting kernel ...

     

    Linux version 2.6.18_pro500-davinci_IPNC_DM368_2.0.0 (root@umair-HP-Compaq-nc843

    0-RF591UC-ACF) (gcc version 4.2.0 (MontaVista 4.2.0-16.0.32.0801914 2008-08-30))

     #1 PREEMPT Mon Apr 25 06:16:43 EDT 2011

    CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177

    Machine: DaVinci DM368 IPNC

    Memory policy: ECC disabled, Data cache writeback

    DaVinci DM0365 variant 0x8

    PLL0: fixedrate: 24000000, commonrate: 170000000, vpssrate: 340000000

    PLL0: vencrate_sd: 75555555, ddrrate: 340000000 mmcsdrate: 48571428

    PLL1: armrate: 432000000, voicerate: 20571428, vencrate_hd: 27000000

    CPU0: D VIVT write-back cache

    CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets

    CPU0: D cache: 8192 bytes, associativity 4, 32 byte lines, 64 sets

    Built 1 zonelists.  Total pages: 14336

    Kernel command line: mem=56M console=ttyS1,115200n8 root=/dev/ram0 rw initrd=0x8

    2000000,17M ip=192.168.1.168:192.168.1.20:192.168.2.1:255.255.255.0:::off eth=00

    :0C:0C:A0:07:40

    TI DaVinci EMAC: kernel boot params Ethernet address: 00:0C:0C:A0:07:40

    PID hash table entries: 256 (order: 8, 1024 bytes)

    Clock event device timer0_0 configured with caps set: 07

    Console: colour dummy device 80x30

    Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)

    Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)

    Memory: 56MB = 56MB total

    Memory: 35236KB available (3193K code, 653K data, 184K init)

    Security Framework v1.0.0 initialized

    Capability LSM initialized

    Mount-cache hash table entries: 512

    CPU: Testing write buffer coherency: ok

    checking if image is initramfs...it isn't (bad gzip magic numbers); looks like a

    n initrd

    Freeing initrd memory: 17408K

    NET: Registered protocol family 16

    DaVinci: 104 gpio irqs

    MUX: initialized GPIO20

    MUX: initialized I2C_SCL

    Generic PHY: Registered new driver

    ch0 default output "COMPOSITE", mode "NTSC"

    VPBE Encoder Initialized

    SCSI subsystem initialized

    NET: Registered protocol family 2

    IP route cache hash table entries: 512 (order: -1, 2048 bytes)

    TCP established hash table entries: 2048 (order: 1, 8192 bytes)

    TCP bind hash table entries: 1024 (order: 0, 4096 bytes)

    TCP: Hash tables configured (established 2048 bind 1024)

    TCP reno registered

    VFS: Disk quotas dquot_6.5.1

    Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)

    squashfs: version 3.1 (2006/08/19) Phillip Lougher

    JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.

    yaffs Apr 25 2011 06:14:06 Installing.

    SGI XFS with no debug enabled

    Initializing Cryptographic API

    io scheduler noop registered

    io scheduler anticipatory registered (default)

    LTT : ltt-facilities init

    LTT : ltt-facility-core init in kernel

    DAVINCI-WDT: DaVinci Watchdog Timer: heartbeat 60 sec

    Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing disabled

    serial8250.0: ttyS0 at MMIO map 0x1c20000 mem 0xfbc20000 (irq = 40) is a 16550A

    serial8250.0: ttyS1 at MMIO map 0x1d06000 mem 0xfbd06000 (irq = 41) is a 16550A

    RAMDISK driver initialized: 1 RAM disks of 32768K size 1024 blocksize

    Davinci EMAC MII Bus: probed

    MAC address is 00:0C:0C:A0:07:40

    TI DaVinci EMAC Linux version updated 4.0

    netconsole: not configured, aborting

    Linux video capture interface: v2.00

    Trying to register davinci display video device.

    layer=c3007000,layer->video_dev=c3007160

    Trying to register davinci display video device.

    layer=c0f44e00,layer->video_dev=c0f44f60

    davinci_init:DaVinci V4L2 Display Driver V1.0 loaded

    i2c /dev entries driver

    nand_davinci nand_davinci.0: Using 4-bit hardware ECC

    NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bi

    t)

    Creating 6 MTD partitions on "nand_davinci.0":

    0x00000000-0x00300000 : "bootloader"

    0x00300000-0x00500000 : "params"

    0x00500000-0x00700000 : "kernel"

    0x00700000-0x01f00000 : "filesystem"

    0x01f00000-0x02100000 : "data1"

    0x02100000-0x08000000 : "data2"

    nand_davinci nand_davinci.0: hardware revision: 2.3

    musb_hdrc: version 6.0, cppi-dma, peripheral, debug=0

    musb_hdrc musb_hdrc: No DMA interrupt line

    musb_hdrc: USB Peripheral mode controller at c4066000 using DMA, IRQ 12

    rtc_davinci_dm365 rtc_davinci_dm365.0: rtc intf: proc

    rtc_davinci_dm365 rtc_davinci_dm365.0: rtc intf: dev (254:0)

    rtc_davinci_dm365 rtc_davinci_dm365.0: rtc core: registered rtc_davinci_dm365 as

     rtc0

    davinci-mmc davinci-mmc.0: Supporting 4-bit mode

    davinci-mmc davinci-mmc.0: Using DMA mode

    Advanced Linux Sound Architecture Driver Version 1.0.12rc1 (Thu Jun 22 13:55:50

    2006 UTC).

    ASoC version 0.13.1

    CQ0093 Voice Codec 0.1

    asoc: cq93vc <-> davinci-vcif mapping ok

    ALSA device list:

      #0: On-chip voice codec (cq93vc)

    IPv4 over IPv4 tunneling driver

    TCP bic registered

    NET: Registered protocol family 1

    NET: Registered protocol family 17

    rtc_davinci_dm365 rtc_davinci_dm365.0: setting the system clock to 2000-01-01 00

    :21:08 (946686068)

    Time: timer0_1 clocksource has been installed.

    Clock event device timer0_0 configured with caps set: 08

    Switched to high resolution mode on CPU 0

    IP-Config: Gateway not on directly connected network.

    RAMDISK: cramfs filesystem found at block 0

    RAMDISK: Loading 16564KiB [1 disk] into ram disk... done.

    VFS: Mounted root (cramfs filesystem) readonly.

    Freeing init memory: 184K

    INIT: version 2.86 booting

    0

    mkdir: Cannot create directory `/dev/.test': Read-only file system

    Starting the hotplug events dispatcher: udevd.

    Synthesizing the initial hotplug events...done.

    Waiting for /dev to be fully populated...done.

    0

    CSL: Module install successful, device major num = 253

    CSL: Module version 0.10.00, built on Apr 25 2011 15:51:54

    I2C: Module install successful, device major num = 252

    DMA: Module install successful, device major num = 251

    DRV: Module install successful

    DRV: Module built on Apr 25 2011 15:51:56

    DRV: EDMACC.QUEPRI  = 00000777

    DRV: SYSTEM.MSTPRI0 = 00550011

    DRV: SYSTEM.MSTPRI1 = 00000444

    DRV: ISP.BCR        = 00000002

    DRV: SYSTEM.MISC = 00000391

    CMEMK module: built on Apr 25 2011 at 06:18:12

      Reference Linux version 2.6.18

      File /home/umair/IPNetCam/dvsdk_2_10_01_18/linuxutils_2_24_03/packages/ti/sdo/

    linuxutils/cmem/src/module/cmemk.c

    allocated heap buffer 0xc5000000 of size 0x4800000

    CMEM Range Overlaps Kernel Physical - allowing overlap

    CMEM phys_start (0x1000) overlaps kernel (0x80000000 -> 0x83800000)

    cmemk initialized

    EDMAK module: built on Apr 25 2011 at 06:18:14

      Reference Linux version 2.6.18

      File /home/umair/IPNetCam/dvsdk_2_10_01_18/linuxutils_2_24_03/packages/ti/sdo/

    linuxutils/edma/src/module/edmak.c

    IRQK module: built on Apr 25 2011 at 06:18:15

      Reference Linux version 2.6.18

      File /home/umair/IPNetCam/dvsdk_2_10_01_18/linuxutils_2_24_03/packages/ti/sdo/

    linuxutils/irq/src/module/irqk.c

    irqk initialized

    Creat queue id:0

    queue id:0

    Creat queue id:32769

    queue id:32769

    queue id:32769

    Creat queue id:65538

    queue id:65538

    IPNC_DM368_2.0.0 (root@umair-HP-Compaq-nc8430-RF591UC-ACF) (gcc

    queue id:65538

     

    CPU is DM368

    DEMOCFG Value   : 0

    Videocodecmode  : 0

    Videocodecres   : 3

    Starting mounting local filesystems: ./av_server.out FD OSD DM368 APPRO2A AEWB 1

    080P H264 4000000 VBR AUTO MENUOFF &

    Check_device_version : DEVICE VER = 1 !!

    mount none on /dev/shm type tmpfs (rw,size=5M)

    none on /var/run type tmpfs (rw)

    none on /tmp type tmpfs (rw,sync)

    Setting up networking ...rm: unable to remove `/etc/network/run': Read-only file

     system

     

    AVSERVER UI: Initializing.

    DRV_SyncRst: module = 47, domain = 0, state = 0

    DRV_SyncRst: module = 47, domain = 0, state = 3

    ApproDrvInit: 7

    Creat queue id:98307

    queue id:98307

    Starting hotplug subsystem:

     

     CLK Hz,

     ARM   Hz =  432000000

     DDR   Hz =  340000000

     VPSS  Hz =  340000000

     IMCOP Hz =  340000000

     

     [OSA_FILE ] Reading file [/mnt/nand/IMG_Paramset.bin] ... ERROR

    IMAGE TUNE: Paramset File is not available..... Setting DEFAULT parameter

       pci

       pci      [success]

     

    CONFIGURING AVSERVER FOR DMVA2 .....

    queue id:65538

    SENSOR FPS VALUE = 30

       usb

    queue id:98307

     

     FR : 0 users registered from exsiting face album

     

    > DMVA App: TASK CREATE

     

    > DMVA APP: Default application parameters set.

    gAVSERVER_config.dmvaAppParams.dmvaAppSMETASensitivity = 3

    gAVSERVER_config.dmvaAppParams.dmvaAppSMETAPresentAdjust = 15

     DMVA > IMD:zone 0 - minX = 13,maxX = 49,minY = 43,maxY = 96

     DMVA > IMD:zone 1 - minX = 3,maxX = 59,minY = 4,maxY = 34

     

    > DMVA APP: Parameters read from UI

                Mode         = 2

                Sensitivty   = 3

                Min Per.Size = 25x40

                Max Per.Size = 38x55

                Polygons     = 2

                Frame rate   = 10

                Tamper Reset = 3

     

     ALG: Created Image Sym Algo Kernel !

     ALG: Created NMS Kernel !

     ALG: Created RLE Kernel !

     ALG: Created MORP Kernel !

     

     

    > DavinciDisplay DavinciDisplay.1: Before finishing with S_FMT:

    layer.pix_fmt.bytesperline = 640,

     layer.pix_fmt.width = 640,

     layer.pix_fmt.height = 480,

     layer.pix_fmt.sizeimage =460800

    DMVAL: CalculatiDavinciDisplay DavinciDisplay.1: pixfmt->width = 640,

     layer->layer_info.config.line_length= 640

    ng memory requirement for DMVAL instance...

             Expecting 320x192 input images of type 'DMVAL_IMG_YUV420_PLANARINTERLEA

    VED'.

    > DMVAL: 8383285 bytes required for DMVAL instance.

    > DMVAL: 5128 bytes required for DMVAL output.

     

    > DMVA APP: Allocated 5128 bytes for DMVAL output memory @ 0x4d1e4000

    > DMVA APP: Allocated 8383285 bytes for DMVAL internal memory @ 0x4d1ec000

    > DMVA APP: Calling DMVAL_configure

    > DMVAL: Assigning memory to support 320x192 image.

    > DMVAL: Assigned memory to library framework.

    > DMVAL: Library framework initialized for the 1st time.

    > DMVAL: Assigned memory to Camera Tamper Detection application.

    > DMVAL: Assigned memory to Intelligent Motion Detection application.

    > DMVAL: Assigned memory to Trip Zone application..

    > DMVAL: Assigned memory to Object Counting application.

    > DMVAL: Assigned memory to Streaming Metadata application.

    > DMVAL: Completed memory assignments to library applications.  ALG: Created Ima

    ge Sym Algo Kernel !

     ALG: Created NMS Kernel !

     ALG: Created RLE Kernel !

     ALG: Created MORP Kernel !

     

    > DMVAL: Library framework reset.

    > DMVAL: Intelligent Motion Detection installed.

    > DMVAL: Initialized library applications.

     

    > DMVA APP: DMVAL modules initialized.

    > DMVA APP: Application Memory Allocation Summary

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

      8383285 bytes for DMVAL instance.

         5128 bytes for DMVAL output.

     ============================================

     Total Allocated = 8388413 bytes

     

    > DMVA APP: Setting up DMVA-IMD parameters...

                No. Zones = 2

     

                Vertex  0: < 41, 82>

                Vertex  1: <156, 82>

                Vertex  2: <156,184>

                Vertex  3: < 41,184>

         CMEMK Error: ioctl: failed to allocate heap buffer of size 0xfd400

           Width:  115

                Height: 102

    > DMVAL: Zone ID(1) registered.

                Vertex  0: <  9,  7>

                Vertex  1: <188,  7>

                Vertex  2: <188, 65>

                Vertex  3: <  9, 65>

                Width:  179

                Height:  58

    > DMVAL: Zone ID(2) registered.

    > DMVA APP: DONE setting up DMVA-IMD parameters...

    IN DMVATSKMAIN

     

    > DMVA EVT: Created JPEG encoder instance for event recording...

     

    > DMVA EVT: Created Event-handling task.

    IPNC_DM368_2.0.0 (root@umair-HP-Compaq-nc8430-RF591UC-ACF) (gcc

    IPNC AUTO_IRIS = 1 #####################

    GBCE in EVAL MODE

    CMEM Error: allocHeap: ioctl CMEM_IOCALLOCHEAP failed: -1

     ERROR  (avServer.c|AVSERVER_bufAlloc|347): OSA_cmemAlloc()

     ERROR  (avServerMainThr.c|AVSERVER_tskStart|218):

    Msg_ThrFxn closing...

    DavinciDisplay DavinciDisplay.1: streaming not started in layer id = 0

    Kill queue id:98307

     

    > DMVA EVT: AVSERVER_CMD_DELETE cmd received. Killing task...

     

    > DMVA EVT: Delete...

     

    > DMVA APP:  Deallocating via dmvalHdl->bytesMemBufPermanent = 8383285 bytes, ad

    dress = 0x4d1ec000

     

    > DMVA APP:  Deallocating via dmvalHdl->bytesMemBufOutput = 5128 bytes, address

    = 0x4d1e4000

     

    > DMVA EVT: Delete...DONE

       usb      [success]

       isapnp

       isapnp   [success]

       ide

       ide      [success]

       input

       input    [success]

       scsi

       scsi     [success]

    done.

    Starting portmap daemon: portmap.

    Starting internet superserver:io scheduler deadline registered inetd.

     

    io scheduler cfq registered

     sbulla:insmod: /opt/ipn unknown partition table

    c/modules/i2c-emac.ko: No such file or directory

    Installing knfsd (copyright (C) 1996 okir@monad.swb.de).

    loop: loaded (max 8 devices)

    tun: Universal TUN/TAP device driver, 1.6

    tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>

    CSLIP: code copyright 1989 Regents of the University of California

    PPP generic driver version 2.4.2

    insmod: /opt/ipnc/modules/netconsole.ko: No such file or directory

    PPP Deflate Compression module registered

    insmod: /opt/ipnc/modules/davinci_emac.ko: No such file or directory

    insmod: /opt/ipnc/modules/mmc_core.ko: No such file or directory

    insmod: /opt/ipnc/modules/mmc_block.ko: No such file or directory

    insmod: /opt/ipnc/modules/davinci-mmc.ko: No such file or directory

    insmod: /opt/ipnc/modules/usbcore.ko: No such file or directory

    insmod: /opt/ipnc/modules/musb_hdrc.ko: No such file or directory

    insmod: /opt/ipnc/modules/usbmon.ko: No such file or directory

    Loading iSCSI transport class v1.1-646.<5>iscsi: registered transport (tcp)

     sbulla: unknown partition table

    mkdosfs 3.0.6 (04 Oct 2009)

    unable to get drive geometry, using default 255/63

    /dev/sbulla has 255 heads and 63 sectors per track,

    logical sector size is 512,

    using 0xf8 media descriptor, with 1024 sectors;

    file system has 2 12-bit FATs and 4 sectors per cluster.

    FAT size is 1 sector, and provides 247 clusters.

    Root directory contains 512 slots.

    Volume ID is 882375be, no volume label.

    queue id:0

    ApproDrvExit: 7

    Error: WaitStreamReady Fail.

     DMVA SCH > created Dmva semaphore with handle = 581968

     DMVA SCH > schedule thread create successful

    umount: /mnt/mmc: not mounted

    killall: dhcpcd: no process killed

    rm: cannot remove `/var/run/dhcpcd-eth0.pid': No such file or directory

    net_search_gateway:eth0, 1A8C0, 0, 1

    dns=192.168.1.1

    net_search_gateway:eth0, 1A8C0, 0, 1

    net_search_gateway:eth0, 0, FE01A8C0, 3

    dns=192.168.1.1

    g_file_storage gadget: File-backed Storage Gadget, version: 28 November 2005

    ERROR: Module g_g_file_storage gadget: Number of LUNs=1

    file_storage doeg_file_storage gadget-lun0: ro=0, file: /dev/sbulla

    s not exist in /proc/modules

    system_server/541[CPU#0]: BUG in local_bh_enable at kernel/softirq.c:196

    ApproDrvInit: 3

    Creat queue id:131075

    queue id:131075

    ApproDrvInit: 2

    queue id:131075

    ApproDrvInit: 6

    queue id:131075

    ApproDrvInit: 8

    queue id:131075

    ApproDrvInit: 9

    queue id:131075

    ApproDrvInit: 10

    queue id:131075

    INIT: Entering runlevel: 3

     

    MontaVista(R) Linux(R) Professional Edition 5.0.0 (0702774)

     

    192.168.1.168 login: root

     

     

    Welcome to MontaVista(R) Linux(R) Professional Edition 5.0.0 (0702774).

  • Umair,

    It seems that changing to  1080p,  codec doesn't have enough memory.
    You will have to decrease Linux memory, from mem=56, to lower value,
    and put more memory to cmem.ko (phys_start in av_capture.sh).
    But since av_server can not start, first delete configuration files.
    They are probably in /mnt/nand/.
    Delete them with :   rm /mnt/nand/*   then restart camera.
    At the next av_server startup, default parameter files will be created.
    Then you can try with different memory configuration.

    Regards,
    Marko.

  • Marko,

    I actually wanna use 5MP resolution. The default resolution that the camera is using is 720x480. How can I increase the resolution? e.g.,  1920 x 2560. I mean the camera has a resolution of 720x480 at H.264 720p. But I wanna increase it to 5MP. 

    Regards,

  • Umair,

    Increase memory to CMEM.
    I don't have that camera model, so i can not tell. It has different memory requirements.
    "CMEMK Error" in your boot log indicate, that memory to CMEM is not sufficient.
    You can try with default resolution and memory settings which works, and then change them by one step.
    Increase resolution by 1 step : e.g. from NTSC to 720p.
    At the same time increase memory given to cmem.ko for a few MB, and decrease the same amount to Linux.
    I don't know how far can you go, since your filesystem is pretty large.
    You will be stopped at some point, when decreasing Linux memory, when your filesystem couldn't  unpack and load.

    However you can solve that by HW change; adding more RAM to your camera, so you will have 256 MB instead of 128MB.

    The  point is, you must increase memory given to CMEM, if you want higher encoded resolution.
    Or disable encoding if you don't need H264 stream.

    Regards,
    Marko.

  • Marko,

    How do you work with different resolutions? I see only one option in the web interface, i.e., 1280 x  780 (H.264). Even if I increase the memory, the question is "How do I increase the resolution?"  I have been asked to work at 5MP (1920 x 2560). 

    Regards,

  • Umair,

    You can also change resolution in web browser, if it is enabled in your camera version code.
    Use : http://192.168.1.168/vb.htm?videocodecres=3
    Look at you options with : http://192.168.1.168/ini.htm

    I have the following options with my model:

    for H264-720p:
    videocodec=0
    videocodecname=Single;Dual;Tri-Stream
    videocodeccombo=0
    videocodeccomboname=H.264;MPEG4;MegaPixel@H.264 + JPEG;MPEG4 + JPEG;Dual H.264;Dual MPEG4;H264 + MPEG4@Dual H264 + JPEG;Dual MPEG4 + JPEG
    videocodecres=0
    videocodecresname=H264:720;H264:D1;H264:SXVGA;H264:1080;H264:720MAX60@MPEG4:720;MPEG4:D1;MPEG4:SXVGA;MPEG4:1080;MPEG4:720MAX60@H264:2MP;JPG:2MP;H264:3MP;JPG:3MP;H264:5MP;JPG:5MP@H264:720,JPEG:VGA;H264:D1,JPEG:D1;H264:720,JPEG:720@MPEG4:720,JPEG:VGA;MPEG4:D1,JPEG:D1;MPEG4:720,JPEG:720@H264:720,H264:QVGA;H264:D1,H264:D1;H264:D1,H264:QVGA;H264:1080,H264:QVGA@MPEG4:720,MPEG4:QVGA;MPEG4:D1,MPEG4:D1;MPEG4:D1,MPEG4:QVGA;MPEG4:1080,MPEG4:QVGA@H264:D1,MPEG4:D1@H264:720,JPEG:VGA,H264:QVGA@MPEG4:720,JPEG:VGA,MPEG4:QVGA
     
    for H264-1080p:
    videocodec=0
    videocodeccombo=0
    videocodecres=3

    So set videocodec, videocodeccombo, videocodecres appropriate.

    You can trace the code from : /DM368IPNC_MT5_2.6.0/ipnc/ipnc_app/network/boa-0.94.13/src/appro_api.c.
    Trace throug code from there, if you want better understand it.

    In your last terminal log there is:

    CPU is DM368
    DEMOCFG Value   : 0
    Videocodecmode  : 0
    Videocodecres   : 3
    Starting mounting local filesystems: ./av_server.out FD OSD DM368 APPRO2A AEWB 1080P H264 4000000 VBR AUTO MENUOFF &

     

    And you can  start your program directly in terminal. ( ./av_server.out FD OSD DM368 APPRO2A AEWB 1080P H264 4000000 VBR AUTO MENUOFF &)
    Here "1080P"  parameter indicates resolution.
    You can see all parameters just at the beginning of file : in /DM368IPNC_MT5_2.6.0/ipnc/av_capture/application/ipnc/av_server/src/common/avServerMain.c

    In terminal go to:  cd   /opt/ipnc
    Then for  :

     Stop :
    ./killall.sh

    Start  :
    ./loadkmodules.sh
    ./av_capture_load.sh
    ./loadmodules_ipnc.sh
    ./system_server &
    ./wis-streamer &
    ./boa -c /etc &

    Or another startup with av_server parameters:
    ./loadkmodules.sh
    ./av_capture_load.sh
    ./loadmodules_ipnc.sh
    ./av_server.out FD OSD DM368 APPRO2A AEWB RTSP 1080P H264 4000000 VBR AUTO MENUOFF &

    For other resolution :
    ./av_server.out DM368 RTSP APPRO2A AEWB 3MP H264 6000000 CBR AUTO MENUOFF &    //for 3MP
    ./av_server.out DM368 RTSP APPRO2A AEWB 5MP H264 5000000 CBR AUTO MENUOFF &    /for 5MP

     

    I can get 5MP work with Linux mem=48.

    You can see description about that in Users_Guide_IPNC_DM36x.pdf,  AVServer_DesignGuide_IPNC_DM36x.pdf

     

    Regards,
    Marko.

     

  • Marko,

    I am capturing video from the camera using OpenCv with FFMPEG. I can get the streaming, but for some frames, I get following errors:

    [h264 @ 0xa0b4d30] no frame!

    [h264 @ 0xa0b4d30] non-existing PPS referenced

    [h264 @ 0xa0b4d30] non-existing PPS 0 referenced

    [h264 @ 0xa0b4d30] decode_slice_header error

    When I use this camera from triggering the other camera on motion detection and capturing images from both the cameras, I get following errors and the frames are corrupted after some time:

    [h264 @ 0xa263470] error while decoding MB 41 29

    [h264 @ 0xa263470] concealing 53 DC, 53 AC, 53 MV errors

    [h264 @ 0xa263470] concealing 666 DC, 666 AC, 666 MV errors

    [h264 @ 0xa263470] negative number of zero coeffs at 21 2

    I am using the lowest resolution right now, i.e., H.264:D1 720x480. These problems were also present when I was using the old kernel and file system (unchanged). Actually my aim is to get a motion trigger from the DMVA2IPNC-mt5 camera on the PC and then use this trigger to capture images from DMVA2IPNC-mt5 and PhotonFocus GigE camera (running in triggered mode). 

    Initially the images from both the cameras are fine. But after some time, the images from DMVA2IPNC-mt5 camera get corrupted and I receive errors as mentioned above. 

    Is this problem related to the camera's memory?

    Regards,

     

  • Umair,

    I don't know about OpenCv, but you can get stream from IPNC with VLC and ActiveX component provided with ipnc sdk and web interface.
    They both use ffmpeg libraries.

    Regards,
    Marko.

  • Marko,

    Can you please let me know how to use that SDK. Is it possible to use that SDK to write a c++ program, capture image from the camera and save it? 

    Please let me know how can I use the SDK?

    Regards,

  • Umair,

    It's an easy way to record file from rtsp stream with command line ffmpeg, like :

    ffmpeg.exe -i rtsp://192.168.1.168:8557/PSIA/Streaming/channels/2?videoCodecType=H.264 -y -vcodec copy myfile1.asf -t 30

    This will record 30 seconds of video to  asf file.

    But if you want to do it in code look at ffmpeg source code, it is open source.

    Regards,
    Marko.

  • Marko,

    Actually my aim is not to record video, but to capture images (and save them). I already use FFMPEG within my  c++ code, but there seems to be some problem with decoding. Although streaming works fine in VLC and MPLAYER or even with FFMPEG at command prompt.

     What do you suggest for

    i) writing a simple application to capture images from the camera?

    ii) If I wanna disable encoding, how can I do that?

    Regards,

     

  • Marko,

    I set the following parameters in http://192.168.1.168/ini.htm: (I am using default kernel and filesystems with mem=48M, 16M)

    videocodec=0 
    videocodeccombo=0 
    videocodecres=3

    With this configuration, I can get av_server running with following parameters: (both for 1020p and 720p)

    ./av_server.out FD OSD DM368 APPRO2A AEWB 1080P H264 4000000 VBR AUTO MENUOFF &

    But when I wanna use 3MP resolution with following parameters:

    ./av_server.out DM368 RTSP APPRO2A AEWB 3MP H264 6000000 CBR AUTO MENUOFF & 

    I get many error messages and av_server is not started: The error log is as follows:

     

     FR : 0 users registered froCMEMK Error: ioctl: failed to allocate heap buffer of size 0x6995e5

    m exsiting face album

    > DMVA App: TASK CREATE

    > DMVA APP: Default application parameters set.

    gAVSERVER_config.dmvaAppParams.dmvaAppSMETASensitivity = 3

    gAVSERVER_config.dmvaAppParams.dmvaAppSMETAPresentAdjust = 15

    > DMVA APP: Parameters read from UI

                Mode         = 0

                Sensitivty   = 3

                CMEMK Error: mmap: can't find allocated buffer with physp 85e0b000

    Min Per.Size = 5CMEMK Error: mmap: can't find allocated buffer with physp 85e0b000x10

               CMEMK Error: get_phys: Unable to find phys addr for 0x85e0b000

     Max Per.Size = CMEMK Error: get_phys: get_user_pages() failed: -14

    160x160

           CMEMK Error: FREE: Failed to convert virtual 0x85e0b000 to physical

         Polygons     = 0

             CMEMK Error: mmap: can't find allocated buffer with physp 85e0b000

       Frame rate   CMEMK Error: get_phys: Unable to find phys addr for 0x85e0b000

    = 10

              CMEMK Error: get_phys: get_user_pages() failed: -14

      Tamper Reset =CMEMK Error: FREE: Failed to convert virtual 0x85e0b000 to physical  3


     ALG: CreaCMEMK Error: mmap: can't find allocated buffer with physp 85e0b000

    ted Image Sym AlCMEMK Error: mmap: can't find allocated buffer with physp 85e0b0

    00

    go Kernel !

     ALG: Created NMS Kernel !

     ALG: Created RLE Kernel !

     ALG: CreatCMEMK Error: get_phys: Unable to find phys addr for 0x85e0b000

    ed MORP Kernel !CMEMK Error: get_phys: get_user_pages() failed: -14


    > DMVAL: CCMEMK Error: FREE: Failed to convert virtual 0x85e0b000 to physical

    alculating memory requirement foCMEMK Error: get_phys: Unable to find phys addr

    for 0x85e0b000

    r DMVAL instanceCMEMK Error: get_phys: get_user_pages() failed: -14

    ...

             ExCMEMK Error: FREE: Failed to convert virtual 0x85e0b000 to physical

    pecting 256x192 input images of CMEMK Error: get_phys: Unable to find phys addr

    for 0x85e0b000

    type 'DMVAL_IMG_CMEMK Error: get_phys: get_user_pages() failed: -14

    YUV420_PLANARINTCMEMK Error: FREE: Failed to convert virtual 0x85e0b000 to physi

    cal

    ERLEAVED'.

    > DMVAL: 6919653 bytes required for DMVAL instance.

    > DMVAL: 5128 bytes required for DMVAL output.


    > DMVA APP: Allocated 5128 bytes for DMVAL output memory @ 0x4df95000CMEM Error:

     allocHeap: ioctl CMEM_IOCALLOCHEAPCACHED failed: -1


    > DMVA APP: Allocated 6919653 bytes for DMVAL internal memory @ 0x0 ERROR  (alg_

    dmval.c|ALG_dmvalCreate|64):

    > DMVA APP: Error allocating bytes for DMVAL instance


    > DMVA APP: Calling DMVAL_configure  ERROR  (alg_dmval.c|ALG_dmvalCreate|81): DM

    VAL_configure()

    allocPool: Failed to mmap buffer at physical address 0x85e0b000

    ApproDrvExit: 8

    allocPool: Failed to mmap buffer at physical address 0x85e0b000

    ApproDrvExit: 9

    allocPool: Failed to mmap buffer at physical address 0x85e0b000

    ApproDrvExit: 10

    allocPool: Failed to mmap buffer at physical address 0x85e0b000

    ApproDrvExit: 6

    allocPool: Failed to mmap buffer at physical address 0x85e0b000

    ApproDrvExit: 2

     

    Whereas, if I set 5MP resolution keeping all other parameters same, I get following error:

     

    AVSERVER UI: Starting Streaming Server...DONE

    SENSOR FPS VALUE = 10

     ERROR  (alg_vidEnc.c|ALG_vidEncCreate|185): Failed to open video encode algorit

    hm: h264enc (0x0)

     ERROR  (videoEncodeThr.c|VIDEO_encodeTskCreate|49): ALG_vidEncCreate(0) ERROR

    (videoEncodeThr.c|VIDEO_encodeTskMain|432): VIDEO_encodeTskCreate()

     ERROR  (avServerMainThr.c|AVSERVER_tskStart|78):

     

    Can you please figure out what is wrong?

    Regards,

  • Hello, Umair.

    I got the same problem.

    insmod: /opt/ipnc/modules/mmc_core.ko: No such file or directory.

    insmod: /opt/ipnc/modules/mmc_block.ko: No such file or directory.

    insmod: /opt/ipnc/modules/davinci-mmc.ko: No such file or directory.

    insmod: /opt/ipnc/modules/usbcore.ko: No such file or directory.

    insmod: /opt/ipnc/modules/musb_hdrc.ko: No such file or directory.

    insmod: /opt/ipnc/modules/usbmon.ko: No such file or directory.

    How did you solve it ?

    regards,

    Bang.

  • Hi,

    These modules are present in different folders. So just copy them to the respective folders (as above) and build the cramfs again. However, I think the camera should work fine even if they are not loaded. 

    Regards,

    Umair