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.

Linux/AM5728: Video capture issue

Part Number: AM5728


Tool/software: Linux

Hi all,

I use the yavta -c1 -fYUYV -Fvout_800x600_yuyv.yuv -s800x600 /dev/video1 command to capture a video in our custom board.But sometimes it will show the following info and the video cannot be captured.

  

After rebooting the kernel,the capture go back to normal and it always happened at the first time to capture.

What does that info means?and how can I solve this problem?

  • The software team have been notified. They will respond here.
  • Hello,

    Please check this user guide:
    processors.wiki.ti.com/.../Linux_Core_VIP_User's_Guide
    debugging chapter. You could check debugging logs in both cases working and not working.

    Hope this helps.

    BR
    Margarita
  • Hi Margarita Gashova,
    I found that when capture is failed the device is recognized as "vpe" and recognized as "vip" when capture is okay. Do u have some insight on this?
  • sorry i click the resolve button by mistake
  • Hello,

    I saw this. Let me check with the video expert.

    BR
    Margarita
  • Hello,

    Meanwhile,
    you could check this print:
    fprintf(stderr, "Device `%s' on `%s' is a video %s (%s mplanes) device.\n",
    cap.card, cap.bus_info,
    video_is_capture(dev) ? "capture" : "output",
    video_is_mplane(dev) ? "with" : "without");

    It seems like /dev/video1 is sometimes detected as note for vpe instead of vip for some reasons.
    Vpe note is /dev/video0.

    BR
    Margarita
  • Hello,
    I've checked this print,but I still didn't find the reason why video1 is detected as vpe.
    FYI,our custom have two camera (video1 and video2),sometimes video2 has the same problem,is something wrong in our camera driver which i wrote based on the mt9t111(gp evm cam module).
    BR
    Boycchi
  • Hello,
    I've checked this print,but I still didn't find the reason why video1 is detected as vpe.
    FYI,our custom have two camera (video1 and video2),sometimes video2 has the same problem,is something wrong in our camera driver which i wrote based on the mt9t111(gp evm cam module).
    BR
    Boycchi
  • Hi Boycchi,

    Video node assignment is based on probe order. Probe order can vary slightly from boot to boot causing different nodes to get different number with each boot. There's few exception where v4l2 device for capture WB will start from video 10 and up.

    You can use below instructions to check which node id the specific v4l2 device got assigned to. 

    #v4l2-ctl --list-devices

    The other option is to look and or open the video node from this /dev/v4l/by-path/ :

     

    ls -al /dev/v4l/by-path/

    drwxr-xr-x    2 root     root           100 Aug  1 20:16 .

    drwxr-xr-x    3 root     root            60 Aug  1 20:16 ..

    lrwxrwxrwx    1 root     root            12 Aug  1 20:16 platform-48990000.vip-video-index0 -> ../../video1

    lrwxrwxrwx    1 root     root            12 Aug  1 20:16 platform-489d0000.vpe-video-index0 -> ../../video0

    lrwxrwxrwx    1 root     root            13 Aug  1 20:16 platform-omapdrm.0-video-index0 -> ../../video10

     

    So with yavta you could specify for example:

     

    # yavta -c100 -s800x480 -fuyvy -F/dev/null /dev/v4l/by-path/platform-48990000.vip-video-index0

  • Hi manisha,
    I've checked the video node using "ls -al /dev/v4l/by-path/" when the issue occurs, and my "vip" device got assigned to other node like video11,other v4l2 device have got assigned to my "vip" node,it's confused. I've tried specify the video node from /dev/v4l/by-path/ and it didn't solve my problem.

    Do u know how to fix this confused problem?
    BR

  • Hi manisha,
    Sorry,the "vip"device didn't assigned to video 11 but video0,and our board have two vip which video node from /dev/v4l/by-path/ is assigned to video1?As showing below,only video2 is assigned to platform-48990000.vip-video-index0,what about video1?

    root@am57xx-evm:~# v4l2-ctl --list-devices
    wbcap (platform:omapwb-cap):
    /dev/video11

    omapwb-m2m (platform:omapwb-m2m):
    /dev/video10

    vip (platform:vip):
    /dev/video1
    /dev/video2

    vpe (platform:vpe):
    /dev/video0

    root@am57xx-evm:~# ls -al /dev/v4l/by-path/
    drwxr-xr-x 2 root root 100 Nov 20 02:54 .
    drwxr-xr-x 3 root root 60 Nov 20 02:54 ..
    lrwxrwxrwx 1 root root 12 Nov 20 02:54 platform-48990000.vip-video-index0 -> ../../video2
    lrwxrwxrwx 1 root root 12 Nov 20 02:54 platform-489d0000.vpe-video-index0 -> ../../video0
    lrwxrwxrwx 1 root root 13 Nov 20 02:54 platform-omapdrm.0-video-index0 -> ../../video10
    root@am57xx-evm:~# yavta -c1 -s800x480 -fuyvy -F/dev/null /dev/v4l/by-path/platform-48990000.vip-video-index0
    Device /dev/v4l/by-path/platform-48990000.vip-video-index0 opened.
    Device `vip' on `platform:vip' is a video output (without mplanes) device.
    Video format set: UYVY (59565955) 800x480 (stride 1600) field none buffer size 768000
    Video format: UYVY (59565955) 800x480 (stride 1600) field none buffer size 768000
    8 buffers requested.
    length: 768000 offset: 0 timestamp type/source: [ 536.125070] success
    mono/EoF
    Buffer 0/0 mapped at address 0xb6cff000.
    length: 768000 offset: 770048 timestamp type/source: mono/EoF
    Buffer 1/0 mapped at address 0xb6c43000.
    length: 768000 offset: 1540096 timestamp type/source: mono/EoF
    Buffer 2/0 mapped at address 0xb6b87000.
    length: 768000 offset: 2310144 timestamp type/source: mono/EoF
    Buffer 3/0 mapped at address 0xb6acb000.
    length: 768000 offset: 3080192 timestamp type/source: mono/EoF
    Buffer 4/0 mapped at address 0xb6a0f000.
    length: 768000 offset: 3850240 timestamp type/source: mono/EoF
    Buffer 5/0 mapped at address 0xb6953000.
    length: 768000 offset: 4620288 timestamp type/source: mono/EoF
    Buffer 6/0 mapped at address 0xb6897000.
    length: 768000 offset: 5390336 timestamp type/source: mono/EoF
    Buffer 7/0 mapped at address 0xb67db000.
  • I am not sure why video1 doesn't get shown by /dev/v4l/by-path. If your objective is to have the static name for devices to simplify your application, there may  be other approaches. You can check this page -

  • I also tried the ls -al /dev/v4l/by-path/ in GP evm board,it didn't show the video11,is video11 supposed to be shown by /dev/v4l/by-path.
  • Node from omapdrm is special case and the second node from it (video11) will not show up in /dev/v4l/by-path
  • Is my node from vip same case as omapdrm?And they are both vip2(vin3a and vin4a).
  • Hi Boychhi,

    Fixing the /dev/v4l/by-path issue does not resolves the problem as it would end-up with something like this:

    root@am57xx-evm:~# ls -al /dev/v4l/by-path/

    drwxr-xr-x 2 root root 100 Nov 20 02:54 .

    drwxr-xr-x 3 root root 60 Nov 20 02:54 ..

    lrwxrwxrwx 1 root root 12 Nov 20 02:54 platform-48990000.vip-video-index0 -> ../../video1

    lrwxrwxrwx 1 root root 12 Nov 20 02:54 platform-48990000.vip-video-index1 -> ../../video2

    lrwxrwxrwx 1 root root 12 Nov 20 02:54 platform-489d0000.vpe-video-index0 -> ../../video0

    lrwxrwxrwx 1 root root 13 Nov 20 02:54 platform-omapdrm.0-video-index0 -> ../../video10

    This index0 and index1 link order to video0 and video1  can change between reboot. So you still cannot positively identify a specific camera.

    We have enhanced the devices CAPS (VIDIOC_QUERYCAP)  for finding the needed information. bus_info property is enhanced to provide  little more meaningful information.

    So currently if you invoke:

    # v4l2-dbg --info -d /dev/video1

    Driver info:

                   Driver name   : vip

                   Card type     : vip

                   Bus info      : platform:vip

                   Driver version: 4.9.68

                   Capabilities  : 0x85200001

                                   Video Capture

                                   Read/Write

                                   Streaming

                                   Extended Pix Format

                                   Device Capabilities

    With attached patch implementing the CAPS modifications, the Bus  info  information can be used to  find the specific camera.

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/0001_2D00_media_2D00_ti_2D00_vpe_2D00_vip_2D00_Set_2D00_bus_5F00_info_2D00_ins_2D00_CAPS_2D00_to_2D00_show_2D00_actua.patch

    # v4l2-dbg --info -d /dev/video1

    Driver info:

                   Driver name   : vip

                   Card type     : vip

                   Bus info      : platform:vip2:vin3a

                   Driver version: 4.9.68

                   Capabilities  : 0x85200001

                                   Video Capture

                                   Read/Write

                                   Streaming

                                   Extended Pix Format

                                   Device Capabilities

    The drawback is that you would have to scan all videos nodes to gather the relevant ones but at least you can get to the detail information you would need to identify specific cameras.

  • Hi manisha,
    Thanks for the patch and could u tell me how to fix the /dev/v4l/by-path issue even if it has some problem.
    BR
    Boycchi
  • It can't be fixed. It suffers from the same problem that indexX assignment is dependent upon boot order which isn't predetermined.
  • I know that but i still want to know the way to show the indexX assignment
  • We don't have the patch for it at this moment.