-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when loading intel-ipu6 module #48
Comments
I can confirm the null pointer dereference in For me, it has the nasty side effect that shutdown and suspend are broken afterwards. |
My wild guess is that it has to do with the patch int3472-support-independent-clock-and-LED-gpios-5.17+ included in this repo is not applied with dkms builds, and furthermore, it does not contain entries for the X1 Carbon:
I guess there some entry for the X1 Carbon (which I also have) is necessary!? |
Seing this null pointer dereference with the patch int3472-support-independent-clock-and-LED-gpios-5.17+ included. |
@fhloston On which hardware? |
@norbusan |
|
Similar on HP Spectre x360 16-f1010TX (i7-1260P) @ 5.19.0-15-generic and (K)Ubuntu 20.10: [ 3594.980687] intel-ipu6 intel-ipu: Device 0x465d (rev: 0x2) Btw, I tried with the new kernel: Same error for kernel 6.0 and 6.1rc1 (dmesg_ipu6.txt) Camera/shutdown/standby not working, but maybe related to other issues with the a370m Intel driver, as the whole dmesg output looks like a Christmas tree |
Hi, wondering if https://launchpad.net/~canonical-hwe-team/+archive/ubuntu/intermediate-kernel works for you:
|
Thanks for your suggestion. The point is, I tried something crazy, I merged the driver with the current
Then you have to add the
After this you can install the kernel:
But I was looking through the diffs and saw that the camera driver files are most probably not in the latest version of the ipu6 repository, i will try to change this and see what happens. (not sure if the ipu driver was already loading the camera driver while it got stuck with the error, or if it was still in an earlier state). In case I find something out I will post it. |
The specific crash mentioned here is fixed by: 5a36712 But fixing it just results in somewhat related crashes further down the road, note I have fixes for those too, see #58 in general. But you also need some other changes to get things to actually work on Alderlake Lenovo Thinkpads let me copy and paste my comment from #55 about this: I have been working on making the ipu6-driver stack work on a Lenovo Thinkpad X1 Yoga gen 7 (alderlake) with a 6.0 kernel and using the INT3472 mainline kernel driver for power-control. I have submitted the following fixes for this, I believe these should also fix things not working on the X1 Nano Gen2: #58 Note this relies on the mainline kernel itself also being build with the 2 patches from ipu6-drivers/patch. And if you look at the int3472-support-independent-clock-and-LED-gpios-5.17+.patch you will see it adds an entry for the Yoga Gen 7 to the |
I can confirm that applying the before mentioned fixes i can see video from the webcam for the first time! Thank you, great job @jwrdegoede
Sadly v4l2-relayd does not work for me yet. @jwrdegoede how do you then use the camera? |
I have not gotten around to trying v4l2-relayd yet. I was happy to have gst-launch work after a marathon coding session involving all the kernel fixes and then called it a day :) I might give v4l2-relayd a shot coming Tuesday. |
BTW did you have to add an entry to the |
I looks like that I do not need to add an entry to I compiled the kernel now with all patches applied, This looks to me as if there are some HAL-driver related files missing, but it seems that the device is available.
same for the other command: Btw, is there any easy way to list the acpi ensor-module-names in the console? |
No, I just applied your mentioned patches plus an unrelated i915 patch. Also X1 Yoga gen7 here. |
@fhloston was that i915 patch useful? @jeffreyfq There are multiple names that are necessary for sensor setup. The _HID and _DDN from ACPI can be obtained easily and are used in the camera sensor driver.
Then there is a model string from ACPI _DSM() of some device that is used by int3472 and compared to the list in Maybe it is contained in the DSDT, but not verbatim, so I just added As a sort of long shot I added this to
and changed
but the ov9734 sensor driver does not like its monochrome sibling variant and fails with -EINVAL during probing. No crash though. |
Thank you for your help and the detailed instructions, I was able to read out the ACPI data:
So I have the device INT3474 with OV2740-CRDG2 It seems that OV2740 and IMX135 (for imx135 there is seemingly no driver available in drivers/media/i2c/), both are RGB sensors, kind of strange, I thought the IR sensor would be grayscale. Then I checked, So next I will compile the kernel module with some print statements to get the I still have the I did it:
for Update:
Update2:
Actually I dont know what the fourth argument -true- means, did not try with false yet. Now something happens, but also new errors appear and also the dmeg is messy (includes
I loaded the v4l2 loopback kernel module as well. btw: this is the output of v4l2-ctl --all
|
You seem to have another secondary sensor in your X1 Yoga Gen7 than me: ` Device (CAM0)
|
@fhloston I just tried now, but results in the same error. But considering that my hardware is so similar to the X1 Yoga Gen7, like in your case, I guess it has to work for me too. I guess to be on the safe side, I have to start over and patch the kernel/modules from a fresh checkout, could be possible that I messed up something. this is the output (does not cause new dmesg errors):
|
@jeffreyfq This is the same error I have with the OV2740 in the Nano X1 Gen2 that I've filed a bug report on ( #55 ) I haven't been able to get further than you and like you I'm a little fatigued by it. I do have one tidbit of info though. Launching your gstreamer command with GST_DEBUG env var set can get you a lot more information. Something like:
I was tracking this down to missing modules or a conflict with the ivsc-driver package. @fhloston What does |
Note that the presence of the sensor in the DSDT does not say everything, there are multiple sensor entries and only some actually are "active", this is governed by the _STA method of the ACPI device returning 0xf (present) or 0 (not present). To really see which sensors you have, first build the main kernel with the int3472-gpio + https://lore.kernel.org/linux-acpi/20221022150722.31787-1-hdegoede@redhat.com/ patches. After this the sensors should show up under in |
I did however |
yes, indeed! thanks!
|
How I installed kernel and drivers:
|
@fhloston thank you for taking the time to write these out, very helpful. I'll get to this sometime today. |
Just something I noted while applying the kernel patch of @jwrdegoede ,
My devices are named
maybe the driver is never loaded if the device name is not in this honor list.... @fhloston : |
As I obviously developed an obsession of compiling my kernel, I tried another round. This time, I used kernel 6.0.5, downloaded from kernel.org.
Actually I tried true and false as the last parameter, and false seems to work better somehow^^ Then it seems to be crucial to install the v4l2loopback kernel module. Somewhere in the internet, someone mentioned As it turns out, I am getting same error messages as before on my self-modified 6.2-rc2/next kernel. The only related dmesg errors show this:
I am not sure, but I had a look into the source, the
and the
so it will not be ready until I even put some additional print-outs there, and it turns out those modules are listed in lsmod, but their probe function is never called!! Not sure how this is possible, I thought when I modprobe the module the probe function is called... but my guess is that there is some fancy function in the kernel which relates to the One thing that seems strange to me is that there is a hi556 kernel module loaded,
|
@jeffreyfq checkout #55 and read a bit. There's some helpful things in there, does What is in Did you actually apply the "LATT2021" patch from the kernel mailing list? Copied manually? What happens when you modprobe ov2740? Here is what a working GPIO/i2c dev tree looks like for the ov2740 sensor on a nano gen2:
|
@jeffreyfq you should not edit/change
For details for how this all actually works (it has to do with ensuring that things are probed in a certain order) see: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9d9bcae47fd5a |
@jwrdegoede That's exactly the details I wanted. Very great reading/learning material. Thanks. |
@fhloston @jwrdegoede If you have trouble with v4l-relayd not working, try using v4l2loopback from Ubuntu (https://git.launchpad.net/ubuntu/+source/v4l2loopback), it contains patches (in folder debian/patches) that are crucial to make v4l-relayd work, mostly relating to V4L2_EVENT_PRI_CLIENT_USAGE, aka v4l2 events needed to start the stream when a client opens the loopback device. I just got that to sort of work today with chromium and gstreamer video source, everything else has some problems with the loopback device and sometimes v4l2-relayd just crashes. |
@drogenlied a thanks, that probably explains why it is not working for me. |
Another tip: applying umlaeute/v4l2loopback#435 to v4l2loopback will allow some ffmpeg based applications to use the device, otherwise they complain about buffer sizes. One more thing: I added an output video format to the v4l2-relayd .service file and the config file, as shown below, now I have successfully tested Chromium, OBS, Firefox, mpv and VLC. Especially VLC and Firefox really do not like the NV12 video format and work fine with YUY2.
|
Thanks @jwrdegoede and @polair for following up on this, @jwrdegoede, I can confirm,
Yes
Yes, I patched this, the one-liner, but I dont have that device in my system.
Nothing, no dmesg entry, no error, I can not notice any difference after loading the module by hand.
I guess there are some differences to the HP spectre notebook, compared to the lenovo one. But there is no hi556 device, also the device name in hi556.c:
Does not exist in the ACPI data (e.g.
Also there is no LATT2021 device, checked
But even then, I seems strange to me that the hi556 module loads without a device present in my system. Right after boot, I can see many messages |
@jeffreyfq the ACPI tables unfortunately are not always written in such a way that they are easily readable. E.g. the ACPI hw-id (HID/CID) may come out of a variable set by the BIOS. E.g. you say there is no INT3537 in your DSDT (did you also check the SSDTs?) but since you do have a It is also interesting to see if the driver is actually binding to the device. Can you do:
And see if there is a driver symlink in there ? And the same for the other i2c-devices. Note that it might be tricky to get things to work on laptop models which do not have an officially supported Linux OS option (typically an Ubuntu OEM install) . On these laptop models some extra work / fixes may be necessary and it may be quite tricky to figure out what changes are necessary. Can you attach a full dmesg output from after your latest attempt here? And also please run |
@jeffreyfq Also please run: |
Hi all, [success message] just joining in with a different but similar hardware: I got the webcam working with the following steps:
With that in place I see a lot of log messages concerning IPU:
I have the following devices:
After that I managed to get a video output with
Next I will try relayd or loopback according to the comments here. Thanks a lot for all your work |
Additional information: With this repo: https://github.com/stefanpartheym/archlinux-ipu6-webcam and in particular the v4l2loopback and v4l2-relayd packages installed and loade using
I get video output in MS Edge (Linux) in Jit.si and Google Meet. Incredible! |
@jwrdegoede Thanks, of course I understand if you don't have time for this. But in case you can have a quick look, and maybe find something I could check, it would be great.
I now figured out, I don't have the ov2740 sensor. This means that the loading of the kernel module is indeed ok. The entries shown by doing a
There is a symlink:
These are the symlinks of the other devices:
dmesg output: dmesg.txt
This is the path
This is the output of gstreamer:
The first error is As a summary:
The sensor driver loads with this. Ipu-related dmesg looks promising:
Later in the dmesg I get the following errors/messages that do not seem right:
and
This tells me that there might be a dependency the vsc driver is waiting for.
But I can not see any output in the dmesg of this, could be that there is no acpi device waiting or the Another thing I wanted to mention, during boot I can see the message:
Modprobing works, but there is the message My suspicion is that the new/unknown GPIO type 0x12 is maybe the physical lid of the sensor that can be closed opened by an electric mechanism (there is a key on the keyboard that physically closes/opens a lid in front of the camera lens). This is maybe why it is not yet defined in the driver. But it is just a guess for now. |
I still fail to use /dev/video0 with vlc or firefox with v4l2loopback and v4l2-relayd With vlc and trying to playback /dev/video0 at least the camera led turns on, but i see no picture. I see vlc detecting YUV format - even though i have set the format to NV12. Any ideas what I could be holding wrong? Update: OK, I have been holding it wrong, cheese and zoom just work. |
@fhloston as a workaround for the NV12 issue you can edit the v4l-relayd.service file, check my comment #48 (comment) |
That's a very practical way to do it, but the solution may not scalable as you will only find the _DSM for the precise version of the camera you're using. For example, the Nano has 2 different _DSM for each camera, depending if the screen is touchscreen enabled or not
If you have access to the Windows partition, an alternative is to check the .inf files like: /w11/Windows/System32/DriverStore/FileRepository/ov2740.inf_amd64_* and /w11/Windows/System32/DriverStore/FileRepository/ov9234.inf_amd64_* You will find there the names without much need to experiment: OV2740:
OV9234:
I think you may be requesting a resolution or a format that's not supported. Check /win/Windows/System32/drivers/graph_settings_OV9234_6BF115T2_ADL.xml for supported formats, ex:
|
I'm now here after opening #106. Thanks for helpful comments. But I see:
So I have what an Arducam IMX135?? lol And OV2740-CRDG2 is Omnivision OV2740? |
I also have a problem with Lenovo Thinkpad X1 carbon gen 11: it loads, but there is no usable camera, even with kernel 6.4.4 (also for some reason $ grep -A4 '(CAM' dsdt.dsl
$ lsmod | grep "ivsc\|ipu\|ov"
$ v4l2-ctl --list-devices
$ gst-launch-1.0 icamerasrc device-name=ov2740-uf buffer-count=7 ! video/x-raw,format=NV12,width=1280,height=720 ! videoconvert ! ximagesink
$ sudo dmesg | grep -i "ipu6\|ljca\|int34"
|
Have you also enabled The wishlist bug for including |
@fhloston, thank you for the idea! It finally somewhat works! But
|
v4l2-relayd enchantment looks a bit different here:
|
Without putting args for I tried both options with |
I also used 6.4.4 for a while but have reverted back to 6.3.7... |
After playing I managed to fix sigfault, but I have no idea how... My best guess is that enabling debug in module So Unfortunately Debugging shows nothing useful:( P.S. I was surprised how bad video quality of this camera, I'd expect something amazing... |
And it finally works! The problem was introduced in umlaeute/v4l2loopback@c7a5cd4, I had to patch So now it works on Lenovo ThinkPad X1 gen 11, Debian/Sid, kernel 6.4.11 |
Distro kernel without recompile? I just noticed, the debian wishlist bug with inclusion of So it should be possible to use ipu6-dkms as is. |
@fhloston I also get this error |
I am running 5.19.12-1-default on OpenSUSE Tumbleweed. My hardware is LENOVO 21CBCTO1WW/21CBCTO1WW, BIOS N3AET65W (1.30). I got an error when loading intel-ipu6 module (commit from 20220926) during boot:
Edit: Still the same problem with kernel 6.0.0 and the commit from 20221009
The text was updated successfully, but these errors were encountered: