Repository navigation
Camera ov5693 driver kernel module on Ubuntu 20.04, 6.17.1-surface-2 and Surface Pro 9 #1892
Description
I was trying to troubleshoot Surface Pro 9 on configuration above. Wasn't able to make it works, but seems I was able to make some progress. Since it is burning issue, let me share my finding, and maybe you can provide some guidance what I can do next.
I've already saw few post here, where people were trying to patch kernel, particularly ov5693.c. However patching kernel is too much for me, I found that I can do it just through configuration by adding following file into linux /etc/ folder:
> $ cat /etc/modprobe.d/ov5693.conf`
alias acpi*:OVTI5693:* ov5693
alias i2c:ov5693 ov5693By looking into file
https://github.com/torvalds/linux/blob/master/drivers/media/i2c/ov5693.c
It is obvious that hardware able to identify itself, and linux kernel using this id given by hardware to find a proper drive. Looking through the source code, I've found this few literals "INT33BE", "ovti", "ov5693" but non of this is not in my Surface Pro 9 setup. Likely linux kernel was able to initialze ov13858 kernel module which is driver for back camera, it seems that linux modprobe can be configured with alias for non-standard hardware identifiers.
To find out which proper alias to put, I've looked into following system files:
cat /sys/bus/acpi/devices/OVTI5693:00/modalias
acpi:OVTI5693:OVTI5693:cat /sys/bus/i2c/devices/i2c-OVTI5693:00/name
OVTI5693:00These few files above, this what linux kernel provides as file by reading it from computer hardware.
Before I've added /etc/modprobe.d/ov5693.conf, I haven't seen ov5693 ever loaded by looking into lsmod utility:
lsmod | grep -i -e ov -e 5693
ov5693 24576 0
v4l2_fwnode 36864 3 ov5693,intel_ipu6_isys,ov13858
v4l2_async 28672 4 v4l2_fwnode,ov5693,intel_ipu6_isys,ov13858
videodev 344064 7 v4l2_async,v4l2_fwnode,videobuf2_v4l2,ov5693,v4l2loopback,intel_ipu6_isys,ov13858 mc 81920 7 v4l2_async,videodev,videobuf2_v4l2,ov5693,intel_ipu6_isys,ov13858,videobuf2_commonAll this lines above were updated with ov5693 after adding ov5693.conf into /etc/modeprobe.d folder and rebooting.
Also by looking into source coe
https://github.com/torvalds/linux/blob/master/drivers/media/i2c/ov5693.c
It is also quite obviouse that ov5693.c is dependent to v4l2loopback dkms, so it looks like v4l2loopback mandatory to have, since ov5693 relaying on this driver, same we can in lsmod as well.
Unfortunately even that my linux kernel started to recognize that some of that i2c devices is really an ov5693.c camera, but camera still doesn't works and I see errors in kernel dmesg log:
sudo dmesg
928 │ [ 3.676791] int3472-discrete INT3472:00: GPIO type 0x08 unknown; the sensor may not work
929 │ [ 3.683105] int3472-discrete INT3472:01: GPIO type 0x10 unknown; the sensor may not work
930 │ [ 3.684225] intel-ipu6 0000:00:05.0: Sending AUTHENTICATE_RUN to CSE
931 │ [ 3.691174] mei_me 0000:00:16.0: enabling device (0000 -> 0002)
932 │ [ 3.692270] ov13858 i2c-OVTID858:00: probe with driver ov13858 failed with error -22
Just empty here:
> $ sudo cam -l
[1:02:48.048945116] [19660] INFO Camera camera_manager.cpp:284 libcamera v0.2.0
Available cameras:
And this command doesn't do any output, even that file /dev/video0 is there and v4l2-ctl --all give me some reasonable info:
> $ sudo ffplay -f v4l2 /dev/video0
...
video4linux2,v4l2 @ 0x7cf3a4000c80] Not a video capture device.
/dev/video0: No such device
...
Some related topics:
- Add camera support for Surface Pro 9 #1867
- SP9: Camera support #1064 (comment)
- SP9: Camera support #1064 (comment)
- [SP9] I MADE THE CAMERA WORK #1865
Looks like there are some patch already available for gpio and probably other related issues:
@@ -202,6 +202,8 @@ static void int3472_get_con_id_and_polarity(struct int3472_discrete_device *int3
*gpio_flags = GPIO_ACTIVE_HIGH;
*gpio_flags = GPIO_ACTIVE_HIGH;
break;
break;
case INT3472_GPIO_TYPE_HANDSHAKE:
case INT3472_GPIO_TYPE_HANDSHAKE:
+ case 0x08:
+ case 0x10:
*con_id = "dvdd";
*con_id = "dvdd";
*gpio_flags = GPIO_ACTIVE_HIGH;
*gpio_flags = GPIO_ACTIVE_HIGH;
break;
break;
Activity