Hello. I am new to Jetson Nano and V4L2 Driver Development in general. I have written a working V4L2 camera driver for another Linux platform. While porting to Jetson Nano I came up with 2 questions I have not found an answer for in the examples. If I was missing something, please let me know :)
While porting I was using your guide on how to implement the driver with tegracam. So I am using 2.0. Since I am using monochrome sensor I am not using your ISP with gstreamer, instead I use v4l2 C-API in my own C++ application I am writing. I mostly used the v4l2-cuda example for that.
I can set exposure time correctly using v4l2-ctl -c exposure=90 from the command line. But when I try to set it in my C Application it gives “Invalid Argument”.
bool v4l2_ctrl_set(int fd, uint32_t id, int val)
{
struct v4l2_control ctrl;
CLEAR(ctrl);
ctrl.id = id;
ctrl.value = val;
if (xioctl(fd, VIDIOC_S_CTRL, &ctrl) == -1) {
std::cout << "Failed to set ctrl with id "
<< id << " to value " << val
<< "\nerror (" << errno << "): " << strerror(errno) << std::endl;
return false;
}
return true;
}
-
How do I set V4l2-ctrls with C-API using the tegracam implementation in my driver?
-
How should I implement custom V4L2 controls using tegracam. For example I want to set top/left readout offset values for my camera. Should I change the tegracam files, or should I add another custom control handler from my driver? How to make it compatible with tegracam 2.0 driver development?
Sorry for my basic questions.
Best regards,
jb