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 capture using saLoopBackFbdev

Other Parts Discussed in Thread: TVP7002

I'm using ezsdk v.5.05.02.00 on the 816x EVM. I am trying to caputre component video using saLoopBackFbdev demo accoring to the explanation in the following document:

http://processors.wiki.ti.com/index.php/TI81XX_PSP_VIDEO_CAPTURE_Driver_User_Guide

To this end, I replaced the original load-hd-firmware.sh script with load-hd-v4l2-firmware.sh which inserts vpss and ti81xxfb modules in the following way:

modprobe vpss sbufaddr=0xBFB00000 mode=hdmi:1080p-60,dvo2:1080p-60,hdcomp:1080p-60 i2c_mode=0
modprobe ti81xxfb vram=0:40M,1:1M,2:1M

I have set bootargs in my boot script as follows:

setenv bootargs 'console=ttyO2,115200n8 rootwait rw mem=256M earlyprintk notifyk.vpssm3_sva=0xBF900000 vram=50M ti816xfb.vram=0:40M,1:1M,2:1M root=/dev/nfs nfsroot=10.0.24.196:/root/targetfs ip=dhcp'

The saLoopBack demo runs fine, showing the captured video on HDMI out. But, saLoopBackFbdev captured frame (saved into file captdump.yuv) is cropped and scrambled. The output log of saLoopBackFbdev follows:

Driver Name: ti81xxvin
Driver bus info: TI81xx Platform
Driver is capable of doing capture
saLoopBackFbdev:
 Mode set is 1080P60
=============================================================
Capture Format:
=============================================================
fmt.type                 = 1
fmt.width                = 1920
fmt.height               = 1080
fmt.pixelformat  = 859981650
fmt.bytesperline         = 5760
fmt.sizeimage    = 6220800
=============================================================

Fix Screen Info:
----------------
Line Length - 7680
Physical Address = 8ce00000
Buffer Length = ------------[ cut here ]------------
WARNING: at kernel/softirq.c:159 local_bh_enable+0x54/0xc4()
Modules linked in: ti81xxhdmi ti81xxvin tvp7002 ti81xxvo ti81xxfb vpss syslink ipv6 [last unloaded: pvrsrvkm]
Backtrace:
[<c004abb8>] (dump_backtrace+0x0/0x110) from [<c039d8f4>] (dump_stack+0x18/0x1c)
 r7:00000000 r6:c0075178 r5:c0467f7a r4:0000009f
[<c039d8dc>] (dump_stack+0x0/0x1c) from [<c006fbfc>] (warn_slowpath_common+0x54/0x6c)
[<c006fba8>] (warn_slowpath_common+0x0/0x6c) from [<c006fc38>] (warn_slowpath_null+0x24/0x2c)
 r9:c0518d1c r8:d088c780 r7:0000000d r6:cca89b00 r5:c04f25a8
r4:c0544080
[<c006fc14>] (warn_slowpath_null+0x0/0x2c) from [<c0075178>] (local_bh_enable+0x54/0xc4)
[<c0075124>] (local_bh_enable+0x0/0xc4) from [<c0069af4>] (omap_mbox_msg_send+0xcc/0xdc)
 r5:c04f25a8 r4:00000000
[<c0069a28>] (omap_mbox_msg_send+0x0/0xdc) from [<c02de844>] (notify_shm_drv_send_event+0x1c8/0x208)
 r5:00000001 r4:00000000
[<c02de67c>] (notify_shm_drv_send_event+0x0/0x208) from [<c02dbfd4>] (notify_send_event+0x114/0x26c)
[<c02dbec0>] (notify_send_event+0x0/0x26c) from [<bf192a08>] (vps_fvid2_queue+0xe4/0x21c [vpss])
[<bf192924>] (vps_fvid2_queue+0x0/0x21c [vpss]) from [<bf19bcfc>] (capture_queue+0x50/0x64 [vpss])
 r8:bf1d4414 r7:60000013 r6:c7926280 r5:00000000 r4:ccb5a400
[<bf19bcac>] (capture_queue+0x0/0x64 [vpss]) from [<bf1d31d4>] (ti81xxvin_buffer_queue+0x9c/0xe8 [ti81xxvin])
 r5:cb7b2800 r4:ccb5a400
[<bf1d3138>] (ti81xxvin_buffer_queue+0x0/0xe8 [ti81xxvin]) from [<c02b57d4>] (videobuf_streamon+0x80/0xd0)
 r7:60000013 r6:cb7b29c4 r5:cb7b2904 r4:c7926280
[<c02b5754>] (videobuf_streamon+0x0/0xd0) from [<bf1d2c4c>] (vidioc_streamon+0x244/0x400 [ti81xxvin])
 r7:cb7aa400 r6:00000001 r5:cb7b2800 r4:cb7b2904
[<bf1d2a08>] (vidioc_streamon+0x0/0x400 [ti81xxvin]) from [<c02ab0dc>] (__video_do_ioctl+0x1618/0x3f34)
 r6:40045612 r5:00000000 r4:00000001
[<c02a9ac4>] (__video_do_ioctl+0x0/0x3f34) from [<c02a98b4>] (__video_usercopy+0x2e4/0x428)
[<c02a95d0>] (__video_usercopy+0x0/0x428) from [<c02a9a28>] (video_ioctl2+0x30/0x38)
[<c02a99f8>] (video_ioctl2+0x0/0x38) from [<c02a8a68>] (v4l2_ioctl+0xe8/0x11c)
 r5:cb7aa400 r4:c7926c80
[<c02a8980>] (v4l2_ioctl+0x0/0x11c) from [<c00d521c>] (vfs_ioctl+0x28/0x44)
 r9:c79c2000 r8:bebc5ca4 r7:00000004 r6:00000004 r5:c7926c80
r4:00000000
[<c00d51f4>] (vfs_ioctl+0x0/0x44) from [<c00d592c>] (do_vfs_ioctl+0x500/0x540)
[<c00d542c>] (do_vfs_ioctl+0x0/0x540) from [<c00d59c4>] (sys_ioctl+0x58/0x7c)
[<c00d596c>] (sys_ioctl+0x0/0x7c) from [<c0046e00>] (ret_fast_syscall+0x0/0x30)
 r8:c0046fa8 r7:00000036 r6:00000001 r5:00000004 r4:00012168
---[ end trace f46703be81464c42 ]---
41943040

Var Screen Info:
----------------
Xres - 1920
Yres - 1080
Xres Virtual - 1920
Yres Virtual - 3240
nonstd       - 0
Bits Per Pixel - 32
blue lenth 8 msb 0 offset 0
red lenth 8 msb 0 offset 16
green lenth 8 msb 0 offset 8
trans lenth 8 msb 0 offset 24

Var Screen Info:
----------------
Xres - 1920
Yres - 1080
Xres Virtual - 1920
Yres Virtual - 4320
nonstd       - 0
Bits Per Pixel - 24
blue lenth 8 msb 0 offset 0
red lenth 8 msb 0 offset 16
green lenth 8 msb 0 offset 8
trans lenth 0 msb 0 offset 0

Fix Screen Info:
----------------
Line Length - 5760
Physical Address = 8ce00000
Buffer Length = 41943040
C: 0
 TS: 51265 index 0
Result Time:    9 77297
Calculated Frame Rate:  55 Fps

I also tried to use sbufaddr=0xA0200000 and notifyk.vpssm3_sva=0xA0000000 as given in the following document:

http://processors.wiki.ti.com/index.php/DM816X_AM389X_VPSS_Video_Driver_User_Guide_PSP_04.00.01.14

But the VPSS module cannot be loaded using these paramters when runnign load-hd-v4l2-firmware.sh script. Plese let me know if I need to make any other changes to allow saLoopBack demo to capture the frame in correct format.

Thanks,
Mohammad

  • Hello,

    Mohammad Kiaei said:
    I also tried to use sbufaddr=0xA0200000 and notifyk.vpssm3_sva=0xA0000000 as given in the following document:

    Do not use 0xA0000000.

    Follow this user guide for v4l2 examples:

    http://processors.wiki.ti.com/index.php/TI81XX_PSP_VIDEO_CAPTURE_Driver_User_Guide

    Mohammad Kiaei said:
    Plese let me know if I need to make any other changes to allow saLoopBack demo to capture the frame in correct format.

    Mohammad Kiaei said:
    The saLoopBack demo runs fine, showing the captured video on HDMI out. But, saLoopBackFbdev captured frame (saved into file captdump.yuv) is cropped and scrambled.

    Which demo doesn't work?

    saLoopBack

    This application demonstrates simple loop back from capture to display. Application takes input through TVP7002 decoder on VPSS VIP port. Capture buffers are displayed using V4L2 display driver. Sample application uses user pointer buffer mechanism for both capture and display driver. User pointer buffers are taken from FBDEV driver. V4L2 capture driver outputs YUV422 (y and cbcr interleaved) data to memory and display driver displays the same format from memory. Capture driver detects the incoming resolution, configures capture and display driver for same resolution. For e.g. For 1080P60 input resolution, Application sets the buffer size to 1920*1080*2 for both display and capture. Application changes the display resolution to 1080P60 on display using the sysfs entry.

    saLoopBackFbdev

    This application demonstrates simple loop back from capture to fbdev display driver. Application takes input through TVP7002 decoder on VPSS VIP port. Captured buffers are displayed using FBDEV driver. Sample application uses user pointer buffer mechanism for capture driver, and mmapped buffers for fbdev. FBDEV buffers are used as userpointer buffer for V4L2 capture. Capture driver takes YUV422 as input, converts it to RGB888 using color space converter of VIP port. Capture driver detects incoming resolution and configures capture and display driver for same resolution. For e.g. for 720P60 input resolution, Application sets the buffer size to 1280*720*3 for capture, and set the fbdev driver for RGB888 display. Application changes the display resolution to 720P60 using the sysfs entry.

    Best Regards,

    Margarita

  • Hello Margarita,

    Thanks for your response. My input is a 1080p-60 component video in YUV format. Both demos (saLoopBack, saLoopBackFbdev) recognize the input video and display it properly on the HDMI out of the EVM. The size of saLoopBackFbdev's captured frame (captdump.yuv file) is correct (1920 * 1080 * 3). But, when I try to display the captured frame, the color space is scrambled.

    Thanks,
    Mohammad

  • Hello Mohammad,

    Could you attach the captdump.yuv file?

    Best Regards,

    Margarita

  • Hi Margarita,

    Please find the captured frame in the attachment.

    Thank you very much,
    Mohammad

    0268.captdump-0419.123