Help for errors in nvargus_nvraw

Hi, I use orin32g with jetpack_5.0.2, i can use v4l2 to capture camera data. but failed by nvargus_nvraw.

$ nvargus_nvraw --lps
libEGL warning: DRI3: Screen seems not DRI3 capable
libEGL warning: DRI2: failed to authenticate
nvargus_nvraw version 1.13.1
Number of supported sensor entries 3
Entry Source Mode Uniquename Resolution FR BitDepth Mode
Index Index Index CSI Dyn Type
0 0 0 imx185_bottomleft_imx185 1280x 720 29 16 16 Yuv
1 0 1 imx185_bottomleft_imx185 1920x1080 29 16 16 Yuv
2 0 2 imx185_bottomleft_imx185 3840x2160 29 16 16 Yuv

$ nvargus_nvraw --c 0 --mode 1 --file camera_nvargus_nvraw.raw --format “nvraw”
libEGL warning: DRI3: Screen seems not DRI3 capable
libEGL warning: DRI2: failed to authenticate
nvargus_nvraw version 1.13.1
(“nvargus_nvraw”) Error BadParameter (0x04): ICaptureSession::createOutputStream(0) returned NULL (in
capture_nvraw/src/mobile/ArgusNvRawCapture.cpp, func createOutputStreams(), line 477)
(“nvargus_nvraw”) Error BadParameter (0x04): (propagating from capture_nvraw/src/mobile/ArgusNvRawCapture.cpp,
func capture(), line 750)
(“nvargus_nvraw”) Error BadParameter (0x04): Unable to capture (propagating from capture_nvraw/src/mobile/main.cpp,
func main(), line 97)


hello lei1234,

it looks you’ve referring to IMX185 to develop your customize driver, it’s a YUV camera sensor?

Argus it doesn’t support with YUV camera sensor,
please try v4l2 IOCTL if you would like to dump the sensor content,
for instance, Applications Using V4L2 IOCTL Directly.

Hi JerryChang,
Thank you very much!
yes, it’s a YUV camera, with 1 line embeded data. i can get framedata by v4l2 but can’t get embeddata, and i want to get embeded data, please give me a help!

hello lei1234,

as you can see in the VI drivers,
there’s chan->emb_buf; to allocates private buffer for embedded data storage.
user may retrieved via user-space.

note, according to the embeddedData type specified by CSI-2.
embedded line is transferred with data type 0x12 in the packet header.

Hi JerryChang,
Thank you for your help!
I found chan->emb_buf in vi5_fops.c, but until now haven’t found how to use it, could you provide me a sample?
thanks a lot.

hello lei1234,

by default, VI driver didn’t export embedded data to user space.
we only have Argus samples to obtain it. so, you’ll have to modify the VI driver to acquire the embedded data buffer to user space.

Hi JerryChang,
could you provide sample code about modify VI driver and user space call ? thanks very much!

hello lei1234,

as you can see,
it’ll allocate emb_buf into surface if you’ve embedded metadata.

static void vi5_setup_surface()
        if (chan->embedded_data_height > 0) { 
                desc->ch_cfg.embdata_enable = 1; 
                desc->ch_cfg.frame.embed_x = chan->embedded_data_width * BPP_MEM;
                desc->ch_cfg.frame.embed_y = chan->embedded_data_height;

[quote=“lei1234, post:8, topic:295932”]
Hi JerryChang,
[/quote] could you provide me some sample code about user space access kernel by this “surface”?

hello lei1234,

since it’s a YUV camera, you may access to the stream via v4l2. (i.e. v4l-utils)
it’s a 3rdparty sources, please see-also v4l2utils/utils/libv4l2util/v4l2_driver.h
you may dig into struct v4l2_driver {...} for fetching this v4l2 buffer.