-
Notifications
You must be signed in to change notification settings - Fork 103
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
minimal required mt9m114 driver changes #6
Comments
Do we additionally have to transplant some of the GPIO handling of the atomisp-mt9m114.c to some atomisp or v4l2-driver to make the new mt9m114.c work? |
The devil is in the detail: mt9m114.c: ov2680.c: static struct i2c_driver ov2680_i2c_driver = { |
This source: should be adapted for Baytrail as was suggested in this commit message: Currently this source only supports Lenovo Ideapad Miix 310 and Xiaomi Mipad2, which both depend on a well formed Cherry Trail GUID for the camera in the DSDT, where the DSDT of the Asus T100 is not that mature and doesn't contain this GUID: |
And probably this one as well: https://github.com/torvalds/linux/blob/master/drivers/media/pci/intel/ipu-bridge.c |
This file has a comment that only mentions the atomisp2401: |
This function is a model for how parse_dt should await the bridge: |
You could wonder why https://github.com/torvalds/linux/blob/master/drivers/media/i2c/aptina-pll.c is not applied in mt9m114.c for determining the PLL values. |
I now pulled and built the newest media-atomisp-branch from Hansg: I found this instruction for coping with memory-issues during driver building:
|
ChatGPT proposes to implement VIDEOBUF2-stuff for supporting V4L2_MEMORY_MMAP |
@rmast, I see that you are spending a lot of time on this. But it is unclear to me what exactly you are trying to achieve? If you take my latest atomisp branch and build a kernel with that and then run: gst-launch-1.0 v4l2src ! videoconvert ! xvimagesink as described in: drivers/staging/media/atomisp/TODO then the camera should just work except that you will have bad exposure/gain values. The next steps would be to either expose proper exposure/gain v4l2-controls from the atomisp specific mt9m114 driver; or make things work with the non staging standard v4l2 mt9m114 driver from drivers/media/i2c/ . I have a bunch of patching working towards the latter here: https://github.com/jwrdegoede/linux-sunxi/commits/main As a first step I would suggest you to reproduce my working setup where "gst-launch-1.0 v4l2src ! videoconvert ! xvimagesink" works using my media-atomisp branch as base. Then lets talk about what exactly you are trying to achieve / what your goal here is and see how we can reach that. |
Great! That's exactly what I'm trying to accomplish. Can you share your magic .config for building the right kernel options as well? Or is there a simple make _some_config command that selects the right config from scratch? |
The config which I use for all my testing can be found here: https://github.com/jwrdegoede/linux-sunxi/blob/main/.config This is Fedora's default kernel config with some local modifications like enabling the atomisp driver. Together with my atomisp branch from: https://git.kernel.org/pub/scm/linux/kernel/git/hansg/linux.git/log/?h=media-atomisp This should result in a working camera. Assuming that you have done the BIOS hack to turn the atomisp device into a PCI device. Note that with these old-style atomisp drivers it is important that the sensor driver gets loaded before the atomisp driver itself. I blacklist the atomisp module and then manually modprobe it after atomisp-mt9m114 has loaded. |
Still no luck and no /dev/video0. This is my /etc/modprobe.d/atomisp.conf: Nov 20 16:51:43 fedora kernel: atomisp-isp2 0000:00:03.0: probe with driver atomisp-isp2 failed with error -22 |
@jwrdegoede as this commit torvalds/linux@795ac29#diff-e28901ef99c4094d9194d0bb3bd3ae194aead0287183eac5c81290c92b8b6479R62 contains a hacky solution to a similar problem, do you remember altering that video format manually and temporarily to get the mt9m114 to work? |
And if so, did you pick similar values to the allowed values for the mt9m114 on this page: https://github.com/jfwells/linux-asus-t100ta/tree/master/webcam for example |
Yes yes yes yes yessss!!!! V4L2_PIX_FMT_YUV422P did the trick! Next step will be to provide this result in a dkms-like construct with @EasyNetDev to make it possible to promote and continue development without rebuilding the kernel each time. |
habemus camera?
Sent from [Proton Mail](https://proton.me/mail/home) for iOS
…On Fri, Nov 22, 2024 at 12:04, rmast ***@***.***(mailto:On Fri, Nov 22, 2024 at 12:04, rmast <<a href=)> wrote:
Yes yes yes yes yessss!!!!
V4L2_PIX_FMT_YUV422P did the trick!
Next step will be to provide this result in a dkms-like construct with ***@***.***(https://github.com/EasyNetDev) to make it possible to promote and continue development without rebuilding the kernel each time.
—
Reply to this email directly, [view it on GitHub](#6 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AOKMBYODHHYMZFKEBH4EQHL2B4FTRAVCNFSM6AAAAABQFS4ZNSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOJTGQ4TGNJRHE).
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
prima signa |
> habemus camera?
prima signa
🌱
(thoroughly enjoying this development thread throughout time. always beautiful to emerge from the dark ages. keep up the good work y'all!)
… —
Reply to this email directly, [view it on GitHub](#6 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AOKMBYJJQE44UKJRPBKH74T2B4JA7AVCNFSM6AAAAABQFS4ZNSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOJTGU2DINRTGQ).
You are receiving this because you commented.Message ID: ***@***.***>
|
My workaround with YUV422 is not stable. Probing atomisp does not consistently result in /dev/video0 and if it does it can still have memory allocation issues, probably less than YUV420. Fedora has Gnome instead of XFCE. I will try to lower the system resources.
|
Installing Fedora 41 LXQt spin, which leaves about 600mb of RAM free reveals the issue with YUV420 was a memory issue. On Fedora LXQt spin the source tree can be built without modification. I wonder whether shrinking that 10000x10000 can releave the memory consumption, as the mt9m114 probably only needs half for the 720p resolution.
|
@EasyNetDev I altered my
atomisp-6.10-dkms repo in the atomisp-mt9m114 branch to reflect the current version of the Hansg media-atomisp branch.
With the exception of the punit_atom_debug module, which appears not essential for the first camera signs I saw the camera function with the current 6.11.4-301.fc41.x86_64 of Fedora LXQt spin 41.
Just run
bash build-dkms
make -j4
sudo make install
I believe I also did a reboot.
And then the magic gst-launch, as long as
free -m
says there's at least about 100MB free.
(and don't forget to blacklist mt9m114 and atomisp and modprobe atomisp after atomisp_mt9m114 is loaded.)
|
The default kernel of Fedora LXQt spin 41 (6.11.4) is unstable for some sdhci_acpi and sdhci, giving crashes about mmc0, an error I didn't see before which seems to block the ssh-connection, so it appears not stable for development. I'll experiment with other kernel builds.
@EasyNetDev this instability seems to occur after some short timeout. I tried the "core" 11.4 and "updates" 11.8 kernel, but both have this instability. The custom kernel built from the media-atomisp - branch from hansg and the config from his linux-sunxi does not have this instability, so there is some altered setting that mitigates this issue. I'll continue with Hansg's custom kernel, probably with some out of tree mechanism to shorten the iterative build.
@EasyNetDev I now tried Hansg's kernel on an USB-SSD-install done with Debian 12.7 xfce live iso. I can confirm this camera hack also works on debian. So, the debian DKMS mechanism should at least work against a custom built kernel.
|
The instability of the default Fedora kernel on the t100 seems to be a revived kernel bug that can be worked around without recompiling the kernel with the kernel boot parameter intel_idle.max_cstate=1
Verzonden vanaf Outlook voor Android<https://aka.ms/AAb9ysg>
…________________________________
From: Robert Mast ***@***.***>
Sent: Sunday, November 24, 2024 11:02:19 PM
To: jfwells/linux-asus-t100ta ***@***.***>; jfwells/linux-asus-t100ta ***@***.***>
Cc: Mention ***@***.***>
Subject: Re: [jfwells/linux-asus-t100ta] minimal required mt9m114 driver changes (Issue #6)
The default kernel of Fedora LXQt spin 41 (6.11.4) is unstable for some sdhci_acpi and sdhci, giving crashes about mmc0, an error I didn't see before which seems to block the ssh-connection, so it appears not stable for development. I'll experiment with other kernel builds.
Verzonden vanaf Outlook voor Android<https://aka.ms/AAb9ysg>
________________________________
From: Robert Mast ***@***.***>
Sent: Saturday, November 23, 2024 8:36:56 PM
To: jfwells/linux-asus-t100ta ***@***.***>; jfwells/linux-asus-t100ta ***@***.***>
Cc: Mention ***@***.***>
Subject: Re: [jfwells/linux-asus-t100ta] minimal required mt9m114 driver changes (Issue #6)
@EasyNetDev I altered my
atomisp-6.10-dkms repo in the atomisp-mt9m114 branch to reflect the current version of the Hansg media-atomisp branch.
With the exception of the punit_atom_debug module, which appears not essential for the first camera signs I saw the camera function with the current 6.11.4-301.fc41.x86_64 of Fedora LXQt spin 41.
Just run
bash build-dkms
make -j4
sudo make install
I believe I also did a reboot.
And then the magic gst-launch, as long as
free -m
says there's at least about 100MB free.
Verzonden vanaf Outlook voor Android<https://aka.ms/AAb9ysg>
________________________________
From: Robert Mast ***@***.***>
Sent: Friday, November 22, 2024 10:27:49 PM
To: jfwells/linux-asus-t100ta ***@***.***>; jfwells/linux-asus-t100ta ***@***.***>
Cc: Mention ***@***.***>
Subject: Re: [jfwells/linux-asus-t100ta] minimal required mt9m114 driver changes (Issue #6)
Installing Fedora 41 LXQt spin, which leaves about 600mb of RAM free reveals the issue with YUV420 was a memory issue. On Fedora LXQt spin the source tree can be built without modification. I wonder whether shrinking that 10000x10000 can releave the memory consumption, as the mt9m114 probably only needs half for the 720p resolution.
Verzonden vanaf Outlook voor Android<https://aka.ms/AAb9ysg>
________________________________
From: Robert Mast ***@***.***>
Sent: Friday, November 22, 2024 4:15:51 PM
To: jfwells/linux-asus-t100ta ***@***.***>; jfwells/linux-asus-t100ta ***@***.***>
Cc: Mention ***@***.***>
Subject: Re: [jfwells/linux-asus-t100ta] minimal required mt9m114 driver changes (Issue #6)
My workaround with YUV422 is not stable. Probing atomisp does not consistently result in /dev/video0 and if it does it can still have memory allocation issues, probably less than YUV420. Fedora has Gnome instead of XFCE. I will try to lower the system resources.
Verzonden vanaf Outlook voor Android<https://aka.ms/AAb9ysg>
________________________________
From: Hans de Goede ***@***.***>
Sent: Wednesday, November 20, 2024 12:29:02 PM
To: jfwells/linux-asus-t100ta ***@***.***>
Cc: rmast ***@***.***>; Mention ***@***.***>
Subject: Re: [jfwells/linux-asus-t100ta] minimal required mt9m114 driver changes (Issue #6)
Great! That's exactly what I'm trying to accomplish. Can you share your magic .config for building the right kernel options as well?
The config which I use for all my testing can be found here: https://github.com/jwrdegoede/linux-sunxi/blob/main/.config
This is Fedora's default kernel config with some local modifications like enabling the atomisp driver.
Together with my atomisp branch from: https://git.kernel.org/pub/scm/linux/kernel/git/hansg/linux.git/log/?h=media-atomisp
This should result in a working camera. Assuming that you have done the BIOS hack to turn the atomisp device into a PCI device.
Note that with these old-style atomisp drivers it is important that the sensor driver gets loaded before the atomisp driver itself.
I blacklist the atomisp module and then manually modprobe it after atomisp-mt9m114 has loaded.
—
Reply to this email directly, view it on GitHub<#6 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAZPZ5XJICCNIQNAMZWVEH32BRW75AVCNFSM6AAAAABQFS4ZNSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBYGMZTAMZYHE>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
By the way, after configuring WiFi with XFCE the LXQT logon also connects to WiFi.
Verzonden vanaf Outlook voor Android<https://aka.ms/AAb9ysg>
…________________________________
From: Robert Mast ***@***.***>
Sent: Sunday, December 8, 2024 8:24:49 PM
To: jfwells/linux-asus-t100ta ***@***.***>; jfwells/linux-asus-t100ta ***@***.***>
Cc: Mention ***@***.***>
Subject: Re: [jfwells/linux-asus-t100ta] minimal required mt9m114 driver changes (Issue #6)
The instability of the default Fedora kernel on the t100 seems to be a revived kernel bug that can be worked around without recompiling the kernel with the kernel boot parameter intel_idle.max_cstate=1
Verzonden vanaf Outlook voor Android<https://aka.ms/AAb9ysg>
________________________________
From: Robert Mast ***@***.***>
Sent: Sunday, November 24, 2024 11:02:19 PM
To: jfwells/linux-asus-t100ta ***@***.***>; jfwells/linux-asus-t100ta ***@***.***>
Cc: Mention ***@***.***>
Subject: Re: [jfwells/linux-asus-t100ta] minimal required mt9m114 driver changes (Issue #6)
The default kernel of Fedora LXQt spin 41 (6.11.4) is unstable for some sdhci_acpi and sdhci, giving crashes about mmc0, an error I didn't see before which seems to block the ssh-connection, so it appears not stable for development. I'll experiment with other kernel builds.
Verzonden vanaf Outlook voor Android<https://aka.ms/AAb9ysg>
________________________________
From: Robert Mast ***@***.***>
Sent: Saturday, November 23, 2024 8:36:56 PM
To: jfwells/linux-asus-t100ta ***@***.***>; jfwells/linux-asus-t100ta ***@***.***>
Cc: Mention ***@***.***>
Subject: Re: [jfwells/linux-asus-t100ta] minimal required mt9m114 driver changes (Issue #6)
@EasyNetDev I altered my
atomisp-6.10-dkms repo in the atomisp-mt9m114 branch to reflect the current version of the Hansg media-atomisp branch.
With the exception of the punit_atom_debug module, which appears not essential for the first camera signs I saw the camera function with the current 6.11.4-301.fc41.x86_64 of Fedora LXQt spin 41.
Just run
bash build-dkms
make -j4
sudo make install
I believe I also did a reboot.
And then the magic gst-launch, as long as
free -m
says there's at least about 100MB free.
Verzonden vanaf Outlook voor Android<https://aka.ms/AAb9ysg>
________________________________
From: Robert Mast ***@***.***>
Sent: Friday, November 22, 2024 10:27:49 PM
To: jfwells/linux-asus-t100ta ***@***.***>; jfwells/linux-asus-t100ta ***@***.***>
Cc: Mention ***@***.***>
Subject: Re: [jfwells/linux-asus-t100ta] minimal required mt9m114 driver changes (Issue #6)
Installing Fedora 41 LXQt spin, which leaves about 600mb of RAM free reveals the issue with YUV420 was a memory issue. On Fedora LXQt spin the source tree can be built without modification. I wonder whether shrinking that 10000x10000 can releave the memory consumption, as the mt9m114 probably only needs half for the 720p resolution.
Verzonden vanaf Outlook voor Android<https://aka.ms/AAb9ysg>
________________________________
From: Robert Mast ***@***.***>
Sent: Friday, November 22, 2024 4:15:51 PM
To: jfwells/linux-asus-t100ta ***@***.***>; jfwells/linux-asus-t100ta ***@***.***>
Cc: Mention ***@***.***>
Subject: Re: [jfwells/linux-asus-t100ta] minimal required mt9m114 driver changes (Issue #6)
My workaround with YUV422 is not stable. Probing atomisp does not consistently result in /dev/video0 and if it does it can still have memory allocation issues, probably less than YUV420. Fedora has Gnome instead of XFCE. I will try to lower the system resources.
Verzonden vanaf Outlook voor Android<https://aka.ms/AAb9ysg>
________________________________
From: Hans de Goede ***@***.***>
Sent: Wednesday, November 20, 2024 12:29:02 PM
To: jfwells/linux-asus-t100ta ***@***.***>
Cc: rmast ***@***.***>; Mention ***@***.***>
Subject: Re: [jfwells/linux-asus-t100ta] minimal required mt9m114 driver changes (Issue #6)
Great! That's exactly what I'm trying to accomplish. Can you share your magic .config for building the right kernel options as well?
The config which I use for all my testing can be found here: https://github.com/jwrdegoede/linux-sunxi/blob/main/.config
This is Fedora's default kernel config with some local modifications like enabling the atomisp driver.
Together with my atomisp branch from: https://git.kernel.org/pub/scm/linux/kernel/git/hansg/linux.git/log/?h=media-atomisp
This should result in a working camera. Assuming that you have done the BIOS hack to turn the atomisp device into a PCI device.
Note that with these old-style atomisp drivers it is important that the sensor driver gets loaded before the atomisp driver itself.
I blacklist the atomisp module and then manually modprobe it after atomisp-mt9m114 has loaded.
—
Reply to this email directly, view it on GitHub<#6 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAZPZ5XJICCNIQNAMZWVEH32BRW75AVCNFSM6AAAAABQFS4ZNSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBYGMZTAMZYHE>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
This bug is not related to Baytrail CPU bug that hangs the OS in the past? |
It is again the same issue. For some reason Fedora doesn't have the solution that Debian appears to have.
Verzonden vanaf Outlook voor Android<https://aka.ms/AAb9ysg>
…________________________________
From: EasyNet ***@***.***>
Sent: Sunday, December 8, 2024 9:10:42 PM
To: jfwells/linux-asus-t100ta ***@***.***>
Cc: rmast ***@***.***>; Mention ***@***.***>
Subject: Re: [jfwells/linux-asus-t100ta] minimal required mt9m114 driver changes (Issue #6)
This bug is not related to Baytrail CPU bug that hangs the OS in the past?
—
Reply to this email directly, view it on GitHub<#6 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAZPZ5X7ZCM2Y2WIM2D6BGD2ESRUFAVCNFSM6AAAAABQFS4ZNSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMRWGM3DAMBWGM>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@jwrdegoede writes:
Unfortunately things are not that easy, I have a pretty good idea what the minimum necessary changes are, to get things to work at a minimum the following mt9m114 driver changes are required:
Originally posted by @jwrdegoede in #4 (comment)
The text was updated successfully, but these errors were encountered: