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.

v4l2 example

Hello

I found some example for DM355 in "DVSDK_1_30_00_40/PSP_01_20_00_014/examples". I compiled it and run in DM355 EVM board. "fbdev" example is running correctly, but while running "v4l2" and "ipipe" I got an error like this (both examples stuck at same error). How to recover from this problem.

root@192.168.1.10:/opt/dvsdk/dm355/examples/v4l2# ./v4l2_loop&                
[1] 1078                                                                      
root@192.168.1.10:/opt/dvsdk/dm355/examples/v4l2#                             
root@192.168.1.10:/opt/dvsdk/dm355/examples/v4l2# DavinciDisplay DavinciDisplay
1: Display Manager failed to allocate layer                                   
DavinciDisplay DavinciDisplay.1: Unable to configure video layer for id = 1   
Open Device: Error in opening the video devices
root@192.168.1.10:/opt/dvsdk/dm355/examples/v4l2

root@192.168.1.10:/opt/dvsdk/dm355/examples/dm355/ipipe# ./ipipe_rsz_example  
h_scale=1, v_scale=1                                                          
initializing capture device                                                   
                                                                              
Open Done                                                                     
                                                                              
QUERYCAP Done                                                                 
setting data format                                                           
SetDataFormat:setting std to 12288                                            
                                                                              
S_STD Done                                                                    
                                                                              
GetSTD Done WITH std = 12288                                                  
SetDataFormat:requestiDavinciDisplay DavinciDisplay.1: Display Manager failed t
 allocate layer                                                               
ng width:704 heiDavinciDisplay DavinciDisplay.1: Unable to configure video laye
 for id = 0                                                                   
ght:480                                                                       
                                                                              
S_FMT Done                                                                    
initializing capture buffers                                                  
                                                                              
REQBUF Done                                                                   
                                                                              
QUERYBUF Done                                                                 
                                                                              
QUERYBUF Done                                                                 
                                                                              
QUERYBUF Done                                                                 
initialize Ipipeinitializing display device                                   
starting streaming                                                            
Queing buffer:0                                                               
                                                                              
Q_BUF Done                                                                    
Queing buffer:1                                                               
                                                                              
Q_BUF Done                                                                    
Queing buffer:2                                                               
                                                                              
Q_BUF Done                                                                    
                                                                              
STREAMON Done                                                                 
                                                                              
root@192.168.1.10:/opt/dvsdk/dm355/examples/dm355/ipipe#    

  • Hi Bala, any luck with your ipipe? I have segmentation fault for the ipipe demo.

  • Hi,

    Still I am getting same error only. But v4l2 example is running properly. I gave this bootargs.

    setenv bootargs console=ttyS0,115200n8 noinitrd rw ip=192.168.1.10 root=/dev/nfs nfsroot=$(nfshost):$(rootpath),nolock mem=116M davinci_capture.device_type=1

    What about your ipipe. Anybody help for us.

    Regards

    Bala

  • Hello there,

    I have exactly the same problems? Did you solve it already? It would be nice if you can post me a solution.

    Martin

  • Howdy,

    I managed to get ipipe_rsz_example to run by setting video=davincifb:vid0=off:vid1=off in the bootargs.  No segmentation fault.  BUT, there is no video!   The screen is blank.  The process is using about 20% of the cpu, so it is not hanging, but something is still screwey.

    Bala, you say you got the v4l2 example running.  Do you mean the v4l2_loop example found in this directory?

    /home/user/dvsdk_1_30_00_40/PSP_01_20_00_014/examples/v4l2

    Even with vid0,1=off in the bootargs, I still get a segmentation fault from this demo.
    We don't seem to be getting much help from TI on this, so if we all post clues we find maybe we can work through this.
    Anyone have anything to add?
    Cheers!

  • For v4l2 example you have to set bootargs. Plz refer section-4.2 in "LSP 1.20 DaVinci Linux V4L2 Display Driver" User's Guide (SPRUEL3).

    Bala...

  • Hi,

     

    I have DM6446 EVM and when I tried to run "fbdev_loop"  example I get the following error:

    root@192.168.184.70:/opt/dvsdk/fbdev_loop# ./fbdev_loop -v 0 -c 200&
    [1] 1056
    root@192.168.184.70:/opt/dvsdk/fbdev_loop# getopt returns 118
    vidid is 0
    opening VID0
    getopt returns 99
    getopt returns -1
    mode:NTSC       output:COMPOSITE
    mode is NTSC
    Setting NTSC DISPLAY
    initializing capture device
    Default crop capbility bounds - 0 0 720 576 ; default - 0 0 720 576
    setting data format
    SetDataFormat:setting std to auto select
    SetDataFormat:ioctl:VIDIOC_QUERYSTD:
    SetDataFormat:setting data format
    SetDataFormat:finally negotiated width:720 height:480
    initializing capture buffers
    initializing display device
    Initializing VID0

    Failed to Initialize VID0:
    : Invalid argument
    Failed FBIOPUT_VSCREENINFOinit_and_mmap Failed

     

    When I tried the "v4l2_loop" exapmle I got the following:

    root@192.168.184.70:/opt/dvsdk/v4l2_example# ./v4l2_loop
     xres = 0 , yres = 0 Current input: COMPOSITE
    Init Capture_VIDIOC_QUERYSTD:
    Init: Error in Initializing the Format for Capture

     

    How can I run these examples??

     

    (My bootarg is:

    mem=120 console=ttyS0,115200n8 root=/dev/nfs nfsroot=192.168.184.70:/home/user/workdir/filesys rw noinitrd ip=dhcp davinci_capture.device_type=0)

     

  • try adding the following to your bootargs

    video=davincifb:vid0=720x576x16,2500K:vid1=720x576x16,2500K:osd0=720x576x16,2025K

    also, if you could post your boot log, we can verify there are not any errors posted duing initialization of the video drivers

  • I tried  "fbdev_loop"  example with the following bootargs, no video is displayed on the screen and execution stops after writing the debug messages of

    "VID0 Display buffer 1 mapped to address 0x40499800
    VID0 Display buffer 2 mapped to address 0x40564000"

    BOOTARGS:

    bootargs=video=davincifb:vid0=720x576x16,2500K:vid1=720x576x16,2500K:osd0=720x576x16,2025K davinci_enc_mngr.ch0_output=COMPOSITE davinci_enc_mngr.ch0_mode=pal console=ttyS0,115200n8 noinitrd rw ip=dhcp root/dev/nfs nfsroot=192.168.171.89:/home/ferhat_olgun/workdir/filesys,nolcok mem=120M

    BOOTLOG:

    U-Boot 1.1.3 (Dec  4 2006 - 12:05:38)

    U-Boot code: 81080000 -> 81097628  BSS: -> 810A0018
    RAM Configuration:
    Bank #0: 80000000 256 MB
    Flash: 16 MB
    In:    serial
    Out:   serial
    Err:   serial
    ARM Clock :- 297MHz
    DDR Clock :- 162MHz
    Hit any key to stop autoboot:  0
    BOOTP broadcast 1
    DHCP client bound to address 192.168.184.70
    TFTP from server 192.168.170.238; our IP address is 192.168.184.70
    Filename 'uImage'.
    Load address: 0x80700000
    Loading: #################################################################
             #################################################################
             ################################################T #################
             #################################################T ################
             #########################################
    done
    Bytes transferred = 1538568 (177a08 hex)
    ## Booting image at 80700000 ...
       Image Name:   Linux-2.6.10_mvl401
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    1538504 Bytes =  1.5 MB
       Load Address: 80008000
       Entry Point:  80008000
       Verifying Checksum ... OK
    OK

    Starting kernel ...

    Uncompressing Linu...................................................................................................... doLinux version 2.6.10_mvl401 (root@localhost.localdomain) (gcc version 3.4.3 (MontaVista 3.4.3-25.0.104.0600975 2006-07-06)) #2 Wed Jun 17 09:46:47 EEST 2009
    CPU: ARM926EJ-Sid(wb) [41069265] revision 5 (ARMv5TEJ)
    CPU0: D VIVT write-back cache
    CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
    CPU0: D cache: 8192 bytes, associativity 4, 32 byte lines, 64 sets
    Machine: DaVinci EVM
    Memory policy: ECC disabled, Data cache writeback
    DM6443
    Built 1 zonelists
    Kernel command line: video=davincifb:vid0=720x576x16,2500K:vid1=720x576x16,2500K:osd0=720x576x16,2025K davinci_enc_mngr.ch0_output=COMPOSITE davinci_enc_mngr.ch0_mode=pal console=ttyS0,115200n8 noinitrd rw ip=dhcp root/dev/nfs nfsroot=192.168.171.89:/home/ferhat_olgun/workdir/filesys,nolcok mem=120M
    PID hash table entries: 512 (order: 9, 8192 bytes)
    Console: colour dummy device 80x30
    Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
    Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
    Memory: 120MB = 120MB total
    Memory: 118272KB available (2656K code, 529K data, 180K init)
    Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
    CPU: Testing write buffer coherency: ok
    spawn_desched_task(00000000)
    desched cpu_callback 3/00000000
    ksoftirqd started up.
    desched cpu_callback 2/00000000
    desched thread 0 started up.
    NET: Registered protocol family 16
    DaVinci: 71 gpio irqs
    Registering platform device 'serial8250.0'. Parent at platform
    Registering platform device 'musb_hdrc'. Parent at platform
    Registering platform device 'mmc.0'. Parent at platform
    DaVinci I2C DEBUG: 10:01:56 Jun 16 2009
    Registering platform device 'i2c'. Parent at platform
    ch0 default output "COMPOSITE", mode "PAL"
    MUX: initialized LOEEN
    MUX: initialized LFLDEN
    VPBE Encoder Initialized
    LogicPD encoder initialized
    SCSI subsystem initialized
    usbcore: registered new driver usbfs
    usbcore: registered new driver hub
    musb_hdrc: version 2.2a/db-0.4.8 [cppi-dma] [host] [debug=0]
    musb_hdrc: ConfigData=0x06 (UTMI-8, dyn FIFOs, SoftConn)
    musb_hdrc: MHDRC RTL version 1.300
    musb_hdrc: USB Host mode controller at c8002000 using DMA, IRQ 12
    musb_hdrc musb_hdrc: new USB bus registered, assigned bus number 1
    hub 1-0:1.0: USB hub found
    hub 1-0:1.0: 1 port detected
    MUX: initialized MCBSP0
    JFFS2 version 2.2. (NAND) (C) 2001-2003 Red Hat, Inc.
    yaffs Jun 16 2009 10:00:34 Installing.
    Registering platform device 'davincifb.0'. Parent at platform
    davincifb davincifb.0: dm_osd0_fb: 720x576x16@0,0 with framebuffer size 2025KB
    davincifb davincifb.0: dm_vid0_fb: 720x576x16@0,0 with framebuffer size 2500KB
    davincifb davincifb.0: dm_osd1_fb: 720x576x4@0,0 with framebuffer size 810KB
    davincifb davincifb.0: dm_vid1_fb: 720x576x16@0,0 with framebuffer size 2500KB
    watchdog: TI DaVinci Watchdog Timer: timer margin 64 sec
    Registering platform device 'davinci_resizer.2'. Parent at platform
    Registering platform device 'davinci_previewer.2'. Parent at platform
    Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing disabled
    Registering platform device 'serial8250'. Parent at platform
    ttyS0 at MMIO 0x1c20000 (irq = 40) is a 16550A
    io scheduler noop registered
    io scheduler anticipatory registered
    RAMDISK driver initialized: 1 RAM disks of 32768K size 1024 blocksize
    loop: loaded (max 8 devices)
    Registering platform device 'ti_davinci_emac'. Parent at platform
    TI DaVinci EMAC: MAC address is 00:0e:99:02:5a:92
    TI DaVinci EMAC Linux version updated 5.0
    TI DaVinci EMAC: Installed 1 instances.
    netconsole: not configured, aborting
    i2c /dev entries driver
    Linux video capture interface: v1.00
    Registering platform device 'vpfe.1'. Parent at platform
    DaVinci I2C WARNING: i2c: NACK detected
    DaVinci I2C WARNING: i2c: NACK detected
    DaVinci I2C WARNING: i2c: NACK detected
    DaVinci I2C WARNING: i2c: NACK detected
    DaVinci I2C WARNING: i2c: NACK detected
    vpfe vpfe.1: DaVinci v4l2 capture driver V1.0 loaded
    Registering platform device 'DavinciDisplay.1'. Parent at platform
    Trying to register davinci display video device.
    layer=c77f0c00,layer->video_dev=c77f0d64
    Trying to register davinci display video device.
    layer=c77f0a00,layer->video_dev=c77f0b64
    davinci_init:DaVinci V4L2 Display Driver V1.0 loaded

     Davici AEW Driver cannot be loaded
     VIDEO PORT is not enabledData Flow path from CCDC is disabled

     Davinci AF driver cannot be loaded
     VIDEO PORT is not enabled
     CCDC needs to be configured<6>Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
    ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
    MUX: initialized HDIREN
    MUX: initialized ATAEN
    hda: TOSHIBA MK4032GAX, ATA DISK drive
    elevator: using anticipatory as default io scheduler
    ide0 at 0xe10661f0-0xe10661f7,0xe10663f6 on irq 22
    hda: max request size: 1024KiB
    hda: 78140160 sectors (40007 MB), CHS=16383/255/63
     hda: hda1 hda2
        ide0: BM-DMA at 0xe1066000-0xe1066007, BIOS settings: hda:pio, hdb:pio
    Initializing USB Mass Storage driver...
    usbcore: registered new driver usb-storage
    USB Mass Storage support registered.
    usbcore: registered new driver usbhid
    drivers/usb/input/hid-core.c: v2.0:USB HID core driver
    mice: PS/2 mouse device common for all mice
    mmc mmc.0: Supporting 4-bit mode
    mmc mmc.0: Using DMA mode
    Registering platform device 'davinci-audio.0'. Parent at platform
    NET: Registered protocol family 2
    IP: routing cache hash table of 512 buckets, 4Kbytes
    TCP: Hash tables configured (established 8192 bind 16384)
    NET: Registered protocol family 1
    NET: Registered protocol family 10
    IPv6 over IPv4 tunneling driver
    NET: Registered protocol family 17
    Sending DHCP requests ., OK
    IP-Config: Got DHCP answer from 0.0.0.0, my address is 192.168.184.70
    IP-Config: Complete:
          device=eth0, addr=192.168.184.70, mask=255.255.192.0, gw=192.168.128.200,
         host=192.168.184.70, domain=karelarge.com, nis-domain=(none),
         bootserver=0.0.0.0, rootserver=192.168.171.89, rootpath=
    Looking up port of RPC 100003/2 on 192.168.171.89
    Looking up port of RPC 100005/1 on 192.168.171.89
    VFS: Mounted root (nfs filesystem).
    Freeing init memory: 180K
    INIT: version 2.85 booting
    Mounting a tmpfs over /dev...done.
    Creating initial device nodes...done.
    Activating swap...done.
    Remounting root filesystem...done.
    Calculating module dependencies
    Loading modules:
    Checking all file systems: fsck
    fsck 1.35 (28-Feb-2004)
    Mounting local filesystems: mount nothing was mounted
    Cleaning: /tmp /var/lock /var/run done.
    Setting up networking (ifupdown) ..
    Cleaning: /etc/network/run/ifstate done.
    Starting network interfaces: done.
    Starting hotplug subsystem:
       pci    
       pci      [success]
       usb    
       usb      [success]
       isapnp 
       isapnp   [success]
       ide    
       ide      [success]
       input  
       input    [success]
       scsi   
       scsi     [success]
    done.
    Starting portmap daemon: portmap.
    done.
    Setting pseudo-terminal access permissions...done.
    Updating /etc/motd...done.
    INIT: Entering runlevel: 3
    Starting NFS common utilities: statd lockd.
    Starting internet superserver: inetd.
    Starting MontaVista target tools daemon: mvltdmvltd version 2.1 MontaVista Software,Inc.
    mvltd[1043]: started on port 34577
    .
    MontaVista(R) Linux(R) Professional Edition 4.0.1 (0600980)

    192.168.184.70 login: root
    Last login: Sun Feb  1 01:48:33 2004 on console
    Linux 192.168.184.70 2.6.10_mvl401 #2 Wed Jun 17 09:46:47 EEST 2009 armv5tejl GNU/Linux

    Welcome to MontaVista(R) Linux(R) Professional Edition 4.0.1 (0600980).

    root@192.168.184.70:~# cd ..
    root@192.168.184.70:/# cd opt/dvsdk/fbdev_loop/
    root@192.168.184.70:/opt/dvsdk/fbdev_loop# ./fbdev_loop -v 0 -c 200&
    [1] 1055
    root@192.168.184.70:/opt/dvsdk/fbdev_loop# getopt returns 118
    vidid is 0
    opening VID0
    getopt returns 99
    getopt returns -1
    mode:PAL        output:COMPOSITE
    mode is PAL
    Setting PAL DISPLAY
    initializing capture device
    Default crop capbility bounds - 0 0 720 576 ; default - 0 0 720 576
    setting data format
    SetDataFormat:setting std to auto select
    SetDataFormat:ioctl:VIDIOC_QUERYSTD:
    SetDataFormat:setting data format
    SetDataFormat:finally negotiated width:720 height:576
    initializing capture buffers
    initializing display device
    Initializing VID0
    mmap VID0
    VID0 Display buffer 1 mapped to address 0x40499800
    VID0 Display buffer 2 mapped to address 0x40564000