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

8MP and VGA cameras not working

I am trying to get the OV8858 (8MP) and OV7251 (VGA) cameras working using Video for Linux (V4L2). I have tried using /dev/video0 through /dev/video13 and only the RealSense cameras work (/dev/video11 to /dev/video13). I can also get a USB webcam working. However, the behavior of the rest of the /dev/video devices is odd. When = 0-3, 5, 6-9, the V4L2 VIDIOC_S_FMT ioctl returns -1 with errno = EINVAL even though the selected pixel format is one of the enumerated pixel formats (I enumerated all available pixel formats, frame sizes, etc. to see what was supposedly supported). When = 4 or 10, the V4L2 API hangs trying to set the pixel format.

The dmesg output shows some errors related to the two cameras:

[ 6.034600] Ov8858 tal init called

[ 6.046159] OV8858 tal test probe called

[ 6.051334] ov8858 i2c-INT3477:00: gmin: initializing atomisp module subdev data.PMIC ID 1

[ 6.051654] acpi INT3477:00: Failed to find gmin variable INT3477:00_CamClk

[ 6.052879] acpi INT3477:00: Failed to find gmin variable INT3477:00_ClkSrc

[ 6.053248] acpi INT3477:00: Failed to find gmin variable INT3477:00_CsiPort

[ 6.054378] acpi INT3477:00: Failed to find gmin variable INT3477:00_CsiLanes

[ 6.056525] acpi INT3477:00: Failed to find gmin variable INT3477:00_eldo1_1p8v

[ 6.057657] acpi INT3477:00: Failed to find gmin variable INT3477:00_eldo1_sel_reg

[ 6.058795] acpi INT3477:00: Failed to find gmin variable INT3477:00_eldo1_ctrl_shift

[ 6.059926] acpi INT3477:00: Failed to find gmin variable INT3477:00_eldo2_1p8v

[ 6.061154] acpi INT3477:00: Failed to find gmin variable INT3477:00_eldo2_sel_reg

[ 6.062242] acpi INT3477:00: Failed to find gmin variable INT3477:00_eldo2_ctrl_shift

[ 6.064856] (NULL device *): Failed to find gmin variable gmin_V2P8GPIO

[ 6.065920] (NULL device *): Failed to find gmin variable gmin_V1P8GPIO

[ 6.077714] mmc0: MAN_BKOPS_EN bit is not set

[ 6.093405] mmc0: new HS200 MMC card at address 0001

[ 6.096069] mmcblk0: mmc0:0001 BJNB4R 29.1 GiB

[ 6.097427] mmcblk0boot0: mmc0:0001 BJNB4R partition 1 4.00 MiB

[ 6.098749] mmcblk0boot1: mmc0:0001 BJNB4R partition 2 4.00 MiB

[ 6.100579] mmcblk0rpmb: mmc0:0001 BJNB4R partition 3 4.00 MiB

[ 6.114744] mmcblk0: p1 p2 p3

[ 7.093307] i2c_designware 808622C1:03: controller timed out

[ 7.100570] ov8858 i2c-INT3477:00: power-up error -5!

[ 7.106785] ov8858 i2c-INT3477:00: ov8858_probe: failed to set config

[ 7.119811] ov8858: probe of i2c-INT3477:00 failed with error -5

[ 7.120167] tal init called

[ 7.131370] tal test probe called

[ 7.171513] ov7251 i2c-INT35AA:00: camera pdata: port: 1 lanes: 4 order: 00000002

[ 8.171331] i2c_designware 808622C1:03: controller timed out

[ 8.178454] ov7251 i2c-INT35AA:00: read from offset 0x300a error -110

[ 8.186308] ov7251 i2c-INT35AA:00: sensor_id_high = 0xffff

[ 8.192980] ov7251 i2c-INT35AA:00: ov7251_detect err s_config.

[ 8.203076] ov7251 i2c-INT35AA:00: sensor power-gating failed

[ 8.222401] tal test probe called

[ 8.259524] ov7251 i2c-INT35AA:01: camera pdata: port: 1 lanes: 4 order: 00000002

[ 9.260322] i2c_designware 808622C1:03: controller timed out

[ 9.267483] ov7251 i2c-INT35AA:01: read from offset 0x300a error -110

[ 9.275334] ov7251 i2c-INT35AA:01: sensor_id_high = 0xffff

[ 9.282053] ov7251 i2c-INT35AA:01: ov7251_detect err s_config.

[ 9.292484] ov7251 i2c-INT35AA:01: sensor power-gating failed

...

[ 11.720724] atomisp-css2401a0_v21 0000:00:03.0: ISP HPLL frequency base = 1600 MHz

...

[ 12.064451] atomisp-css2401a0_v21 0000:00:03.0: no camera attached or fail to detect

...

[ 12.211527] atomisp-css2401a0_v21 0000:00:03.0: hmm_reserved_pool init successfully,hmm_reserved_pool is with 32768 pages.

...

I'm using the 12V, 2A wall adapter to power the Intel Aero Compute board mounted in the Intel enclosure kit (as per the illustrated guide), with all three cameras (8MP, VGA and RealSense) attached. Is this a power-supply issue? I'm wondering if 2A is not sufficient on power-up as later in the dmesg log the following messages appear:

[ 129.098186] CPU3: Core temperature above threshold, cpu clock throttled (total events = 1)

[ 129.099007] CPU2: Core temperature above threshold, cpu clock throttled (total events = 1)

Or is V4L2 the wrong API to use to access these cameras? I have the very latest BIOS release flashed:

[ 0.000000] DMI: Insyde CherryTrail/Intel(R) Aero Platform for UAVs, BIOS Aero-01.00.12_Prod 12/09/2016

and operating system image:

Linux intel-aero 4.4.3-yocto-standard # 1 SMP PREEMPT Fri Dec 16 18:13:41 CLST 2016 x86_64 x86_64 x86_64 GNU/Linux

My suspicion is that the cameras are /dev/video4 and /dev/video10, but did not come up properly so V4L2 hangs trying to use them (since VIDIOC_S_FMT is the first ioctl to gain exclusive access to the device).

Any assistance would be appreciated.

Regards,

Dan

48 Replies
Highlighted
Community Manager
41 Views

Hi Dan,

 

 

Thank you for reaching out and for your interest in the Intel Aero Compute board.

 

We would like to investigate this case a little bit more so we can provide a more accurate answer. We will get back to you soon with some more updates. We appreciate your patience.

 

 

Regards,

 

-Pablo
0 Kudos
Highlighted
Community Manager
41 Views

Hi Dan,

 

 

We would like to ask some more question about this case.
  1. Did you use the https://github.com/intel-aero/meta-intel-aero/wiki/Quickstart-Guide Quickstart guide to setup your development board? If so, are you booting from the USB installer or did you flash the iso to eMMC?
  2. Are you using any external guide or tutorial to connect the 8MP and VGA cameras to the board? If so, could you please share it with us?
  3. Have you tried connecting just one camera at a time? This is just to discard any power supply issue as you mentioned before.
We'll be waiting for your reply.

 

 

Regards,

 

-Pablo
0 Kudos
Highlighted
New Contributor I
41 Views

HI Pablo,

1. I did use the Quickstart guide. However, I did not build my own image. I downloaded the latest BIOS and O/S image from the Intel Download Centre and used that. I updated the BIOS first. Then I made a USB installer and booted from the USB flash drive to ensure that the O/S image booted (even though I had already checked the MD5 checksum). When that booted successfully, I then flashed the ISO to the eMMC since I was confident that it would boot.

2. I am using an Intel Aero Enclosure Kit for holding the Compute board and cameras. I followed the instructions in the Aero Dev Kit Mechanical Assembly Guide v161101.pdf which I found on Intel's website at .

3. I have not tried connecting one camera at a time yet. I can try that.

Regards,

Dan

0 Kudos
Highlighted
Community Manager
41 Views

Hi Dan,

Thank you very much for the information. I will try to replicate the issue with the same configuration you're using, I just needed to be sure about this extra information. I don't have the enclosure at hand, but I believe it won't be necessary.

 

I would appreciate if you could try disconnecting two of the cameras to test with just one at a time. Let me know your results.

Regards,

 

-PabloM
0 Kudos
Highlighted
Community Manager
41 Views

Hi Dan,

 

 

Have you been able to test your cameras after disconnecting the RealSense R200 camera? Did you get different results?

 

 

Regards,

 

-Pablo
0 Kudos
Highlighted
New Contributor I
41 Views

Hi Pablo,

Sorry to take so long to get back to you. I did try disconnecting the RealSense camera, but it did not change the results. I still could not use the other two cameras.

Regards,

Dan

0 Kudos
Highlighted
Community Manager
41 Views

Hi Dan,

 

 

Don't worry, I just wanted to compare results. I did some tests too and had a very similar output, I just connected these two cameras and run dmesg | grep –iC 3 "ov8858" and got the same failed messages from your first post. With the other one, the OV7251, I received some 'success' lines but many failed messages too. Didn't use V4L2, though. We will keep investigating and will share any updates, if you keep doing some tests please keep us updated too.

 

 

Regards,

 

-Pablo
0 Kudos
Highlighted
New Contributor I
41 Views

I'm glad you have at least been able to replicate the error messages. I look forward to hearing your results.

Regards,

Dan

0 Kudos
Highlighted
Employee
41 Views

Hi Dan,

I https://github.com/intel-aero/sample-apps added a legacy sample app to use cameras through v4l2 with a recipe to build it on https://github.com/intel-aero/intel-aero-samples intel-aero-samples layer.

The sample code should help you to integrate your application.

If you want to test your cameras with the sample application, run:

sh-4.3# C=10 INPUT=0 MODE=PREVIEW capture_example --userp -d /dev/video0

 

sh-4.3# C=10 INPUT=1 MODE=PREVIEW capture_example --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=335.918000ms FPS=29.769170

See --help for more info.

It generates raw frames but you can convert them. I converted with ffmpeg:

ffmpeg -f rawvideo -s 640x480 -pix_fmt yuv420p -i Image-video2-640x480-4.yuv420 test.jpg

For example, downward facing camera on my the drone:

 

If you have any issues, please create a new one at https://github.com/intel-aero/meta-intel-aero/issues Issues · intel-aero/meta-intel-aero · GitHub

Also, I welcome pull requests.

Hope this helps,

-Ville

0 Kudos
Highlighted
New Contributor I
41 Views

Thank you Ville.

Regards,

Dan

0 Kudos
Highlighted
Community Manager
41 Views

Hi Dan,

 

 

Let us know when you try Ville's suggestion. We would like to know if you're able to get the cameras successfully recognized after that.

 

Ville, thank you very much for helping us on this case.

 

 

Regards,

 

-Pablo
0 Kudos
Highlighted
Community Manager
41 Views

Hi Dan,

 

 

Did you get to test Ville suggestion? Did you have better results?

 

 

Regards,

 

-Pablo
0 Kudos
Highlighted
New Contributor I
41 Views

I tried Ville's sample program. Here's the output:

login as: root

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

Preview mode: 640x480, yuv420.

VIDIOC_S_FMT error 22, Invalid argument

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

Preview mode: 640x480, yuv420.

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

VIDIOC_STREAMON error 22, Invalid argument

It didn't work for some reason. I haven't had time to dig into the "invalid argument", but as a side note, my V4L2 code queries the cameras extensively for their capabilities and then tries to use the settings that the cameras indicate they support, and it doesn't work either, even though the same code works with a USB webcam.

Dan

0 Kudos
Highlighted
Community Manager
41 Views

Thank you for your update Dan.

vilvo, do you have any idea of what could have caused the issue that Dan is experiencing with your sample? Have you seen this error on any of your previous tests?

-Pablo

0 Kudos
Highlighted
Employee
41 Views

Hi Dan,

Can you please run usr/sbin/get_aero_version.py?

It should output as follows:

BIOS_VERSION = Aero-01.00.12_Prod OS_VERSION = v01.00.04 AIRMAP_VERSION = 1.8 FPGA_VERSION = 0xff 0xff

to make sure that we are running the same release version.

If get_aero_versions.py is not there or your version output is different, please update to the latest release which has the support for cameras.

https://github.com/intel-aero/meta-intel-aero/wiki/Upgrade-To-Latest-Software-Release The instructions to update are available here.

Please note that current Aero RTF implementation of v4l2-interface for camera support uses vendor specific extensions. That explains differences to your USB cameras.

0 Kudos
Highlighted
New Contributor I
41 Views

Here is the output:

 

root@intel-aero:~# /usr/sbin/get_aero_version.py

 

BIOS_VERSION = Aero-01.00.12_Prod

 

OS_VERSION = v01.00.04

 

AIRMAP_VERSION = 1.8

 

FPGA_VERSION = 0xff 0xff

 

Dan
0 Kudos
Highlighted
Community Manager
41 Views

vilvo,

Any ideas?

Regards,

 

Pablo
0 Kudos
Highlighted
Employee
41 Views

DanMadill

Your release is the latest so no issues there.

I haven't had time to dig into the "invalid argument",

Depending on your sequence "invalid argument" might come after the capability queries. I tested the raw frame capture with the example code as is - I'd be interested to know whether you can capture a frame or are you completely blocked?

but as a side note, my V4L2 code queries the cameras extensively for their capabilities and then tries to use the settings that the cameras indicate they support, and it doesn't work either, even though the same code works with a USB webcam.

This is true. As you can see from the example code, the v4l2 interface implementation uses vendor specific extensions, like V4L2_CID_ATOMISP_*. USB webcams do not use these, making them more compatible with the v4l2 spec and programs. Unfortunately this is legacy implementation which would benefit from refactoring to support v4l2 compatible user space programs. If you can share which user space programs you'd expect to work, please do.

0 Kudos
Highlighted
New Contributor I
41 Views

1. I do not get any frames at all.

2. I'm not using a particular user-space program. We have our own software that we wish to run with the camera.

0 Kudos