intel / ipu6-drivers

GNU General Public License v2.0
160 stars 51 forks source link

Sensor never starts streaming data 70% of the time on X1 Carbon Gen 11 #187

Open lukemarsden opened 11 months ago

lukemarsden commented 11 months ago

I have an X1 Carbon Gen 11 21HMCTO1WW with an ov2740 sensor.

I am running the latest 6.5.5 kernel with the Fedora driver stack from https://hansdegoede.livejournal.com/27276.html

Linux fedora 6.5.5-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Sep 24 15:52:44 UTC 2023 x86_64 GNU/Linux

Very often the stream just fails to start streaming. I can run sudo gst-launch-1.0 icamerasrc ! autovideosink 10 times in a row and on average, I will only get a video stream 3/10 times. The webcam works reliably in Windows so I doubt it's a hardware problem. The exact same software stack works more reliably on an X1 Yoga Gen 8 with the same sensor (different hardware configuration though, the Yoga has a i7-1370P CPU and the Carbon has a i7-1365U).

dmesg -w while doing this shows the following pattern:

image

Here you can see when it worked (on, off with no red errors), and when it didn't (timeouts), from dmesg -w.

Here's the output from running sudo gst-launch-1.0 icamerasrc ! autovideosink > gst-1.txt 2>&1 one time that it didn't work: https://gist.github.com/lukemarsden/d51e5f438d72f3211c402ea4e9af7cf6

And the journal from that time: sudo journalctl -f > journal-1.txt 2>&1: https://gist.github.com/lukemarsden/a5022bebdadaa5ae34aab822aff636b9

The only log lines that seem interesting are the timeouts from gstreamer and the:

Oct 04 17:46:12 fedora kernel: intel-ipu6-isys intel-ipu6-isys0: stream stop time out

line from the ipu6 driver. That "stream stop time out" only happens after I hit ctrl+c (twice) on the gstreamer stream because I'm seeing a black video feed.

dmesg |grep ipu6: https://gist.github.com/lukemarsden/01beb5c00d37e57f71706922aa713832

I followed the instructions at https://hansdegoede.livejournal.com/27276.html

Versions:

akmod-intel-ipu6.x86_64                                                                  0.0-7.20230622git8e41080.fc38                                    @rpmfusion-nonfree-updates                    
ipu6-camera-bins.x86_64                                                                  0.0-7.20230208git276859f.fc38                                    @rpmfusion-nonfree-updates                    
ipu6-camera-bins-firmware.x86_64                                                         0.0-7.20230208git276859f.fc38                                    @rpmfusion-nonfree-updates                    
ipu6-camera-hal.x86_64                                                                   0.0-14.20230208git884b81a.fc38                                   @rpmfusion-nonfree-updates                    
kmod-intel-ipu6-6.4.15-200.fc38.x86_64.x86_64                                            0.0-7.20230622git8e41080.fc38                                    @@commandline                                 
kmod-intel-ipu6-6.5.5-200.fc38.x86_64.x86_64                                             0.0-7.20230622git8e41080.fc38                                    @@commandline                                 
kmod-intel-ipu6-6.5.5-200.fc38.x86_64+debug.x86_64                                       0.0-7.20230622git8e41080.fc38                                    @@commandline                                 
ipu6-camera-bins-devel.x86_64                                                            0.0-7.20230208git276859f.fc38                                    rpmfusion-nonfree-updates                     
ipu6-camera-hal-devel.x86_64                                                             0.0-14.20230208git884b81a.fc38                                   rpmfusion-nonfree-updates                     
kmod-intel-ipu6.x86_64                                                                   0.0-7.20230622git8e41080.fc38                                    rpmfusion-nonfree-updates                     

Please let me know if you need any more details or logs from my system.

kupietz commented 6 months ago

With kernel 6.7 on Fedora 39, success rate with my Lenovo X11 Gen 11 has dropped to 0%. Also, booting Windows in between does not help anymore.

# dmesg | grep -E 'ov2740|ipu6'
[    7.510170] intel-ipu6 0000:00:05.0: enabling device (0000 -> 0002)
[    7.510470] intel-ipu6 0000:00:05.0: Device 0xa75d (rev: 0x1)
[    7.510488] intel-ipu6 0000:00:05.0: physical base address 0x603c000000
[    7.510490] intel-ipu6 0000:00:05.0: mapped as: 0x0000000077df4fb4
[    7.510565] intel-ipu6 0000:00:05.0: IPU in secure mode
[    7.510569] intel-ipu6 0000:00:05.0: IPU secure touch = 0x0
[    7.510571] intel-ipu6 0000:00:05.0: IPU camera mask = 0xff
[    7.530341] intel-ipu6 0000:00:05.0: IPC reset done
[    7.530345] intel-ipu6 0000:00:05.0: cpd file name: intel/ipu6ep_fw.bin
[    7.534974] intel-ipu6 0000:00:05.0: FW version: 20230102
[    7.586383] intel-ipu6 0000:00:05.0: Device 0xa75d (rev: 0x1)
[    7.586426] intel-ipu6 0000:00:05.0: physical base address 0x603c000000
[    7.586428] intel-ipu6 0000:00:05.0: mapped as: 0x0000000077df4fb4
[    7.587498] intel-ipu6 0000:00:05.0: IPU in secure mode
[    7.587502] intel-ipu6 0000:00:05.0: IPU secure touch = 0x0
[    7.587504] intel-ipu6 0000:00:05.0: IPU camera mask = 0xff
[    7.590365] intel-ipu6 0000:00:05.0: IPC reset done
[    7.590368] intel-ipu6 0000:00:05.0: cpd file name: intel/ipu6ep_fw.bin
[    7.590835] intel-ipu6 0000:00:05.0: FW version: 20230102

Has anyone had any better luck?

lukemarsden commented 5 months ago

@jwrdegoede great progress with the open source driver.

Unfortunately still only 30% reliable on my X1 Gen Carbon 11 and about 70% reliable on the X1 Yoga Gen 8.

Also seeing more washed out colour, but it's exciting to see it working without the v4l-relay.

Any ideas who we can ping at Intel to get some movement on the more fundamental reliability issue on these machines? What further device details or instrumentation can I provide?

lukemarsden commented 5 months ago

Following https://copr.fedorainfracloud.org/coprs/jwrdegoede/ipu6-softisp/, seeing the same dmesg 70% of the time when the sensor times (original issue on this thread). Fresh fc39.

[ 1257.974947] intel_ipu6_isys.isys intel_ipu6.isys.40: stream stop time out
[ 1260.152009] intel_ipu6_isys.isys intel_ipu6.isys.40: stream close time out
[ 1267.447995] intel_ipu6_isys.isys intel_ipu6.isys.40: stream stop time out
[ 1269.495069] intel_ipu6_isys.isys intel_ipu6.isys.40: stream close time out
System Information
        Manufacturer: LENOVO
        Product Name: 21HMCTO1WW
        Version: ThinkPad X1 Carbon Gen 11
[...]
        Wake-up Type: Power Switch
        SKU Number: LENOVO_MT_21HM_BU_Think_FM_ThinkPad X1 Carbon Gen 11
        Family: ThinkPad X1 Carbon Gen 11
Linux fedora 6.7.1-200.1.ipu6.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jan 24 21:55:31 UTC 2024 x86_64 GNU/Linux
lukemarsden commented 5 months ago

@jwrdegoede just wanted to add a thank-you, your COPR https://copr.fedorainfracloud.org/coprs/jwrdegoede/ipu6-softisp/ is the only stable way to run the webcam on my X1 Yoga Gen 8 right now. Ubuntu 24.04 nightly was working with the webcam, but broke itself (and emojis stopped working :joy:), and the original https://hansdegoede.livejournal.com/27276.html is no longer working on latest 6.7.9 kernel on fc39.

Even though the colour is a bit washed out, I'm able to use my newer hardware again, so thank you! I also love the fact that the kernel is pinned, knowing that a kernel update can break your webcam any day is annoying :) The kernel also works with bluetooth, 5G and suspend, which is a small miracle.

Is there a near-term plan to improve the washed out colours?

andaag commented 5 months ago

Not succeeding in fedora 39 on a dell xps 9320, but I feel like I'm missing something basic. It's not it's not trying to connect to he camera at all. Not finding any relevant errors either.

# dmesg | grep -E 'ov2740|ipu6'
[    0.000000] Linux version 6.7.1-200.1.ipu6.fc39.x86_64 (mockbuild@ec318dcebdd54443ad88e7a1e85dfd0a) (gcc (GCC) 13.2.1 20231205 (Red Hat 13.2.1-6), GNU ld version 2.40-13.fc39) #1 SMP PREEMPT_DYNAMIC Wed Jan 24 21:55:31 UTC 2024
[    0.000000] Command line: BOOT_IMAGE=(hd0,gpt7)/vmlinuz-6.7.1-200.1.ipu6.fc39.x86_64 root=UUID=363ed805-a453-4c64-b849-f8ae575f439f ro rootflags=subvol=root rd.luks.uuid=luks-625a417b-ab29-4568-983c-c40770ed3480 rhgb quiet mem_sleep_default=s2idle i915.enable_psr=0 resume=UUID=363ed805-a453-4c64-b849-f8ae575f439f resume_offset=75549882 rd.driver.blacklist=nouveau modprobe.blacklist=nouveau
[    0.055212] Kernel command line: BOOT_IMAGE=(hd0,gpt7)/vmlinuz-6.7.1-200.1.ipu6.fc39.x86_64 root=UUID=363ed805-a453-4c64-b849-f8ae575f439f ro rootflags=subvol=root rd.luks.uuid=luks-625a417b-ab29-4568-983c-c40770ed3480 rhgb quiet mem_sleep_default=s2idle i915.enable_psr=0 resume=UUID=363ed805-a453-4c64-b849-f8ae575f439f resume_offset=75549882 rd.driver.blacklist=nouveau modprobe.blacklist=nouveau
[    0.055321] Unknown kernel command line parameters "rhgb BOOT_IMAGE=(hd0,gpt7)/vmlinuz-6.7.1-200.1.ipu6.fc39.x86_64", will be passed to user space.
[    1.606878] usb usb1: Manufacturer: Linux 6.7.1-200.1.ipu6.fc39.x86_64 xhci-hcd
[    1.607141] usb usb2: Manufacturer: Linux 6.7.1-200.1.ipu6.fc39.x86_64 xhci-hcd
[    1.609344] usb usb3: Manufacturer: Linux 6.7.1-200.1.ipu6.fc39.x86_64 xhci-hcd
[    1.610639] usb usb4: Manufacturer: Linux 6.7.1-200.1.ipu6.fc39.x86_64 xhci-hcd
[    2.399849]     BOOT_IMAGE=(hd0,gpt7)/vmlinuz-6.7.1-200.1.ipu6.fc39.x86_64
[   15.424259] intel-ipu6 0000:00:05.0: enabling device (0000 -> 0002)
[   15.424504] intel-ipu6 0000:00:05.0: IPU6 in non-secure mode touch 0x0 mask 0xff
[   15.428447] intel-ipu6 0000:00:05.0: FW version: 20220510
[   15.432657] intel-ipu6 0000:00:05.0: IPU6-v3[465d] hardware version 5
# uname -a

Linux 6.7.1-200.1.ipu6.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jan 24 21:55:31 UTC 2024 x86_64 GNU/Linux

# qcam
[0:01:09.812481594] [5024]  INFO Camera camera_manager.cpp:284 libcamera v0.0.0+3-70b69666
[0:01:09.820633664] [5040] ERROR SimplePipeline simple.cpp:1496 No sensor found

# cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 512-871, parent: platform/INTC1055:00, INTC1055:00:

gpiochip1: GPIOs 872-935, parent: auxiliary/usb_ljca.ljca-gpio.0, INTC1096:00, can sleep:

Any ideas?

lukemarsden commented 5 months ago

@jwrdegoede one more bit of feedback on the copr, when the webcam has to do a "retry" before it starts, sometimes the video comes up "juddery". It feels like there are maybe two simultaneous streams from the webcam that are slightly out of sync with eachother. Maybe this has to do with the first attempt to connect appearing to fail, but actually starting streaming frames, and then the second attempt also ends up streaming them? I'm totally guessing there. Just FYI.

Restarting firefox is normally sufficient to fix it when it does that.

s-ailus commented 5 months ago

I think I came across this issue while testing the embedded data support with Lenovo X1 Carbon Gen 10. I don't know what the actual reason is but I can start streaming reliably (tried about 200 times) after disabling runtime PM on the ov2740 sensor: https://git.linuxtv.org/sailus/media_tree.git/commit/?h=ipu6&id=af377d7fa423f371a3a9b8288b8d65da8a90f47e. This is indeed just a hack, a proper fix would likely end up being somewhere else than this driver. Without the patch in about 50 % of the attempts streaming is supposed to start but no buffers (or anything else) are returned by the ISYS driver.

jwrdegoede commented 5 months ago

I think I came across this issue while testing the embedded data support with Lenovo X1 Carbon Gen 10. I don't know what the actual reason is but I can start streaming reliably (tried about 200 times) after disabling runtime PM on the ov2740 sensor: https://git.linuxtv.org/sailus/media_tree.git/commit/?h=ipu6&id=af377d7fa423f371a3a9b8288b8d65da8a90f47e. This is indeed just a hack, a proper fix would likely end up being somewhere else than this driver. Without the patch in about 50 % of the attempts streaming is supposed to start but no buffers (or anything else) are returned by the ISYS driver.

@s-ailus good catch. Can you try extending the msleep in ov2740_resume() and also try putting a msleep between the clk_prepare_enable() and the gpiod_set_value_cansleep() ?

Hopefully that will fix it. If not then I guess that the reset pin may not be wired up, and that the ACPI PS0 / PS3 methods do actually turn the sensor on/off and without a proper reset it then gets stuck.

Which would suggest Windows never powers down the sensor ... Or maybe we are missing a sw-reset as part of our stream on commands and/or the sleep after the swreset is too short ?

lukemarsden commented 5 months ago

Great news, thanks @s-ailus !

@jwrdegoede any chance you could bake this workaround into a build of your copr kernel please? I'd love to test it on my X1 Carbon Gen 11 where I couldn't get more than 30% success rate with the camera. Also making the Yoga webcam more reliable would be a huge quality of life improvement. I don't mind a slight reduction in battery life.

kupietz commented 4 months ago

I think I came across this issue while testing the embedded data support with Lenovo X1 Carbon Gen 10. I don't know what the actual reason is but I can start streaming reliably (tried about 200 times) after disabling runtime PM on the ov2740 sensor: https://git.linuxtv.org/sailus/media_tree.git/commit/?h=ipu6&id=af377d7fa423f371a3a9b8288b8d65da8a90f47e. This is indeed just a hack, a proper fix would likely end up being somewhere else than this driver. Without the patch in about 50 % of the attempts streaming is supposed to start but no buffers (or anything else) are returned by the ISYS driver.

This solves the issue for me, too, on Fedora 39 and Fedora 40, thanks! Camera indeed seems to work 100%, now.

Patch for current tree, here:

iff --git a/drivers/media/i2c/ov2740.c b/drivers/media/i2c/ov2740.c
index 2b2fbf2d9..f00b95f79 100644
--- a/drivers/media/i2c/ov2740.c
+++ b/drivers/media/i2c/ov2740.c
@@ -1585,7 +1585,7 @@ static int ov2740_probe(struct i2c_client *client)
         */
        pm_runtime_set_active(&client->dev);
        pm_runtime_enable(&client->dev);
-       pm_runtime_idle(&client->dev);
+       pm_runtime_get(&client->dev);

        return 0;
lukemarsden commented 4 months ago

Do you mind sharing a kernel rpm please?

lukemarsden.net @.*** @lmarsden https://twitter.com/lmarsden

On Sat, 27 Apr 2024 at 19:37, Marc Kupietz @.***> wrote:

I think I came across this issue while testing the embedded data support with Lenovo X1 Carbon Gen 10. I don't know what the actual reason is but I can start streaming reliably (tried about 200 times) after disabling runtime PM on the ov2740 sensor: https://git.linuxtv.org/sailus/media_tree.git/commit/?h=ipu6&id=af377d7fa423f371a3a9b8288b8d65da8a90f47e http://url. This is indeed just a hack, a proper fix would likely end up being somewhere else than this driver. Without the patch in about 50 % of the attempts streaming is supposed to start but no buffers (or anything else) are returned by the ISYS driver.

This solves the issue for me, too, on Fedora 39 and Fedora 40, thanks! Camera indeed seems to work 100%, now.

Patch for current tree, here:

iff --git a/drivers/media/i2c/ov2740.c b/drivers/media/i2c/ov2740.c index 2b2fbf2d9..f00b95f79 100644--- a/drivers/media/i2c/ov2740.c+++ b/drivers/media/i2c/ov2740.c@@ -1585,7 +1585,7 @@ static int ov2740_probe(struct i2c_client client) / pm_runtime_set_active(&client->dev); pm_runtime_enable(&client->dev);- pm_runtime_idle(&client->dev);+ pm_runtime_get(&client->dev);

    return 0;

— Reply to this email directly, view it on GitHub https://github.com/intel/ipu6-drivers/issues/187#issuecomment-2081124813, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACATURQNV4AT2CV4VRSAVTY7PWALAVCNFSM6AAAAAA5TDSMNWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBRGEZDIOBRGM . You are receiving this because you were mentioned.Message ID: @.***>

lukemarsden commented 4 months ago

And does suspend still work with this change?

lukemarsden.net @.*** @lmarsden https://twitter.com/lmarsden

On Sat, 27 Apr 2024 at 19:40, Luke Marsden @.***> wrote:

Do you mind sharing a kernel rpm please?

lukemarsden.net @.*** @lmarsden https://twitter.com/lmarsden

On Sat, 27 Apr 2024 at 19:37, Marc Kupietz @.***> wrote:

I think I came across this issue while testing the embedded data support with Lenovo X1 Carbon Gen 10. I don't know what the actual reason is but I can start streaming reliably (tried about 200 times) after disabling runtime PM on the ov2740 sensor: https://git.linuxtv.org/sailus/media_tree.git/commit/?h=ipu6&id=af377d7fa423f371a3a9b8288b8d65da8a90f47e http://url. This is indeed just a hack, a proper fix would likely end up being somewhere else than this driver. Without the patch in about 50 % of the attempts streaming is supposed to start but no buffers (or anything else) are returned by the ISYS driver.

This solves the issue for me, too, on Fedora 39 and Fedora 40, thanks! Camera indeed seems to work 100%, now.

Patch for current tree, here:

iff --git a/drivers/media/i2c/ov2740.c b/drivers/media/i2c/ov2740.c index 2b2fbf2d9..f00b95f79 100644--- a/drivers/media/i2c/ov2740.c+++ b/drivers/media/i2c/ov2740.c@@ -1585,7 +1585,7 @@ static int ov2740_probe(struct i2c_client client) / pm_runtime_set_active(&client->dev); pm_runtime_enable(&client->dev);- pm_runtime_idle(&client->dev);+ pm_runtime_get(&client->dev);

    return 0;

— Reply to this email directly, view it on GitHub https://github.com/intel/ipu6-drivers/issues/187#issuecomment-2081124813, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACATURQNV4AT2CV4VRSAVTY7PWALAVCNFSM6AAAAAA5TDSMNWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBRGEZDIOBRGM . You are receiving this because you were mentioned.Message ID: @.***>

kupietz commented 4 months ago

Do you mind sharing a kernel rpm please? lukemarsden.net @.*** @lmarsden https://twitter.com/lmarsden

I have built the modules outside the kernel tree with dkms, as described here: https://github.com/intel/ipu6-drivers#3-build-with-dkms

With a little variation/addition to get rid of the old conflicting modules:

dkms install  ipu6-drivers/0.0.0
for m in /usr/lib/modules/$(uname -r)/extra/*.ko.xz; do find /usr/lib/modules/$(uname -r) -name $(basename $m) -not -path $m -delete; done; find /usr/lib/modules/$(uname -r) -name usb-ljca.ko.xz -delete

What's still sometimes required is:

systemctl restart v4l2-relayd

And does suspend still work with this change? lukemarsden.net @.*** @lmarsden https://twitter.com/lmarsden

Yes, suspend still works, but indeed not, while the camera is running.

lukemarsden commented 4 months ago

OK, wow, this issue is finally worked-around on my X1 Carbon Gen 11, and webcam is working reliably :tada: Thank you everyone!

This is on Manjaro with kernel 6.6.27-1-MANJARO for now, because it (a) has functional non-softisp setup, so picture quality is better and (b) is easier to patch kernel modules by pointing PKGBUILD files at forks of git repos

Instructions based on https://github.com/stefanpartheym/archlinux-ipu6-webcam:

jwrdegoede commented 4 months ago

@kupietz @lukemarsden thank you both for confirming that disabling runtime pm fixes things.

For upstream I would like to come up with a better fix then disabling runtime-pm. As I cannot reproduce this myself I hope that you can help me with finding a better fix:

  1. Please create a /etc/modprobe.d/intel_skl_int3472_discrete.conf file with the following contents options intel_skl_int3472_discrete dyndbg or add intel_skl_int3472_discrete.dyndbg to your kernel commandline then reboot and after rebooting run: sudo dmesg > dmesg.txt and then attach the generated dmesg.txt file here.

  2. Since you are now both building the drivers yourself can you please try replacing the disable-runtime-pm fix with this patch: 0001-media-ov2740-Attempt-to-fix-stream-on-issues.patch

Note for 1. I'm most interested in log lines like these 3:

[   62.173820] int3472-discrete INT3472:05: Sensor module id: '6BF115T2'
[   62.174338] int3472-discrete INT3472:05: reset \_SB.PC00.XHCI.RHUB.HS08.VGPO pin 10 active-low
[   62.174430] int3472-discrete INT3472:05: privacy-led \_SB.PC00.XHCI.RHUB.HS08.VGPO pin 15 active-high

AFAIK the Carbon Gen 11 has the same camera module as the X1 Yoga Gen 8 from which these 2 log lines are, so I wonder if there maybe is an issue with the pin configuration in the ACPI tables on the Carbon Gen 11.

kupietz commented 4 months ago

Thank you, @jwrdegoede , for trying to find a better fix!

Here the dmesgs before and after replacing the patches:

dmesg_before_patch_replace.txt dmesg_after_patch_replace.txt

With your patch, the camera does not work anymore.

jwrdegoede commented 4 months ago

@kupietz thank you for testing the patch so quickly, looking at the broken log it seems that ov2740_identify_module() failed, which it does sometime independent of the stream start issue. Note this happens before runtime pm is enabled.

So it seems that you hit an unrelated issue (for which I also have an idea how to fix this now, so thank you for that).

Can you reboot into the kernel with my patch attempting to fix it again and try again ? The ov2740 i2c-INT3474:01: chip id mismatch: 2740!=0 error should be intermittent so hopefully after a reboot it will be gone. Unless my adding of sleeps has made this other problem worse.

jwrdegoede commented 4 months ago

Applying this patch: 0001-media-ov2740-Initialize-reset-signal-to-high-not-low.patch.txt

Together with my previous patch to add a bunch of sleeps will hopefully fix the chip id mismatch issue.

kupietz commented 4 months ago

@kupietz thank you for testing the patch so quickly, looking at the broken log it seems that ov2740_identify_module() failed, which it does sometime independent of the stream start issue. Note this happens before runtime pm is enabled.

So it seems that you hit an unrelated issue (for which I also have an idea how to fix this now, so thank you for that).

I don't think it can be unrelated to the runtime pm patch, as the cam works reliably with the patch and reliably not without it. I have no idea, why.

Can you reboot into the kernel with my patch attempting to fix it again and try again ? The ov2740 i2c-INT3474:01: chip id mismatch: 2740!=0 error should be intermittent so hopefully after a reboot it will be gone. Unless my adding of sleeps has made this other problem worse.

It doesn't seem to work. Tried it already for some time and a couple of reboots.

Applying this patch: 0001-media-ov2740-Initialize-reset-signal-to-high-not-low.patch.txt

Together with my previous patch to add a bunch of sleeps will hopefully fix the chip id mismatch issue.

Thanks, @jwrdegoede ! With this patch (alone and together with the first), the camera seems to work reliably again.

I still have to restart v4l2-relayd after/before e.g. zoom sessions or just streaming from v4l2src.

kupietz commented 4 months ago

Applying this patch: 0001-media-ov2740-Initialize-reset-signal-to-high-not-low.patch.txt

Together with my previous patch to add a bunch of sleeps will hopefully fix the chip id mismatch issue.

@jwrdegoede, would you like to make a corresponding pull request? With this patch alone, the camera runs 100% reliably on my Carbon X1 Gen 11 with Fedora 40 and currently kernel 6.8.8 – without this patch, close to not at all since months and kernel 6.7.

Here the dmesg output with int3472 debugging. Let me know when you need more logs. dmesg-after-Initialize-reset-signal-to-high-not-low.txt

@lukemarsden have you tried this patch?

lukemarsden commented 4 months ago

Interesting, with 0001-media-ov2740-Initialize-reset-signal-to-high-not-low.patch.txt I see the first sign of life for the webcam on 6.8.8-2-MANJARO - a kernel I'm keen to use because it fixes suspend issues for the FM350 5G WWAN

However with that configuration I'm back to seeing intermittent failures per the original post in this thread, when also applying the patch to disable PM (https://github.com/lukemarsden/ipu6-drivers/commit/8442600622249ca9498208738e22ac253f1f1b72), I think it's slightly more reliable (hard to tell exactly) but not 100% like it was with 6.6 + only the PM patch

Haven't yet tested 0001-media-ov2740-Attempt-to-fix-stream-on-issues.patch, or the high-not-low patch on 6.6

For ref, here's the tree I'm using: https://github.com/lukemarsden/ipu6-drivers/commits/high-not-low/

lukemarsden commented 4 months ago

adding the sleeps (https://github.com/lukemarsden/ipu6-drivers/commit/04691add59d2aa54dacef8823d6a334ee429066a) doesn't make any difference, we're still back to ~30% reliability with https://github.com/lukemarsden/ipu6-drivers/commits/high-not-low/ which includes:

I'm also nervous that I used a newer version of ipu6-drivers on this newer kernel versus the https://github.com/lukemarsden/ipu6-drivers/commits/fix-pm-runtime-idle/ branch I used on 6.6, so, might be other confounding factors. The fix-pm-runtime-idle branch alone on 6.8 (with just the PM fix) didn't seem to work at all.

lukemarsden commented 4 months ago

@kupietz what tree are you applying these patches to?

kupietz commented 4 months ago

@kupietz what tree are you applying these patches to?

To the master branch here, to build the modules. I've successfully tested the patches here with kernel 6.8.7 and 6.8.8. I had this 30% reliability before, too, (with kernel 6.6 I think), but with the two patches it seems to be 100%, now.

lukemarsden commented 4 months ago

@kupietz would you mind writing down how you're getting things working on stock Fedora, step by step please? I'll try to repro your exact setup, rather than from Manjaro.

lukemarsden commented 4 months ago

@kupietz are you using @jwrdegoede’s original rpmfusion userland stack https://hansdegoede.livejournal.com/27276.html but compiling ipu6-drivers from intel’s github with dkms? or something else?

if the former, how do you remove the ipu6 module from rpmfusion but keep the rest of the bits installed?

kupietz commented 4 months ago

@kupietz are you using @jwrdegoede’s original rpmfusion userland stack https://hansdegoede.livejournal.com/27276.html but compiling ipu6-drivers from intel’s github with dkms? or something else?

No, I'm using the ipu6-driver sources here (https://github.com/intel/ipu6-drivers ) and apply the two patches 0001-media-ov2740-Initialize-reset-signal-to-high-not-low.patch.txt and 0001-media-ov2740-Attempt-to-fix-stream-on-issues.patch

if the former, how do you remove the ipu6 module from rpmfusion but keep the rest of the bits installed?

The removal of the conflicting modules and the rest exactly as described here:

https://github.com/intel/ipu6-drivers/issues/187#issuecomment-2081130149

lukemarsden commented 4 months ago

ok thanks, sorry I forgot you already explained! this is all with rpmfusion packages for userland?

lukemarsden commented 4 months ago

I tried booting into my fedora partition and:

I also checked in /usr/lib/modules/$(uname -r)/extra/ and saw an intel-ipu6 directory with timestamps dated April 19, so tried deleting that entire directory, and rebooted again.

All in, no luck. Webcam light doesn't even turn on. dmesg log shows errors about int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring (not 100% sure if this is related to the webcam?). What did I do wrong?

luke@fedora:~$ sudo dmesg |grep ipu6
[    7.160451] intel_ipu6: loading out-of-tree module taints kernel.
[    7.160459] intel_ipu6: module verification failed: signature and/or required key missing - tainting kernel
[    7.173942] intel-ipu6 0000:00:05.0: enabling device (0000 -> 0002)
[    7.174363] intel-ipu6 0000:00:05.0: Device 0xa75d (rev: 0x1)
[    7.174389] intel-ipu6 0000:00:05.0: physical base address 0x603c000000
[    7.174391] intel-ipu6 0000:00:05.0: mapped as: 0x0000000029f25f37
[    7.174586] intel-ipu6 0000:00:05.0: IPU in secure mode
[    7.174589] intel-ipu6 0000:00:05.0: IPU secure touch = 0x0
[    7.174591] intel-ipu6 0000:00:05.0: IPU camera mask = 0xff
[    7.190647] intel-ipu6 0000:00:05.0: IPC reset done
[    7.191818] intel-ipu6 0000:00:05.0: FW version: 20230102
[    7.194317] intel-ipu6 0000:00:05.0: Found supported sensor INT3474:01
[    7.194381] intel-ipu6 0000:00:05.0: Connected 1 cameras
[    7.196783] intel-ipu6 0000:00:05.0: Sending BOOT_LOAD to CSE
[    7.220401] intel-ipu6 0000:00:05.0: Sending AUTHENTICATE_RUN to CSE
[    7.296452] intel-ipu6 0000:00:05.0: CSE authenticate_run done
[    7.296485] intel-ipu6 0000:00:05.0: IPU6-v3 driver version 1.0
[    7.329406] intel-ipu6-psys intel-ipu6-psys0: pkg_dir entry count:8
[    7.332455] intel-ipu6-psys intel-ipu6-psys0: psys probe minor: 0

sudo dmesg -w

[   81.601862] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring
[   81.603316] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring

sudo gst-launch-1.0 icamerasrc ! autovideosink

luke@fedora:~$ sudo gst-launch-1.0 icamerasrc ! autovideosink
Setting pipeline to PAUSED ...
[05-06 13:07:55.869] CamHAL[INF] aiqb file name ov13b10.aiqb
[05-06 13:07:55.871] CamHAL[INF] aiqb file name ov13b10.aiqb
[05-06 13:07:55.872] CamHAL[INF] (null), media format in tuning: 0, media format for aic 0.
[05-06 13:07:55.872] CamHAL[INF] aiqb file name ov13b10.aiqb
[05-06 13:07:55.872] CamHAL[INF] aiqb file name ov13b10.aiqb
[05-06 13:07:55.873] CamHAL[INF] (null), media format in tuning: 0, media format for aic 0.
[05-06 13:07:55.873] CamHAL[INF] aiqb file name ov8856.aiqb
[05-06 13:07:55.873] CamHAL[INF] aiqb file name ov8856.aiqb
[05-06 13:07:55.874] CamHAL[INF] (null), media format in tuning: 0, media format for aic 0.
[05-06 13:07:55.874] CamHAL[INF] aiqb file name ov8856.aiqb
[05-06 13:07:55.874] CamHAL[INF] aiqb file name ov8856.aiqb
[05-06 13:07:55.874] CamHAL[INF] (null), media format in tuning: 0, media format for aic 0.
[05-06 13:07:55.874] CamHAL[INF] aiqb file name ov01a10.aiqb
[05-06 13:07:55.875] CamHAL[INF] aiqb file name ov01a10.aiqb
[05-06 13:07:55.876] CamHAL[INF] (null), media format in tuning: 0, media format for aic 0.
[05-06 13:07:55.876] CamHAL[INF] aiqb file name ov01a10.aiqb
[05-06 13:07:55.876] CamHAL[INF] aiqb file name ov01a10.aiqb
[05-06 13:07:55.877] CamHAL[INF] (null), media format in tuning: 0, media format for aic 0.
[05-06 13:07:55.877] CamHAL[INF] aiqb file name OV02C10_1BG203N3_ADL.aiqb
[05-06 13:07:55.877] CamHAL[INF] aiqb file name OV02C10_1BG203N3_ADL.aiqb
[05-06 13:07:55.878] CamHAL[INF] (null), media format in tuning: 0, media format for aic 0.
[05-06 13:07:55.878] CamHAL[INF] aiqb file name OV02C10_1SG204N3_ADL.aiqb
[05-06 13:07:55.878] CamHAL[INF] aiqb file name OV02C10_1SG204N3_ADL.aiqb
[05-06 13:07:55.879] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.879] CamHAL[INF] aiqb file name OV02C10_CIFME14_ADL.aiqb
[05-06 13:07:55.879] CamHAL[INF] aiqb file name OV02C10_CIFME14_ADL.aiqb
[05-06 13:07:55.879] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.879] CamHAL[INF] aiqb file name OV02C10_1BG203N3_ADL.aiqb
[05-06 13:07:55.880] CamHAL[INF] aiqb file name OV02C10_1BG203N3_ADL.aiqb
[05-06 13:07:55.880] CamHAL[INF] (null), media format in tuning: 0, media format for aic 0.
[05-06 13:07:55.880] CamHAL[INF] aiqb file name OV02C10_1SG204N3_ADL.aiqb
[05-06 13:07:55.880] CamHAL[INF] aiqb file name OV02C10_1SG204N3_ADL.aiqb
[05-06 13:07:55.880] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.880] CamHAL[INF] aiqb file name OV02C10_CIFME14_ADL.aiqb
[05-06 13:07:55.880] CamHAL[INF] aiqb file name OV02C10_CIFME14_ADL.aiqb
[05-06 13:07:55.881] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.881] CamHAL[INF] aiqb file name OV2740_CJFLE23_ADL.aiqb
[05-06 13:07:55.881] CamHAL[INF] aiqb file name OV2740_CJFLE23_ADL.aiqb
[05-06 13:07:55.881] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.881] CamHAL[INF] aiqb file name HM2170_1SG205N3_ADL.aiqb
[05-06 13:07:55.882] CamHAL[INF] aiqb file name HM2170_1SG205N3_ADL.aiqb
[05-06 13:07:55.882] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.882] CamHAL[INF] aiqb file name HM2170_CJFME18_ADL.aiqb
[05-06 13:07:55.882] CamHAL[INF] aiqb file name HM2170_CJFME18_ADL.aiqb
[05-06 13:07:55.883] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.883] CamHAL[INF] aiqb file name HM2170_1SG205N3_ADL.aiqb
[05-06 13:07:55.883] CamHAL[INF] aiqb file name HM2170_1SG205N3_ADL.aiqb
[05-06 13:07:55.883] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.883] CamHAL[INF] aiqb file name HM2170_CJFME18_ADL.aiqb
[05-06 13:07:55.883] CamHAL[INF] aiqb file name HM2170_CJFME18_ADL.aiqb
[05-06 13:07:55.883] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.883] CamHAL[INF] aiqb file name HI556_1BG502T3_ADL.aiqb
[05-06 13:07:55.884] CamHAL[INF] aiqb file name HI556_1BG502T3_ADL.aiqb
[05-06 13:07:55.884] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.884] CamHAL[INF] aiqb file name HI556_CJFLE25_ADL.aiqb
[05-06 13:07:55.884] CamHAL[INF] aiqb file name HI556_CJFLE25_ADL.aiqb
[05-06 13:07:55.884] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.884] CamHAL[INF] aiqb file name ov01a1s.aiqb
[05-06 13:07:55.885] CamHAL[INF] aiqb file name ov01a1s.aiqb
[05-06 13:07:55.886] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.886] CamHAL[INF] aiqb file name OV08A10_YHUT_ADL.aiqb
[05-06 13:07:55.886] CamHAL[INF] aiqb file name OV08A10_YHUT_ADL.aiqb
[05-06 13:07:55.887] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.887] CamHAL[INF] aiqb file name IMX390_HDR_TGL.aiqb
[05-06 13:07:55.887] CamHAL[INF] aiqb file name IMX390_HDR_TGL.aiqb
[05-06 13:07:55.888] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.888] CamHAL[INF] aiqb file name IMX390_HDR_TGL.aiqb
[05-06 13:07:55.888] CamHAL[INF] aiqb file name IMX390_HDR_TGL.aiqb
[05-06 13:07:55.888] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.888] CamHAL[INF] aiqb file name IMX390_HDR_TGL.aiqb
[05-06 13:07:55.888] CamHAL[INF] aiqb file name IMX390_HDR_TGL.aiqb
[05-06 13:07:55.889] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.889] CamHAL[INF] aiqb file name IMX390_HDR_TGL.aiqb
[05-06 13:07:55.889] CamHAL[INF] aiqb file name IMX390_HDR_TGL.aiqb
[05-06 13:07:55.889] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.889] CamHAL[INF] aiqb file name IMX390_HDR_TGL.aiqb
[05-06 13:07:55.890] CamHAL[INF] aiqb file name IMX390_HDR_TGL.aiqb
[05-06 13:07:55.890] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.890] CamHAL[INF] aiqb file name IMX390_HDR_TGL.aiqb
[05-06 13:07:55.890] CamHAL[INF] aiqb file name IMX390_HDR_TGL.aiqb
[05-06 13:07:55.891] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.891] CamHAL[INF] aiqb file name IMX390_HDR_TGL.aiqb
[05-06 13:07:55.891] CamHAL[INF] aiqb file name IMX390_HDR_TGL.aiqb
[05-06 13:07:55.892] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.892] CamHAL[INF] aiqb file name IMX390_HDR_TGL.aiqb
[05-06 13:07:55.892] CamHAL[INF] aiqb file name IMX390_HDR_TGL.aiqb
[05-06 13:07:55.892] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.892] CamHAL[INF] aiqb file name IMX390_HDR_TGL.aiqb
[05-06 13:07:55.892] CamHAL[INF] aiqb file name IMX390_HDR_TGL.aiqb
[05-06 13:07:55.893] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.893] CamHAL[INF] aiqb file name IMX390_HDR_TGL.aiqb
[05-06 13:07:55.893] CamHAL[INF] aiqb file name IMX390_HDR_TGL.aiqb
[05-06 13:07:55.893] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.893] CamHAL[INF] aiqb file name IMX390_HDR_TGL.aiqb
[05-06 13:07:55.893] CamHAL[INF] aiqb file name IMX390_HDR_TGL.aiqb
[05-06 13:07:55.894] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.894] CamHAL[INF] aiqb file name IMX390_HDR_TGL.aiqb
[05-06 13:07:55.894] CamHAL[INF] aiqb file name IMX390_HDR_TGL.aiqb
[05-06 13:07:55.894] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.894] CamHAL[INF] aiqb file name AR0234_TGL_10bits.aiqb
[05-06 13:07:55.895] CamHAL[INF] aiqb file name AR0234_TGL_10bits.aiqb
[05-06 13:07:55.895] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.895] CamHAL[INF] aiqb file name AR0234_TGL_10bits.aiqb
[05-06 13:07:55.895] CamHAL[INF] aiqb file name AR0234_TGL_10bits.aiqb
[05-06 13:07:55.896] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.896] CamHAL[INF] aiqb file name AR0234_TGL_10bits.aiqb
[05-06 13:07:55.896] CamHAL[INF] aiqb file name AR0234_TGL_10bits.aiqb
[05-06 13:07:55.896] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.896] CamHAL[INF] aiqb file name AR0234_TGL_10bits.aiqb
[05-06 13:07:55.896] CamHAL[INF] aiqb file name AR0234_TGL_10bits.aiqb
[05-06 13:07:55.897] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.897] CamHAL[INF] aiqb file name AR0234_TGL_10bits.aiqb
[05-06 13:07:55.897] CamHAL[INF] aiqb file name AR0234_TGL_10bits.aiqb
[05-06 13:07:55.897] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.897] CamHAL[INF] aiqb file name AR0234_TGL_10bits.aiqb
[05-06 13:07:55.897] CamHAL[INF] aiqb file name AR0234_TGL_10bits.aiqb
[05-06 13:07:55.898] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.898] CamHAL[INF] aiqb file name AR0234_TGL_10bits.aiqb
[05-06 13:07:55.898] CamHAL[INF] aiqb file name AR0234_TGL_10bits.aiqb
[05-06 13:07:55.898] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.898] CamHAL[INF] aiqb file name AR0234_TGL_10bits.aiqb
[05-06 13:07:55.898] CamHAL[INF] aiqb file name AR0234_TGL_10bits.aiqb
[05-06 13:07:55.898] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.898] CamHAL[INF] aiqb file name AR0234_TGL_10bits.aiqb
[05-06 13:07:55.898] CamHAL[INF] aiqb file name AR0234_TGL_10bits.aiqb
[05-06 13:07:55.899] CamHAL[ERR] invalid media format, default value used.
[05-06 13:07:55.899] CamHAL[INF] (null), media format in tuning: 0, media format for aic 0.
[05-06 13:07:55.899] CamHAL[INF] (null), media format in tuning: 0, media format for aic 0.
[05-06 13:07:55.899] CamHAL[INF] (null), media format in tuning: 0, media format for aic 0.
[05-06 13:07:55.899] CamHAL[INF] (null), media format in tuning: 0, media format for aic 0.
[05-06 13:07:55.899] CamHAL[ERR] Failed to find DevName for cameraId: 0, get video node: ov13b10 , devname: /dev/v4l-subdev1
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
[05-06 13:07:55.920] CamHAL[ERR] Get entity fail for calling getEntityById
[05-06 13:07:55.920] CamHAL[ERR] Get entity fail for calling getEntityById
[05-06 13:07:55.920] CamHAL[ERR] setup Link ov13b10  [-1:0] ==> Intel IPU6 CSI-2  [-1x0] enable 1 failed.
[05-06 13:07:55.920] CamHAL[ERR] set MediaCtlConf McLink failed: ret = -1
[05-06 13:07:55.920] CamHAL[ERR] set up mediaCtl failed
[05-06 13:07:55.920] CamHAL[ERR] @configure Device Configure failed
[05-06 13:07:55.920] CamHAL[ERR] failed to config streams.
ERROR: from element /GstPipeline:pipeline0/Gstcamerasrc:camerasrc0: src pad: Internal data flow error.
Additional debug info:
gstcambasesrc.cpp(3153): gst_cam_base_src_loop (): /GstPipeline:pipeline0/Gstcamerasrc:camerasrc0:
streaming task paused, reason not-negotiated (-4)
Execution ended after 0:00:00.014406447
Setting pipeline to NULL ...
Freeing pipeline ...

sudo uname -a

Linux fedora 6.8.8-300.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Apr 27 17:53:31 UTC 2024 x86_64 GNU/Linux
lukemarsden commented 4 months ago

I was a bit suspicious that there was no ov2740 module:

luke@fedora:~$ sudo find /usr/lib/modules/$(uname -r)/extra/ |grep ov2740
luke@fedora:~$ 

Or did it get renamed?

kupietz commented 4 months ago

I was a bit suspicious that there was no ov2740 module:

luke@fedora:~$ sudo find /usr/lib/modules/$(uname -r)/extra/ |grep ov2740
luke@fedora:~$ 

Or did it get renamed?

No, it should definitely be there:

$ ls -l /usr/lib/modules/6.8.8-300.fc40.x86_64/extra/             
total 360
-rw-r--r--. 1 root root  5968 May  3 17:50 gpio-ljca.ko.xz
-rw-r--r--. 1 root root 10336 May  3 17:50 hi556.ko.xz
-rw-r--r--. 1 root root  8464 May  3 17:50 hm11b1.ko.xz
-rw-r--r--. 1 root root  8488 May  3 17:50 hm2170.ko.xz
-rw-r--r--. 1 root root  9224 May  3 17:50 hm2172.ko.xz
-rw-r--r--. 1 root root  4864 May  3 17:50 i2c-ljca.ko.xz
-rw-r--r--. 1 root root 60948 May  3 17:50 intel-ipu6-isys.ko.xz
-rw-r--r--. 1 root root 45540 May  3 17:50 intel-ipu6-psys.ko.xz
-rw-r--r--. 1 root root 46224 May  3 17:50 intel-ipu6.ko.xz
-rw-r--r--. 1 root root  3908 May  3 17:50 intel_vsc.ko.xz
-rw-r--r--. 1 root root 12296 May  3 17:50 ljca.ko.xz
-rw-r--r--. 1 root root 18024 May  3 17:50 mei-vsc.ko.xz
-rw-r--r--. 1 root root  5964 May  3 17:50 mei_ace.ko.xz
-rw-r--r--. 1 root root  6272 May  3 17:50 mei_ace_debug.ko.xz
-rw-r--r--. 1 root root  4924 May  3 17:50 mei_csi.ko.xz
-rw-r--r--. 1 root root  8832 May  3 17:50 mei_pse.ko.xz
-rw-r--r--. 1 root root  8012 May  3 17:50 ov01a10.ko.xz
-rw-r--r--. 1 root root  8780 May  3 17:50 ov01a1s.ko.xz
-rw-r--r--. 1 root root  9704 May  3 17:50 ov02c10.ko.xz
-rw-r--r--. 1 root root  9444 May  3 17:50 ov02e10.ko.xz
-rw-r--r--. 1 root root 10388 May  3 17:50 ov2740.ko.xz
-rw-r--r--. 1 root root  4296 May  3 17:50 spi-ljca.ko.xz
drwxr-xr-x. 1 root root    36 May  3 17:46 v4l2loopback

Maybe you did not actually make the modules in ipu6-drivers (make -j $(nrpoc)) or you need to force install them (sudo dkms install --force ipu6-drivers/0.0.0)?

What I forgot to mention: I've also installed v4l2loopback.x86_64 v4l2-relayd.x86_64 from rpmfusion-free.

jwrdegoede commented 4 months ago

First of all thank you both for all the testing. I'm a bit surprised that just fixing the initial reset line state not only fixes probe() sometimes outright failing but that it also fixes the stream not starting problem for @kupietz .

One problem at probe() is that if the reset line is 0 before the driver acquires the GPIO then it is driven high (to reset the ov2740) only for a very short time. Here is a patch which fixes both the initial state and then waits a bit to ensure that the ov2740 actually sees the reset line go high and has time to fully enter reset: 0001-media-ov2740-Ensure-proper-reset-sequence-on-probe.patch

@lukemarsden when trying this please fully poweroff the laptop and then after 10 seconds power it back on. Since the sensor was not properly being reset it may be in some sort of weird limbo state until power-cycled.

About the ov2740 driver not showing up under: /usr/lib/modules/$(uname -r)/extra/ this is caused by recent changes by ipu6-drivers upstream where they no longer build the ov2740 driver with recent kernels since I merged all the necessary changes for ov2740 to work into the mainline kernel.

To get the extra version of the ov2740 to build again with the latest ipu6-drivers, apply this change to ipu6-drivers/Makefile :

diff --git a/Makefile b/Makefile
index 6286beade..d679c061a 100644
--- a/Makefile
+++ b/Makefile
@@ -83,9 +83,9 @@ export CONFIG_VIDEO_OV02E10 = m
 export CONFIG_VIDEO_HM2170 = m
 export CONFIG_VIDEO_HM2172 = m
 export CONFIG_VIDEO_HI556 = m
+export CONFIG_VIDEO_OV2740 = m

 ifeq ($(call version_lt,$(KERNEL_VERSION),$(KV_OV2740)),true)
-export CONFIG_VIDEO_OV2740 = m
 export CONFIG_VIDEO_GC5035 = m
 endif
 obj-y += drivers/media/i2c/
jwrdegoede commented 4 months ago

I have also posted more or less the same patch upstream for the upstream version of the ov2740 driver, note that the upstream driver did already properly initialize the gpio to high:

https://lore.kernel.org/linux-media/20240506132438.278920-1-hdegoede@redhat.com/

trygvis commented 4 months ago

@lukemarsden I'm having the same issues that you are, but I also have this in dmesg:

deferred probe pending: ov2740: failed to check HW configuration: -517 ```plain [ 4.775798] intel-ipu6 0000:00:05.0: enabling device (0000 -> 0002) [ 4.775923] intel-ipu6 0000:00:05.0: Device 0xa75d (rev: 0x0) [ 4.775943] intel-ipu6 0000:00:05.0: physical base address 0x603c000000 [ 4.775945] intel-ipu6 0000:00:05.0: mapped as: 0x00000000b7f47d17 [ 4.775998] intel-ipu6 0000:00:05.0: IPU in secure mode [ 4.776002] intel-ipu6 0000:00:05.0: IPU secure touch = 0x0 [ 4.776004] intel-ipu6 0000:00:05.0: IPU camera mask = 0xff [ 4.794116] intel-ipu6 0000:00:05.0: IPC reset done [ 4.796634] intel-ipu6 0000:00:05.0: firmware: direct-loading firmware intel/ipu6ep_fw.bin [ 4.796942] intel-ipu6 0000:00:05.0: FW version: 20230102 [ 4.800518] intel-ipu6 0000:00:05.0: Sending BOOT_LOAD to CSE [ 4.824978] intel-ipu6 0000:00:05.0: Sending AUTHENTICATE_RUN to CSE [ 4.913811] intel-ipu6 0000:00:05.0: CSE authenticate_run done [ 4.913835] intel-ipu6 0000:00:05.0: IPU6-v3 driver version 1.0 [ 4.948999] intel-ipu6-psys intel-ipu6-psys0: pkg_dir entry count:8 [ 4.949269] intel-ipu6-psys intel-ipu6-psys0: psys probe minor: 0 [ 5.071643] intel-ipu6-isys intel-ipu6-isys0: isys probe 0000000008e6d417 0000000008e6d417 [ 5.072181] intel-ipu6-isys intel-ipu6-isys0: csi-0 base = 0xffffb09e85220000 [ 5.072194] intel-ipu6-isys intel-ipu6-isys0: csi-1 base = 0xffffb09e85221000 [ 5.072200] intel-ipu6-isys intel-ipu6-isys0: csi-2 base = 0xffffb09e85222000 [ 5.072205] intel-ipu6-isys intel-ipu6-isys0: csi-3 base = 0xffffb09e85223000 [ 5.072211] intel-ipu6-isys intel-ipu6-isys0: csi-4 base = 0xffffb09e85224000 [ 5.072214] intel-ipu6-isys intel-ipu6-isys0: csi-5 base = 0xffffb09e85225000 [ 5.072218] intel-ipu6-isys intel-ipu6-isys0: csi-6 base = 0xffffb09e85226000 [ 5.072221] intel-ipu6-isys intel-ipu6-isys0: csi-7 base = 0xffffb09e85227000 [ 5.072432] intel-ipu6-isys intel-ipu6-isys0: no subdev found in graph [ 5.073159] intel-ipu6-isys intel-ipu6-isys0: set_iwake_ltrdid ltr: 1023 did: 1023 [ 5.076972] intel-ipu6-isys intel-ipu6-isys0: set_iwake_ltrdid ltr: 20 did: 20 [ 5.088014] intel-ipu6-isys intel-ipu6-isys0: set_iwake_ltrdid ltr: 1023 did: 1023 [ 5.984337] intel-ipu6-isys intel-ipu6-isys0: set_iwake_ltrdid ltr: 20 did: 20 [ 6.011167] intel-ipu6-isys intel-ipu6-isys0: set_iwake_ltrdid ltr: 1023 did: 1023 [ 6.059332] intel-ipu6-isys intel-ipu6-isys0: set_iwake_ltrdid ltr: 20 did: 20 [ 6.084585] intel-ipu6-isys intel-ipu6-isys0: set_iwake_ltrdid ltr: 1023 did: 1023 [ 16.951904] i2c i2c-INT3474:01: deferred probe pending: ov2740: failed to check HW configuration: -517 [ 30.996092] intel-ipu6-isys intel-ipu6-isys0: set_iwake_ltrdid ltr: 20 did: 20 [ 31.024062] intel-ipu6-isys intel-ipu6-isys0: set_iwake_ltrdid ltr: 1023 did: 1023 [ 31.229647] intel-ipu6-isys intel-ipu6-isys0: set_iwake_ltrdid ltr: 20 did: 20 [ 31.232608] intel-ipu6-isys intel-ipu6-isys0: set_iwake_ltrdid ltr: 1023 did: 1023 [ 31.233355] intel-ipu6-isys intel-ipu6-isys0: set_iwake_ltrdid ltr: 20 did: 20 [ 31.255464] intel-ipu6-isys intel-ipu6-isys0: set_iwake_ltrdid ltr: 1023 did: 1023 [ 31.258553] intel-ipu6-isys intel-ipu6-isys0: set_iwake_ltrdid ltr: 20 did: 20 [ 31.282975] intel-ipu6-isys intel-ipu6-isys0: set_iwake_ltrdid ltr: 1023 did: 1023 [ 32.247939] intel-ipu6-isys intel-ipu6-isys0: set_iwake_ltrdid ltr: 20 did: 20 [ 32.271752] intel-ipu6-isys intel-ipu6-isys0: set_iwake_ltrdid ltr: 1023 did: 1023 [ 57.406046] intel-ipu6-isys intel-ipu6-isys0: set_iwake_ltrdid ltr: 20 did: 20 [ 57.408919] intel-ipu6-isys intel-ipu6-isys0: set_iwake_ltrdid ltr: 1023 did: 1023 [ 57.409747] intel-ipu6-isys intel-ipu6-isys0: set_iwake_ltrdid ltr: 20 did: 20 [ 57.436689] intel-ipu6-isys intel-ipu6-isys0: set_iwake_ltrdid ltr: 1023 did: 1023 ```

My output from sudo gst-launch-1.0 icamerasrc ! autovideosink looks the same as yours.

The kernel is from Debian experimental.

kupietz commented 4 months ago

First of all thank you both for all the testing. I'm a bit surprised that just fixing the initial reset line state not only fixes probe() sometimes outright failing but that it also fixes the stream not starting problem for @kupietz .

One problem at probe() is that if the reset line is 0 before the driver acquires the GPIO then it is driven high (to reset the ov2740) only for a very short time. Here is a patch which fixes both the initial state and then waits a bit to ensure that the ov2740 actually sees the reset line go high and has time to fully enter reset: 0001-media-ov2740-Ensure-proper-reset-sequence-on-probe.patch

For some reason, this patch does not seem to work as reliably for me as 0001-media-ov2740-Initialize-reset-signal-to-high-not-low.patch.txt together with 0001-media-ov2740-Attempt-to-fix-stream-on-issues.patch.

In ~70% of reboots, either the camera does not start at all (chip id mismatch: 2740!=0) or the picture stays black.

I have also posted more or less the same patch upstream for the upstream version of the ov2740 driver, note that the upstream driver did already properly initialize the gpio to high:

https://lore.kernel.org/linux-media/20240506132438.278920-1-hdegoede@redhat.com/

I'm currently back to the old combination , but will try this variant later (ah, this is the same except that the high instead of low reset was already applied).

jwrdegoede commented 4 months ago

For some reason, this patch does not seem to work as reliably for me as 0001-media-ov2740-Initialize-reset-signal-to-high-not-low.patch.txt together with 0001-media-ov2740-Attempt-to-fix-stream-on-issues.patch.

Hmm, 2 more things to try and thank you for all the testing! :

  1. What happens if you combine the new patch with the patch adding the sleeps to ov2740_resume()?
  2. What happens if you swap the clk_prepare_enable() and the gpiod_set_value() calls in ov2740_resume() ?

For 2: I wonder if the DSDT has the clk and reset GPIOs swapped (in the end the clk is controlled by a GPIO too on these laptops) and thus instead of enabling the clk, then wait a bit for it too be stable and then take the ov2740 out of reset, we first take it out of reset and only then enable the clk .... So if swapping these 2 calls helps then it is likely the clk-enable and reset GPIOs are indeed swapped.

lukemarsden commented 4 months ago

On Fedora, I couldn't get past

[   81.601862] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring

even after getting ov2740.ko.xz to exist with https://github.com/lukemarsden/ipu6-drivers/commit/83ee2476b31b4364f09a6c1dca30882ee5319609

Back on Manjaro, I couldn't get anything out of the webcam even after shutting down for 10 seconds. I'm now getting this:

❯ sudo dmesg |grep ov2740
[    5.574789] ov2740 i2c-INT3474:01: no link frequency 360000000 supported
[    5.574794] ov2740 i2c-INT3474:01: error -EINVAL: failed to check HW configuration: -22
[    5.575006] ov2740: probe of i2c-INT3474:01 failed with error -22

I fear some other changes might have landed upstream that have broken me :(

❯ sudo dmesg|grep ipu6
[    5.168560] intel-ipu6 0000:00:05.0: enabling device (0000 -> 0002)
[    5.169011] intel-ipu6 0000:00:05.0: Device 0xa75d (rev: 0x1)
[    5.169033] intel-ipu6 0000:00:05.0: physical base address 0x603c000000
[    5.169035] intel-ipu6 0000:00:05.0: mapped as: 0x000000005ba7bcbf
[    5.169396] intel-ipu6 0000:00:05.0: IPU in secure mode
[    5.169399] intel-ipu6 0000:00:05.0: IPU secure touch = 0x0
[    5.169401] intel-ipu6 0000:00:05.0: IPU camera mask = 0xff
[    5.186798] intel-ipu6 0000:00:05.0: IPC reset done
[    5.189235] intel-ipu6 0000:00:05.0: FW version: 20230925
[    5.195590] intel-ipu6 0000:00:05.0: Found supported sensor INT3474:01
[    5.195679] intel-ipu6 0000:00:05.0: Connected 1 cameras
[    5.205368] intel-ipu6 0000:00:05.0: Sending BOOT_LOAD to CSE
[    5.222629] intel-ipu6 0000:00:05.0: Sending AUTHENTICATE_RUN to CSE
[    5.302421] intel-ipu6 0000:00:05.0: CSE authenticate_run done
[    5.302462] intel-ipu6 0000:00:05.0: IPU6-v3 driver version 1.0
[    5.434618] intel-ipu6-psys intel-ipu6-psys0: pkg_dir entry count:8
[    5.434747] intel-ipu6-psys intel-ipu6-psys0: psys probe minor: 0
[ 3012.564839] intel-ipu6 0000:00:05.0: IPU in secure mode
[ 4483.012916] intel-ipu6 0000:00:05.0: IPU in secure mode
❯ uname -a
Linux hope 6.8.8-2-MANJARO #1 SMP PREEMPT_DYNAMIC Thu May  2 10:47:46 UTC 2024 x86_64 GNU/Linux

Any ideas @jwrdegoede? Here are the patches I'm running: https://github.com/lukemarsden/ipu6-drivers/commits/high-not-low/

The9Cat commented 4 months ago

I also have a Lenovo 21HMCTO1WW with the same issues using the Ubuntu 6.8.0-32 noble-proposed kernel. Not much else I can add.

kupietz commented 4 months ago

For some reason, this patch does not seem to work as reliably for me as 0001-media-ov2740-Initialize-reset-signal-to-high-not-low.patch.txt together with 0001-media-ov2740-Attempt-to-fix-stream-on-issues.patch.

Hmm, 2 more things to try and thank you for all the testing! :

1. What happens if you combine the new patch with the patch adding the sleeps to ov2740_resume()?

This seems to work almost as reliably as the old combination. But only almost. The advantage of the old combination seems to be that I can always recover from a black picture with one and sometimes a couple of systemctl restart v4l2-relayd. With the new combination, I got stuck with a black picture after some camera starts and stops.

2. What happens if you swap the clk_prepare_enable() and the gpiod_set_value() calls in ov2740_resume() ?

You mean in ov2740_power_on, I guess? With this change, I couldn't get the camera to start, after three power cycles (chip id mismatch: 2740!=0).

For 2: I wonder if the DSDT has the clk and reset GPIOs swapped (in the end the clk is controlled by a GPIO too on these laptops) and thus instead of enabling the clk, then wait a bit for it too be stable and then take the ov2740 out of reset, we first take it out of reset and only then enable the clk .... So if swapping these 2 calls helps then it is likely the clk-enable and reset GPIOs are indeed swapped.

Apparently not with my variant.

lukemarsden commented 4 months ago

@jwrdegoede should I not be installing your akmod-intel-ipu6 when building the modules with DKMS (and then attempting to clean up the kernel modules)? Could that be why my system is broken on Fedora? If so, which specific packages (and from where) should I be installing? A short list of instructions (from fresh install) on how to test patches against Fedora would be tremendously helpful.

kupietz commented 4 months ago

@jwrdegoede should I not be installing your akmod-intel-ipu6 when building the modules with DKMS (and then attempting to clean up the kernel modules)? Could that be why my system is broken on Fedora? If so, which specific packages (and from where) should I be installing? A short list of instructions (from fresh install) on how to test patches against Fedora would be tremendously helpful.

Yes, you should not install the modules from the sources here and from akmod-intel-ipu6. I accidentally, had this configuration once, too and was wondering why nothing works. Apart from what I described above, v4l2-relayd.x86_64 from @rpmfusion-free should be installed. And even with the best working solution, I often have to restart it (systemctl restart v4l2-relayd), after/before a Zoom session.

My model is, however, slightly different from yours, according to lshw: product: 21HM0067GE (LENOVO_MT_21HM_BU_Think_FM_ThinkPad X1 Carbon Gen 11)

The9Cat commented 4 months ago

The situation is much more inconvenient on the 21HMCTO1WW. When it works, it's good for a Zoom session or two, with lucky. And then it will hang in "on" state. Nothing seems to work, e.g. systemctl restart v4l2-relayd doesn't help, except a reboot.

jwrdegoede commented 4 months ago

Hi All, here is a new attempt at fixing the start/stop issues. If possible please give this a try 0001-media-ov2740-Attempt-3-to-fix-stream-on-issues.patch

kupietz commented 4 months ago

Hi All, here is a new attempt at fixing the start/stop issues. If possible please give this a try 0001-media-ov2740-Attempt-3-to-fix-stream-on-issues.patch

Thank you for your tireless attempts!

(Based this on the changed master branch, as here: https://github.com/kupietz/ipu6-drivers/tree/media-ov2740-Attempt-3-to-fix-stream-on-issues )

This seems to work as well as the previous best combination. I have to restart v4l2-relayd after/before almost every camera start/stop at least once, but it reliably recovers from black picture every time and the camera starts reliably.

The9Cat commented 4 months ago

I'd be happy to try this, but I'd need some pointers. Does someone have a recipe outlining the steps for building in Ubuntu?

lukemarsden commented 3 months ago

Hi @kupietz I'm trying to follow your instructions on a fresh Fedora 40 install, per https://github.com/intel/ipu6-drivers/issues/187#issuecomment-2081130149

I'm confused by what the line

for m in /usr/lib/modules/$(uname -r)/extra/*.ko.xz; do find /usr/lib/modules/$(uname -r) -name $(basename $m) -not -path $m -delete; done; find /usr/lib/modules/$(uname -r) -name usb-ljca.ko.xz -delete

is intended to do exactly. I tried it without the -delete parts to see which files it would match, but it seemed like it matched more files than you probably intended. What's the intention behind this command? What specific modules need to be deleted (and, out of curiousity, but optionally, why?)

Cheers, Luke

kupietz commented 3 months ago

The patched ipu6-driver modules are in installed with dkms in: /usr/lib/modules/$(uname -r)/extra/. The script goes through all of these and deletes any stale duplicates in /usr/lib/modules/$(uname -r)/. In addition, it deletes the stale and conflicting module usb-ljca.ko.xz, if it exists. On Fedora, the script should do exactly what needs to be done. Of course, you only need to run it once after a new kernel installation with dnf, but it does not harm to always call it.

lukemarsden commented 3 months ago

Thank you @kupietz! One more question: in https://github.com/intel/ipu6-drivers#3-build-with-dkms, do you run the

 git clone https://github.com/intel/ivsc-driver.git
 cp -r ivsc-driver/backport-include ivsc-driver/drivers ivsc-driver/include .
 rm -rf ivsc-driver

steps? It's unclear to me whether to do so, because it mentions <= kernel v6.6, but we're on v6.8 here.

lukemarsden commented 3 months ago

@kupietz Oh, and are you doing the equivalent of https://github.com/lukemarsden/ipu6-drivers/commit/ba14c27e2203975852a3b7d547bb2ee253c40c07 and https://github.com/lukemarsden/ipu6-drivers/commit/83ee2476b31b4364f09a6c1dca30882ee5319609 to make the module build? I didn't see it in your tree.

lukemarsden commented 3 months ago

Latest status report on freshly installed Fedora 40 6.8.9-300.fc40.x86_64. Currently blocked on:

[   24.938184] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring

code

I'm using this ipu6-drivers code: https://github.com/lukemarsden/ipu6-drivers/commits/attempt-3-to-fix-stream-on-issues/

Based on latest master of https://github.com/intel/ipu6-drivers - I noticed https://github.com/intel/ipu6-drivers/pull/213 landed

Includes:

steps

Steps to reproduce / what I did (@jwrdegoede @kupietz please check carefully if this looks correct to you):

  1. Install Fedora 40 fresh from ISO
  2. dnf update, reboot
  3. Get confused by fact that kernel headers are no longer packages in kernel-headers package. Oh well, they seem to be on the system
  4. Install v4l2-relayd.x86_64 from rpmfusion-free
  5. checkout https://github.com/lukemarsden/ipu6-drivers/commits/attempt-3-to-fix-stream-on-issues/
  6. sudo dkms add .; sudo dkms autoinstall ipu6-drivers/0.0.0 --force - this definitely seems to build the modules, /usr/lib/modules/6.8.9-300.fc40.x86_64/extra/ov2740.ko.xz now exists for example. (I did not cp -r ivsc-driver etc from https://github.com/intel/ipu6-drivers#3-build-with-dkms since we're not on <= 6.6)
  7. for m in /usr/lib/modules/$(uname -r)/extra/*.ko.xz; do find /usr/lib/modules/$(uname -r) -name $(basename $m) -not -path $m -delete; done; find /usr/lib/modules/$(uname -r) -name usb-ljca.ko.xz -delete, reboot
  8. dmesg now complains it can't find firmware. so clone https://github.com/intel/ipu6-camera-bins and run cp -r ipu6-camera-bins/include/* /usr/include/, cp -r ipu6-camera-bins/lib/* /usr/lib/, reboot

Webcam now fails to load with:

[   24.938184] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring

I've also tried powering off for 10 seconds.

Detailed relevant dmesg output ``` luke@fedora:~/ipu6-drivers$ sudo dmesg |grep 'ipu6\|ov2740\|GPIO' [ 6.955001] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 6.960578] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 6.961305] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 6.965562] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 6.970979] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 6.976965] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 6.987938] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 6.994108] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 7.004692] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 7.015471] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 7.040282] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 7.041409] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 7.046794] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 7.053207] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 7.055028] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 7.059297] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 7.069082] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 7.071694] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 7.072597] intel-ipu6 0000:00:05.0: enabling device (0000 -> 0002) [ 7.072738] intel-ipu6 0000:00:05.0: Device 0xa75d (rev: 0x1) [ 7.072753] intel-ipu6 0000:00:05.0: physical base address 0x603c000000 [ 7.072755] intel-ipu6 0000:00:05.0: mapped as: 0x00000000ca5cdf5d [ 7.072812] intel-ipu6 0000:00:05.0: IPU in secure mode [ 7.072814] intel-ipu6 0000:00:05.0: IPU secure touch = 0x0 [ 7.072816] intel-ipu6 0000:00:05.0: IPU camera mask = 0xff [ 7.074068] intel-ipu6 0000:00:05.0: IPC reset done [ 7.075606] intel-ipu6 0000:00:05.0: FW version: 20230925 [ 7.077987] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 7.080684] intel-ipu6 0000:00:05.0: Found supported sensor INT3474:01 [ 7.080784] intel-ipu6 0000:00:05.0: Connected 1 cameras [ 7.082201] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 7.084161] intel-ipu6 0000:00:05.0: Sending BOOT_LOAD to CSE [ 7.086632] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 7.092855] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 7.097676] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 7.103885] intel-ipu6 0000:00:05.0: Sending AUTHENTICATE_RUN to CSE [ 7.136770] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 7.144760] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 7.174035] intel-ipu6 0000:00:05.0: CSE authenticate_run done [ 7.174091] intel-ipu6 0000:00:05.0: IPU6-v3 driver version 1.0 [ 7.178669] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 7.191973] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 7.199115] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 7.206614] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 7.210166] intel-ipu6-psys intel-ipu6-psys0: pkg_dir entry count:8 [ 7.213695] intel-ipu6-psys intel-ipu6-psys0: psys probe minor: 0 [ 7.217934] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 7.228296] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 7.235333] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 7.248348] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 7.261944] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 7.266933] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 7.356604] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 7.368275] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 7.397793] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 7.410607] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 7.428513] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 7.437517] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 7.452591] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 7.463366] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 7.476049] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 7.558077] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 7.561806] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 7.566781] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 7.570479] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 7.584425] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 7.588018] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 7.591478] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 7.593826] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 7.781005] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 7.785465] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 7.860123] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 7.864547] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 8.549908] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 8.551433] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 15.832329] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 15.833066] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 18.624681] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 18.626839] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring [ 18.627104] platform INT3472:05: deferred probe pending: int3472-discrete: Failed to get GPIO [ 18.627112] platform INT3472:06: deferred probe pending: int3472-discrete: Failed to get GPIO [ 24.937038] int3472-discrete INT3472:05: cannot find GPIO chip INTC1096:00, deferring [ 24.938184] int3472-discrete INT3472:06: cannot find GPIO chip INTC1096:00, deferring ```

I also copied /etc/default/v4l2-relayd from my Manjaro install, not sure if this is necessary:

# GStreamer source element name:
VIDEOSRC="icamerasrc"
#SPLASHSRC="filesrc location=/.../splash.png ! pngdec ! imagefreeze num-buffers=4 ! videoscale ! videoconvert"

# Output format, width, height, and frame rate:
FORMAT=NV12
WIDTH=1280
HEIGHT=720
FRAMERATE=30/1

# Virtual video device name:
CARD_LABEL="Virtual Camera"

# Extra options to pass to v4l2-relayd:
#EXTRA_OPTS=-d

But we don't seem to be getting that far (no kernel logs from ov2740 module, getting stuck on int3472-discrete error which seems to be earlier in the process).

What am I doing wrong? I'd like to get to the point that we can document, from a fresh install, exactly what to do. That would really help other users.