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 Greenish with TI2A

Other Parts Discussed in Thread: DM388, DM385

Hello,

RDK : IPNC RDK v3.8

Cam : DM388

Sensor : IMX136

I downloaded fresh IPNC code and built for full feature demo. By default , APPRO2A  is selected. The video looks fine.

I changed the 2A  to  TI2A ( by selecting TI2A   in the web GUI  selects APPRO2A internally, don't know why)  by making

pObj->aewbVendor = AEWB_ID_TI;  in ti_tools/iss_03_80_00_00/packages/ti/psp/iss/drivers/alg/2A/src/issdrv_alg2AApi.c  (IssAlg_capt2AProcess())

The video is greenish. I made sure that sensor board vendor is Appro  and used it in the Rules.make. Attached is the screenshot of the video.

Request  some experts  to look into this issue.

Best regards

JK

  • I will notify the IPNC RDK team for help.

    Regards,
    Pavel
  • Hi,

    What is your requirement?Do you want to enable both Appro and TI 2A for DM388 + Appro IMX136 combo?

    By default,only Appro 2A is enabled for this combo, and if you change to TI 2A via web GUI then it gets forced back to Appro 2A.

    If you want to run both 2A algorithms then you need to remove the constraint in the ..\ipnc_rdk\ipnc_app\sys_server\src\Makefile file:

    ifeq ($(SENSOR_BOARD_VENDOR), APPRO)
    ifeq ($(IMGS_ID), IMGS_SONY_IMX136)
    #C_FLAGS += -D_ONLY_APPRO2A
    endif
    endif  

    As far as greenish image is concerned,pl. make below change in the ..\ti_tools\iss_03_80_00_00\packages\ti\psp\iss\drivers\capture\src\issdrv_captureApi.c file and check:

    gIss_captCommonObj.pIssConfig->ptH3aAewbParams->ptAewbPaxelWin->nHPos = 32;    //31; 

    Pl. note that the TI 2A is not tested with DM388+Appro IMX136 sensor combo.

     

    regards,

    Anand

  • Dear Anand,
    I wanted to use TI2A. I made both changes, and ensured that TI2A is selected.
    But still the image is greenish.

    Regards
    JK
  • Hi,

    I am running TI 2A on DM388+LI IMX136 combo.

    If i make 'gIss_captCommonObj.pIssConfig->ptH3aAewbParams->ptAewbPaxelWin->nHPos = 31;' then i observe the greeish image:

    Conversely you should see proper image by making gIss_captCommonObj.pIssConfig->ptH3aAewbParams->ptAewbPaxelWin->nHPos = 32; 

    If there is no apparent change in the video it means the change made is not getting reflected.

    Can you send me your changes?

    If you want to run TI 2A algorithm then you should have used LI IMX136 sensor board and driver.

     

    regards,

    Anand

  • Dear  Anand,

    With   C_FLAGS += -D_ONLY_APPRO2A  to   #C_FLAGS += -D_ONLY_APPRO2A  change, I can  now  select  TI2A.

    Attached is  issdrv_captureApi.c and  the console logs. See  the snapshots take  before  and  after  your  changes. There  is slight  change.

    6242.issdrv_captureApi.txt

    3034.ti2A.txt
    
    U-Boot 2010.06 (May 29 2014 - 15:44:09) DM388_IPNC_3.80.00
    
    DM385-GP rev 1.1
    
    ARM clk: 600MHz
    DDR clk: 533MHz
    L3 clk:  200MHz
    IVA clk: 450MHz
    ISS clk: 400MHz
    DSP Default OFF
    DSS Default OFF
    
    DRAM:  1 GiB
    DCACHE:  Off
    NAND:  HW ECC BCH8 Selected
    256 MiB
    Using default environment
    
    The 2nd stage U-Boot will now be auto-loaded
    Please do not interrupt the countdown till DM385_IPNC prompt if 2nd stage is already flashed
    Hit any key to stop autoboot:  0 
    
    NAND read: device 0 offset 0x20000, size 0x40000
     262144 bytes read: OK
    ## Starting application at 0x81000000 ...
    
    
    U-Boot 2010.06 (May 29 2014 - 15:47:28) DM388_IPNC_3.80.00
    
    DM385-GP rev 1.1
    
    ARM clk: 600MHz
    DDR clk: 533MHz
    L3 clk:  200MHz
    IVA clk: 450MHz
    ISS clk: 400MHz
    DSP Default OFF
    DSS Default OFF
    
    I2C:   ready
    DRAM:  1 GiB
    DCACHE:  On
    NAND:  HW ECC BCH8 Selected
    256 MiB
    MMC:   OMAP SD/MMC: 0, ON-BOARD SDIO: 1
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @@                                                               @@
    @@                                                               @@
    @@                                                               @@
    @@                                                               @@
    @@       _______   __       __   ______    ______    ______      @@
    @@      /       \ /  \     /  | /      \  /      \  /      \     @@
    @@      $$$$$$$  |$$  \   /$$ |/$$$$$$  |/$$$$$$  |/$$$$$$  |    @@
    @@      $$ |  $$ |$$$  \ /$$$ |$$ ___$$ |$$ \__$$ |$$ \__$$ |    @@
    @@      $$ |  $$ |$$$$  /$$$$ |  /   $$< $$    $$< $$    $$<     @@
    @@      $$ |  $$ |$$ $$ $$/$$ | _$$$$$  | $$$$$$  | $$$$$$  |    @@
    @@      $$ |__$$ |$$ |$$$/ $$ |/  \__$$ |$$ \__$$ |$$ \__$$ |    @@
    @@      $$    $$/ $$ | $/  $$ |$$    $$/ $$    $$/ $$    $$/     @@
    @@      $$$$$$$/  $$/      $$/  $$$$$$/   $$$$$$/   $$$$$$/      @@
    @@                                                               @@
    @@                                                               @@
    @@                                                               @@
    @@                                                               @@
    @@                                                               @@
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    
    Net:   Ethernet clocking: 0x52
    Detected MACID:0:c:c:2:50:a1
    cpsw
    Hit any key to stop autoboot:  3  2  1  0 
    phy info reg 0x1e addr 0 val 2
    phy info reg 0x1e addr 0 val a
    link up on port 0, speed 1000, full duplex
    Using cpsw device
    TFTP from server 192.168.1.170; our IP address is 192.168.1.224
    Filename 'uImage_e2e_new_cam'.
    Load address: 0x81000000
    Loading: *#################################################################
    	 #################################################################
    	 #################################################################
    	 #################################################################
    	 #################################################################
    	 #################################################################
    	 #################################################################
    	 ##############################
    done
    Bytes transferred = 2482304 (25e080 hex)
    ## Booting kernel from Legacy Image at 81000000 ...
       Image Name:   Linux-2.6.37_DM388_IPNC_3.80.00-
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    2482240 Bytes = 2.4 MiB
       Load Address: 80008000
       Entry Point:  80008000
       Verifying Checksum ... OK
       Loading Kernel Image ... OK
    OK
    
    Starting kernel ...
    
    Uncompressing Linux... done, booting the kernel.
    Linux version 2.6.37_DM388_IPNC_3.80.00-00103-g1a13629-dirty (x00kulka@bangvideoapps01) (gcc version 4.5.3 20110311 (prerelease) (GCC) ) #1 Thu Jul 17 16:21:44 IST 2014
    
    CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7f
    
    CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
    
    Machine: dm385ipnc
    
    vram size = 4194304 at 0x0
    
    bootconsole [earlycon0] enabled
    
    ti81xx_reserve: ### Reserved DDR region @84f00000
    
    reserved size = 4194304 at 0x0
    
    FB: Reserving 4194304 bytes SDRAM for VRAM
    
    Memory policy: ECC disabled, Data cache writeback
    
    OMAP chip is DM385 1.0
    
    SRAM: Mapped pa 0x402f1000 to va 0xfe400000 size: 0xf000
    
    Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 19040
    
    Kernel command line: console=ttyO0,115200n8 root=/dev/nfs rw mem=80M vram=4M notifyk.vpssm3_sva=0xBFD00000 nfsroot=192.168.1.170:/home/jayakrishnan/work/projects/dm388/ipnc_rdk_fresh_code/Source/ipnc_rdk/target/filesys,nolock eth=00:0C:0C:02:50:A1 ip=192.168.1.224 cmemk.phys_start=0x85000000 cmemk.phys_end=0x89000000 cmemk.allowOverlap=1 earlyprintk rootdelay=4
    
    cpsw: kernel boot params Ethernet address: 00:0C:0C:02:50:A1
    
    PID hash table entries: 512 (order: -1, 2048 bytes)
    
    Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
    
    Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
    
    Memory: 74MB 1MB = 75MB total
    
    Memory: 70676k/70676k available, 11244k reserved, 0K highmem
    
    Virtual kernel memory layout:
    
        vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    
        fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    
        DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
    
        vmalloc : 0xc5800000 - 0xf8000000   ( 808 MB)
    
        lowmem  : 0xc0000000 - 0xc5000000   (  80 MB)
    
        pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    
        modules : 0xbf000000 - 0xbfe00000   (  14 MB)
    
          .init : 0xc0008000 - 0xc003e000   ( 216 kB)
    
          .text : 0xc003e000 - 0xc04b9000   (4588 kB)
    
          .data : 0xc04ba000 - 0xc04fa980   ( 259 kB)
    
    SLUB: Genslabs=11, HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
    
    NR_IRQS:375
    
    IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
    
    Total of 128 interrupts on 1 active controller
    
    GPMC revision 6.0
    
    Trying to install interrupt handler for IRQ368
    
    Trying to install interrupt handler for IRQ369
    
    Trying to install interrupt handler for IRQ370
    
    Trying to install interrupt handler for IRQ371
    
    Trying to install interrupt handler for IRQ372
    
    Trying to install interrupt handler for IRQ373
    
    Trying to install interrupt handler for IRQ374
    
    Trying to install type control for IRQ375
    
    Trying to set irq flags for IRQ375
    
    OMAP clockevent source: GPTIMER1 at 20000000 Hz
    
    Console: colour dummy device 80x30
    
    Calibrating delay loop... 599.65 BogoMIPS (lpj=2998272)
    
    pid_max: default: 32768 minimum: 301
    
    Security Framework initialized
    
    Mount-cache hash table entries: 512
    
    CPU: Testing write buffer coherency: ok
    
    devtmpfs: initialized
    
    TI81XX: Map 0x84f00000 to 0xfe500000 for dram barrier
    
    TI81XX: Map 0x40300000 to 0xfe600000 for sram barrier
    
    omap_voltage_early_init: voltage driver support not added
    
    regulator: core version 0.5
    
    regulator: dummy: 
    
    NET: Registered protocol family 16
    
    omap_voltage_domain_lookup: Voltage driver init not yet happened.Faulting!
    
    omap_voltage_add_dev: VDD specified does not exist!
    
    OMAP GPIO hardware version 0.1
    
    OMAP GPIO hardware version 0.1
    
    OMAP GPIO hardware version 0.1
    
    OMAP GPIO hardware version 0.1
    
    omap_mux_init: Add partition: #1: core, flags: 4
    
    Cannot clk_get ck_32
    
    Debugfs: Only enabling/disabling deep sleep and wakeup timer is supported now
    
    registered ti81xx_vpss device
    
    registered ti81xx_vidout device
    
    registered ti81xx on-chip HDMI device
    
    registered ti81xx_fb device
    
    PWM0 init success.
    
    PWM1 init success.
    
    bio: create slab <bio-0> at 0
    
    SCSI subsystem initialized
    
    USBSS revision 4ea2080b
    
    registerd cppi-dma Intr @ IRQ 17
    
    Cppi41 Init Done
    
    omap_i2c omap_i2c.1: bus 1 rev4.0 at 100 kHz
    
    tps65910 1-002d: No interrupt support, no core IRQ
    
    Advanced Linux Sound Architecture Driver Version 1.0.23.
    
    Switching to clocksource gp timer
    
    musb-hdrc: version 6.0, peripheral, debug=0
    
    musb-hdrc musb-hdrc.0: dma type: dma-cppi41
    
    MUSB controller-0 revision 4ea20800
    
    usb2phy: computed values rxcalib(15)DACs(24 14 17)
    
    usb2phy: override computed values rxcalib(15)DACs(24 14 17)
    
    usb2phy_config: musb(0) rxcalib done, rxcalib read value 6f6c5d8e
    
    musb-hdrc musb-hdrc.0: USB Peripheral mode controller at c581e000 using DMA, IRQ 18
    
    NET: Registered protocol family 2
    
    IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
    
    TCP established hash table entries: 4096 (order: 3, 32768 bytes)
    
    TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
    
    TCP: Hash tables configured (established 4096 bind 4096)
    
    TCP reno registered
    
    UDP hash table entries: 256 (order: 0, 4096 bytes)
    
    UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
    
    NET: Registered protocol family 1
    
    RPC: Registered udp transport module.
    
    RPC: Registered tcp transport module.
    
    RPC: Registered tcp NFSv4.1 backchannel transport module.
    
    NetWinder Floating Point Emulator V0.97 (double precision)
    
    PMU: registered new PMU device of type 0
    
    omap-iommu omap-iommu.0: ducati registered
    
    omap-iommu omap-iommu.1: sys registered
    
    JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
    
    msgmni has been set to 138
    
    io scheduler noop registered
    
    io scheduler deadline registered
    
    io scheduler cfq registered (default)
    
    CMEMK module: built on May 27 2014 at 16:44:00
    
      Reference Linux version 2.6.37
    
      File /data/datalocal1_videoapps01/user/anandyk/DM81xx/IPNetCam/ti_tools/linuxutils_3_23_00_01/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.c
    
    allocated heap buffer 0xc7000000 of size 0x4000000
    
    cmemk initialized
    
    Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
    
    omap_uart.0: ttyO0 at MMIO 0x48020000 (irq = 72) is a OMAP UART0
    
    console [ttyO0] enabled, bootconsole disabled
    console [ttyO0] enabled, bootconsole disabled
    
    omap_uart.1: ttyO1 at MMIO 0x48022000 (irq = 73) is a OMAP UART1
    omap_uart.2: ttyO2 at MMIO 0x48024000 (irq = 74) is a OMAP UART2
    brd: module loaded
    loop: module loaded
    omap2-nand driver initializing
    ONFI param page 0 valid
    ONFI flash detected
    NAND device: Manufacturer ID: 0x2c, Chip ID: 0xba (Micron NAND 256MiB 1,8V 16-bit)
    omap2-nand: detected x16 NAND flash 
    Creating 8 MTD partitions on "omap2-nand.0":
    0x000000000000-0x000000020000 : "U-Boot-min"
    0x000000020000-0x000000260000 : "U-Boot"
    0x000000260000-0x000000280000 : "U-Boot Env"
    0x000000280000-0x0000006c0000 : "Kernel"
    0x0000006c0000-0x000006fc0000 : "File System"
    0x000006fc0000-0x000007bc0000 : "Data"
    0x000007bc0000-0x00000b0c0000 : "File System2"
    0x00000b0c0000-0x000010000000 : "Reserved"
    davinci_mdio davinci_mdio.0: davinci mdio revision 1.6
    davinci_mdio davinci_mdio.0: detected phy mask fffffffe
    davinci_mdio.0: probed
    davinci_mdio davinci_mdio.0: phy[0]: device 0:00, driver unknown
    mice: PS/2 mouse device common for all mice
    omap_rtc omap_rtc: rtc core: registered omap_rtc as rtc0
    i2c /dev entries driver
    Linux video capture interface: v2.00
    OMAP Watchdog Timer Rev 0x00: initial timeout 60 sec
    notify_shm_drv: no DSP present (MULTIPROC_INVALIDID)
    notify_init : notify drivercreated  for  remote proc id 1 at physical Address 0xbfd00000
    cm: Module associated with clock hdmi_i2s_fck didn't enable in 100000 tries
    asoc: tlv320aic3x-hifi <-> davinci-mcasp.1 mapping ok
    asoc: HDMI-DAI-CODEC <-> hdmi-dai mapping ok
    ALSA device list:
      #0: TI81XX EVM
    nf_conntrack version 0.5.0 (1104 buckets, 4416 max)
    ip_tables: (C) 2000-2006 Netfilter Core Team
    TCP cubic registered
    NET: Registered protocol family 17
    Bridge firewalling registered
    lib80211: common routines for IEEE802.11 drivers
    Registering the dns_resolver key type
    VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
    omap_voltage_late_init: Voltage driver support not added
    Power Management for TI81XX.
    Detected MACID=0:c:c:2:50:a1
    omap_rtc omap_rtc: setting system clock to 2000-01-01 00:00:00 UTC (946684800)
    
    CPSW phy found : id is : 0x4dd074
    PHY 0:01 not found
    IP-Config: Guessing netmask 255.255.255.0
    IP-Config: Complete:
         device=eth0, addr=192.168.1.224, mask=255.255.255.0, gw=255.255.255.255,
         host=192.168.1.224, domain=, nis-domain=(none),
         bootserver=255.255.255.255, rootserver=192.168.1.170, rootpath=
    Waiting 4sec before mounting root device...
    PHY: 0:00 - Link is Up - 1000/Full
    VFS: Mounted root (nfs filesystem) on device 0:14.
    devtmpfs: mounted
    Freeing init memory: 216K
    
    INIT: version 2.86 booting
    
    Please wait: booting...
    Starting udev
    Root filesystem already rw, not remounting
    Caching udev devnodes
    root: mount: mounting /dev/root on / failed: No such file or directory
    NOT configuring network interfaces: / is an NFS mount
    rm: cannot remove '/tmp': Device or resource busy
    Fri Nov  9 12:48:00 GMT-8 2012
     inside finish.sh 
    UBI: attaching mtd5 to ubi0
    UBI: physical eraseblock size:   131072 bytes (128 KiB)
    UBI: logical eraseblock size:    126976 bytes
    UBI: smallest flash I/O unit:    2048
    UBI: sub-page size:              512
    UBI: VID header offset:          2048 (aligned 2048)
    UBI: data offset:                4096
    UBI: max. sequence number:       215
    UBI: attached mtd5 to ubi0
    UBI: MTD device name:            "Data"
    UBI: MTD device size:            12 MiB
    UBI: number of good PEBs:        96
    UBI: number of bad PEBs:         0
    UBI: number of corrupted PEBs:   0
    UBI: max. allowed volumes:       128
    UBI: wear-leveling threshold:    4096
    UBI: number of internal volumes: 1
    UBI: number of user volumes:     1
    UBI: available PEBs:             0
    UBI: total number of reserved PEBs: 96
    UBI: number of PEBs reserved for bad PEB handling: 2
    UBI: max/mean erase counter: 4/3
    UBI: image sequence number:  -1790138376
    UBI: background thread "ubi_bgt0d" started, PID 267
    UBI device number 0, total 96 LEBs (12189696 bytes, 11.6 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)
    UBIFS: recovery needed
    UBIFS: recovery completed
    UBIFS: mounted UBI device 0, volume 0, name "ubifs_volume"
    UBIFS: file system size:   10285056 bytes (10044 KiB, 9 MiB, 81 LEBs)
    UBIFS: journal size:       1015809 bytes (992 KiB, 0 MiB, 6 LEBs)
    UBIFS: media format:       w4/r0 (latest is w4/r0)
    UBIFS: default compressor: lzo
    UBIFS: reserved for root:  485787 bytes (474 KiB)
    UBI: attaching mtd7 to ubi1
    UBI: physical eraseblock size:   131072 bytes (128 KiB)
    UBI: logical eraseblock size:    126976 bytes
    UBI: smallest flash I/O unit:    2048
    UBI: sub-page size:              512
    UBI: VID header offset:          2048 (aligned 2048)
    UBI: data offset:                4096
    UBI: max. sequence number:       25
    UBI: attached mtd7 to ubi1
    UBI: MTD device name:            "Reserved"
    UBI: MTD device size:            79 MiB
    UBI: number of good PEBs:        634
    UBI: number of bad PEBs:         0
    UBI: number of corrupted PEBs:   0
    UBI: max. allowed volumes:       128
    UBI: wear-leveling threshold:    4096
    UBI: number of internal volumes: 1
    UBI: number of user volumes:     1
    UBI: available PEBs:             0
    UBI: total number of reserved PEBs: 634
    UBI: number of PEBs reserved for bad PEB handling: 6
    UBI: max/mean erase counter: 36/34
    UBI: image sequence number:  1832438436
    UBI: background thread "ubi_bgt1d" started, PID 279
    UBI device number 1, total 634 LEBs (80502784 bytes, 76.8 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)
    UBIFS: recovery needed
    UBIFS: recovery completed
    UBIFS: mounted UBI device 1, volume 0, name "ubifs_volume"
    UBIFS: file system size:   78090240 bytes (76260 KiB, 74 MiB, 615 LEBs)
    UBIFS: journal size:       3936256 bytes (3844 KiB, 3 MiB, 31 LEBs)
    UBIFS: media format:       w4/r0 (latest is w4/r0)
    UBIFS: default compressor: lzo
    UBIFS: reserved for root:  3688395 bytes (3601 KiB)
    numid=1,iface=MIXER,name='PCM Playback Volume'
      ; type=INTEGER,access=rw---R--,values=2,min=0,max=127,step=0
      : values=127,127
      | dBscale-min=-63.50dB,step=0.50dB,mute=0
     [c6xdsp ] Remote Debug Shared Memory @ 0xbff00000
     [m3video] Remote Debug Shared Memory @ 0xbff05020
     [m3vpss ] Remote Debug Shared Memory @ 0xbff0a040
    SysLink version : 2.21.02.10
    SysLink module created on Date:May  5 2015 Time:17:39:02
    Trace enabled
    Trace SetFailureReason enabled
    /dev/mem opened.
                 Phy Addr : 0x48181560 Data : 0x00000002
              Unhandled fault: external abort on non-linefetch (0x1018) at 0x402770e4
       Phy Addr : 0x48180f10 Data : 0x00000000
                 Phy Addr : 0x48180508 Data : 0x00000302
                 Phy Addr : 0x48180520 Data : 0x00000002
                 Phy Addr : 0x48180524 Data : 0x00000002
                 Phy Addr : 0x48180528 Data : 0x00000002
                 Phy Addr : 0x4c0000e4 Data : 0x00170209
    Bus error
    
    
     [host]  Setting DMM priority for [ISS     ] to [0] ( 0x4e000634 = 0x00080000 )
    
    
     [host]  Setting DMM priority for [HDVICP0 ] to [1] ( 0x4e000634 = 0x00000009 )
    
    
     [host]  Setting L3 bandwidth regulator for [HDVICP0 ] to [press=[0,0] BW=900, WM Cycles=2500]
    
    Creat queue id:0
    queue id:0
    FileMngThread created
    Creat queue id:32769
    queue id:32769
    AlramThread created
    Share memory init success
    IPNC_3.80.00-00103-g1a13629-dirty (x00kulka@bangvideoapps01) (gcc versio 
    
     [host]  Setting L3 bandwidth regulator for [ISS     ] to [press=[3,3] BW=400, WM Cycles=2500]
    Creat queue id:65538
    queue id:65538
    Creat queue id:98307
    queue id:98307
    queue id:32769
    
    
     [host] Attached to slave procId 1.
     [c6xdsp ] Remote Debug Shared Memory @ 0xbff00000
     [m3video] Remote Debug Shared Memory @ 0xbff05020
     [m3vpss ] Remote Debug Shared Memory @ 0xbff0a040
    
    
     [host] Loaded file ./firmware/ipnc_rdk_fw_m3vpss.xem3 on slave procId 1.
    
    
     [host] Started slave procId 1.
    
    
     [host] After Ipc_loadcallback status [0x00000000]
    
    
     [host] Attached to slave procId 0.
     [m3vpss ] ***** SYSTEM  : Frequency <ORG> - 200000000, <NEW> - 200000000
     [m3vpss ] notify_attach  rtnVal  0
     [m3vpss ] initProxyServer  rtnVal  0
     [m3vpss ]  
     [m3vpss ]  *** UTILS: CPU KHz = 400000 Khz ***
     [m3vpss ]  
     [m3vpss ]  69: SYSTEM  : System Common Init in progress !!!
     [m3vpss ]  69: SYSTEM: IPC init in progress !!!
     [m3vpss ]  69: SYSTEM: Attaching to [HOST] ... 
     [m3vpss ]  120: SYSTEM: Attaching to [HOST] ... 
     [m3vpss ]  170: SYSTEM: Attaching to [HOST] ... 
     [m3vpss ]  220: SYSTEM: Attaching to [HOST] ... 
     [m3vpss ]  270: SYSTEM: Attaching to [HOST] ... 
     [m3vpss ]  320: SYSTEM: Attaching to [HOST] ... 
     [m3vpss ]  370: SYSTEM: Attaching to [HOST] ... 
     [m3vpss ]  420: SYSTEM: Attaching to [HOST] ... 
     [m3vpss ]  470: SYSTEM: Attaching to [HOST] ... 
     [m3vpss ]  472: SYSTEM: Attaching to [HOST] ... SUCCESS !!!
     [m3vpss ]  472: SYSTEM: Attaching to [VIDEO-M3] ... 
    
    
     [host] After Ipc_startcallback status [0x00000000]
    
    
     [host] Loaded file ./firmware/ipnc_rdk_fw_m3video.xem3 on slave procId 0.
    
    
     [host] Started slave procId 0.
    
    
     [host] After Ipc_loadcallback status [0x00000000]
     [m3video] ***** SYSTEM  : Frequency <ORG> - 200000000, <NEW> - 200000000
     [m3vpss ]  522: SYSTEM: Attaching to [VIDEO-M3] ... 
     [m3video]  
     [m3video]  *** UTILS: CPU KHz = 400000 Khz ***
     [m3video]  
     [m3video]  493: SYSTEM  : System Common Init in progress !!!
     [m3video]  494: SYSTEM: IPC init in progress !!!
     [m3video]  494: SYSTEM: Attaching to [HOST] ... 
    
    
     [host] After Ipc_startcallback status [0x00000000]
     [m3video]  543: SYSTEM: Attaching to [HOST] ... 
     [m3video]  547: SYSTEM: Attaching to [HOST] ... SUCCESS !!!
     [m3video]  547: SYSTEM: Attaching to [VPSS-M3] ... 
     [m3vpss ]  572: SYSTEM: Attaching to [VIDEO-M3] ... 
     [m3video]  596: SYSTEM: Attaching to [VPSS-M3] ... 
     [m3video]  622: SYSTEM: Attaching to [VPSS-M3] ... SUCCESS !!!
     [m3vpss ]  622: SYSTEM: Attaching to [VIDEO-M3] ... 
     [m3video]  623: SYSTEM: Opening MsgQ Heap [IPC_MSGQ_MSG_HEAP] ...
     [m3vpss ]  622: SYSTEM: Attaching to [VIDEO-M3] ... SUCCESS !!!
     [m3vpss ]  623: SYSTEM: Creating MsgQ Heap [IPC_MSGQ_MSG_HEAP] ...
     [m3vpss ]  623: SYSTEM: Creating MsgQ [VPSS-M3_MSGQ] ...
     [m3vpss ]  623: SYSTEM: Creating MsgQ [VPSS-M3_ACK_MSGQ] ...
     [m3vpss ]  625: SYSTEM: Notify register to [HOST] line 0, event 12 ... 
     [m3vpss ]  626: SYSTEM: Notify register to [VIDEO-M3] line 0, event 12 ... 
     [m3vpss ]  626: SYSTEM: IPC init DONE !!!
     [m3vpss ]  642: MEM: Shared Region 2: Base = 0xb8000000, Length = 0x06900000 (105 MB) 
     [m3vpss ] Received character 's'
     [m3vpss ]  642: MEM: Shared Region 1: Base = 0x89000000, Length = 0x03b00000 (59 MB) 
     [m3vpss ]  645: SYSTEM  : System Common Init Done !!!
     [c6xdsp ] Remote Debug Shared Memory @ 0xbff00000
     [m3video] Remote Debug Shared Memory @ 0xbff05020
     [m3vpss ] Remote Debug Shared Memory @ 0xbff0a040
     [m3video]  722: SYSTEM: Opening MsgQ Heap [IPC_MSGQ_MSG_HEAP] ...
     [m3video]  723: SYSTEM: Creating MsgQ [VIDEO-M3_MSGQ] ...
     [m3video]  723: SYSTEM: Creating MsgQ [VIDEO-M3_ACK_MSGQ] ...
     [m3video]  725: SYSTEM: Notify register to [HOST] line 0, event 12 ... 
     [m3video]  726: SYSTEM: Notify register to [VPSS-M3] line 0, event 12 ... 
     [m3video]  726: SYSTEM: IPC init DONE !!!
     [m3video]  741: MEM: Shared Region 2: Base = 0xb8000000, Length = 0x06900000 (105 MB) 
     [m3video]  742: MEM: Shared Region 1: Base = 0x89000000, Length = 0x03b00000 (59 MB) 
     [m3video] Received character 's'
    queue id:65538
     [m3video]  744: SYSTEM  : System Common Init Done !!!
    Creat queue id:131076
    queue id:131076
    
    CPU is TI812x
    
    *****************************************************************
    
        IPNC BUILD VERSION: IPNC RDK VERSION 03.80.00.05 (FULL FEATURE)	
    
    *****************************************************************
    
    DEMOCFG Value	: 0
    Videocodecmode	: 8
    Videocodecres 	: 0
    streamtype 	: 2
    
     vsenable : 0
    ./bin/ipnc_rdk_mcfw.out   VNF_QUALITY TRISTREAM TRIPLE_H264 TI2A AEWB 1080P_D1 H264 HIGH_SPEED1 H264 HIGH_SPEED2 MJPEG 80 &
    Creat queue id:163845
    queue id:163845
    queue id:65538
     [c6xdsp ] Remote Debug Shared Memory @ 0xbff00000
     [m3video] Remote Debug Shared Memory @ 0xbff05020
     [m3vpss ] Remote Debug Shared Memory @ 0xbff0a040
     [c6xdsp ] Remote Debug Shared Memory @ 0xbff00000
     [m3video] Remote Debug Shared Memory @ 0xbff05020
     [m3vpss ] Remote Debug Shared Memory @ 0xbff0a040
     [m3video]  943: SYSTEM  : System Video Init in progress !!!
     [m3vpss ]  945: SYSTEM  : System VPSS Init in progress !!!
     [m3video]  944: SYSTEM: Creating ListMP [VIDEO-M3_IPC_OUT_0] in region 0 ...
     [m3video]  944: SYSTEM: Creating ListMP [VIDEO-M3_IPC_IN_0] in region 0 ...
     [m3video]  945: SYSTEM: ListElem Shared Addr = 0xbe984180
     [m3video]  947: SYSTEM: Creating ListMP [VIDEO-M3_IPC_OUT_1] in region 0 ...
     [m3video]  948: SYSTEM: Creating ListMP [VIDEO-M3_IPC_IN_1] in region 0 ...
     [m3video]  948: SYSTEM: ListElem Shared Addr = 0xbe987680
     [m3video]  958: SYSTEM: Creating ListMP [VIDEO-M3_IPC_OUT_29] in region 0 ...
     [m3vpss ] === I2C0/2 Clk is active ===
     [m3video]  959: SYSTEM: Creating ListMP [VIDEO-M3_IPC_IN_29] in region 0 ...
     [m3vpss ] PLATFORM: UNKNOWN CPU detected, defaulting to VPS_PLATFORM_CPU_REV_1_0
     [m3video]  959: SYSTEM: ListElem Shared Addr = 0xbe98ab80
     [m3vpss ]  PLATFORM: UNKNOWN CPU detected, defaulting to ISS_PLATFORM_CPU_REV_2_1
     [m3video]  962: SYSTEM: Creating ListMP [VIDEO-M3_IPC_OUT_30] in region 0 ...
     [m3vpss ]  964: SYSTEM: Creating ListMP [VPSS-M3_IPC_OUT_0] in region 0 ...
     [m3video]  962: SYSTEM: Creating ListMP [VIDEO-M3_IPC_IN_30] in region 0 ...
     [m3vpss ]  964: SYSTEM: Creating ListMP [VPSS-M3_IPC_IN_0] in region 0 ...
     [m3video]  962: SYSTEM: ListElem Shared Addr = 0xbe9a4800
     [m3vpss ]  965: SYSTEM: ListElem Shared Addr = 0xbe9be480
     [m3video]  965: HDVICP: Doing PRCM for IVAHD[0] ... 
     [m3vpss ]  968: SYSTEM: Creating ListMP [VPSS-M3_IPC_OUT_1] in region 0 ...
     [m3video]  965: HDVICP: PRCM for IVAHD[0] ... DONE.
     [m3vpss ]  968: SYSTEM: Creating ListMP [VPSS-M3_IPC_IN_1] in region 0 ...
     [m3video]  966: SYSTEM  : Initializing Links !!! 
     [m3video]  966: SYSTEM  : FREE SPACE : System Heap      = 2088976 B, Mbx = 10240 msgs) 
     [m3vpss ]  969: SYSTEM: ListElem Shared Addr = 0xbe9c1980
     [c6xdsp ] Remote Debug Shared Memory @ 0xbff00000
     [m3video] Remote Debug Shared Memory @ 0xbff05020
     [m3vpss ] Remote Debug Shared Memory @ 0xbff0a040
     [m3video]  967: SYSTEM  : FREE SPACE : SR0 Heap         = 15985792 B (15 MB) 
     [m3vpss ]  983: SYSTEM: Creating ListMP [VPSS-M3_IPC_OUT_24] in region 0 ...
     [m3vpss ]  984: SYSTEM: Creating ListMP [VPSS-M3_IPC_IN_24] in region 0 ...
     [m3video]  967: SYSTEM  : FREE SPACE : Frame Buffer     = 110100352 B (104 MB) 
     [m3vpss ]  984: SYSTEM: ListElem Shared Addr = 0xbe9c4e80
     [m3vpss ]  987: SYSTEM: Creating ListMP [VPSS-M3_IPC_OUT_25] in region 0 ...
     [m3video]  967: SYSTEM  : FREE SPACE : Bitstream Buffer = 61865856 B (58 MB) 
     [m3vpss ]  987: SYSTEM: Creating ListMP [VPSS-M3_IPC_IN_25] in region 0 ...
     [m3vpss ]  988: SYSTEM: ListElem Shared Addr = 0xbe9e4880
     [m3video]  968: SYSTEM: Opening MsgQ [VPSS-M3_MSGQ] ...
     [m3video]  969: SYSTEM  : FREE SPACE : Tiler Buffer     = 128 B (0 MB)  - TILER OFF 
    ApproDrvInit: 7
    queue id:163845
     [m3video] Entered the MctnfLink_init() 
     [m3vpss ]  991: SYSTEM: Creating ListMP [VPSS-M3_IPC_OUT_26] in region 0 ...
     [m3vpss ]  991: SYSTEM: Creating ListMP [VPSS-M3_IPC_IN_26] in region 0 ...
     [m3vpss ]  992: SYSTEM: ListElem Shared Addr = 0xbea04280
     [m3vpss ]  998: SYSTEM: Creating ListMP [VPSS-M3_IPC_OUT_29] in region 0 ...
     [m3vpss ]  999: SYSTEM: Creating ListMP [VPSS-M3_IPC_IN_29] in region 0 ...
     [m3vpss ]  999: SYSTEM: ListElem Shared Addr = 0xbea23c80
     [m3vpss ]  1002: SYSTEM: Creating ListMP [VPSS-M3_IPC_OUT_30] in region 0 ...
     [m3vpss ]  1002: SYSTEM: Creating ListMP [VPSS-M3_IPC_IN_30] in region 0 ...
     [m3vpss ]  1003: SYSTEM: ListElem Shared Addr = 0xbea3d900
     [m3vpss ]  1005: SYSTEM : HDVPSS Drivers Version: HDVPSS_01_00_01_37
     [m3vpss ]  1005: SYSTEM  : FVID2 Init in progress !!!
     [m3video]  1030: SYSTEM  : Initializing Links ... DONE !!! 
     [m3video]  1030: SYSTEM  : System Video Init Done !!!
     [m3vpss ]  1076: SYSTEM  : FVID2 Init in progress DONE !!!
     [m3vpss ]  1076: SYSTEM  : Device Init in progress !!!
     [m3vpss ]  Iss_init called !!!!!! 
     [m3vpss ]  CPIS_init DONE !!!!!! 
     [m3vpss ] initPrms.isI2cInitReq = 1
     [m3vpss ] initPrms.isI2cInitReq = 0
     [m3vpss ]  1203: SYSTEM  : Device Init in progress DONE !!!
     [m3vpss ] Sensor in 1080p Mode...
     [m3vpss ] XXXXX DRV_imgsSetAgain() Error(1000)
     [m3vpss ] XXXXX DRV_imgsSetAgain() Error(1000)
     [m3vpss ] With IMX136 SETTING_-_-,DRV_imgsSetRegs,598 0 
     [m3vpss ]  1386: SYSTEM  : System VPSS Init Done !!!
     [m3vpss ]  1387: UTILS: DMA: HWI Create for INT62 !!!
     [m3vpss ]  1387: SYSTEM  : Initializing Links !!! 
     [m3vpss ]  1387: SYSTEM  : FREE SPACE : System Heap      = 1682704 B, Mbx = 10240 msgs) 
     [m3vpss ]  1388: SYSTEM  : FREE SPACE : SR0 Heap         = 15372416 B (14 MB) 
     [m3vpss ]  1388: SYSTEM  : FREE SPACE : Frame Buffer     = 105790336 B (100 MB) 
     [m3vpss ]  1388: SYSTEM  : FREE SPACE : Bitstream Buffer = 61865856 B (58 MB) 
     [m3vpss ]  1389: SYSTEM  : FREE SPACE : Tiler Buffer     = 128 B (0 MB)  - TILER OFF 
     [m3vpss ]  1523: SYSTEM  : Initializing Links ... DONE !!! 
     [m3vpss ] Received character 't'
     [c6xdsp ] Remote Debug Shared Memory @ 0xbff00000
     [m3video] Remote Debug Shared Memory @ 0xbff05020
     [m3vpss ] Remote Debug Shared Memory @ 0xbff0a040
     [m3video] Received character 't'
    DMA: Module install successful, device major num = 248 
    DRV: Module install successful
    DRV: Module built on May  5 2015 17:45:41 
    HDMI W1 rev 4.0
    HDMI CEC Spec version 1.2
    I2C No Ack
    
    
    HDMI failed to read E-EDID
    
    
     [host]  
    
    
     [host]  ORG 0x46c00524: 0
    
    
     [host]  NEW 0x46c00524: 2
    
    
     [host]  
    
    
     [host] Application Start Completed
    
    
     [host]  0: SYSTEM: System Common Init in progress !!!
    
    
     [host]  0: SYSTEM: IPC init in progress !!!
    
    
     [host]  11: SYSTEM: CPU [DSP] is NOT available on this platform !!!
    
    
     [host]  11: SYSTEM: CPU [VIDEO-M3] syslink proc ID is [0] !!!
    
    
     [host]  11: SYSTEM: CPU [VPSS-M3] syslink proc ID is [1] !!!
    
    
     [host]  11: SYSTEM: CPU [HOST] syslink proc ID is [2] !!!
    
    
     [host]  11: SYSTEM: Opening MsgQ Heap [IPC_MSGQ_MSG_HEAP] ...
    
    
     [host]  13: SYSTEM: Creating MsgQ [HOST_MSGQ] ...
    
    
     [host]  14: SYSTEM: CreDMA: ChannelID allocated:4
    ating MsgQ [HOSTDMA: ChannelID allocated:5
    _ACK_MSGQ] ...
    
    
     [host]  16: SYSTEM: Opening MsgQ [VIDEO-M3_MSGQ] ...
    
    
     [host]  16: SYSTEM: Opening MsgQ [VPSS-M3_MSGQ] ...
    
    
     [host]  17: SYSTEM: Notify register to [VIDEO-M3] line 0, event 12 ... 
    
    
     [host]  18: SYSTEM: Notify register to [VPSS-M3] line 0, event 12 ... 
    
    
     [host]  18: SYSTEM: IPC init DONE !!!
    
    
     [host]  20: SYSTEM: Creating ListMP [HOST_IPC_OUT_29] in region 0 ...
    
    
     [host]  22: SYSTEM: Creating ListMP [HOST_IPC_IN_29] in region 0 ...
    
    
     [host]  23: SYSTEM: ListElem Shared Addr = 0x40cbe580
    
    
     [host]  24: SYSTEM: Creating ListMP [HOST_IPC_OUT_30] in region 0 ...
    
    
     [host]  26: SYSTEM: Creating ListMP [HOST_IPC_IN_30] in region 0 ...
    
    
     [host]  28: SYSTEM: ListElem Shared Addr = 0x40cd8200
    
    
     [host]  29: SYSTEM: Creating ListMP [HOST_IPC_OUT_24] in region 0 ...
    
    
     [host]  31: SYSTEM: Creating ListMP [HOST_IPC_IN_24] in region 0 ...
    
    
     [host]  33: SYSTEM: ListElem Shared Addr = 0x40cf1e80
    
    
     [host]  34: SYSTEM: Creating ListMP [HOST_IPC_OUT_25] in region 0 ...
    
    
     [host]  36: SYSTEM: Creating ListMP [HOST_IPC_IN_25] in region 0 ...
    
    
     [host]  37: SYSTEM: ListElem Shared Addr = 0x40d11880
    
    
     [host]  38: SYSTEM: Creating ListMP [HOST_IPC_OUT_26] in region 0 ...
    
    
     [host]  40: SYSTEM: Creating ListMP [HOST_IPC_IN_26] in region 0 ...
    
    
     [host]  42: SYSTEM: ListElem Shared Addr = 0x40d31280
    
    
     [host]  43: SYSTEM: System Common Init Done !!!
    
    
     [host] Vsys_allocBuf - addr = 0x4c5c6000,size = 65011712
    ##########pInfo->totalsize 63897600
    
    
     [host] MemMng_memcpy_open:OSA_dmaOpen passed with ch id = 4
    
    
     [host] CacheMng_MemCpy_open:OSA_dmaOpen passed with ch id = 5
    
    
     [host] MCFW_IPCFRAMES:App_ipcFramesSendRecvFxn:Entered...
    
     [host] Vsys_allocBuf - addr = 0x51653000,size = 29127
    
    
     [host] DCC buffer allocated for size 29127
    
    
     [host] DCC Default File Intialization Done
    
    
     [host] Before System_linkControl SYSTEM_M3VPSS_CMD_GET_DISPLAYCTRL_INIT
     [m3vpss ] tiedVencs VPS_DC_VENC_HDMI | VPS_DC_VENC_HDCOMP
    
    
     [host] 
    ********** FULL FEATURE USECASE ********
    
    
     [host] ********* Entered Tri Streaming usecase - H264 1080p @60fps + H264 D1 @30fps + MJPEG 1080p @5fps ********
    
    
    
     [host]  134: MCFW  : CPU Revision [ES1.0] !!! 
    
    
    
     [host]  134: MCFW  : Detected [4x TVP5158 VS] Board !!! 
    
    
    
     [host]  134: MCFW  : Base Board Revision [REV A] !!! 
    
    
    
     [host]  134: MCFW  : Daughter Card Revision [REV A] !!! 
    
     [m3vpss ] VPS_DCTRL_INST_0
     [m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_OUTPUT SYSTEM_DC_VENC_DVO2
     [m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_OUTPUT SYSTEM_DC_VENC_HDMI
     [m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_OUTPUT SYSTEM_DC_VENC_SD
     [m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_OUTPUT SYSTEM_DC_VENC_HDCOMP
     [m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_CLK_SRC VPS_DC_VENC_HDMI | VPS_DC_VENC_HDCOMP
     [m3vpss ] HDCOMPCLK
     [m3vpss ]  2727: CAMERA: Create in progress !!!
     [m3vpss ]  Channel Num Stream 0 Ch 0 ChannelNum 0
     [m3vpss ]  Channel Num Stream 1 Ch 0 ChannelNum 1
     [m3vpss ]  2728: CAMERA: VIP0 PortA camera mode is [ 8-bit, Non-mux Embedded Sync] !!! 
    
    INIT: Entering runlevel: 5
    
     inside autorun 
     sbulla: unknown partition table
    Starting telnet daemon sbulla: unknown partition table
    .
    Starting syslogd/klogd: done
    c
     _____                    _____           _         _   
    |  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_ 
    |     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
    |__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|  
                  |___|                    |___|            
    
    Arago Project http://arago-project.org DM385_IPNC ttyO0
    
    Arago 2011.09 DM385_IPNC ttyO0
    
    DM385_IPNC login: root (automatic login)
    root@DM385_IPNC:~# mkdosfs 3.0.12 (29 Oct 2011)
    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.
    There is 1 reserved sector.
    Root directory contains 512 slots and uses 32 sectors.
    Volume ID is b0fd9fbc, no volume label.
    g_file_storage gadget: No serial-number string provided!
    g_file_storage gadget: File-backed Storage Gadget, version: 1 September 2010
    g_file_storage gadget: Number of LUNs=1
    g_file_storage gadget-lun0: ro=0, nofua=0, file: /dev/sbulla
     [m3vpss ]  I2C: timed out in wait_for_bb: I2C_IRQSTATUS=1000 !!!
     [m3vpss ]  7728: CAMERA: VIP 0: VID DEC 268436750 (0x2d): 8f0fcb80:ffff0000:8f0ff03c, AUD_STATUS -1894774072
    Simple mixer control 'PGA',0
      Capabilities: cvolume cswitch penum
      Capture channels: Front Left - Front Right
      Limits: Capture 0 - 119
      Front Left: Capture 80 [67%] [40.00dB] [on]
      Front Right: Capture 80 [67%] [40.00dB] [on]
     [m3vpss ] Iss_captCreate:1661
     [m3vpss ]  7941: CAMERA: Create Done !!!
     [m3vpss ]  8030: CAMERA: Detect video in progress !!!
     [m3vpss ]  8030: CAMERA: Detect video Done !!!
     [m3vpss ]  8106: DUP   : Create Done !!!
     [m3vpss ]  8106: IPC_OUT_M3   : Create in progress !!!
     [m3video]  8108: IPC_IN_M3   : Create in progress !!!
     [m3vpss ]  8108: IPC_OUT_M3   : Create Done !!!
     [m3video]  8109: SYSTEM: Opening ListMP [VPSS-M3_IPC_OUT_1] ...
     [m3vpss ] DCC server task running 
     [m3video]  8109: SYSTEM: Opening ListMP [VPSS-M3_IPC_IN_1] ...
     [m3video]  8112: IPC_IN_M3   : Create Done !!!
     [m3video] Entered the MctnfLink_tskMain() 
     [m3video] inChInfo->width = 1920 
     [m3video] inChInfo->height = 1080 
     [m3video] inChInfo->pitch[0] = 1984 
     [m3video] MCTNF Algorithm Instance Creation for the Module MCTNF_TI DEV.500.V.MCTNF.IVAHD.00.08.00.00       Done...
     [m3video]  [MCTNF] startX = 0 
     [m3video]  [MCTNF] startY = 0 
     [m3video] [MCTNF]  outChInfo->width = 1920
     [m3video] [MCTNF]  outChInfo->height = 1080
     [m3video] [MCTNF]  outChInfo->pitch[0] = 1984
     [m3vpss ]  8292: IPC_IN_M3   : Create in progress !!!
     [m3video] [MCTNF]  outChInfo->pitch[1] = 1984
     [m3vpss ]  8292: SYSTEM: Opening ListMP [VIDEO-M3_IPC_OUT_0] ...
     [m3video]  8290: IPC_OUT_M3   : Create in progress !!!
     [m3vpss ]  8293: SYSTEM: Opening ListMP [VIDEO-M3_IPC_IN_0] ...
     [m3video]  8292: IPC_OUT_M3   : Create Done !!!
     [m3vpss ]  8294: SYSTEM: Opening MsgQ [VIDEO-M3_MSGQ] ...
     [m3vpss ]  8296: IPC_IN_M3   : Create Done !!!
     [m3vpss ]  8229: VNF: 
     [m3vpss ] Create in progress ... !!!
     [m3vpss ]  8229: VNF: 
     [m3vpss ] Input Channel CH0 of 1920 x 1080, pitch = (1984, 1984) [0,0][PROGRESSIVE] [7] ... 
     [m3vpss ]  8230: VNF: 
     [m3vpss ]  [VNF] eOperateMode=7 [6-TNF3,7-NSF2]chVnfCreateParams->ulStartX = -16 			chVnfCreateParams->ulStartY = -18 chVnfCreateParams->ulInputStride = 1984				chVnfCreateParams->ulInputWidth=1952,chVnfCreateParams->ulInputHeight=1112 
     [m3vpss ]  8398: VNF: 
     [m3vpss ]  [VNF] outChInfo->StartX = 0 outChInfo->startY = 0 outChInfo->pitch[0] = 1920	outChInfo->width=1920,outChInfo->height=1080 
     [m3vpss ]  8400: VNF: 
     [m3vpss ] Create ... DONE !!!
     [m3vpss ]  8469: NSF: Create in progress !!!
     [m3vpss ] NSF::HEAPID:0	USED:128
     [m3vpss ] NSDMA: ChannelID allocated:6
    F::HEAPID:1	USEDDMA: ChannelID allocated:7
    :4928
     [m3vpss ]  8594: NSF: Create Done !!!
     [m3vpss ]  8594: Mux   : Creating... !!!
     [m3vpss ]  8596: WARNING MUX Link : Ignoring channel no   0 of Input Q ID   0. As this channel was not mapped !!!
     [m3vpss ]  8597: Mux   : Create Done !!!
     [m3vpss ]  8604: DUP   : Create Done !!!
     [m3vpss ]  8612: DUP   : Create Done !!!
     [m3vpss ]  8612: Mux   : Creating... !!!
     [m3vpss ]  8614: Mux   : Create Done !!!
     [m3vpss ] {SWOSD} edma3Handle->tccVal = 36 
     [m3vpss ] {SWOSD} edma3Handle->chId   = 36 
     [m3vpss ] {SWOSD} edma3Handle->tccVal = 37 
     [m3vpss ] {SWOSD} edma3Handle->chId   = 37 
    
    
     [host] Vsys_eventHandler:OSA_dmaOpen passed with ch id = 6
    
    
     [host] Vsys_eventHandler:OSA_dmaOpen passed with ch id = 7
     [m3vpss ] {SWOSD} edma3Handle->tccVal = 38 
     [m3vpss ] {SWOSD} edma3Handle->chId   = 38 
     [m3vpsDMA: ChannelID allocated:8
    s ]  8625: SYSTEM: Opening MsgQ [HOST_MSGQ] ...
     [m3vpss ]  8618: SWOSD   : Create Done !!!
     [m3vpss ]  8693: DUP   : Create Done !!!
     [m3vpss ]  8694: SCLR: Create in progress !!!
     [m3vpss ]  8700: SCLR    : Loading Up-scaling Co-effs ... 
     [m3vpss ]  8700: SCLR    : Co-effs Loading ... DONE !!!
    
    
     [host] Vsys_eventHandler:OSA_dmaOpen passed with ch id = 8
     [m3video]  8713: IPC_IN_M3   : Create in progress !!!
     [m3video]  8713: SYSTEM: Opening ListMP [VPSS-M3_IPC_OUT_0] ...
     [m3vpss ] SCLR:HEAPID:0	USED:64
     [m3video]  8714: SYSTEM: Opening ListMP [VPSS-M3_IPC_IN_0] ...
     [m3vpss ] SCLR:HEAPID:1	USED:5952
     [m3vpss ]  8701: SCLR: Create Done !!!
     [m3vpss ]  8642: FD   : Alg Create Done !!!
     [m3vpss ]  8642: FD   : Create Done !!!
     [m3vpss ]  8711: IPC_OUT_M3   : Create in progress !!!
     [m3vpss ]  8712: IPC_OUT_M3   : Create Done !!!
     [m3video]  8717: IPC_IN_M3   : Create Done !!!
     [m3video]  8717: ENCODE: Create in progress ... !!!
    queue id:0
     [m3video]  8844: ENCODE: Creating CH0 of 1920 x 1080, pitch = (1920, 1920) [PROGRESSIVE] [NON-TILED  ], bitrate = 8000 Kbps ... 
     [m3video] ENCLINK_H264:HEAPID:0	USED:11720
     [m3video]  8927: ENCODE: Creating CH1 of 720 x 480, pitch = (720, 720) [PROGRESSIVE] [NON-TILED  ], bitrate = 8000 Kbps ... 
    
    
     [host] IpcBitsInLink_tskMain:Entered
    
     [host]  6361: IPC_BITS_IN   : Create in progress !!!
    
    
     [host]  6361: IPC_BITS_IN   : ListMPOpen start !!!
    
    
     [host]  6361: SYSTEM: Opening ListMP [VIDEO-M3_IPC_OUT_29] ...
    
    
     [host]  6363: SYSTEM: Opening ListMP [VIDEO-M3_IPC_IN_29] ...
    
    
     [host]  6365: IPC_BITS_IN   : ListMPOpen done !!!
    
    
     [host]  6366: IPC_BITS_IN   : System_linkGetInfo done !!!
    
    
     [host]  6366: IPC_BITS_IN   : Create Done !!!
    
    
     [host] USECASE SETUP DONE
     [m3video] ENCLINK_H264:HEAPID:0	USED:11720
     [m3vpss ]  9027: DISPLAY: Create in progress !!!
     [m3video]  9012: ENCODE: Creating CH2 of 1920 x 1080, pitch = (1920, 1920) [PROGRESSIVE] [NON-TILED  ], bitrate = 100 Kbps ... 
     [m3vpss ] DisplayId = 1,DataFormat = 7
     [m3vpss ] SC2 displayInstId = 6
     [m3vpss ]  9028: DISPLAY: Create Done !!!
     [m3video] ENCLINK_JPEG:HEAPID:0	USED:4368
     [m3vpss ]  9029: DISPLAY: Create in progress !!!
     [m3video]  9014: ENCODE: All CH Create ... DONE !!!
     [m3vpss ] DisplayId = 4,DataFormat = 7
     [m3vpss ] SD displayInstId = 2
     [m3vpss ]  9030: DISPLAY: Create Done !!!
     [m3video] ENCLINK:HEAPID:0	USED:28136
     [m3vpss ]  9032: DISPLAY: Start in progress !!!
     [m3video]  9016: ENCODE: Create ... DONE !!!
     [m3video]  8525: VSTAB   : Alg Create Done !!!
     [m3video]  8525: VSTAB   : Create Done !!!
     [m3video]  9018: IPC_BITS_OUT   : Create in progress !!!
     [m3video]  9021: IPC_BITS_OUT   : Create Done !!!
     [m3vpss ]  9094: DISPLAY: Start Done !!!
     [m3vpss ]  9094: DISPLAY: AUX PATH: 32 fps, Latency (Min / Max) = ( 255 / 0 ), Callback Interval (Min / Max) = ( 255 / 0 ) !!! 
     [m3vpss ]  9095: DISPLAY: Start in progress !!!
     [m3vpss ]  9159: DISPLAY: Start Done !!!
     [m3vpss ]  9159: DISPLAY: SDDAC(SEC1): 15 fps, Latency (Min / Max) = ( 255 / 0 ), Callback Interval (Min / Max) = ( 255 / 0 ) !!! 
     [m3vpss ]  9093: CAMERA: Start in progress !!!
     [m3vpss ]  9093: CAMERA: Start Done !!!
    
    
     [host] 
    Application Run Completed
     [m3vpss ] CT: 1000, 3dlut index:0 
     [m3vpss ]  9237: CAMERA: Fields = 2 (fps = 0), Total Resets = 0 (Avg 0 ms per reset)
     [m3video]  Channel:1 inputframerate:30 targetfps:60
     [m3video] [MCTNF]  MctnfChObj->dynParams.vidnf1DynamicParams.inputWidth = 1920 
     [m3video] [MCTNF]  MctnfChObj->dynParams.vidnf1DynamicParams.inputHeight = 1088 
     [m3video] [MCTNF]  MctnfChObj->dynParams.vidnf1DynamicParams.captureWidth = 1984 
     [m3video] [MCTNF]  MctnfChObj->gOutputBufDesc.imagePitch[0] = 1984 
     [m3video] [MCTNF]  MctnfChObj->format.pitch[0] = 1984 
    
    
     [host] ITT server task running !!!
    
    
     [host] 
     ITT ittServer_run
    
    
     [host] ITT Server Message initialization successful
    
    
     [host] 
     ITT capture task created
    
    
     [host] DCC server Message ques is open succefully
    
    
     [host] Setting cmd <1> in message <40b6ac00>
    
    
     [host] Posting message <40b6ac00> in QId <10002> 
     [m3vpss ] Command 1 recived from HOST A8 
    
    
     [host] Response from M3 is : 1
     [m3vpss ] Command 2 recived from HOST A8 
     [m3vpss ] New DCC data of size <29127> 
     [m3vpss ] Call to VNF_LINK_CMD_UPDATE_DCC 536870980
    
    
     [host] Response from M3 is : 1
    
    
     [host] Default parameters were sent sucessfully 
    
    
     [host] Server Socket created with ID <22> 
     [m3video]  Channel:0 inputframerate:30 targetfps:60
     [m3video]  Channel:2 inputframerate:60 targetfps:5
    ./boa: /usr/lib/libssl.so.1.0.0: no version information available (required by ./boa)
    ./boa: /usr/lib/libcrypto.so.1.0.0: no version information available (required by ./boa)
    ApproDrvInit: 3
    queue id:163845
    queue id:0
    queue id:32769
     [m3vpss ]  11365: DISPLAY: Stop in progress !!!
    
     Venc not supported!! 
     [m3vpss ]  11428: DISPLAY: Stop Done !!!
     [m3vpss ]  11432: DISPLAY: Start in progress !!!
     [m3vpss ]  11482: DISPLAY: Start Done !!!
     [m3vpss ]  11485: DISPLAY: SDDAC(SEC1): 1307 fps, Latency (Min / Max) = ( 4 / 18 ), Callback Interval (Min / Max) = ( 32 / 34 ) !!! 
     [m3vpss ]  11422: VNF: 
     [m3vpss ] EnableSNF current SNF 1 => new 0!!!
     [m3vpss ] NSF: EnableSNF 0 current mode 0!!!
    
    
     [host] VNF MESSAGE RECIEVED: (Enable:0) (Mode:5) (Strength:0) (EnableTNF:0) (EnableSNF:0)
    
    
     [host] 
    
     Channel Selected: 0
    
     [host] 
    
     Channel Selected: 0,rate control = 1 [m3vpss ]  11448: VNF: 
     [m3vpss ] EnableTNF current TNF 1 => new 0!!!
     [m3vpss ] NSF: EnableTNF 0 current mode 1!!!
    
    
     [host] 
    
    ========== Stream FrameRate1 = 30 =================
    
    
     [host] 
    
     Channel Selected: 0
    
     [host] 
    
     Channel Selected: 0
    
     [host] 
    
     Channel Selected: 0
    
     [host] 
    
     Channel Selected: 0,packet size = 100
    
     [host] 
    
     Channel Selected: 0,encPreset = 0
    
     [host] 
    
     Channel Selected: 0,enable = 0
    
     [host] 
    
     Channel Selected: 1
    
     [host] 
    
     Channel Selected: 1,rate control = 0
    
     [host] 
    
     Channel Selected: 1
    
     [host] 
    
     Channel Selected: 1
    
     [host] 
    
     Channel Selected: 1
    
     [host] 
    
     Channel Selected: 1,packet size = 100
    
     [host] 
    
     Channel Selected: 1,encPreset = 0
    
     [host] 
    
     Channel Selected: 1,enable = 0
    
     [host] 
    
     Channel Selected: 2
    
     [host] 
    
     Channel Selected: 2,rate control = 2
    
     [host] MJPEG in Rate Control OFF Mode
    Check_device_version : read device error !!
     [m3video]  Channel:0 inputframerate:30 targetfps:30
     [m3video]  Channel:2 inputframerate:30 targetfps:5
     [m3video]  ENCLINK: new targetbitrate to set:10000000 
     [m3video]  ENCLINK: new targetframerate to set:30000 
     [m3video]  ENCLINK: new QP I Param to set:10 36 -1
     [m3video]  ENCLINK: new rate control algorithm  to set:1 
     [m3video]  ENCLINK: new targetbitrate to set:2000000 
     [m3video]  ENCLINK: new targetframerate to set:30000 
     [m3video]  ENCLINK: new intraFrameInterval to set:30,new maxPicSizeRatioI to set = 960 
     [m3video]  ENCLINK: new QP I Param to set:10 36 -1
     [m3video]  ENCLINK: new QP P Param to set:10 40 28
    Simple mixer control 'PGA',0
      Capabilities: cvolume cswitch penum
      Capture channels: Front Left - Front Right
      Limits: Capture 0 - 119
      Front Left: Capture 95 [80%] [47.50dB] [on]
      Front Right: Capture 95 [80%] [47.50dB] [on]
     [m3video]  ENCLINK: new PacketSize Param to set:100 
    Check_device_version : read device error !!
     [m3video]  ENCLINK: new Encode Preset Param to set:0
     [m3video]  ENCLINK: new rate control algorithm  to set:0 
     [m3video]  Channel:1 inputframerate:30 targetfps:30
     [m3video]  JPGLINK: new targetframerate to set:5000 for bitrate 100000 
     [m3video]  JPGLINK: new QP Param to set:1 51 80
     [m3video]  JPGLINK: new qualityFactor Param to set:80
     [m3video]  JPGLINK: new rate control algorithm  to set:2 for bitrate: 100000
     [m3video]  JPGLINK: Run time parameters changed 0
     [m3video]  Channel:2 inputframerate:30 targetfps:5
     [m3video]  ENCLINK: new intraFrameInterval to set:30,new maxPicSizeRatioI to set = 960 
     [m3video]  ENCLINK: new QP P Param to set:10 40 28
    Simple mixer control 'PCM',0
      Capabilities: pvolume penum
      Playback channels: Front Left - Front Right
      Limits: Playback 0 - 127
      Mono:
      Front Left: Playback 101 [80%] [-13.00dB]
      Front Right: Playback 101 [80%] [-13.00dB]
    
    
     [host] 
    
    Force IDR on Channel: 0
    
     [host] 
    
    Force IDR on Channel: 1 [m3video]  ENCLINK: new PacketSize Param to set:100 
     [m3video]  ENCLINK: new Encode Preset Param to set:0
    SystemInit success
    Schedule manager init success
    Dmva Schedule manager init success
    umount: can't umount /mnt/mmc: Invalid argument
    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: No serial-number string provided!
    g_file_storage gadget: File-backed Storage Gadget, version: 1 September 2010
    g_file_storage gadget: Number of LUNs=1
    g_file_storage gadget-lun0: ro=0, nofua=0, file: /dev/sbulla
    [09/Nov/2012:04:48:19 +0000] boa: server version Boa/0.94.13
    [09/Nov/2012:04:48:19 +0000] boa: server built May  6 2015 at 09:39:35.
    [09/Nov/2012:04:48:19 +0000] boa: starting server pid=549, port 80
    queue id:0
    queue id:131076
    ApproDrvInit: 9
    queue id:163845
    Initializing...
    ...done initializing
    Play this stream using the URL:
    	rtsp://192.168.1.224:8556/PSIA/Streaming/channels/2?videoCodecType=H.264
    
    (We use port 8303 for optional RTSP-over-HTTP tunneling.)
    ApproDrvInit: 8
    queue id:163845
    Initializing...
    ...done initializing
    Play this stream using the URL:
    	rtsp://192.168.1.224:8555/PSIA/Streaming/channels/0?videoCodecType=MJPEG
    
    (We use port 8302 for optional RTSP-over-HTTP tunneling.)
    ApproDrvInit: 10
    ApproDrvInit: 2
    ApproDrvInit: 6
    queue id:0
    queue id:163845
    queue id:163845
    Initializing...
    ...done initializing
    Initializing...
    ...done initializing
    Play this stream using the URL:
    	rtsp://192.168.1.224:8553/PSIA/Streaming/channels/1?videoCodecType=MPEG4
    
    (We use port 8300 for optional RTSP-over-HTTP tunneling.)
    Play this stream using the URL:
    	rtsp://192.168.1.224:8554/PSIA/Streaming/channels/1?videoCodecType=MPEG4
    
    (We use port 8301 for optional RTSP-over-HTTP tunneling.)
    queue id:163845
    Initializing...
    ...done initializing
    Play this stream using the URL:
    	rtsp://192.168.1.224:8557/PSIA/Streaming/channels/2?videoCodecType=H.264
    
    (We use port 8304 for optional RTSP-over-HTTP tunneling.)
    <UDN>uuid:Upnp-TVEmulator-1_0-00_0050179813</UDN>
    
    Upnp port is 0
    UPnP Initialized OK ip=192.168.1.224, port=0
    desc_doc_url = http://192.168.1.224/tvdevicedesc.xml
    error code = 0
    device advertisement succeed.
    queue id:32769
    
    
     [host] 
    Usecase is Active !!! 
     [m3video]  ==================== EncLink_PrintDetails ==================== 
     [m3video] 	43493: HDVICP-ID:0
     [m3video] 		totalAcquire2wait in msec:       904
     [m3video] 		totalWait2Isr in msec:     31907
     [m3video] 		totalIsr2Done in msec:        96
     [m3video] 		totalWait2Done in msec:     32003
     [m3video] 		totalDone2Release in msec:         0
     [m3video] 		totalAcquire2Release in msec:     34861
     [m3video] 		totalAcq2acqDelay in msec:       643
     [m3video] 		totalElapsedTime in msec:     34179
     [m3video] 		numAccessCnt:      3295
     [m3video] 		IVA-FPS :        96
     [m3video]  
     [m3video]  *** ENCODE Statistics *** 
     [m3video]  
     [m3video]  Elasped Time           : 32 secs
     [m3video]  
     [m3video]  
     [m3video]  CH  | In Recv In Skip In User  Out Latency  
     [m3video]  Num | FPS     FPS     Skip FPS FPS Min / Max
     [m3video]  --------------------------------------------
     [m3video]    0 |      30       0        0 30.41 126 / 209
     [m3video]    1 |      30       0        0 30.16   8 /  59
     [m3video]    2 |      30       0       25 5.09 139 / 218
     [m3video]  
     [m3video] Multi Channel Encode Average Submit Batch Size 
     [m3video] Max Submit Batch Size : 24
     [m3video] IVAHD_0 Average Batch Size : 1
     [m3video] IVAHD_0 Max achieved Batch Size : 1
     [m3video]  ============================================================== 
     [m3vpss ]  54030: VNF: 
     [m3vpss ] EnableSNF current SNF 0 => new 0!!!
     [m3vpss ] NSF: EnableSNF 0 current mode 3!!!
    
    
     [host] VNF MESSAGE RECIEVED: (Enable:0) (Mode:5) (Strength:0) (EnableTNF:0) (EnableSNF:0)
     [m3vpss ]  54062: VNF: 
     [m3vpss ] EnableTNF current TNF 0 => new 0!!!
     [m3vpss ] NSF: EnableTNF 0 current mode 3!!!
     [m3vpss ] ********************************************************************
     [m3vpss ]         APPRO AEWB TRIAL VERSION (LIMITATION is 1 DAY in 60fps)
     [m3vpss ]    For the formal release PLEASE CONTACT http://www.appropho.com !!!
     [m3vpss ] ********************************************************************
     [m3vpss ]  69269: CAMERA: Fields = 3568 (fps = 59), Total Resets = 0 (Avg 0 ms per reset)
    
    
     [host] 
    Usecase is Active !!! 
    
    ==================== STREAMING DETAILS ====================
    Start Time : 1352436526sec 226087usec
    End Time   : 1352436559sec 577451usec
    Total Time to stream 1000 frames: 33351.364 msec
    Time per frame: 33.3514 msec
    Streaming Performance in FPS: 29.9838
    ===========================================================
     [m3video]  ==================== EncLink_PrintDetails ==================== 
     [m3video] 	76365: HDVICP-ID:0
     [m3video] 		totalAcquire2wait in msec:      1679
     [m3video] 		totalWait2Isr in msec:     62775
     [m3video] 		totalIsr2Done in msec:       201
     [m3video] 		totalWait2Done in msec:     62976
     [m3video] 		totalDone2Release in msec:         0
     [m3video] 		totalAcquire2Release in msec:     70455
     [m3video] 		totalAcq2acqDelay in msec:      1119
     [m3video] 		totalElapsedTime in msec:     67052
     [m3video] 		numAccessCnt:      6634
     [m3video] 		IVA-FPS :        99
     [m3video]  
     [m3video]  *** ENCODE Statistics *** 
     [m3video]  
     [m3video]  Elasped Time           : 32 secs
     [m3video]  
     [m3video]  
     [m3video]  CH  | In Recv In Skip In User  Out Latency  
     [m3video]  Num | FPS     FPS     Skip FPS FPS Min / Max
     [m3video]  --------------------------------------------
     [m3video]    0 |      30       0        0 30.78 131 / 180
     [m3video]    1 |      30       0        0 30.75   9 /  47
     [m3video]    2 |      30       0       25 5.13 141 / 181
     [m3video]  
     [m3video] Multi Channel Encode Average Submit Batch Size 
     [m3video] Max Submit Batch Size : 24
     [m3video] IVAHD_0 Average Batch Size : 1
     [m3video] IVAHD_0 Max achieved Batch Size : 1
     [m3video]  ============================================================== 
     [m3vpss ]  88883: VNF: 
     [m3vpss ] EnableSNF current SNF 0 => new 0!!!
     [m3vpss ] NSF: EnableSNF 0 current mode 3!!!
     [m3vpss ]  88935: VNF: 
     [m3vpss ] EnableTNF current TNF 0 => new 0!!!
     [m3vpss ] NSF: EnableTNF 0 current mode 3!!!
    
    
     [host] VNF MESSAGE RECIEVED: (Enable:0) (Mode:5) (Strength:0) (EnableTNF:0) (EnableSNF:0)
    
    
     [host] 
    Usecase is Active !!! 
     [m3video]  ==================== EncLink_PrintDetails ==================== 
     [m3video] 	109519: HDVICP-ID:0
     [m3video] 		totalAcquire2wait in msec:      2549
     [m3video] 		totalWait2Isr in msec:     93830
     [m3video] 		totalIsr2Done in msec:       288
     [m3video] 		totalWait2Done in msec:     94118
     [m3video] 		totalDone2Release in msec:         0
     [m3video] 		totalAcquire2Release in msec:    105323
     [m3video] 		totalAcq2acqDelay in msec:      1604
     [m3video] 		totalElapsedTime in msec:    100198
     [m3video] 		numAccessCnt:      9934
     [m3video] 		IVA-FPS :        99
     [m3video]  
     [m3video]  *** ENCODE Statistics *** 
     [m3video]  
     [m3video]  Elasped Time           : 33 secs
     [m3video]  
     [m3video]  
     [m3video]  CH  | In Recv In Skip In User  Out Latency  
     [m3video]  Num | FPS     FPS     Skip FPS FPS Min / Max
     [m3video]  --------------------------------------------
     [m3video]    0 |      30       0        0 30.15 128 / 178
     [m3video]    1 |      30       0        0 30.12   8 /  48
     [m3video]    2 |      30       0       25 5.03 141 / 177
     [m3video]  
     [m3video] Multi Channel Encode Average Submit Batch Size 
     [m3video] Max Submit Batch Size : 24
     [m3video] IVAHD_0 Average Batch Size : 1
     [m3video] IVAHD_0 Max achieved Batch Size : 1
     [m3video]  ============================================================== 
    
    ==================== STREAMING DETAILS ====================
    Start Time : 1352436564sec 598356usec
    End Time   : 1352436597sec 969905usec
    Total Time to stream 1000 frames: 33371.549 msec
    Time per frame: 33.3715 msec
    Streaming Performance in FPS: 29.9656
    ===========================================================
     [m3vpss ]  ==================== CameraLink_PrintDetails ==================== 
     [m3vpss ]  129236: CAMERA: Fields = 7166 (fps = 59, CPU Load = 33)
     [m3vpss ]  129236: CAMERA: Num Resets = 0 (Avg 0 ms per reset)
     [m3vpss ]  ================================================================= 
     [m3vpss ]  129302: CAMERA: Fields = 3600 (fps = 59), Total Resets = 0 (Avg 0 ms per reset)
    
    
     [host] 
    Usecase is Active !!! 
     [m3video]  ==================== EncLink_PrintDetails ==================== 
     [m3video] 	142589: HDVICP-ID:0
     [m3video] 		totalAcquire2wait in msec:      3460
     [m3video] 		totalWait2Isr in msec:    124817
     [m3video] 		totalIsr2Done in msec:       370
     [m3video] 		totalWait2Done in msec:    125187
     [m3video] 		totalDone2Release in msec:         0
     [m3video] 		totalAcquire2Release in msec:    138893
     [m3video] 		totalAcq2acqDelay in msec:      2077
     [m3video] 		totalElapsedTime in msec:    133276
     [m3video] 		numAccessCnt:     13141
     [m3video] 		IVA-FPS :        98
     [m3video]  
     [m3video]  *** ENCODE Statistics *** 
     [m3video]  
     [m3video]  Elasped Time           : 33 secs
     [m3video]  
     [m3video]  
     [m3video]  CH  | In Recv In Skip In User  Out Latency  
     [m3video]  Num | FPS     FPS     Skip FPS FPS Min / Max
     [m3video]  --------------------------------------------
     [m3video]    0 |      30       0        0 30.09 128 / 177
     [m3video]    1 |      30       0        0 30.03   8 /  45
     [m3video]    2 |      30       0       25 5.00 142 / 178
     [m3video]  
     [m3video] Multi Channel Encode Average Submit Batch Size 
     [m3video] Max Submit Batch Size : 24
     [m3video] IVAHD_0 Average Batch Size : 1
     [m3video] IVAHD_0 Max achieved Batch Size : 1
     [m3video]  ============================================================== 
    
    ==================== STREAMING DETAILS ====================
    Start Time : 1352436603sec 037632usec
    End Time   : 1352436636sec 403546usec
    Total Time to stream 1000 frames: 33365.914 msec
    Time per frame: 33.3659 msec
    Streaming Performance in FPS: 29.9707
    ===========================================================
    
    
     [host] 
    Usecase is Active !!! 
     [m3video]  ==================== EncLink_PrintDetails ==================== 
     [m3video] 	175768: HDVICP-ID:0
     [m3video] 		totalAcquire2wait in msec:      4394
     [m3video] 		totalWait2Isr in msec:    155893
     [m3video] 		totalIsr2Done in msec:       454
     [m3video] 		totalWait2Done in msec:    156347
     [m3video] 		totalDone2Release in msec:         0
     [m3video] 		totalAcquire2Release in msec:    172432
     [m3video] 		totalAcq2acqDelay in msec:      2565
     [m3video] 		totalElapsedTime in msec:    166451
     [m3video] 		numAccessCnt:     16350
     [m3video] 		IVA-FPS :        98
     [m3video]  
     [m3video]  *** ENCODE Statistics *** 
     [m3video]  
     [m3video]  Elasped Time           : 33 secs
     [m3video]  
     [m3video]  
     [m3video]  CH  | In Recv In Skip In User  Out Latency  
     [m3video]  Num | FPS     FPS     Skip FPS FPS Min / Max
     [m3video]  --------------------------------------------
     [m3video]    0 |      30       0        0 30.15 128 / 177
     [m3video]    1 |      30       0        0 30.15   9 /  45
     [m3video]    2 |      30       0       25 5.03 142 / 178
     [m3video]  
     [m3video] Multi Channel Encode Average Submit Batch Size 
     [m3video] Max Submit Batch Size : 24
     [m3video] IVAHD_0 Average Batch Size : 1
     [m3video] IVAHD_0 Max achieved Batch Size : 1
     [m3video]  ============================================================== 
    
    ==================== STREAMING DETAILS ====================
    Start Time : 1352436641sec 438237usec
    End Time   : 1352436674sec 803522usec
    Total Time to stream 1000 frames: 33365.285 msec
    Time per frame: 33.3653 msec
    Streaming Performance in FPS: 29.9713
    ===========================================================
     [m3vpss ]  189334: CAMERA: Fields = 3600 (fps = 59), Total Resets = 0 (Avg 0 ms per reset)
    
    
     [host] 
    Usecase is Active !!! 
     [m3video]  ==================== EncLink_PrintDetails ==================== 
     [m3video] 	209726: HDVICP-ID:0
     [m3video] 		totalAcquire2wait in msec:      5398
     [m3video] 		totalWait2Isr in msec:    187672
     [m3video] 		totalIsr2Done in msec:       530
     [m3video] 		totalWait2Done in msec:    188202
     [m3video] 		totalDone2Release in msec:         0
     [m3video] 		totalAcquire2Release in msec:    206602
     [m3video] 		totalAcq2acqDelay in msec:      3047
     [m3video] 		totalElapsedTime in msec:    200410
     [m3video] 		numAccessCnt:     19623
     [m3video] 		IVA-FPS :        98
     [m3video]  
     [m3video]  *** ENCODE Statistics *** 
     [m3video]  
     [m3video]  Elasped Time           : 33 secs
     [m3video]  
     [m3video]  
     [m3video]  CH  | In Recv In Skip In User  Out Latency  
     [m3video]  Num | FPS     FPS     Skip FPS FPS Min / Max
     [m3video]  --------------------------------------------
     [m3video]    0 |      30       0        0 30.88 125 / 178
     [m3video]    1 |      30       0        0 30.85   9 /  46
     [m3video]    2 |      30       0       25 5.15 142 / 179
     [m3video]  
     [m3video] Multi Channel Encode Average Submit Batch Size 
     [m3video] Max Submit Batch Size : 24
     [m3video] IVAHD_0 Average Batch Size : 1
     [m3video] IVAHD_0 Max achieved Batch Size : 1
     [m3video]  ============================================================== 
    
    ==================== STREAMING DETAILS ====================
    Start Time : 1352436679sec 838536usec
    End Time   : 1352436713sec 200248usec
    Total Time to stream 1000 frames: 33361.712 msec
    Time per frame: 33.3617 msec
    Streaming Performance in FPS: 29.9745
    ===========================================================
    
    
     [host] 
    Usecase is Active !!! 
    

    Apart  from  DM388+LIMG Sensor  combo, which other IPNC+Sensor combo  are  tested  with TI2A ? Is DM8127+ Appro MT9J003 sensor tested ?

    Best Regards

    JK

  • Hi Anand,

    Any updates ?

    Regards

    JK

  • Hi,

     

    Yes, DM8127 + J003 is tested for TI2A.

    And all other sensors work well with both the TI and Appro 2A algorithms and i was expecting the same for Appro IMX136 too.

    But i found some changes w.r.t H3A configuration which i shared with you but it doesn't make TI 2A work better.

    I will try to get Appro IMX136 sensor and check sometimes next week.

     

    regards,

    Anand

     

  • Thanks Anand.

    Regards

    JK

  • Hi  Anand,

    Any  updates ?

    Best regards

    JK

  • Hi,

    Pl. merge the changes from the attached files:

    1. ..\ti_tools\iss_03_80_00_00\packages\ti\psp\iss\drivers\capture\src\issdrv_captureApi.c (line # 6040 to 6046).
    2. ..\ti_tools\iss_03_80_00_00\packages\ti\psp\iss\drivers\alg\2A\src\issdrv_alg2AApi.c (line # 1251 to 1256)

    I assume you have commented out 'C_FLAGS += -D_ONLY_APPRO2A' in the '..\ipnc_rdk\ipnc_app\sys_server\src\Makefile' file to select both Appro 2A and TI 2A.

    Also with these changes you will not be able to switch between Appro and TI 2A dynamically.issdrv_captureApi.c

    issdrv_alg2AApi.c
    /** ==================================================================
    
     *  @file   issdrv_alg2AApi.c.c
    
     *
    
     *  @path   /ti/psp/iss/drivers/capture/src/
    
     *
    
     *  @desc   This  File contains.
    
     * ===================================================================
    
     *  Copyright (c) Texas Instruments Inc 2011, 2012
    
     *
    
     *  Use of this software is controlled by the terms and conditions found
    
     *  in the license agreement under which this software has been supplied
    
     * ===================================================================*/
    
    
    
    
    
    #include <xdc/std.h>
    
    #include <stdlib.h>
    
    #include <ti/psp/iss/drivers/alg/2A/inc/issdrv_alg2APriv.h>
    
    #include <ti/psp/iss/core/inc/iss_drv_common.h>
    
    #include <ti/psp/examples/utility/vpsutils_mem.h>
    
    #include <ti/psp/vps/common/vps_config.h>
    
    #include <ti/psp/iss/drivers/alg/2A/inc/issdrv_algTIaewb.h>
    
    #include <ti/psp/devices/iss_sensorDriver.h>
    
    #include <ti/psp/iss/alg/aewb/appro2a/inc/alg_appro_aewb.h>
    
    #include <ti/psp/iss/alg/dcc/inc/idcc.h>
    #include <ti/psp/iss/drivers/capture/src/issdrv_capturePriv.h>
    
    
    
    extern ti2a_output ti2a_output_params;
    
    extern ti2aControlParams_t gTi2aControlParams;
    
    extern const ipipe_gbce_cfg_t gbce_iss_default_params;
    
    
    
    Iss_2AObj *gpIssAlg2AObj;
    
    Iss_2AFocusStatistics gFocusStatistics = {.firstTime = 1};
    
    /* Stack for 2A task */
    
    
    
    #pragma DATA_ALIGN(gIssAlg_captTskStack2A, 32)
    
    #pragma DATA_SECTION(gIssAlg_captTskStack2A, ".bss:taskStackSection")
    
    UInt8 gIssAlg_captTskStack2A[ISSALG_CAPT_TSK_STACK_2A];
    
    UInt32 rgb_3d_lut_table[729];
    const uint32 iss_3d_lut_r_table_6500K[] = {
    	#include "./3DLUT/Camera_3DLUT_6500K_R.txt"
    };
    const uint32 iss_3d_lut_g_table_6500K[] = { 
    	#include "./3DLUT/Camera_3DLUT_6500K_G.txt" 
    };
    const uint32 iss_3d_lut_b_table_6500K[] = { 
    	#include "./3DLUT/Camera_3DLUT_6500K_B.txt" 
    };
    
    const uint32 iss_3d_lut_r_table_5000K[] = {
    	#include "./3DLUT/Camera_3DLUT_5000K_R.txt"
    };
    const uint32 iss_3d_lut_g_table_5000K[] = { 
    	#include "./3DLUT/Camera_3DLUT_5000K_G.txt" 
    };
    const uint32 iss_3d_lut_b_table_5000K[] = { 
    	#include "./3DLUT/Camera_3DLUT_5000K_B.txt" 
    };
    
    const uint32 iss_3d_lut_r_table_A[] = { 
    	#include "./3DLUT/Camera_3DLUT_A_R.txt" 
    };
    const uint32 iss_3d_lut_g_table_A[] = { 
    	#include "./3DLUT/Camera_3DLUT_A_G.txt" 
    };
    const uint32 iss_3d_lut_b_table_A[] = { 
    	#include "./3DLUT/Camera_3DLUT_A_B.txt" 
    };
    
    const uint32 iss_3d_lut_r_table_TL84[] = { 
    	#include "./3DLUT/Camera_3DLUT_TL84_R.txt" 
    };
    const uint32 iss_3d_lut_g_table_TL84[] = { 
    	#include "./3DLUT/Camera_3DLUT_TL84_G.txt" 
    };
    const uint32 iss_3d_lut_b_table_TL84[] = { 
    	#include "./3DLUT/Camera_3DLUT_TL84_B.txt" 
    };
    //#define TWOA_PROFILE
    
    #ifdef TWOA_PROFILE
        extern UInt32 Utils_getCurTimeInMsec();
    #endif
    
    /* H3A ISR call back function */
    
    
    
    /* ===================================================================
     *  @func     IssAlg_capt2AIsrCallBack
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    Int32 IssAlg_capt2AIsrCallBack(Iss_2AObj *pObj)
    
    {
    
        /* save the full H3A buf address */
    
        pObj->fullH3ABufAddr = pObj->h3aBufAddr[pObj->curH3aBufIdx];
    
    
    
        /* post the 2A sem */
    
        Semaphore_post(pObj->sem);
    
    
    
        /* switch the H3A buffer */
    
        pObj->curH3aBufIdx = pObj->curH3aBufIdx?0:1;
    
    
    
        h3a_config_aewb_op_addr(pObj->h3aBufAddr[pObj->curH3aBufIdx]);
    
        h3a_config_af_op_addr(pObj->h3aBufAddr[pObj->curH3aBufIdx] + pObj->h3aBufSize);
    
        return FVID2_SOK;
    
    }
    
    
    
    /****************************************************************************************
    
                                    SET FUNCTIONS
    
    ****************************************************************************************/
    
    
    
    /* Set color */
    
    
    
    /* ===================================================================
     *  @func     IssAlg_capt2ASetColor
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    Int32 IssAlg_capt2ASetColor(Fdrv_Handle handle,Ptr cmdArgs)
    
    {
    
        Iss_2AObj *pObj = gpIssAlg2AObj;
    
        Iss_CaptColor *pColorPrm = (Iss_CaptColor*)cmdArgs;
    
    
    
        pObj->saturation = pColorPrm->saturation;
    
        pObj->contrast   = pColorPrm->contrast;
    
        pObj->brightness = pColorPrm->brightness;
    
    
    
        return FVID2_SOK;
    
    }
    
    
    
    /* Set AEWB Vendor */
    
    
    
    /* ===================================================================
     *  @func     IssAlg_capt2ASetAEWBVendor
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    Int32 IssAlg_capt2ASetAEWBVendor(Fdrv_Handle handle,Ptr cmdArgs)
    
    {
    
        Iss_2AObj *pObj = gpIssAlg2AObj;
    
    
    
        pObj->aewbVendor = (AEWB_VENDOR)(*((UInt32*)cmdArgs));
    
    
    
        return FVID2_SOK;
    
    }
    
    
    
    /* Set AEWB mode */
    
    
    
    /* ===================================================================
     *  @func     IssAlg_capt2ASetAEWBMode
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    Int32 IssAlg_capt2ASetAEWBMode(Fdrv_Handle handle,Ptr cmdArgs)
    
    {
    
        Iss_2AObj *pObj = gpIssAlg2AObj;
    
    
    
        pObj->aewbMode = *((UInt32*)cmdArgs);
    
        pObj->aewbModeFlag = 1;
    
        return FVID2_SOK;
    
    }
    
    
    
    /* Set Iris */
    
    
    
    /* ===================================================================
     *  @func     IssAlg_capt2ASetIris
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    Int32 IssAlg_capt2ASetIris(Fdrv_Handle handle,Ptr cmdArgs)
    
    {
    
        Iss_2AObj *pObj = gpIssAlg2AObj;
    
    
    
        pObj->AutoIris = *((UInt32*)cmdArgs);
    
    
    
        return FVID2_SOK;
    
    }
    
    
    
    /* Set Frame Rate */
    
    
    
    /* ===================================================================
     *  @func     IssAlg_capt2ASetFrameRate
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    Int32 IssAlg_capt2ASetFrameRate(Fdrv_Handle handle,Ptr cmdArgs)
    
    {
    
        Iss_2AObj *pObj = gpIssAlg2AObj;
    
    
    
        pObj->FrameRate = *((UInt32*)cmdArgs);
    
    
    
        return FVID2_SOK;
    
    }
    
    
    
    /* Set AEWB Priority */
    
    
    
    /* ===================================================================
     *  @func     IssAlg_capt2ASetAEWBPri
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    Int32 IssAlg_capt2ASetAEWBPri(Fdrv_Handle handle,Ptr cmdArgs)
    
    {
    
        Iss_2AObj *pObj = gpIssAlg2AObj;
    
    
    
        pObj->aewbPriority = *((UInt32*)cmdArgs);
    
    
    
        return FVID2_SOK;
    
    }
    
    
    
    /* Set sharpness */
    
    
    
    /* ===================================================================
     *  @func     IssAlg_capt2ASetSharpness
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    Int32 IssAlg_capt2ASetSharpness(Fdrv_Handle handle,Ptr cmdArgs)
    
    {
    
        Iss_2AObj *pObj = gpIssAlg2AObj;
    
    
    
        pObj->sharpness = *((UInt32*)cmdArgs);
    
    
    
        return FVID2_SOK;
    
    }
    
    
    
    /* Set BLC */
    
    
    
    /* ===================================================================
     *  @func     IssAlg_capt2ASetBlc
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    Int32 IssAlg_capt2ASetBlc(Fdrv_Handle handle,Ptr cmdArgs)
    
    {
    
        Iss_2AObj *pObj = gpIssAlg2AObj;
    
    
    
        pObj->blc = *((UInt32*)cmdArgs);
    
    
    
        return FVID2_SOK;
    
    }
    
    
    
    /* Set AWB Mode */
    
    
    
    /* ===================================================================
     *  @func     IssAlg_capt2ASetAwbMode
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    Int32 IssAlg_capt2ASetAwbMode(Fdrv_Handle handle,Ptr cmdArgs)
    
    {
    
        Iss_2AObj *pObj = gpIssAlg2AObj;
    
    
    
        pObj->AWBMode = *((UInt32*)cmdArgs);
    
    
    
        return FVID2_SOK;
    
    }
    
    
    
    /* Set AE mode */
    
    
    
    /* ===================================================================
     *  @func     IssAlg_capt2ASetAeMode
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    Int32 IssAlg_capt2ASetAeMode(Fdrv_Handle handle,Ptr cmdArgs)
    
    {
    
        Iss_2AObj *pObj = gpIssAlg2AObj;
    
    
    
        pObj->AEMode = *((UInt32*)cmdArgs);
    
    
    
        return FVID2_SOK;
    
    }
    
    
    
    /* Set ENV */
    
    
    
    /* ===================================================================
     *  @func     IssAlg_capt2ASetEnv
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    Int32 IssAlg_capt2ASetEnv(Fdrv_Handle handle,Ptr cmdArgs)
    
    {
    
        Iss_2AObj *pObj = gpIssAlg2AObj;
    
    
    
        pObj->Env = *((UInt32*)cmdArgs);
    
    
    
        return FVID2_SOK;
    
    }
    
    
    
    /* Set Binning */
    
    
    
    /* ===================================================================
     *  @func     IssAlg_capt2ASetBinning
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    Int32 IssAlg_capt2ASetBinning(Fdrv_Handle handle,Ptr cmdArgs)
    
    {
    
        Iss_2AObj *pObj = gpIssAlg2AObj;
    
    
    
        pObj->Binning = *((UInt32*)cmdArgs);
    
    
    
        return FVID2_SOK;
    
    }
    
    
    
    /* Set DCC param */
    
    
    
    /* ===================================================================
     *  @func     IssAlg_capt2ASetDccPrm
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    Int32 IssAlg_capt2ASetDccPrm(Fdrv_Handle handle,Ptr cmdArgs)
    
    {
    
        Iss_2AObj *pObj = gpIssAlg2AObj;
    
        Iss_CaptDccPrm *pDccPrm = (Iss_CaptDccPrm*)cmdArgs;
    
    
    
        pObj->dcc_Default_Param = pDccPrm->dcc_Default_Param;
    
        pObj->dcc_init_done     = pDccPrm->dcc_init_done;
    
        pObj->dccSize           = pDccPrm->dccSize;
    
    
    
        return FVID2_SOK;
    
    }
    
    
    
    /****************************************************************************************
    
                                    GET FUNCTIONS
    
    ****************************************************************************************/
    
    
    
    /* Get AEWB vendor */
    
    
    
    /* ===================================================================
     *  @func     IssAlg_capt2AGetAEWBVendor
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    AEWB_VENDOR IssAlg_capt2AGetAEWBVendor()
    
    {
    
        Iss_2AObj *pObj = gpIssAlg2AObj;
    
    
    
        return (pObj->aewbVendor);
    
    }
    
    
    
    /****************************************************************************************
    
                            TI 2A functions
    
    *****************************************************************************************/
    
    
    
    void TI_2A_UpdateDynamicParams1(Iss_2AObj *pObj)
    
    {
    
    
    
        static int flickerFreq = 0;
    
    
    
        if (gTi2aControlParams.brightness != pObj->brightness ||
    
            gTi2aControlParams.contrast != pObj->contrast)
    
        {
    
            gTi2aControlParams.brightness = pObj->brightness;
    
            gTi2aControlParams.contrast = pObj->contrast;
    
            gTi2aControlParams.update |= TI2A_UPDATE_CNT_BRGT;
    
        }
    
    
    
        if (gTi2aControlParams.saturation != pObj->saturation)
    
        {
    
            gTi2aControlParams.saturation = pObj->saturation;
    
            gTi2aControlParams.update |= TI2A_UPDATE_SATURATION;
    
        }
    
    
    
        if (gTi2aControlParams.sharpness != pObj->sharpness)
    
        {
    
            gTi2aControlParams.sharpness = pObj->sharpness;
    
            gTi2aControlParams.update |= TI2A_UPDATE_SHARPNESS;
    
        }
    
    
    
        if (gTi2aControlParams.day_night == pObj->aewbPriority)
    
        {
    
            gTi2aControlParams.day_night = !(pObj->aewbPriority);
    
            gTi2aControlParams.update |= TI2A_UPDATE_AE_DAY_NIGHT;
    
        }
    
    
    
        if (gTi2aControlParams.blc != pObj->blc)
    
        {
    
            gTi2aControlParams.blc = pObj->blc;
    
            gTi2aControlParams.update |= TI2A_UPDATE_BLC;
    
        }
    
    
    
        if (pObj->Env != flickerFreq)
    
        {
    
            flickerFreq = pObj->Env;
    
            switch (flickerFreq)
    
            {                                                  /* <TBR: Uday>Sel
    
                                                                * between 50/60Hz
    
                                                                * * flicker */
    
                case 0:
    
                    gTi2aControlParams.flickerFreq = 60;
    
                    break;
    
                case 1:
    
                    gTi2aControlParams.flickerFreq = 50;
    
                    break;
    
                default:
    
                    gTi2aControlParams.flickerFreq = 0;
    
                    break;
    
            }
    
            gTi2aControlParams.update |= TI2A_UPDATE_CONTROL_PARAMS_2A;
    
        }
    
    
        if(pObj->aewbModeFlag == 1){
            gTi2aControlParams.aewbType = pObj->aewbMode;
            pObj->aewbModeFlag = 0;
        // 0=off, 1=AE,
        }
        // 2=AWB, 3=AE+AWB
    
        gTi2aControlParams.wbSceneMode = pObj->AWBMode;
    
    }
    
    #define NUM_RGB2RGB_MATRIXES 4
    static int RGB2RGB_stablize(int curr_RGB2RGBIndex, int reset)
    {
    #define AWB_AVG_BUF_LENGTH 12
        static int history_index[AWB_AVG_BUF_LENGTH];
        static int awb_count = 1;
        static int prev_RGB2RGBIndex = 0;
    
        int i;
        int max;
        int max_index = 0;
        int history_length;
        int index_histogram[NUM_RGB2RGB_MATRIXES];
    
        if (reset == 1) {
            awb_count = 1;
            prev_RGB2RGBIndex = 0;
        }
    
        if (awb_count < AWB_AVG_BUF_LENGTH) {
            history_length = awb_count;
            awb_count++;
        } else {
            history_length = AWB_AVG_BUF_LENGTH;
        }
    
    	if (history_length == AWB_AVG_BUF_LENGTH) {
            for (i = 0; i < history_length - 1; i++) {
                history_index[i] = history_index[i + 1];
            }
        }
        history_index[history_length - 1] = curr_RGB2RGBIndex;
    
        for (i = 0; i < NUM_RGB2RGB_MATRIXES; i++) {
            index_histogram[i] = 0;
        }
        for (i = 0; i < history_length; i++) {
            index_histogram[history_index[i]]++;
        }
    
        max = 0;
        for (i = 0; i < NUM_RGB2RGB_MATRIXES; i++) {
            if (index_histogram[i] > max) {
                max = index_histogram[i];
                max_index = i;
            }
        }
    
    	if (history_length < AWB_AVG_BUF_LENGTH) {
            curr_RGB2RGBIndex = max_index;
        } else {
            if (max * 10 >= (AWB_AVG_BUF_LENGTH * 8)) {
                curr_RGB2RGBIndex = max_index;
            } else {
                curr_RGB2RGBIndex = prev_RGB2RGBIndex;
            }
        }
        prev_RGB2RGBIndex = curr_RGB2RGBIndex;
        return (curr_RGB2RGBIndex);
    }
    
    
    int get_index_of_matrixes(int colorTemp,  int reset)
    {
        int i, diff, next_diff;
        static int prev_i = -1;
        static int color_temp[] = {2850, 4250, 5000, 6500};
    
        for (i = 0; i < NUM_RGB2RGB_MATRIXES - 1 && color_temp[i+1] > 0; i++)
        {
            diff = colorTemp - color_temp[i];
            next_diff = color_temp[i+1] - colorTemp;
            if ((next_diff >= 0 && diff >= 0) || diff < 0)
            {
                if (prev_i == i) diff -= 200;
                if (prev_i == i+1) next_diff -= 200;
                if (next_diff < diff)
                {
                    i++;
                }
                break;
            }
        }
        i = RGB2RGB_stablize(i, reset);
    	if (prev_i != i || reset)
        {
            prev_i = i;
        }
    	return i;
    }
    
    
    /* TI 2A Process Call */
    
    
    /* ===================================================================
     *  @func     IssAlg_capt2AProcessTI
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    extern int16 gamma_iss_default_table[];
    Int32 IssAlg_capt2AProcessTI(Iss_2AObj *pObj)
    
    {
        Int32 status = FVID2_SOK;
        static UInt32 dccFrmCnt = 0;
    
        TI_2A_UpdateDynamicParams1(pObj);
        status = ALG_aewbRun((Void*)pObj->fullH3ABufAddr);
        ALG_aewbControl();
        if (status == FVID2_SOK)
        {
            // AE write to SENSOR
            status =
                FVID2_control(pObj->SensorHandle, IOCTL_ISS_SENSOR_UPDATE_EXP_GAIN,
                              &ti2a_output_params, NULL);
            if (status != FVID2_SOK)
            {
                Vps_rprintf("\nAE write to sensor failed!\n");
                return status;
            }
    
            pObj->AEWBValue1 = ti2a_output_params.sensorExposure/100;  //10 bit
            pObj->AEWBValue2 = (ti2a_output_params.sensorGain / 100);
            pObj->AEWBValue2 *= (ti2a_output_params.ipipe_awb_gain.dGain *40/1024); //20 bit
            // AWB write to ISP
    
            status =
                Iss_captControl(pObj->cameraVipHandle, IOCTL_ISS_ALG_2A_UPDATE,
                                &ti2a_output_params, NULL);
    
            if (status != FVID2_SOK)
            {
                Vps_rprintf("AWB write to ISP failed!\n");
                return status;
            }
        } else {
            Vps_rprintf("2A ALG run failed!\n");
        }
    
        /* Added for DCC Parser */
        if (pObj->aewbVendor == AEWB_ID_TI)
        {
            if (((dccFrmCnt % 32) == 0) && (pObj->dcc_init_done == TRUE))
            {
                dcc_parser_input_params_t input_params;
                dcc_parser_output_params_t output_params;
    
                extern iss_drv_config_t *iss_drv_config;
                static int first_time = 0;
                if(first_time == 0)
                {
                  extern volatile int new_dcc_data_available;
                  new_dcc_data_available = 1;
    
                  iss_drv_config->isif_cfg.lsc_params = (isif_2dlsc_cfg_t*)gIss_captCommonObj.pIssConfig->ptLsc2D;
    
                  first_time = 1;
                }
                output_params.iss_drv_config   = iss_drv_config;
                input_params.dcc_buf           = (Int8 *)pObj->dcc_Default_Param;
                input_params.dcc_buf_size      = pObj->dccSize;
                input_params.color_temparature = ti2a_output_params.colorTemparaure;
                input_params.exposure_time     = ti2a_output_params.sensorExposure;
                input_params.analog_gain       = (ti2a_output_params.sensorGain / 1000);
                input_params.analog_gain       *= (ti2a_output_params.ipipe_awb_gain.dGain *4/1024);
                output_params.pVnfParam   = NULL;
                output_params.pGlbceParams   = NULL;
    			output_params.pMctnfParam   = NULL;
    
                dcc_update(&input_params, &output_params);
    
                output_params.iss_drv_config->ipipe_cfg.rgb_yuv_params->offset[0] =
                    gTi2aControlParams.brightness - 128;
                output_params.iss_drv_config->ipipe_cfg.rgb_yuv_params->contrast =
                    (gTi2aControlParams.contrast >> 3);
                output_params.iss_drv_config->ipipe_cfg.filter_flag |=
                    (IPIPE_RGB_TO_YUV_FLAG);
    
    #if defined(IMGS_MICRON_MT9M034) | defined(IMGS_SONY_IMX104) | defined(IMGS_SONY_IMX136) |  defined(IMGS_SONY_IMX140)
    			/* shaprness adjustment sample code*/
                if( (gTi2aControlParams.sharpness > 0 || gTi2aControlParams.sharpness < 256) &&
                        (ti2a_output_params.sensorGain <= 16000))
                {
                    output_params.iss_drv_config->ipipe_cfg.ee_param->enable = 1;
                    output_params.iss_drv_config->ipipe_cfg.ee_param->halo_reduction = IPIPE_HALO_REDUCTION_ENABLE;
                    output_params.iss_drv_config->ipipe_cfg.ee_param->sel = 1;
    
                    output_params.iss_drv_config->ipipe_cfg.ee_param->gain = gTi2aControlParams.sharpness/2 ;
                    output_params.iss_drv_config->ipipe_cfg.ee_param->hpf_low_thr = 100 ;
                    output_params.iss_drv_config->ipipe_cfg.ee_param->hpf_high_thr = 30 ;
                    output_params.iss_drv_config->ipipe_cfg.ee_param->hpf_gradient_gain =
                             output_params.iss_drv_config->ipipe_cfg.ee_param->gain >> 1 +
                                    output_params.iss_drv_config->ipipe_cfg.ee_param->gain ;
                    output_params.iss_drv_config->ipipe_cfg.ee_param->hpf_gradient_offset = 24;
                    output_params.iss_drv_config->ipipe_cfg.filter_flag |= (IPIPE_EE_FLAG);
                } else {
                    output_params.iss_drv_config->ipipe_cfg.ee_param->enable = 0;
                    output_params.iss_drv_config->ipipe_cfg.filter_flag |= (IPIPE_EE_FLAG);
                }
    #endif
    
    			/*3DLut sample code*/
    			int i3dlut = 0;
    			static int indexPrev = -1;
    			int index = get_index_of_matrixes(ti2a_output_params.colorTemparaure, 0);
    
    			if(index != indexPrev)
    			{
    				Vps_printf("CT: %d, 3dlut index:%d \n", ti2a_output_params.colorTemparaure, index);
    				if(index == 3)
    				{
    					for(i3dlut = 0 ; i3dlut< 729 ; i3dlut ++) {
    						rgb_3d_lut_table[i3dlut] = (iss_3d_lut_r_table_6500K[i3dlut] & 0x3FF) << 20;
    						rgb_3d_lut_table[i3dlut] |= (iss_3d_lut_g_table_6500K[i3dlut]& 0x3FF) << 10;
    						rgb_3d_lut_table[i3dlut] |= (iss_3d_lut_b_table_6500K[i3dlut]& 0x3FF);
    					}
    				} else if(index == 2) {
    					for(i3dlut = 0 ; i3dlut< 729 ; i3dlut ++) {
    						rgb_3d_lut_table[i3dlut] = (iss_3d_lut_r_table_5000K[i3dlut] & 0x3FF) << 20;
    						rgb_3d_lut_table[i3dlut] |= (iss_3d_lut_g_table_5000K[i3dlut]& 0x3FF) << 10;
    						rgb_3d_lut_table[i3dlut] |= (iss_3d_lut_b_table_5000K[i3dlut]& 0x3FF);
    					}
    				} else if(index == 1 ) {
    					for(i3dlut = 0 ; i3dlut< 729 ; i3dlut ++) {
    						rgb_3d_lut_table[i3dlut] = (iss_3d_lut_r_table_TL84[i3dlut] & 0x3FF) << 20;
    						rgb_3d_lut_table[i3dlut] |= (iss_3d_lut_g_table_TL84[i3dlut]& 0x3FF) << 10;
    						rgb_3d_lut_table[i3dlut] |= (iss_3d_lut_b_table_TL84[i3dlut]& 0x3FF);
    					}
    				} else if(index == 0) { 
    					for(i3dlut = 0 ; i3dlut< 729 ; i3dlut ++) {
    						rgb_3d_lut_table[i3dlut] = (iss_3d_lut_r_table_A[i3dlut] & 0x3FF) << 20;
    						rgb_3d_lut_table[i3dlut] |= (iss_3d_lut_g_table_A[i3dlut]& 0x3FF) << 10;
    						rgb_3d_lut_table[i3dlut] |= (iss_3d_lut_b_table_A[i3dlut]& 0x3FF);
    					}
    				}
    
    				MSP_IspProcCfgT tIspParamCfg;
    				tIspParamCfg.ptIssConfig  = gIss_captCommonObj.pModuleInstance->tConfigParams.ptIssConfig;
    				tIspParamCfg.ptIssConfig->pt3Dcc->enable = 0; /* enable 3dlut:1 */
    				tIspParamCfg.ptIssConfig->pt3Dcc->pInBiffData = &rgb_3d_lut_table;
    				tIspParamCfg.ptIssConfig->eFProcIpipeValidity =(MSP_PROC_IPIPE_VALID_ID)(MSP_PROC_IPIPE_VALID_3DCC);
    				MSP_ISP_config(gIss_captCommonObj.pModuleInstance->hIspHandle,
                   		    (MSP_INDEXTYPE) MSP_ISP_CFG_IPIPE, &tIspParamCfg);
    			}
    			indexPrev = index;
    
                if(gTi2aControlParams.saturation != 128)
    
                {
    
                  int K = ((gTi2aControlParams.saturation * 1024) / 128);
    
    
    
    
    
                  output_params.iss_drv_config->ipipe_cfg.rgb_rgb1_params->mul_off[0] +=
    
                  ((717 * (K - 1024)) * 256 )/(1024 * 1024);
    
    
    
                  output_params.iss_drv_config->ipipe_cfg.rgb_rgb1_params->mul_off[1] +=
    
                  ((601 * (1024 - K)) * 256 )/(1024 * 1024);
    
    
    
                  output_params.iss_drv_config->ipipe_cfg.rgb_rgb1_params->mul_off[2] +=
    
                  ((117 * (1024 - K)) * 256 )/(1024 * 1024);
    
    
    
                  output_params.iss_drv_config->ipipe_cfg.rgb_rgb1_params->mul_off[3] +=
    
                  ((601 * (1024 - K)) * 256 )/(1024 * 1024);
    
    
    
                  output_params.iss_drv_config->ipipe_cfg.rgb_rgb1_params->mul_off[4] +=
    
                  ((717 * (K - 1024)) * 256 )/(1024 * 1024);
    
    
    
                  output_params.iss_drv_config->ipipe_cfg.rgb_rgb1_params->mul_off[5] +=
    
                  ((117 * (1024 - K)) * 256 )/(1024 * 1024);
    
    
    
                  output_params.iss_drv_config->ipipe_cfg.rgb_rgb1_params->mul_off[6] +=
    
                    ((306 * (1024 - K)) * 256 )/(1024 * 1024);
    
    
    
                  output_params.iss_drv_config->ipipe_cfg.rgb_rgb1_params->mul_off[7] +=
    
                  ((311 * (1024 - K)) * 256 )/(1024 * 1024);
    
    
    
                  output_params.iss_drv_config->ipipe_cfg.rgb_rgb1_params->mul_off[8] +=
    
                  ((717 * (K - 1024)) * 256 )/(1024 * 1024);
    
    
    
                  output_params.iss_drv_config->ipipe_cfg.filter_flag |=
    
                        (IPIPE_RGB_RGB_1_FLAG);
    
                }
    
    #if 0
                /*GBCE/GAMMA adjustment Sample Code*/
                output_params.iss_drv_config->ipipe_cfg.gbce_params = (ipipe_gbce_cfg_t* )&gbce_iss_default_params;
                output_params.iss_drv_config->ipipe_cfg.filter_flag |= (IPIPE_GBCE_FLAG);
    
                static ipipe_gamma_cfg_t gamma_cfg = 
                {IPIPE_GAMMA_TBL_512, 0, IPIPE_GAMMA_BYPASS_DISABLE, IPIPE_GAMMA_BYPASS_DISABLE, IPIPE_GAMMA_BYPASS_DISABLE, NULL, NULL, NULL};
                gamma_cfg.red_table = gamma_cfg.green_table = gamma_cfg.blue_table = (int16 *)gamma_iss_default_table;
                ipipe_config_gamma(&gamma_cfg);
    #endif
    
                ipipe_config_filters(&output_params.iss_drv_config->ipipe_cfg);
    
                output_params.iss_drv_config->ipipe_cfg.filter_flag = 0;
    
    #if defined(APPRO_SENSOR_VENDOR) && defined(IMGS_SONY_IMX136)
    			/*
    			 *	To run TI AEWB algorithm with Appro IMX136 sensor.
    			 */
    			output_params.iss_drv_config->isif_cfg.digital_clamp_params = 0;
    #endif
    			
                output_params.iss_drv_config->isif_cfg.feature_flag &= ~ISIF_SDRAM_OP_FLAG;
                isif_config(&output_params.iss_drv_config->isif_cfg);
    
                output_params.iss_drv_config->isif_cfg.feature_flag = 0;
    
            }
    
        }
    
    
    
        dccFrmCnt++;
    
    
    
        return FVID2_SOK;
    
    }
    
    
    
    /****************************************************************************************
    
                            APPRO 2A functions
    
    *****************************************************************************************/
    
    
    
    /* ===================================================================
     *  @func     copy4x32bit
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    static inline void copy4x32bit(Uint32 * pDest, Uint32 * pSource)
    
    {
    
        *pDest++ = *pSource++;
    
        *pDest++ = *pSource++;
    
        *pDest++ = *pSource++;
    
        *pDest++ = *pSource++;
    
    }
    
    
    
    /* reorder H3A data */
    
    void reorderH3AData1(Uint32 * pDest, Uint32 * pSource, Uint32 nPaxX,
    
                         Uint32 nPaxY)
    
    {
    
    #define SKIP_BLACK_ROW
    
        int nIdx1;
    
    
    
        int nIdx2;
    
    
    
        int nPaxRemain = nPaxX;
    
    
    
        int nBytesInThisRow = 0;
    
    
    
        Uint32 *pDestSumPtr = pDest;
    
    
    
        Uint32 *pDestUnSatPtr = pDest + 4;
    
    
    
    #ifdef SKIP_BLACK_ROW
    
        nPaxY++;
    
    #endif                                                     // SKIP_BLACK_ROW
    
        for (nIdx1 = 0; nIdx1 < (nPaxX * nPaxY); nIdx1++)
    
    
    
        {
    
            // Copy Paxel
    
            copy4x32bit(pDestSumPtr, pSource);
    
            pDestSumPtr += 5;
    
            pSource += 4;
    
            nBytesInThisRow += 16;
    
            // Copy Packet end data (unsaturated pixels)
    
            if (nIdx1 % 8 == 7)
    
            {
    
                for (nIdx2 = 0; nIdx2 < 4; nIdx2++)
    
                {
    
                    *pDestUnSatPtr = *pSource & 0xFFFF;
    
                    pDestUnSatPtr += 5;
    
                    *pDestUnSatPtr = ((*pSource) >> 16) & 0xFFFF;
    
                    pDestUnSatPtr += 5;
    
                    pSource++;
    
                }
    
                nBytesInThisRow += 16;
    
            }
    
            nPaxRemain--;
    
            if (!nPaxRemain)
    
            {
    
    #ifdef SKIP_BLACK_ROW
    
                if ((nPaxX - 1) == nIdx1)
    
                {
    
                    pDestSumPtr = pDest;
    
                    pDestUnSatPtr = pDest + 4;
    
                }
    
    #endif                                                     // SKIP_BLACK_ROW
    
                // End of row
    
                if (nBytesInThisRow % 32)
    
                {
    
                    pSource += 4;
    
                }
    
                nPaxRemain = nPaxX;
    
                nBytesInThisRow = 0;
    
            }
    
    
    
        }
    
    
    
        for (nIdx2 = 0; nIdx2 < (1 + (nPaxX * nPaxY) % 8) / 2; nIdx2++)
    
        {
    
            *pDestUnSatPtr = *pSource & 0xFFFF;
    
            pDestUnSatPtr += 5;
    
            *pDestUnSatPtr = ((*pSource) >> 16) & 0xFFFF;
    
            pDestUnSatPtr += 5;
    
            pSource++;
    
        }
    
    
    
    }
    
    
    
    /***************************************************************************************/
    
    /* ===================================================================
     *  @func     IssAlg_capt2ADynamicParmAppro
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    Int32 IssAlg_capt2ADynamicParmAppro(Iss_2AObj *pObj)
    {
        Int32 status = FVID2_SOK;
        static int FlgFrame = -1;
        static int FlgFlicker = -1;
        Int32 SetVal1 = 1;
        Int32 SetVal2 = 0;
        Int32 IsDbgOn = 0;
        static appro2a_output *pApproOutPrm = NULL;
        static ipipe_cfg_t * pIpipe_config = NULL;
        static isif_cfg_t * pIsif_config = NULL;
    
        Appro2ACtrl(APPRO_CMD_AUTO_IRIS, &pObj->AutoIris);
        Appro2ACtrl(APPRO_CMD_SATURATION,&pObj->saturation);
        Appro2ACtrl(APPRO_CMD_SHARPNESS, &pObj->sharpness);
        Appro2ACtrl(APPRO_CMD_BRIGHTNESS,&pObj->brightness);
        Appro2ACtrl(APPRO_CMD_CONTRAST,  &pObj->contrast);
        Appro2ACtrl(APPRO_CMD_BLC,       &pObj->blc);
    
        switch( pObj->aewbMode )
        {
            case 0:
                if( IsDbgOn ) Vps_printf("AWB Disable \n");
                SetVal1 = 0;
                SetVal2 = 0;
            break;
            case 1:
                if( IsDbgOn ) Vps_printf("AE Only \n");
                SetVal1 = 1;
                SetVal2 = 1;
            break;
            case 2:
                if( IsDbgOn ) Vps_printf("AWB Only \n");
                SetVal1 = 1;
                SetVal2 = 2;
            break;
            case 3:
                if( IsDbgOn ) Vps_printf("AEWB Enable \n");
                SetVal1 = 1;
                SetVal2 = 0;
            break;
            default :
                if( IsDbgOn ) Vps_printf("AEWB Default \n");
                SetVal1 = 1;
                SetVal2 = 0;
    
            break;
        }
        Appro2ACtrl(APPRO_CMD_AEWB_ENABLE, &SetVal1);
        Appro2ACtrl(APPRO_CMD_AEWB_TYPE,   &SetVal2);
    
        if( pObj->aewbPriority == 0 )
        {
            if( IsDbgOn ) Vps_printf("PRIORITY_FRAMERATE \n");
            Appro2ACtrl(APPRO_CMD_AE_FRAME_PRIO,   NULL);
        }
        else if( pObj->aewbPriority == 1)
        {
            if( IsDbgOn ) Vps_printf("PRIORITY_EXPOSURE \n");
            Appro2ACtrl(APPRO_CMD_AE_QUALITY_PRIO,   NULL);
        }else{
            if( IsDbgOn ) Vps_printf("PRIORITY_Default \n");
            Appro2ACtrl(APPRO_CMD_AE_QUALITY_PRIO,   NULL);
        }
    
        //pObj->AWBMode = 0;//0:auto 1:d65 2:d55 3:fluorescent 4:incandescent
        if( IsDbgOn ) Vps_printf("AWB MODE = %d \n",pObj->AWBMode);
        Appro2ACtrl(APPRO_CMD_AWB_MODE,   &pObj->AWBMode);
    
    
        if ((FlgFrame != pObj->FrameRate)||(FlgFlicker!=pObj->Env))
        {
            int FrameTime = 0;
            int frameRate = 30;
    
            if(FlgFlicker!=pObj->Env)
            {
                FlgFlicker = pObj->Env;
                Appro2ACtrl(APPRO_CMD_AE_FLICKER, &FlgFlicker);
            }
    
            FlgFrame = pObj->FrameRate;
    
            if ((FlgFrame == 30) || (FlgFrame == 60))
            {
                if(FlgFrame == 60 )
                {
                    if( FlgFlicker == 0 )
                        frameRate = 60;
                    else
                        frameRate = 50;
                }else{
                    if( FlgFlicker == 0 )
                        frameRate = 30;
                    else
                        frameRate = 25;
                }
                status =
                    FVID2_control(pObj->SensorHandle,
                                  IOCTL_ISS_SENSOR_FRAME_RATE_SET, &frameRate,
                                  &FrameTime);
                if (status != FVID2_SOK)
                {
                    Vps_rprintf("\nAE write to sensor failed!\n");
                    return FVID2_EFAIL;
                }
    
                if( IsDbgOn ) Vps_rprintf("\nFrameTime = %d\n", FrameTime);
    
                Appro2ACtrl(APPRO_CMD_FRAME_TIME, &FrameTime);
            }
        }
    
        if( pApproOutPrm == NULL )
        {
    
            Appro2ACtrl(APPRO_CMD_GET_OUTPUT, &pApproOutPrm);
            pIpipe_config = (ipipe_cfg_t * )(pApproOutPrm->ipipe);
            pIsif_config = (isif_cfg_t * )(pApproOutPrm->isif);
            Appro2ACtrl(APPRO_CMD_SET_ENGMODE, APPRO_2AEngModeParm());
        }
    
        if( pApproOutPrm != NULL )
        {
            if( pIpipe_config->filter_flag != 0 &&  IsDbgOn  )
            {
                Vps_printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
                Vps_printf("pIpipe_config->filter_flag = 0x%X\n", pIpipe_config->filter_flag);
                Vps_printf("pIsif_config->feature_flag = 0x%X\n", pIsif_config->feature_flag);
                Vps_printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
            }
    
            ipipe_config_filters(pIpipe_config);
    
            pIpipe_config->filter_flag = 0;
    
            pIsif_config->feature_flag &= ~ISIF_SDRAM_OP_FLAG;
            isif_config(pIsif_config);
    
            pIsif_config->feature_flag = 0;
    
            if( pApproOutPrm->updateMisc )
            {
    
    
                if( pApproOutPrm->updateMisc & UPDATE_MISC_PWM_VIDEO )
                {
                    Iss_SensorPwmParm PwmParm;
                    PwmParm.Id = ISS_SENSOR_PWM_VIDEO;
                    PwmParm.period = pApproOutPrm->PwmVideoPeriod;
                    PwmParm.duty = pApproOutPrm->PwmVideoDuty;
                    status =   FVID2_control(pObj->SensorHandle,
                                  IOCTL_ISS_SENSOR_PWM_CONFIG, &PwmParm,NULL);
                    if (status != FVID2_SOK)
                    {
                        Vps_printf("\n ISS_SENSOR_PWM_VIDEO failed!\n");
                    }
    
                }
    
                if( pApproOutPrm->updateMisc & UPDATE_MISC_PWM_DC )
                {
                    Iss_SensorPwmParm PwmParm;
                    PwmParm.Id = ISS_SENSOR_PWM_DC;
                    PwmParm.period = pApproOutPrm->PwmDCPeriod;
                    PwmParm.duty = pApproOutPrm->PwmDCDuty;
                    status =   FVID2_control(pObj->SensorHandle,
                                  IOCTL_ISS_SENSOR_PWM_CONFIG, &PwmParm,NULL);
                    if (status != FVID2_SOK)
                    {
                        Vps_printf("\n ISS_SENSOR_PWM_VIDEO failed!\n");
                    }
    
                }
    
                pApproOutPrm->updateMisc = 0;
    
            }
        }
    
    
        return 0;
    }
    
    
    
    /* APPRO 2A Process */
    
    
    
    /* ===================================================================
     *  @func     IssAlg_capt2AProcessAppro
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    Int32 IssAlg_capt2AProcessAppro(Iss_2AObj *pObj)
    
    {
        static appro2a_output *pApproOutPrm = NULL;
        Int32 status = FVID2_SOK;
    
    
    
        /* reorder data */
    
        reorderH3AData1((Uint32*)pObj->pH3AMem,(Uint32*)pObj->fullH3ABufAddr,
    
                        (Uint32)pObj->aewbNumWinH,
    
                        (Uint32)pObj->aewbNumWinV);
    
    
    
        Appro2ACalc(pObj->aewbNumWinV,pObj->aewbNumWinH,
    
                    pObj->aewbNumPix,pObj->pH3AMem);
    
    
        if (status == FVID2_SOK)
    
        {
    
    
            if( pApproOutPrm == NULL )
            {
    
                Appro2ACtrl(APPRO_CMD_GET_OUTPUT, &pApproOutPrm);
            }
    
            // AE write to SENSOR
            if( pApproOutPrm != NULL )
            {
                if((pApproOutPrm->sensor.update & UPDATE_SENSOR_GAIN) ||
                    (pApproOutPrm->sensor.update & UPDATE_SENSOR_SHUTTER))
                {
    
                    ti2a_output_params.sensorGain       = pApproOutPrm->sensor.Gain;
                    ti2a_output_params.sensorExposure   = pApproOutPrm->sensor.Shutter;
                    ti2a_output_params.mask             = pApproOutPrm->sensor.update;
    
                    status =
    
                        FVID2_control(pObj->SensorHandle,
    
                                      IOCTL_ISS_SENSOR_UPDATE_EXP_GAIN,
    
                                      &ti2a_output_params,NULL);
    
                    if (status != FVID2_SOK)
    
                    {
    
                        Vps_rprintf("\nAE write to sensor failed!\n");
    
                        return FVID2_EFAIL;
    
                    }
    
                }
    
                pApproOutPrm->sensor.update = 0;
            }
    #if 0
            // AWB write to ISP
            status =
                Iss_captControl(pObj->cameraVipHandle,IOCTL_ISS_ALG_2A_UPDATE,
    
                                &ti2a_output_params,NULL);
    
            if (status != FVID2_SOK)
    
            {
    
                Vps_rprintf("AWB write to ISP failed!\n");
    
                return FVID2_EFAIL;
    
            }
    #else
            // AEWB write to ISP
            IssAlg_capt2ADynamicParmAppro(pObj);
    #endif
        }
    
        else
    
        {
    
            Vps_rprintf("2A ALG run failed!\n");
    
        }
    
    
    
        return status;
    
    }
    
    
    
    /* 2A process function */
    
    
    
    /* ===================================================================
     *  @func     IssAlg_capt2AProcess
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    Int32 IssAlg_capt2AProcess(Iss_2AObj *pObj)
    
    {
    #ifdef TWOA_PROFILE
        Uint32 start, end;
        start = Utils_getCurTimeInMsec();
    #endif
    
        if(pObj->aewbVendor == AEWB_ID_TI)
    
        {
    
            IssAlg_capt2AProcessTI(pObj);
    
        }
    
        else if(pObj->aewbVendor == AEWB_ID_APPRO)
    
             {
    
                 IssAlg_capt2AProcessAppro(pObj);
    
             }
    
    #ifdef TWOA_PROFILE
        end = Utils_getCurTimeInMsec();
        Vps_printf("2A:Process time = %d msec\n",(end - start));
    #endif
    
        return FVID2_SOK;
    
    }
    
    
    
    /* 2A task Main function */
    
    
    
    /* ===================================================================
     *  @func     IssAlg_captTsk2A
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    Void IssAlg_captTsk2A(UArg arg0,UArg arg1)
    
    {
    
        Iss_2AObj *pObj = (Iss_2AObj*)arg0;
    
        static int count = 0;
    
    
        /* allocate H3A temp memory */
    
        pObj->pH3AMem = memalign(64,20 * pObj->aewbNumWinV * pObj->aewbNumWinH);
    
        if (pObj->pH3AMem == NULL)
        {
    
            Vps_rprintf ( " %s:%d: pObj->pH3AMem is NULL.. memalign failed !!!\n", __FUNCTION__,
    
                            __LINE__ );
        }
    
        /* Create AEWB algorithm instance */
    
        pObj->pAlgHndl = (Void*)ALG_aewbCreate(pObj->aewbNumWinH, pObj->aewbNumWinV,pObj->aewbNumPix);
    
    
    
        if(pObj->pAlgHndl == NULL)
    
        {
    
            Vps_rprintf ( " %s:%d: 2A alg instance create failed !!!\n", __FUNCTION__,
    
                            __LINE__ );
    
            GT_assert(GT_DEFAULT_MASK,pObj->pAlgHndl != NULL);
    
        }
    
    
    
    #ifdef ISS_CAPT_DEBUG
    
        Vps_rprintf ( " %s:%d: 2A task Main function Entered !!!\n", __FUNCTION__,
    
                        __LINE__ );
    
    #endif
    
    
    
        while(pObj->exitFlag == FALSE)
    
        {
    
            /* wait for 2A sem */
    
            Semaphore_pend(pObj->sem,BIOS_WAIT_FOREVER);
    
            if(pObj->exitFlag == FALSE)
            {
                /* Got new H3A data apply 2A algorithm */
                IssAlg_capt2AProcess(pObj);
    
                /*
                 *  Save the current AF H3A buffer address to be used for Focus value
                 *  calculation for VA Defocus algorithm.
                 */
                gFocusStatistics.pCurAFDataAddr = (Void*)(pObj->fullH3ABufAddr + pObj->h3aBufSize);
    
                count ++;
                if ((count % 60) == 0)
                {
                    pObj->AFValue = ALG_afRun((Void*)(pObj->fullH3ABufAddr + pObj->h3aBufSize));
                }
    
            }
    
        }
    
        /* Delete the 2A alg instance */
    
        ALG_aewbDelete(pObj->pAlgHndl);
    
        //Appro2ARelease();
    
        /* free H3A temp memory */
    
        free(pObj->pH3AMem);
    
    
    
    #ifdef ISS_CAPT_DEBUG
    
        Vps_rprintf ( " %s:%d: 2A task Main function Exited !!!\n", __FUNCTION__,
    
                        __LINE__ );
    
    #endif
    }
    
    
    
    /* Set 2A default params */
    
    
    
    /* ===================================================================
     *  @func     IssAlg_capt2ASetDefault
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    Int32 IssAlg_capt2ASetDefault(Iss_2AObj *pObj)
    
    {
    
        pObj->exitFlag   = FALSE;
    
        pObj->AutoIris   = 0;
    
        pObj->saturation = 0;
    
        pObj->sharpness  = 0;
    
        pObj->brightness = 0;
    
        pObj->contrast   = 0;
    
        pObj->blc        = 0;
    
        pObj->AWBMode    = 0;
    
        pObj->AEMode     = 0;
    
        pObj->Env        = 0;
    
        pObj->Binning    = 0;
    
        pObj->FrameRate  = 0;
    
    
    
        pObj->dcc_Default_Param = NULL;
    
        pObj->dcc_init_done     = FALSE;
    
        pObj->dccSize           = 0;
    
    
    
        return FVID2_SOK;
    
    }
    
    
    
    /* 2A Init */
    
    
    
    /* ===================================================================
     *  @func     IssAlg_capt2AInit
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    Int32 IssAlg_capt2AInit(Iss_2AObj *pObj, UInt32 bSetDefaultFlag)
    
    {
    
        Task_Params tskParams;
    
        Semaphore_Params semParams;
    
    
    
        gpIssAlg2AObj = pObj;
    
    
        if(bSetDefaultFlag)
            IssAlg_capt2ASetDefault(pObj);
    
        if (pObj->taskHndl==NULL)
        {
    
            /* Create 2A task */
    
            Task_Params_init(&tskParams);
    
    
    
            tskParams.priority  = ISSALG_CAPT_TSK_PRI_2A;
    
            tskParams.stack     = gIssAlg_captTskStack2A;
    
            tskParams.stackSize = sizeof(gIssAlg_captTskStack2A);
    
            tskParams.arg0      = (UArg)pObj;
    
    
    
            pObj->taskHndl = Task_create(IssAlg_captTsk2A,
    
                                        &tskParams,
    
                                        NULL);
    
    
    
            if(pObj->taskHndl == NULL)
    
            {
    
                Vps_rprintf ( " %s:%d: 2A task create failed !!!\n", __FUNCTION__,
    
                                __LINE__ );
    
                GT_assert(GT_DEFAULT_MASK,pObj->taskHndl != NULL);
    
            }
    
    
    
            /* create 2A sem */
    
            Semaphore_Params_init(&semParams);
    
            semParams.mode = Semaphore_Mode_BINARY;
    
    
    
            pObj->sem = Semaphore_create(0u,&semParams,NULL);
    
    
    
            if(pObj->sem == NULL)
    
            {
    
                Vps_rprintf ( " %s:%d: 2A task sem create failed !!!\n", __FUNCTION__,
    
                            __LINE__ );
    
                GT_assert(GT_DEFAULT_MASK,pObj->sem != NULL);
    
            }
    
    
    
            /* Allocate memory for the H3A buffers */
    
            pObj->h3aBufAddr[0] = (UInt32)memalign(64,pObj->h3aBufSize * 2); // AEWB + AF
    
            pObj->h3aBufAddr[1] = (UInt32)memalign(64,pObj->h3aBufSize * 2); // AEWB + AF
    
        }
    
        pObj->curH3aBufIdx  = 0;
    
    
    
        /* H3A module config */
    
        pObj->ispH3aCfg.ptIssConfig = pObj->pIssConfig;
    
        pObj->ispH3aCfg.pAewbBuff   = (MSP_PTR)pObj->h3aBufAddr[0];
    
        pObj->ispH3aCfg.pAfBuff     = (MSP_PTR)(pObj->h3aBufAddr[0] + pObj->h3aBufSize);
    
    
    
        MSP_ISP_config(pObj->pIspHandle,(MSP_INDEXTYPE)MSP_ISP_CFG_H3A,&pObj->ispH3aCfg);
    
    
    
    #ifdef ISS_CAPT_DEBUG
    
        Vps_rprintf ( " %s:%d: 2A task Init Done !!!\n", __FUNCTION__,
    
                        __LINE__ );
    
    #endif
    
    
    
        return FVID2_SOK;
    
    }
    
    
    
    /* 2A De Init */
    
    
    
    /* ===================================================================
     *  @func     IssAlg_capt2ADeInit
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    Int32 IssAlg_capt2ADeInit(Iss_2AObj *pObj)
    
    {
        /* Set exit flag */
        pObj->exitFlag = TRUE;
    
        /* post the 2A semaphore so that 2A task comes out of sem wait */
        Semaphore_post(pObj->sem);
    
        /* wait for 2A task to exit the loop */
        if(pObj->taskHndl != NULL)
        {
            while(Task_getMode(pObj->taskHndl) != Task_Mode_TERMINATED)
            {
                /* wait for 100 msec */
                Task_sleep(100);
            }
        }
    
        /* Delete the 2A task */
        if(pObj->taskHndl != NULL)
        {
            Task_delete(&pObj->taskHndl);
        }
    
        if(pObj->sem != NULL)
        {
            Semaphore_delete(&pObj->sem);
        }
    
        /* Stop H3A module */
        if(ISP_SUCCESS != issDrvH3aStop()) {
            Vps_printf("issDrvH3aStop failed\n");
        }
    
        /* free H3A buffers */
        free((void*)pObj->h3aBufAddr[0]);
        free((void*)pObj->h3aBufAddr[1]);
    
        pObj->taskHndl = NULL;
    
    #ifdef ISS_CAPT_DEBUG
        Vps_rprintf ( " %s:%d: 2A task DeInit Done !!!\n", __FUNCTION__, __LINE__ );
    #endif
    
    
    
        return FVID2_SOK;
    
    }
    
    Int32 ALG_afRun(void *h3aDataVirtAddr)
    {
        MSP_H3aAfOutVfDisableOverlay *pAfPaxData;
        unsigned short i,j;
        int focus_value;
        Uint8 *curAfAddr;
        Uint32 accAfVal[9] = {0,0,0,0,0,0,0,0,0};
        //float avgAfVal[9];
        int weighti, weightj, fweight;
        int af_pax_vt_cnt, af_pax_hz_cnt;
    
        af_pax_vt_cnt = 16;
        af_pax_hz_cnt = 6;
    
        curAfAddr = (Uint8* ) h3aDataVirtAddr;
    
        for(i=1;i<af_pax_vt_cnt-1; i++) {
            for(j=1;j<af_pax_hz_cnt-1; j++) {
    
                pAfPaxData = (MSP_H3aAfOutVfDisableOverlay *)curAfAddr;
    
                weighti = (i > (af_pax_vt_cnt-1 - i))?(af_pax_vt_cnt-1 - i):i;
                weightj = (j > (af_pax_hz_cnt-1 - j))?(af_pax_hz_cnt-1 - j):j;
                fweight = weighti*weightj;
    
                accAfVal[0] += fweight*pAfPaxData->hfvSum_0;
                accAfVal[1] += fweight*pAfPaxData->hfv1_0;
                accAfVal[2] += fweight*pAfPaxData->hfv2_0;
                accAfVal[3] += fweight*pAfPaxData->hfvSum_1;
                accAfVal[4] += fweight*pAfPaxData->hfv1_1;
                accAfVal[5] += fweight*pAfPaxData->hfv2_1;
                accAfVal[6] += fweight*pAfPaxData->hfvSum_2;
                accAfVal[7] += fweight*pAfPaxData->hfv1_2;
                accAfVal[8] += fweight*pAfPaxData->hfv2_2;
    
                curAfAddr += sizeof(MSP_H3aAfOutVfDisableOverlay);
    
            }
        }
    
    /*   for(i=0;i<9;i++){
          avgAfVal[i] = (float)accAfVal[i]/(af_pax_vt_cnt*af_pax_hz_cnt);
          //if((i==4)||(i==5)) // 4 & 5 indices for green value in RGB space
          //    OSA_printf("accAfVal[%d]: %d \t avgAfVal[%d]: %f \n", i, accAfVal[i], i, avgAfVal[i]);
       }*/
    
       focus_value = accAfVal[4];
    
       return focus_value;
    }
    
    /************************* FOCUS VALUE FOR TAMPER ALGORITHM ***********************/
    
    Void IssAlg_capt2AGetFocusInfo(UInt8 **pAFAddr,UInt16 *pVtPaxCnt,UInt16 *pHzPaxCnt)
    {
        *pAFAddr   = gFocusStatistics.pCurAFDataAddr;
        *pVtPaxCnt = AF_PAX_VT_CNT;
        *pHzPaxCnt = AF_PAX_HZ_CNT;
    }
    
    Void IssAlg_capt2AInitKmax(Iss_2AFocusStatistics *pStatistics)
    {
        UInt8 k;
    
        pStatistics->focusValue = pStatistics->lumValue = pStatistics->globalLumValue = 0;
    
        for (k = 0; k < NUM_MAX_FOCUS; k++)
        {
            pStatistics->maxFocusValues[k] = 0;
            pStatistics->maxLumValues[k]   = 0;
            pStatistics->locMax_x[k]       = 0;
            pStatistics->locMax_y[k]       = 0;
        }
    }
    
    Void IssAlg_capt2AShiftKmax(Iss_2AFocusStatistics *pStatistics,Int8 k)
    {
        Int8 i;
    
        for(i = (NUM_MAX_FOCUS - 2); i >= k ; i--)
        {
            pStatistics->locMax_x[i + 1]       = pStatistics->locMax_x[i];
            pStatistics->locMax_y[i + 1]       = pStatistics->locMax_y[i];
            pStatistics->maxFocusValues[i + 1] = pStatistics->maxFocusValues[i];
            pStatistics->maxLumValues[i + 1]   = pStatistics->maxLumValues[i];
        }
    }
    
    Void IssAlg_capt2AUpdateKmax(Iss_2AFocusStatistics *pStatistics,Int8 k,Iss_2AKMaxParams *kmaxp)
    {
        if(k == NUM_MAX_FOCUS)
        {
            return;
        }
    
        if(kmaxp->focusValue > pStatistics->maxFocusValues[k])
        {
            IssAlg_capt2AShiftKmax(pStatistics,k);
            pStatistics->locMax_x[k]       = kmaxp->x;
            pStatistics->locMax_y[k]       = kmaxp->y;
            pStatistics->maxFocusValues[k] = kmaxp->focusValue;
            pStatistics->maxLumValues[k]   = kmaxp->sumValue;
        }
        else
        {
            IssAlg_capt2AUpdateKmax(pStatistics,(k + 1),kmaxp);
        }
    }
    
    Int32 IssAlg_capt2AFocusReset(Iss_2AFocusStatistics *pStatistics)
    {
        MSP_H3aAfOutVfDisableOverlay *pAfPaxData;
        UInt16 i,j;
        UInt8 *curAfAddr,*afAddr;
        UInt16 af_pax_vt_cnt, af_pax_hz_cnt;
        Iss_2AKMaxParams kmaxp;
    
        IssAlg_capt2AGetFocusInfo(&afAddr,&af_pax_vt_cnt,&af_pax_hz_cnt);
    
        IssAlg_capt2AInitKmax(pStatistics);
    
        curAfAddr = afAddr + sizeof(MSP_H3aAfOutVfDisableOverlay);
    
        for(i = 0;i < af_pax_vt_cnt; i++)
        {
            pStatistics->offsetRowAfPaxData[i] = (curAfAddr - afAddr);
    
            for(j = 0;j < (af_pax_hz_cnt - 2); j++)
            {
                pAfPaxData       = (MSP_H3aAfOutVfDisableOverlay *)curAfAddr;
                kmaxp.focusValue = (pAfPaxData->hfv1_1 << 16)/pAfPaxData->hfvSum_1;
                kmaxp.sumValue   = pAfPaxData->hfvSum_1;
                kmaxp.x          = j;
                kmaxp.y          = i;
    
                IssAlg_capt2AUpdateKmax(pStatistics,0,&kmaxp);
    
                pStatistics->globalLumValue += pAfPaxData->hfvSum_1;
    
                curAfAddr += sizeof(MSP_H3aAfOutVfDisableOverlay);
            }
    
            curAfAddr += sizeof(MSP_H3aAfOutVfDisableOverlay);
            curAfAddr += sizeof(MSP_H3aAfOutVfDisableOverlay);
        }
    
        pStatistics->focusValue = 0;
        pStatistics->lumValue   = 0;
    
        for (i = 0;i < NUM_MAX_FOCUS;i++)
        {
            pStatistics->focusValue += pStatistics->maxFocusValues[i];
            pStatistics->lumValue   += pStatistics->maxLumValues[i];
        }
    
        pStatistics->focusValue /= NUM_MAX_FOCUS;
        pStatistics->lumValue /= NUM_MAX_FOCUS;
    
        pStatistics->globalLumValue /= (af_pax_vt_cnt)*(af_pax_hz_cnt - 2);
    
        return FVID2_SOK;
    }
    
    Int32 IssAlg_capt2AFocus(Iss_2AFocusStatistics *pStatistics,UInt32 *pFocusValue)
    {
        MSP_H3aAfOutVfDisableOverlay *pAfPaxData;
        UInt16 i;
        UInt8 *afAddr;
        UInt16 af_pax_vt_cnt, af_pax_hz_cnt;
    
        IssAlg_capt2AGetFocusInfo(&afAddr,&af_pax_hz_cnt,&af_pax_vt_cnt);
    
        /* Find average of target locations' focus value */
        *pFocusValue = 0;
    
        for(i = 0;i < NUM_MAX_FOCUS;i++)
        {
            pAfPaxData= (MSP_H3aAfOutVfDisableOverlay*)(afAddr + pStatistics->offsetRowAfPaxData[pStatistics->locMax_y[i]] + pStatistics->locMax_x[i] * sizeof(MSP_H3aAfOutVfDisableOverlay));
            *pFocusValue += (pAfPaxData->hfv1_1 << 16)/pAfPaxData->hfvSum_1;
        }
    
        *pFocusValue /= NUM_MAX_FOCUS;
    
        return FVID2_SOK;
    }
    
    
    /* Focus value calculation for VA defocus algorithm */
    Int32 IssAlg_capt2AGetFocus(Ptr pCmdArgs)
    {
        UInt32 focusValue;
        Iss_CaptFocusValue *pFocusValue = (Iss_CaptFocusValue*)pCmdArgs;
    
        if((pFocusValue->resetFlag == 1) || (gFocusStatistics.firstTime == 1))
        {
            /* AF Reset */
            IssAlg_capt2AFocusReset(&gFocusStatistics);
    
            gFocusStatistics.firstTime = 0;
        }
    
        IssAlg_capt2AFocus(&gFocusStatistics,&focusValue);
    
        pFocusValue->focusValue = focusValue;
    
        return FVID2_SOK;
    }
    

    regards,

    Anand

  • Dear Anand,

    Thanks a lot for the fix. The image looks  better now. I will  keep it for testing over this weekend.

    Best Regards

    JK

  • Hi Anand

    We  have  tested  the  video  quality  at  outdoor  settings(With sunlight). It looks  very  bad. See  the  attached  image .

    Can  you  pls look  into this  issue ?

    Best regards

    JK

  • Attached two more images. One is image scenery taken by  phone  and  other one  is  from ipcam (TI2A)  snapshot of the same  scene. The green plants are  completely  changed  in  color.

  • Hi,

    Your image is over exposed.

    Reduce the value of 'gTi2aControlParams.minExposure' for your sensor in the ;..\ti_tools\iss_03_80_00_00\packages\ti\psp\iss\drivers\alg\2A\src\issdrv_algTIaewb.c' file.

    You can make it as low as 200 usec.

    regards,

    Anand

  • Hi Anand,

    After making  'gTi2aControlParams.minExposure = 200;  the  over exposure  issue is  improved. But the  green plants  are still  purple. see  the image  below.

    Is there  any other  parameter  to tune ?

    Best  Regards

    JK

  • Hi Anand ,

    The  greenish plant is OK  at  indoors. Pls  see the  snapshot  below.

    Best Regards

    JK

  • Hi  Anand,

    Few more observations.

    1. The green tree leaves  turn  purple  when   sunlight falls  directly on it. The more the  sunlight, the more  the purple  color.

    2. The tree leaves under the  shade  are better. See the picture  below. Attached  the  original scene  for  reference.

    Best Regards

    JK

     

  • Hi,

    The Appro IMX136 sensor board has an IR cut filter. 

    Pl. check with Appro on how to use it.

    Also you can remove the filter and check the effect.

    regards,

    Anand

  • Hi  Anand,

    Appro IMX136  sensor  board  do  have IR cut filter  inside. The  default GUI  config  setting  is "Night" mode, which cannot  be  set  to Day  mode  by DM388  GUI.

    Instead , I used DM385 kernel  and file system to  change it to "Day"  mode. (Day  mode --> IR cut  filter included,  Night mode--> IR cut filter NOT included).

    Once  this  is  done, I am getting good video( snap shot attached). Appreciate your  help.

    Best Regards

    JK