linux-surface icon indicating copy to clipboard operation
linux-surface copied to clipboard

SP6 camera detected, sensor ov7251 9-0060 has not format compatible with the IPU3

Open Mprogramavimai opened this issue 1 year ago • 4 comments

After following all the instructions for enabling the camera in the camera support page and getting the firmware file based on this blog post (rebooting afterwards also): https://neilzone.co.uk/2021/08/working-front-and-rear-cameras-on-debian-11-on-a-surface-pro-6-surfacebook-2-and-surface-go/ The camera on the SP6 gets detected:

$ cam --list
[0:20:09.058378430] [40050]  INFO Camera camera_manager.cpp:325 libcamera v0.3.1+36-62760bd2
[0:20:09.181947006] [40051]  WARN IPAProxy ipa_proxy.cpp:161 Configuration file 'ov8865.yaml' not found for IPA module 'ipu3', falling back to 'uncalibrated.yaml'
[0:20:09.183479488] [40051]  INFO IPU3 ipu3.cpp:1141 Registered Camera[0] "\_SB_.PCI0.I2C3.CAMR" connected to CSI-2 receiver 0
[0:20:09.201018088] [40051]  WARN IPAProxy ipa_proxy.cpp:161 Configuration file 'ov5693.yaml' not found for IPA module 'ipu3', falling back to 'uncalibrated.yaml'
[0:20:09.201406028] [40051]  INFO IPU3 ipu3.cpp:1141 Registered Camera[1] "\_SB_.PCI0.I2C2.CAMF" connected to CSI-2 receiver 1
Available cameras:
1: Internal back camera (\_SB_.PCI0.I2C3.CAMR)
2: Internal front camera (\_SB_.PCI0.I2C2.CAMF)

But trying to test it with qcam:

$ qcam
QSocketNotifier: Can only be used with threads started with QThread
[0:20:39.654159425] [40912]  INFO Camera camera_manager.cpp:284 libcamera v0.2.0
[0:20:39.746868925] [40924]  WARN CameraSensor camera_sensor.cpp:248 'ov7251 9-0060': Recommended V4L2 control 0x009a0922 not supported
[0:20:39.746899864] [40924]  WARN CameraSensor camera_sensor.cpp:315 'ov7251 9-0060': The sensor kernel driver needs to be fixed
[0:20:39.746910821] [40924]  WARN CameraSensor camera_sensor.cpp:317 'ov7251 9-0060': See Documentation/sensor_driver_requirements.rst in the libcamera sources for more information
[0:20:39.747160232] [40924]  WARN CameraSensorProperties camera_sensor_properties.cpp:262 No static properties available for 'ov7251'
[0:20:39.747179987] [40924]  WARN CameraSensorProperties camera_sensor_properties.cpp:264 Please consider updating the camera sensor properties database
[0:20:39.747193176] [40924]  WARN CameraSensor camera_sensor.cpp:463 'ov7251 9-0060': Failed to retrieve the camera location
[0:20:39.747201499] [40924]  WARN CameraSensor camera_sensor.cpp:485 'ov7251 9-0060': Rotation control not available, default to 0 degrees
[0:20:39.747218363] [40924] ERROR IPU3 cio2.cpp:157 Sensor ov7251 9-0060 has not format compatible with the IPU3

It fails saying that:

[0:20:39.747218363] [40924] ERROR IPU3 cio2.cpp:157 Sensor ov7251 9-0060 has not format compatible with the IPU3

Environment

  • Hardware model: Microsoft Corporation Surface Pro 6
  • Kernel version: Linux 6.10.3-surface-1
  • Distribution: Ubuntu 24.04 LTS
`dmesg` output

Too long for Github, see here: https://r2.mprogramavimai.lt/dmesg.txt

Reply if any additional information is needed, and than you for the excruciating work of bringing Linux to these great devices!

Mprogramavimai avatar Aug 10 '24 18:08 Mprogramavimai

Same issue here with SG2 using the 6.10.5-surface-1 kernel.

Running qcam brings up a similar list of errors for me:

$ qcam QSocketNotifier: Can only be used with threads started with QThread [3:25:01.548652929] [27701] WARN IPAManager ipa_manager.cpp:154 No IPA found in '/usr/lib/x86_64-linux-gnu/libcamera' [3:25:01.548751126] [27701] INFO Camera camera_manager.cpp:284 libcamera v0.2.0 [3:25:01.677684060] [27713] WARN CameraSensor camera_sensor.cpp:248 'ov7251 3-0060': Recommended V4L2 control 0x009a0922 not supported [3:25:01.677709367] [27713] WARN CameraSensor camera_sensor.cpp:315 'ov7251 3-0060': The sensor kernel driver needs to be fixed [3:25:01.677714952] [27713] WARN CameraSensor camera_sensor.cpp:317 'ov7251 3-0060': See Documentation/sensor_driver_requirements.rst in the libcamera sources for more information [3:25:01.678057146] [27713] WARN CameraSensorProperties camera_sensor_properties.cpp:262 No static properties available for 'ov7251' [3:25:01.678101689] [27713] WARN CameraSensorProperties camera_sensor_properties.cpp:264 Please consider updating the camera sensor properties database [3:25:01.678110005] [27713] WARN CameraSensor camera_sensor.cpp:463 'ov7251 3-0060': Failed to retrieve the camera location [3:25:01.678134858] [27713] WARN CameraSensor camera_sensor.cpp:485 'ov7251 3-0060': Rotation control not available, default to 0 degrees [3:25:01.678160940] [27713] ERROR IPU3 cio2.cpp:157 Sensor ov7251 3-0060 has not format compatible with the IPU3

The folks have done such a fantastic job getting things working: this is the only wrinkle for me!

ChrisLangley123 avatar Aug 22 '24 14:08 ChrisLangley123

+1

claudinux11 avatar Sep 10 '24 10:09 claudinux11

qcam is using libcamera 0.2

I'm on a SP5 running ubuntu 24 and I fixed this by jumping into the /usr/lib/x86_64-linux-gnu folder and redirecting all of the libcamera 0.2 files to point at libcamera 0.3.1.

I used symlinks like sudo ln -s libcamera.so.0.3.1 libcamera.so.0.2.0

surface-enjoyer avatar Sep 10 '24 14:09 surface-enjoyer

@surface-enjoyer Sorry, your solution doesn't work for me. The default symlinks are already redirected to version 3, but after redirecting the 0.2.0 to 0.3.1, it just fails:

qcam: symbol lookup error: qcam: undefined symbol: _ZN9libcamera13CameraManager8version_B5cxx11E

Mprogramavimai avatar Sep 28 '24 15:09 Mprogramavimai

On sp4 I get similar

cam --list

cam --list
[3:53:28.976299661] [40342]  INFO Camera camera_manager.cpp:325 libcamera v0.3.2+73-80a7ccd3
[3:53:29.098128343] [40343]  WARN IPAProxy ipa_proxy.cpp:160 Configuration file 'ov8865.yaml' not found for IPA module 'ipu3', falling back to 'uncalibrated.yaml'
[3:53:29.099870539] [40343]  INFO IPU3 ipu3.cpp:1141 Registered Camera[0] "\_SB_.PCI0.I2C3.CAMR" connected to CSI-2 receiver 0
[3:53:29.116080056] [40343]  WARN IPAProxy ipa_proxy.cpp:160 Configuration file 'ov5693.yaml' not found for IPA module 'ipu3', falling back to 'uncalibrated.yaml'
[3:53:29.117139062] [40343]  INFO IPU3 ipu3.cpp:1141 Registered Camera[1] "\_SB_.PCI0.I2C2.CAMF" connected to CSI-2 receiver 1
Available cameras:
1: Internal back camera (\_SB_.PCI0.I2C3.CAMR)
2: Internal front camera (\_SB_.PCI0.I2C2.CAMF)

Which looks fairly OK (?) But qcam gives errors and no cameras can be selected in the dropdown.

qcam
QSocketNotifier: Can only be used with threads started with QThread
[3:50:25.070743326] [40277]  INFO Camera camera_manager.cpp:284 libcamera v0.2.0
[3:50:25.184345818] [40289]  WARN CameraSensor camera_sensor.cpp:248 'ov7251 3-0060': Recommended V4L2 control 0x009a0922 not supported
[3:50:25.184365381] [40289]  WARN CameraSensor camera_sensor.cpp:315 'ov7251 3-0060': The sensor kernel driver needs to be fixed
[3:50:25.184369998] [40289]  WARN CameraSensor camera_sensor.cpp:317 'ov7251 3-0060': See Documentation/sensor_driver_requirements.rst in the libcamera sources for more information
[3:50:25.184633641] [40289]  WARN CameraSensorProperties camera_sensor_properties.cpp:262 No static properties available for 'ov7251'
[3:50:25.184649716] [40289]  WARN CameraSensorProperties camera_sensor_properties.cpp:264 Please consider updating the camera sensor properties database
[3:50:25.184656840] [40289]  WARN CameraSensor camera_sensor.cpp:463 'ov7251 3-0060': Failed to retrieve the camera location
[3:50:25.184663390] [40289]  WARN CameraSensor camera_sensor.cpp:485 'ov7251 3-0060': Rotation control not available, default to 0 degrees
[3:50:25.184697481] [40289] ERROR IPU3 cio2.cpp:157 Sensor ov7251 3-0060 has not format compatible with the IPU3

stuartm9999 avatar Nov 06 '24 15:11 stuartm9999

I did some more investigation on this. It would appear that qcam is using version 0.2.0 pf libcamera as @surface-enjoyer points out, and cam is using the correct 0.3.2 version as installed by the instructions linked by the OP.

Indeed the installation instructions linked

Update the symlinks as required:

Installing symlink pointing to libcamera-base.so.0.3.2 to /usr/lib/x86_64-linux-gnu/libcamera-base.so.0.3
Installing symlink pointing to libcamera-base.so.0.3 to /usr/lib/x86_64-linux-gnu/libcamera-base.so
Installing symlink pointing to libcamera.so.0.3.2 to /usr/lib/x86_64-linux-gnu/libcamera.so.0.3
Installing symlink pointing to libcamera.so.0.3 to /usr/lib/x86_64-linux-gnu/libcamera.so

So I tried to rebuild the optional qcam from https://libcamera.org/getting-started.html

This took me a while as I've not touched c++ build systems for 25 years.

But eventually I figured that

meson setup --reconfigure -Dqcam=disabled build

seemed to set the right build options.

    cam application          : YES
    qcam application         : YES
    lc-compliance application: YES

And installed all the dependent package for qcam.

Unfortunately the qcam does not build

/usr/bin/ld: src/apps/qcam/qcam.p/cam_select_dialog.cpp.o: in function `QString::toStdString() const':
/usr/include/x86_64-linux-gnu/qt6/QtCore/qstring.h:1477:(.text._ZNK7QString11toStdStringEv[_ZNK7QString11toStdStringEv]+0x35): undefined reference to `QByteArray::toStdString() const'

I do not have the inclination to try and fix this!

However - it occurred to me that just because qcam is not working, doesn't mean the camera isn't.

so I tried (as per instructions):

gst-launch-1.0 libcamerasrc camera-name='\\_SB_.PCI0.I2C2.CAMF' ! 
    video/x-raw,width=1280,height=720,framerate=30/1,format=NV12 
    ! videoconvert ! video/x-raw,format=YUY2 ! videoconvert ! 
    v4l2sink device=/dev/video42

and got the error

pipeline could not be constructed: no element "libcamerasrc".

I tried to work this out for a while and then gave up!

stuartm9999 avatar Nov 16 '24 18:11 stuartm9999

It worked fine for me, when I used Ubuntu 24 on my SP6. I just followed the github guide and built v4l2loopback myself instead of installing from the repo. I think I built libcamera from lateset source as well.

Maybe try if Cheese recognizes both your cams

MarcuZSz avatar Dec 25 '24 21:12 MarcuZSz