Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor I
4,693 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
Beginner
22 Views

Hi vilvo,

What is https://github.com/intel-aero/intel-aero-samples intel-aero-samples layer?

And how to build this https://github.com/intel-aero/sample-apps added a legacy sample app?

thanks

0 Kudos
Highlighted
Community Manager
22 Views

Hi Dan,

 

 

I just tried it myself and got a similar image to the one Vilvo showed earlier on this thread. Could you please let us know what steps you're using to compile the source code? We would like to check if there's something that should be changed on your process that might be causing the issue.

 

 

Regards,

 

Pablo M.
0 Kudos
Highlighted
Community Manager
22 Views

Hi Dan,

 

 

Last time we requested the steps you used to compile the source code, I'm not sure if you checked our post. In any case, could you please provide them so we can check if everything's correct?

 

 

Regards,

 

Pablo M.
0 Kudos
Highlighted
New Contributor I
22 Views

Hi Pablo,

Is it possible to attach the capture_example executable that I built to a reply so that you can try the executable I built using vilvo's example source code? That would be an easy confirmation as to whether there is a problem with my executable.

Dan

0 Kudos
Highlighted
Community Manager
22 Views

Hi Dan,

 

 

Sure, go ahead and attach the file. We will gladly test it with our hardware.

 

 

Regards,

 

Pablo M.
0 Kudos
Highlighted
New Contributor I
22 Views

How do you attach files to a reply? The Insert Link button just seems to insert a URL or email address and the Insert Image option is not easily fooled. Do I need to put the file on a website?

Regards,

Dan

0 Kudos
Highlighted
Community Manager
22 Views

Hi Dan,

 

 

Could you please share your email address with me via private message? I will open a ticket with your email information and then will contact you, that way you'll be able to share the file with us.

 

 

Regards,

 

Pablo M.
0 Kudos
Highlighted
New Contributor I
22 Views

Hi Pablo,

I attempted to send you a private message. If you don't get it, then let me know. (I used the Message button associated with the avatar to the top, left of your post. Hopefully I didn't just send my email to all of Intel Corporation... ).

Update: It looks like it bounced as it tried to send the message to intel.corp. However, it looks like you can add attachments to replies when you edit an existing reply, so I added my capture_example executable to this reply. We'll see if that works.

Dan

0 Kudos
Highlighted
Community Manager
22 Views

Hi Dan,

 

 

Thank you for providing the file. We will try it with our hardware and will let you know our results soon. Thank you for your patience.

 

 

Regards,

 

Pablo M.

 

0 Kudos
Highlighted
New Contributor I
22 Views

Thanks Pablo.

Dan

0 Kudos
Highlighted
Novice
22 Views

Same issue here. Can't get the 8MP or VGA camera running at all. Realsense works fine.

As a first step - could someone from Intel bring some clarity about all those /dev/videoXX devices?

What are actually the correct ones for the 8MP/VGA camera?

Do you have a super-simple out-of the box example for showing that the 8MP and VGA camera work at all?

Like this gstreamer pipeline for the realsense which is mentioned on the wiki and works perfect:

 

gst-launch-1.0 v4l2src device=/dev/video13 ! xvimagesink

If we would have working examples for the other cameras similar to the above, I think everyone could easily adapt that to any usecase.

Regards

Peter

0 Kudos
Highlighted
Community Manager
22 Views

Hi Dan,

We just tried to take some pictures with your capture_example file and everything went fine. You can find the pictures attached.

 

Which commands are you running to get the images from the cameras? Also, if you could share a picture of your current hardware configuration we would also appreciate it.

Regards,

 

Pablo M.

 

0 Kudos
Highlighted
New Contributor I
22 Views

Hi Pablo,

The commands I am running are:

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=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

 

VIDIOC_STREAMON error 22, Invalid argument

I have tried other /dev/video devices to no avail. At least I know from the fact you ran my compiled binary that my cross-compiler works. Here is the output of lsmod on my Intel Aero in case that is relevant (e.g. missing driver? wrong driver?):

root@intel-aero:~# lsmod Module

 

Size Used by

 

bnep 13661 2

 

drbg 14324 1

 

ctr 4031 3

 

ccm 8624 3

 

uvcvideo 74749 0

 

videobuf2_vmalloc 5350 1 uvcvideo

 

videobuf2_memops 2057 1 videobuf2_vmalloc

 

videobuf2_v4l2 15823 1 uvcvideo

 

videobuf2_core 20221 2 uvcvideo,videobuf2_v4l2

 

arc4 2232 2

 

iwlmvm 378686 0

 

mac80211 605188 1 iwlmvm

 

iwlwifi 264035 1 iwlmvm

 

cfg80211 467582 3 iwlwifi,mac80211,iwlmvm

 

atomisp_css2401a0_v21 767057 0

 

compat 4079 4 cfg80211,iwlwifi,mac80211,iwlmvm

 

videobuf_vmalloc 4487 1 atomisp_css2401a0_v21

 

videobuf_core 15106 2 videobuf_vmalloc,atomisp_css2401a0_v21

 

spi_imu 1136 0

 

spi_fpga 1201 0

 

spi_can 1200 0

Sorry for the formatting. If you edit my reply it looks good, but somehow it doesn't maintain the Courier New font that lines up the columns nicely.

Regards,

Dan

0 Kudos
Highlighted
Community Manager
22 Views

Hi Dan,

 

 

That's very strange. Everything in your configuration seems fine, and the commands you are entering are the same that I used to get those images, the only difference is that I don't get an error message (VIDIOC_S_FMT error 22, Invalid argument) but a list of 10 images taken with the camera.

 

Did you build the sample as a package or updated the whole intel-samples layer? Also, check this thread about the error you're getting http://www.linuxquestions.org/questions/linux-software-2/vidioc_s_fmt-error-22-invalid-argument-8339... http://www.linuxquestions.org/questions/linux-software-2/vidioc_s_fmt-error-22-invalid-argument-8339....

 

 

Regards,

 

Pablo M.

 

0 Kudos
Highlighted
Community Manager
22 Views

Hi Dan,

 

 

Do you have updates on this case? Last time we asked some questions about your building process, I'm not sure if you checked them.

 

 

Regards,

 

Pablo M.

 

0 Kudos
Highlighted
New Contributor I
22 Views

I simply downloaded the source for the capturev4l2 example that you gave me and compiled it using my cross-compiler on Windows using a Makefile:

LDFLAGS += -lpthread

capture_example: capture.o atomisp_obj.o v4l2_obj.o

 

$(CXX) -o $@ $^ $(LDFLAGS)

capture.o: capture.cpp

 

atomisp_obj.o: atomisp_obj.cpp

 

v4l2_obj.o: v4l2_obj.cpp

I then copied the executable over to the Intel Aero. It's the same executable I sent you, so if it works on your Aero but not mine, that suggests the cross-compiling is not the issue, but something is not configured properly on my Aero or I have a hardware issue (hard to believe it is hardware though given both cameras are affected).

Regards,

Dan

0 Kudos
Highlighted
Community Manager
22 Views

Hi Dan,

 

 

I would suggest to try building the sample as a package or rebuilding the image with the new sample-apps layer from the Intel Aero GitHub page. That's what I did and it worked well for me.

 

Also, make sure you're running the command to take the picture in the directory where you have the binary file (I don't think this is causing the issue but it's always a good idea to try it)

 

 

Regards,

 

Pablo M.
0 Kudos
Highlighted
Community Manager
22 Views

Hi Dan,

 

 

Do you still need assistance with this case? What were the results of trying our latest suggestion?

 

 

-Sergio A

 

0 Kudos
Highlighted
Beginner
22 Views

I got the same error info when running capture_example

VIDIOC_S_FMT error 22, Invalid argument

0 Kudos
Highlighted
New Contributor I
22 Views

I tried building the sample as part of the Intel Aero image and I get exactly the same results as I did with my capture_example. We recently received an Intel drone, so I'll try the same binary on the drone once we get it up and running.

0 Kudos