• Resolved

dm816x v4l2 capture problem (gstreamer v4l2src)

I try to run the following gstreamer pipeline in EZSDK 5.05.01.04:

gst-launch v4l2src always-copy=false queue-size=12 num-buffers=2000 ! 'video/x-raw-yuv-strided,format=(fourcc)NV12,width=1920,height=1080,framerate=(fraction)60/1' ! omxbufferalloc numBuffers=12 ! omx_h264enc bitrate=5000000 ! filesink location=v4l2cap.h264

and it fails with the segmentation fault: 

root@dm816x-evm:~/dm816x-evm/usr/share/ti/ti-psp-examples# gst-launch v4l2src always-copy=false queue-size=12 num-buffers=2000 ! 'video/x-raw-yuv-strided,fo
rmat=(fourcc)NV12,width=1920,height=1080,framerate=(fraction)60/1' ! omxbufferalloc numBuffers=12 ! omx_h264enc bitrate=5000000 ! filesink location=v4l2cap.
h264
Setting pipeline to PAUSED ...

Mode set is 1080
allocating 12 buffers of size:3110400!!
allocated outbuf:0x40d3a080
allocated outbuf:0x41031680
allocated outbuf:0x41328c80
allocated outbuf:0x41620280
allocated outbuf:0x41917880
allocated outbuf:0x41c0ee80
allocated outbuf:0x41f06480
allocated outbuf:0x421fda80
allocated outbuf:0x424f5080
allocated outbuf:0x427ec680
allocated outbuf:0x42ae3c80
allocated outbuf:0x42ddb280
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Caught SIGSEGV accessing address 0x8
Spinning. Please run 'gdb gst-launch 1401' to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.

And this is dmesg output:

tvp7002 2-005d: tvp7002 found @ 0x5d (OMAP I2C adapter)
tvp7002 2-005d: Rev. 02 detected.
ti81xxvin ti81xxvin: registered sub device tvp7002
ti81xxvin ti81xxvin: TI81xx HDVPSS Capture driver initialized
HDMI W1 rev 2.0
HDMI CEC Spec version 1.2
hdmi: Enter HDMI_W1_StopVideoFrame()
found best resolution: 1680x1050 (31)
hdmi: Enter HDMI_W1_GlobalInitVars()
hdmi: Enter HDMI_Core_GlobalInitVars()
hdmi: Enter HDMI_W1_ConfigVideoResolutionTiming()
hdmi: Enter HDMI_W1_ConfigVideoInterface()
hdmi: HDMI_WP_AUDIO_CFG = 0x1030006
hdmi: HDMI_WP_AUDIO_CFG2 = 0x20c0
hdmi: HDMI_WP_AUDIO_CTRL = 0x20
hdmi: Enter DSS_HDMI_CORE_SW_RESET_ASSERT ()
hdmi: Enter DSS_HDMI_CORE_POWER_DOWN_DISABLE()
hdmi: Enter DSS_HDMI_CORE_SW_RESET_RELEASE()
hdmi: Enter HDMI_W1_StartVideoFrame ()
hdmi: Irqenable 60000011
hdmi: 40 hpd
hdmi: -------------DEBUG-------------------
hdmi: 1 hdmi_wp_irqstatus
hdmi: 1 hdmi_core_intr_state
hdmi: 60 hdmi_core_intr1
hdmi: 3 hdmi_core_intr2
hdmi: f hdmi_core_intr3
hdmi: 87 hdmi_core_sys_sys_stat
hdmi: -------------DEBUG-------------------
hdmi: first hpd
eth0: no IPv6 routers present
hdmi: Enter DSS_HDMI_CORE_SW_RESET_ASSERT ()
hdmi: Enter HDMI_W1_StopVideoFrame()
hdmi: Enter HDMI_W1_StopVideoFrame()
found best resolution: 1680x1050 (31)
hdmi: Enter HDMI_W1_GlobalInitVars()
hdmi: Enter HDMI_Core_GlobalInitVars()
hdmi: Enter HDMI_W1_ConfigVideoResolutionTiming()
hdmi: Enter HDMI_W1_ConfigVideoInterface()
hdmi: HDMI_WP_AUDIO_CFG = 0x1030006
hdmi: HDMI_WP_AUDIO_CFG2 = 0x20c0
hdmi: HDMI_WP_AUDIO_CTRL = 0x20
hdmi: Enter DSS_HDMI_CORE_SW_RESET_ASSERT ()
hdmi: Enter DSS_HDMI_CORE_POWER_DOWN_DISABLE()
hdmi: Enter DSS_HDMI_CORE_SW_RESET_RELEASE()
hdmi: Enter HDMI_W1_StartVideoFrame ()
hdmi: Irqenable 60000011
hdmi: 40 hpd
hdmi: -------------DEBUG-------------------
hdmi: 1 hdmi_wp_irqstatus
hdmi: 1 hdmi_core_intr_state
hdmi: 60 hdmi_core_intr1
hdmi: 3 hdmi_core_intr2
hdmi: f hdmi_core_intr3
hdmi: 87 hdmi_core_sys_sys_stat
hdmi: -------------DEBUG-------------------
------------[ cut here ]------------
WARNING: at kernel/softirq.c:159 local_bh_enable+0x54/0xc4()
Modules linked in: bufferclass_ti omaplfb pvrsrvkm ti81xxhdmi ti81xxvin tvp7002 ti81xxvo ti81xxfb vpss syslink ipv6
Backtrace:
[<c0049bb8>] (dump_backtrace+0x0/0x110) from [<c039bec8>] (dump_stack+0x18/0x1c)
r7:00000000 r6:c0073bd8 r5:c0465e24 r4:0000009f
[<c039beb0>] (dump_stack+0x0/0x1c) from [<c006e65c>] (warn_slowpath_common+0x54/0x6c)
[<c006e608>] (warn_slowpath_common+0x0/0x6c) from [<c006e698>] (warn_slowpath_null+0x24/0x2c)
r9:c05167f4 r8:d708c800 r7:0000000e r6:d66d5c00 r5:c04f0380
r4:c0541b40
[<c006e674>] (warn_slowpath_null+0x0/0x2c) from [<c0073bd8>] (local_bh_enable+0x54/0xc4)
[<c0073b84>] (local_bh_enable+0x0/0xc4) from [<c0068554>] (omap_mbox_msg_send+0xcc/0xdc)
r5:c04f0380 r4:00000000
[<c0068488>] (omap_mbox_msg_send+0x0/0xdc) from [<c02dd084>] (notify_shm_drv_send_event+0x1c8/0x208)
r5:00000001 r4:00000000
[<c02dcebc>] (notify_shm_drv_send_event+0x0/0x208) from [<c02da814>] (notify_send_event+0x114/0x26c)
[<c02da700>] (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:d5801180 r5:00000000 r4:d5e21800
[<bf19bcac>] (capture_queue+0x0/0x64 [vpss]) from [<bf1d31d4>] (ti81xxvin_buffer_queue+0x9c/0xe8 [ti81xxvin])
r5:d5c1e800 r4:d5e21800
[<bf1d3138>] (ti81xxvin_buffer_queue+0x0/0xe8 [ti81xxvin]) from [<c02b4014>] (videobuf_streamon+0x80/0xd0)
r7:60000013 r6:d5c1e9c4 r5:d5c1e904 r4:d5801180
[<c02b3f94>] (videobuf_streamon+0x0/0xd0) from [<bf1d2c4c>] (vidioc_streamon+0x244/0x400 [ti81xxvin])
r7:d5fc0a00 r6:00000001 r5:d5c1e800 r4:d5c1e904
[<bf1d2a08>] (vidioc_streamon+0x0/0x400 [ti81xxvin]) from [<c02a991c>] (__video_do_ioctl+0x1618/0x3f34)
r6:40045612 r5:00000000 r4:00000001
[<c02a8304>] (__video_do_ioctl+0x0/0x3f34) from [<c02a80f4>] (__video_usercopy+0x2e4/0x428)
[<c02a7e10>] (__video_usercopy+0x0/0x428) from [<c02a8268>] (video_ioctl2+0x30/0x38)
[<c02a8238>] (video_ioctl2+0x0/0x38) from [<c02a72a8>] (v4l2_ioctl+0xe8/0x11c)
r5:d5fc0a00 r4:d5c65d80
[<c02a71c0>] (v4l2_ioctl+0x0/0x11c) from [<c00d3c7c>] (vfs_ioctl+0x28/0x44)
r9:d59b2000 r8:bebcac6c r7:00000003 r6:00000003 r5:d5c65d80
r4:00000000
[<c00d3c54>] (vfs_ioctl+0x0/0x44) from [<c00d438c>] (do_vfs_ioctl+0x500/0x540)
[<c00d3e8c>] (do_vfs_ioctl+0x0/0x540) from [<c00d4424>] (sys_ioctl+0x58/0x7c)
[<c00d43cc>] (sys_ioctl+0x0/0x7c) from [<c0045e00>] (ret_fast_syscall+0x0/0x30)
r8:c0045fa8 r7:00000036 r6:00000002 r5:bebcac6c r4:0001215c
---[ end trace 81462528746bb2c8 ]---
ti81xxvin ti81xxvin: Invalid input index
ti81xxvin ti81xxvin: Invalid format index
notify_shm_drv_sendevent failed! status = 0xfffffff2
notify_send_event failed! status = 0xfffffff2
notify_shm_drv_sendevent failed! status = 0xfffffff2
notify_send_event failed! status = 0xfffffff2

The same pipeline runs fime in EZSDK 5.04.00.11:

root@dm816x-evm:~# gst-launch v4l2src always-copy=false queue-size=12 num-buffers=2000 ! 'video/x-raw-yuv-strided,format=(fourcc)NV12,width=1920,height=1080
,framerate=(fraction)60/1' ! omxbufferalloc numBuffers=12 ! omx_h264enc bitrate=5000000 ! filesink location=v4l2cap.h264
Setting pipeline to PAUSED ...

Mode set is 1080
allocating 12 buffers of size:3110400!!
allocated outbuf:0x4743e880
allocated outbuf:0x47735e80
allocated outbuf:0x47a2d480
allocated outbuf:0x47d24a80
allocated outbuf:0x4801c080
allocated outbuf:0x48313680
allocated outbuf:0x4860ac80
allocated outbuf:0x48902280
allocated outbuf:0x48bf9880
allocated outbuf:0x48ef0e80
allocated outbuf:0x491e8480
allocated outbuf:0x494dfa80
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
^CCaught interrupt -- handling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 15474964630 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

saLoopBack works fine for both versions.

Any ideas?

Alex

  • Hello,

    I will check that and I will let you know the result. Sorry for the delay.

    Best Regards

    Margarita

  • In reply to Margarita Gashova:

    I have the same problem described in this poster. 

    I am using ezsdk5_05, and gstreamer TAG_GST_DM81XX_00_06_00_00/.

    I am using dm814x, and here is my poster.

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/t/228517.aspx

    I hope TI experts can clarify this as soon as possible.

    Jun 

  • Hi,

    It seems  your bootargs are wrong. There are separate set of bootargs for EZSDK which should be mentioned in EZSDK user guide.

    Alexander Khudoshin
    notify_shm_drv_sendevent failed! status = 0xfffffff2
    notify_send_event failed! status = 0xfffffff2
    notify_shm_drv_sendevent failed! status = 0xfffffff2
    notify_send_event failed! status = 0xfffffff2

    This mostly means your bootargs are wrong specifially "notifyk.vpssm3_sva"

    Regards,

    Hardik Shah




    Please mark this post as answered via the Verify Answer button below if you think it answers your question.  Thanks!

  • In reply to HardikShah:

    Hello Hardik,

    Which particular document you are referring to as "EZSDK user guide"? I have taken them from mksdboot.sh script which came with the EZSDK.  Here they are:

    bootcmd=run nfsboot

    bootargs=console=ttyO2,115200n8 root=/dev/nfs rootfstype=nfs ip=192.168.30.103:192.168.30.245:192.168.30.245:255.255.255.0:dvevm:eth0:off nfsroot=/home/alexk/dm8168/targetfs rootdelay=2 mem=364M@0x80000000 mem=320M@0x9FC00000 vmalloc=500M notifyk.vpssm3_sva=0xBF900000 

    According to EZSDK Memory Map (http://processors.wiki.ti.com/index.php/EZSDK_Memory_Map#Linux_Notify_Module_Memory) this is the right value. And it still does not explain difference between EZSDK versions.

    Alex

  • In reply to HardikShah:

    Hi Hardik,

    Glad to see your reply again.

    In my case, if I use the ezsdk_5_05 with gstreamer tag v5, the pipeline is fine.

    howeverm ezsdk_5_05+ gstreamer tag v6, have the same error message here.

    Jun

  • In reply to Jun_Zhang:

    Hi, 

           In order to get the  TAG_GST_DM81XX_00_06_00_00/  working with V4L2 properly we had to create the following patch:

    Index: gst-openmax-dm81xx/src/omx/gstomxbufferalloc.c
    ===================================================================
    --- gst-openmax-dm81xx.orig/src/omx/gstomxbufferalloc.c 2012-11-14 16:15:41.392143697 -0600
    +++ gst-openmax-dm81xx/src/omx/gstomxbufferalloc.c 2012-11-14 16:17:40.760145714 -0600
    @@ -190,6 +190,7 @@

    gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
    gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
    + filter->out_port.portptr = gst_omxportptr_new(&filter->out_port);
    filter->silent = FALSE;
    filter->out_port.num_buffers = 10;
    filter->out_port.always_copy = FALSE;

    Also we had to apply the patches (5633.v4l2_patches) suggested in http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/p/186865/672611.aspx

    pipeline:


    PIPELINE 1: V4L2 to capture and V4L2 to display
    gst-launch v4l2src always-copy=false queue-size=12  ! 'video/x-raw-yuv-strided,format=(fourcc)NV12,width=1920,height=1080,framerate=(fraction)60/1' !  omxbufferalloc numBuffers=12 ! omx_scaler ! gstperf  ! v4l2sink sync=false

    PIPELINE 2: V4L2 to capture and omx to display
    gst-launch v4l2src always-copy=false queue-size=12  ! 'video/x-raw-yuv-strided,format=(fourcc)NV12,width=1920,height=1080,framerate=(fraction)60/1' !  omxbufferalloc numBuffers=12 ! omx_scaler ! omx_ctrl display-mode=OMX_DC_MODE_1080P_60 ! gstperf  ! omx_videosink sync=false

    Regards,

    -David

     

    _______________________________________________________
    RidgeRun - https://www.ridgerun.com/www/index.php/contact-us.html

  • In reply to David Soto - RidgeRun:

    Hello David,

    Did you test this patch with 1080i video?

    Thanks,

    Jun

  • In reply to Jun_Zhang:

    Hi Jun,

             I tested just with 1080p, if you test it with 1080i and get good results please let us know,

    Regards,

    -David

    _______________________________________________________
    RidgeRun - https://www.ridgerun.com/www/index.php/contact-us.html

  • In reply to David Soto - RidgeRun:

    Hi David,

    The patch works for 1080p60 and 720p60, but for 1080i30 I got the following errors:

    ERROR: Pipeline doesn't want to pause.
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device '/dev/video0' cannot capture at 1920x1080
    Additional debug info:
    v4l2src_calls.c(326): gst_v4l2src_set_format (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    Call to S_FMT failed for NV12 @ 1920x1080: Invalid argument

    Alex


  • In reply to Alexander Khudoshin:

    Hello,

    I'm checking this issue with 1080i. When I have results I will inform you.

    Best Regards,

    Margarita