v4l2src is not working on tx2/?

Hi,

I’d like to use v4l2src not nvcamerasrc due to image sensor.

I test v4l2src on tx2 follows command, but v4l2src is not working on tx2.

gst-launch-1.0 v4l2src device=“/dev/video0” ! “video/x-raw, width=640, height=480, format=(string)I420” ! xvimagesink -e

Plz let me know the reason?

Thanks,
Doohan93

r u using the onboard sesor?

I use nvcamerasrc for the Jetson TX2 on-board camera:

gst-launch-1.0 nvcamerasrc ! ‘video/x-raw(memory:NVMM),width=1280, height=720, framerate=30/1, format=NV12’ ! nvvidconv ! xvimagesink -e

I’ve used v4l2src for a usb camera plugged in to the Jetson USB.

I’m not 100% sure why nvcamerasrc works and v4l2src doesnt. Bayer formats perhaps?

To Andrey1984

Of course, i’m using onboard sensor, i just want to test v4l2src plugin on tx2.

Thanks,
Doohan93

To cobrien,

You means, usb camera is working on tx2 using v4l2src?

I’m using onboard sensor on tx2, it is not working.

Thanks,
Doohan93

@doohan93
Onboard camera is bayer sensor you need some plugin like bayer2rbg element and the format is bayer “bggr”
a possible command should be like below.

gst-launch-1.0 v4l2src device="/dev/video0" ! "video/x-bayer, width=640, height=480, format=(string)rggb" ! bayer2rgb ! videoconvert ! xvimagesink -e

To ShaneCCC

I used your recommend command, but i got below error log, what is problem?

Thanks,
Doohan93

→ command
gst-launch-1.0 v4l2src device=“/dev/video0” ! “video/x-bayer, width=640, height=480, format=(string)rggb” ! bayer2rgb ! videoconvert ! xvimagesink -e

→ error log
vert ! xvimagesink -e40, height=480, format=(string)rggb" ! bayer2rgb ! videocov
Setting pipeline to PAUSED …
ERROR: Pipeline doesn’t want to pause.
ERROR: from element /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0: Could nt
Additional debug info:
xvimagesink.c(1760): gst_xv_image_sink_open (): /GstPipeline:pipeline0/GstXvIma:
Could not open display (null)
Setting pipeline to NULL …
Freeing pipeline …

@doohan
Did you connect HDMI display? Try “export DISPLAY=:0” before launch gst or try replace the xvimagesink to nvoverlaysink.

TO ShaneCCC,

Thanks for you answer.

But after i apply export DISPLAY=:0 , i got error message below.

Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
Setting pipeline to PLAYING …
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data f.
Additional debug info:
gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l:
streaming task paused, reason not-negotiated (-4)
EOS on shutdown enabled – waiting for EOS after Error
Waiting for EOS…

Thanks,
Doohan93

@doohan93
Would you try the fakesink first. If fakesink is no problem it could be the bayer2rgb element have problem. Try some others debayer element.

gst-launch-1.0 v4l2src device="/dev/video0" ! "video/x-bayer, width=640, height=480, format=(string)rggb" ! fakesink

Hi ShaneCCC,

I applied your fakesink and i got belows error logs.

gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming task paused, reason not-negotiated (-4)
Execution ended after 0:00:00.000459127
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …

And i applied belows article.

But i got belows error logs

Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = event ******* (fakesink0
Setting pipeline to PLAYING …
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = “video/x-bayer,\ format”
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = "video/x-bayer,\ "
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = event ******* (fakesink0
/GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = “video/x-bayer,\ for”
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = "video/x-bayer,"
[ 240.024551] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ 241.028564] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
^Chandling interrupt.
Interrupt: Stopping pipeline …
Execution ended after 0:00:02.446131841
Setting pipeline to PAUSED …
Setting pipeline to READY …
[ 242.032607] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ 243.036651] tegra-vi4 15700000.vi: ATOMP_FE syncpt timeout!
Setting pipeline to NULL …
Freeing pipeline …

Thanks,
Doohan93

@doohan93
Try don’t set the width, height to avoid sensor mode select failed caused the pipeline error.

gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-bayer, format=(string)rggb" ! fakesink

To ShaneCCC,

i followed your guide, and i got below error log.

nvidia@tegra-ubuntu:~$ export DISPLAY=:0
r, format=(string)rggb" ! fakesink1.0 v4l2src device=/dev/video0 ! "video/x-bay
Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
Setting pipeline to PLAYING …
New clock: GstSystemClock
[ 476.234303] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ 477.238325] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ 478.242355] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ 479.246367] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11

Thanks,
Doohan93

@doohan93
Looks like need -v for the v4l2src.

gst-launch-1.0 -v v4l2src device=/dev/video0 ! "video/x-bayer, format=(string)rggb" ! fakesink

To ShaneCCC,

I applied your option, but result was same. i got below error log…

[ 476.234303] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ 477.238325] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ 478.242355] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ 479.246367] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11

Thanks,
Doohan93

@Doohan
I didn’t get the PXL_SOF message after run the nvcamerasrc. I can’t figure what the problem now.

Run below command before run the “gst-launch-1.0 -v v4l2src device=/dev/video0 ! “video/x-bayer, format=(string)rggb” ! fakesink”

gst-launch-1.0 nvcamerasrc sensor-id=0 ! 'video/x-raw(memory:NVMM), framerate=(fraction)30/1' ! nvtee ! nvoverlaysink

To ShaneCCC,

I test v4l2src plugin using R27.1 sources.
I checked PXL_SOF error take place in kernel device driver.
And i knew that R28.1 sources released. so i’ll update R28.1 and test.
After test using R28.1, i’ll report v4l2src test result.

Thanks,
Doohan93

Hi doohan93,

Have your migrated on R28.1? issue still repro?
Please share the test result.

Thanks

Hi kayccc,

I updated R28.1 sources, and then test v4l2src.
But PXL_SOF error still happened.

I’ll upload gstreamer command that i used for v4l2src and error log.

Thanks,
Doohan93

Hi kayccc,

I’d like to share my test procedure and v4l2src test results .
If my test prodecures have a problem, plz let me know.
And all test using v4l2src failed. plz give me resolution.

Thanks,
Doohan93

  1. test procedure using R28.1 sources

a. flash all binary to clean board status
sudo ./flash.sh jetson-tx2 mmcblk0p1

b. install gstreamer
sudo add-apt-repository universe
sudo add-apt-repository multiverse
sudo apt-get update
sudo apt-get install gstreamer1.0-tools gstreamer1.0-alsa gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav
sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev libgstreamer-plugins-bad1.0-dev

c. connect HDMI display
export DISPLAY=:0

d. sudo apt-get install v4l-utils

  1. test result
    a, gst-launch-1.0 nvcamerasrc sensor-id=0 ! ‘video/x-raw(memory:NVMM), framerate=(fraction)30/1’ ! nvtee ! nvoverlaysink
    → it’s working

b. gst-launch-1.0 v4l2src device=“/dev/video0” ! “video/x-bayer, width=640, height=480, format=(string)rggb” ! bayer2rgb ! videoconvert ! xvimagesink -e
→ not working
→ error log
Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
Setting pipeline to PLAYING …
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data f.
Additional debug info:
gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l:
streaming task paused, reason not-negotiated (-4)
EOS on shutdown enabled – waiting for EOS after Error
Waiting for EOS…

c. gst-launch-1.0 v4l2src device=“/dev/video0” ! “video/x-bayer, width=640, height=480, format=(string)rggb” ! fakesink
→ not working
→ error log
Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
Setting pipeline to PLAYING …
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data f.
Additional debug info:
gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l:
streaming task paused, reason not-negotiated (-4)
Execution ended after 0:00:00.000316940
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …

d. gst-launch-1.0 -v v4l2src device=/dev/video0 ! “video/x-bayer, format=(string)rggb” ! fakesink
→ not working
→ error log
[ 96.724797] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ 97.728694] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ 98.732604] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ 99.736536] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11