Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor I
2,967 Views

VGA camera issue with VIDIOC_S_FMT

Hi,

I know there is at least one more thread for the same issue but I did not see a resolution so I decided to open a new thread for the same.

I am getting err = -1 when trying to set the format on the VGA camera using VIDIOC_S_FMT as the ioctl request code. I tried using different supported pixel formats (YUV, RGB..)

Has anyone been able to find the answer to this ?

ioctl(camera->fd, VIDIOC_S_FMT, &format)

MartyG

intel_corp

best

Rohan

26 Replies
Highlighted
New Contributor I
26 Views

I kinda did a hack.. Did a GET of the format and then used it to set the format. That seemed to have work.

0 Kudos
Highlighted
New Contributor I
26 Views

I do have a couple questions thou -

1. What is the size of the frame returned for this ?

2. Also, is the top of the camera suppose to come off ? Im not sure if should or should not and dont want to break anything. I have attached a pic.

0 Kudos
Highlighted
Honored Contributor III
26 Views

Awesome, glad you found a solution!

The section attached to the camera is described as a 'FPC extension cable'. Extension implies that it is detachable, though I don't know whether you could or should do so. Researching the camera module (an OmniVision OV7251) on Google Images though, it was never shown without a cable attached to it.

0 Kudos
Highlighted
New Contributor I
26 Views

I do not understand what you mean. The bottom cable has pins which this top half fits in to. The top half has the camera. I have attached 2 pics for the camera. One shows the top cable that should fit into the bottom cable that is attached to the Intel Aero board.

I was talking about the top cable and if the camera is hidden behind the small black cover or is this how it is.

best

Rohan

0 Kudos
Highlighted
Honored Contributor III
26 Views

Sorry l could not help. I do not own a Vision Kit or Aero board (or a drone for that matter!) and so could only comment on what I could find out from the internet.

0 Kudos
Highlighted
New Contributor I
26 Views

No problem.

Looking for a reply from intel_corp

Thanks Marty

0 Kudos
Highlighted
New Contributor I
26 Views

intel_corp

Can you please help answer the following questions -

1. From the pic above is the connection for VGA camera correct ?

2. What is the size of a frame returned for a VGA camera usually with WIDTH = 640 and HEIGHT = 480 ?

3. How can I tell the VGA camera is streaming ? Is there a light turned ON like the red in R200 ?

best

Rohan

0 Kudos
Highlighted
New Contributor I
26 Views

I rebooted the board and see this in dmesg | grep ov

[3.526081] ov7251 i2c-INT35AA:00: camera pdata: port: 1 lanes: 4 order: 00000002[3.526881] ov7251 i2c-INT35AA:00: read from offset 0x300a error -121[3.534182] ov7251 i2c-INT35AA:00: sensor_id_high = 0xffff[3.540607] ov7251 i2c-INT35AA:00: ov7251_detect err s_config.[3.558456] ov7251 i2c-INT35AA:00: sensor power-gating failed[3.582994] ov7251 i2c-INT35AA:01: gmin: initializing atomisp module subdev data.PMIC ID 1[3.619098] ov7251 i2c-INT35AA:01: camera pdata: port: 1 lanes: 1 order: 00000002[3.620005] ov7251 i2c-INT35AA:01: read from offset 0x300a error -121[3.627895] ov7251 i2c-INT35AA:01: sensor_id_high = 0xffff[3.634976] ov7251 i2c-INT35AA:01: ov7251_detect err s_config.[3.650865] ov7251 i2c-INT35AA:01: sensor power-gating failed

The VGA is the only camera attached. Can you tell me what is going on and how to correct this ?

Also, is VGA video0 or video2 ? Or is this dynamic ?

0 Kudos
Highlighted
Community Manager
26 Views

Hi rohanK23,

 

 

The VGA camera (the second picture from reply 4) should be connected to the port farthest to the right of the Intel Aero, taking as reference the first picture of reply 4.

 

In regards to the size, I believe that the size of each frame is returned as an output each time a new frame is taken. If you look in the community for threads where users successfully manage to take pictures, you can see a variable called m_sizeimage, which value is 462848.

 

 

The way to tell if the camera is operational is through the console. Whenever the camera is taking pictures, you'll see the program output the preview mode as well as a confirmation that there are files being created.

 

 

I hope you find this information useful.

 

 

-Sergio A

 

0 Kudos
Highlighted
New Contributor I
26 Views

Hi Sergio,

The VGA camera is attached to the far right of the board. Please check attached pic. Its the only camera attached at the moment.

I did read the size is WIDTH*HEIGHT*3/2 somewhere - so roughly what you said.

The VGA camera can take pictures as well as stream video, correct ?

I am trying to program the VGA camera thru my application. What are the console commands to check if its working ?

Rohan

0 Kudos
Highlighted
Community Manager
26 Views

Hi Rohan,

 

 

The setup we use is very similar to yours. In your case, you connect the camera to an expansion cable that goes to the Aero. In our case, the camera is directly connected to the Aero.

 

 

The VGA camera is capable of streaming. You can use a package such as ffmpeg to test the streaming capabilities of the camera. You can see more of what ffmpeg can do here: https://www.ffmpeg.org/documentation.html https://www.ffmpeg.org/documentation.html .

 

 

Once everything is setup, you can start using the camera. We have taken some pictures to see the results. The command used to take pictures is:

 

C=10 INPUT=0 MODE=PREVIEW capture_example --userp -d /dev/video0. If everything is working correctly, you should see something similar to:

 

Preview mode: 640x480, yuv420.

 

m_width 640, m_height 480, m_sizeimage 462848, m_padded_width:640, bytesperline 640

 

Saving file: Image-video2-640x480-0.yuv420

 

Saving file: Image-video2-640x480-1.yuv420

 

Saving file: Image-video2-640x480-2.yuv420

 

 

Let us know if this answers your questions.

 

 

Regards,

 

-Sergio A

 

0 Kudos
Highlighted
New Contributor I
26 Views

That console command did not work.

From dmesg | grep ov

[3.492573] ov7251 i2c-INT35AA:00: gmin: initializing atomisp module subdev data.PMIC ID 1[3.521157] ov7251 i2c-INT35AA:00: camera pdata: port: 0 lanes: 1 order: 00000002[3.524677] ov7251 i2c-INT35AA:00: sensor_revision = 0x2[3.524685] ov7251 i2c-INT35AA:00: detect ov7251 success[3.524861] input: ov7251 as /devices/virtual/input/input4[3.525153] ov7251 i2c-INT35AA:00: register atomisp i2c module type 1[3.534819] ov7251 i2c-INT35AA:01: gmin: initializing atomisp module subdev data.PMIC ID 1[3.563532] ov7251 i2c-INT35AA:01: camera pdata: port: 1 lanes: 1 order: 00000002[3.564861] ov7251 i2c-INT35AA:01: read from offset 0x300a error -121[3.572277] ov7251 i2c-INT35AA:01: sensor_id_high = 0xffff[3.579232] ov7251 i2c-INT35AA:01: ov7251_detect err s_config.[3.586395] ov7251 i2c-INT35AA:01: sensor power-gating failed

I did not see any capture_example but I did see a cpp-capture so I ran that:

root@intel-aero:/# C=10 INPUT=0 MODE=PREVIEW capture_example --userp -d /dev/video0

-sh: capture_example: command not found

root@intel-aero:/# C=10 INPUT=0 MODE=PREVIEW cpp-capture --userp -d /dev/video0

RealSense error calling rs_create_context(api_version:11201):

uvcvideo kernel module is not loaded

I do not know if its looking for the RealSense or the VGA camera here. Perhaps the binary cpp-capture is for the Realsense camera. I did not see a capture_example that uses the VGA.

Please advise.

best

Rohan

0 Kudos
Highlighted
Community Manager
26 Views

Hi

 

 

We have received that error before. This error occurs when the steps needed to use the camera were not completed successfully or if the camera was disconnected at the time the board was powered.

 

Please let us know in detail, what previous configuration steps you have done so far and what guides have you followed prior to using the command we recommended. We want to know if all the steps required were completed. If the problem is related to the camera being disconnected, turn off your board, then connect the camera and then power it back on so it can be recognized.

 

The capture_example is the name of the name of the file you have to run in order to test the camera. This file doesn't necessarily need to be called this way.

 

 

We'll be waiting for your reply.

 

 

Regards,

 

-Sergio A

 

0 Kudos
Highlighted
New Contributor I
26 Views

Hi Sergio,

The camera is attached before the board is turned ON. I also rebooted the board with the camera attached. Same error. I have followed the steps on the Wiki.

capture_example is a file that will hold the images captured by the camera or is it a script that will be run ?

best

Rohan

0 Kudos
Highlighted
Community Manager
26 Views

Hi Rohan,

 

 

Thanks for the confirmation. Have you already copied the samples from https://github.com/intel-aero/sample-apps https://github.com/intel-aero/sample-apps to the Aero board? These samples need to be compiled before you can take pictures with the camera. Have you already completed this procedure?

 

 

Also, please send us the output of aero-get-version.py

 

 

We'll be waiting for your response.

 

 

-Sergio A

 

0 Kudos
Highlighted
New Contributor I
26 Views

Hi Sergio,

I have not copied them to the Aero Board. I am not sure why I need to. I am trying to program the VGA camera in my application. I am not trying to run capture_example. My application fails on the VIDIOC_S_FMT ioctl. Do I need anything to be able to do that thru my application ? I have the necessary Header files included. Please advise.

best

Rohan

0 Kudos
Highlighted
New Contributor I
26 Views

Hi Sergio,

Have you already copied the samples from https://github.com/intel-aero/sample-apps https://github.com/intel-aero/sample-apps to the Aero board? --> How do I do that ? Can you send me the instructions to do that ?

Also, please send us the output of aero-get-version.py

I am at kernel 1.3.1.

I tried to install 1.4 but got some errors in my application related to pthreads.

best

Rohan

0 Kudos
Highlighted
New Contributor I
26 Views

I have done the git clone on my ubuntu machine of the tree. I am nat sure you mean by copy to Intel Aero and compile. Can you please explain ?

0 Kudos
Highlighted
New Contributor I
26 Views

Okay. I completely misunderstood what you said there.

I compiled the capturev4l2 on my ubuntu and copied the executable over to the aero board and ran the command

root@intel-aero:~# C=10 INPUT=0 MODE=PREVIEW ./capture_examples --userp -d /dev/video0

Preview mode: 640x480, yuv420.

m_width 640, m_height 480, m_sizeimage 462848, m_padded_width:640, bytesperline 640

Saving file: Image-video2-640x480-0.yuv420

Saving file: Image-video2-640x480-1.yuv420

Saving file: Image-video2-640x480-2.yuv420

Saving file: Image-video2-640x480-3.yuv420

Saving file: Image-video2-640x480-4.yuv420

Saving file: Image-video2-640x480-5.yuv420

Saving file: Image-video2-640x480-6.yuv420

Saving file: Image-video2-640x480-7.yuv420

Saving file: Image-video2-640x480-8.yuv420

Saving file: Image-video2-640x480-9.yuv420

Preview: Time=336.619000ms FPS=29.707176

Now why am I getting an error when I do a VIDIOC_S_FMT or STREAMON within my application ?

best

Rohan

0 Kudos