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
Need help with pinephone cameras bring-up (Android) #28
Comments
I found one discussion which was an attempt to solve this: sailfish-on-dontbeevil/droid-config-pinephone#55 |
And a set of kernel patches: https://github.com/simonschmeisser/kernel-megi/tree/5.10-libcamera |
We can try to apply RPI4 experience: According to the datasheet (https://cdn.sparkfun.com/datasheets/Sensors/LightImaging/OV5640_datasheet.pdf), registers for ov5640 and raspberry pi's ov5647 is similar (at least for hblank and vblank values) |
By the way, are there any plans moving libcamera to freedesktop, where other major linux graphics components are located? |
None that I'm aware of. libcamera is a "component" of the linux-media projects https://linuxtv.org/, more closely associated with the Kernel, than the desktop. |
Yes, the updates may be similar. |
Sorry for using your personal fork for reporting project-global issues. |
You can also start discussions/issues on our https://bugs.libcamera.org/ bugzilla instance if you want an audience that isn't just me ;-) Though I guess that's not really a forum, as it's a bug tracker ... ;-) |
CC: @daaaanil81 |
Are you guys still busy with trying to implement the neccesary v4l2 functions into the camera drivers of the PinePhone? Greetings Jasper |
Hello Jasper, Thanks for the info. We haven't started yet, so in case patches are already available, it would be nice to start testing them. |
Hi @PsychoGame, If there are patches to improve support for PinePhone floating around, could you consider posting them to the linux-media and libcamera mailing lists as well please to get the support reviewed for upstreaming? |
@PsychoGame I'm not sure who xnux is, but feel free to join #libcamera on irc.oftc.net if you would like any support in getting libcamera running successfully on the pinephone too, and the support integrated upstream. |
As soon as I have the chance i'll upload them.
I'm currently onboard of a shipping vessel with limited time/internet.
xnux is one of the main developers working on PinePhone kernel.
His real name is Ondrej Jirman.
Op zondag 16 januari 2022 schreef Kieran Bingham ***@***.***>:
@PsychoGame I'm not sure who xnux is, but feel free to join #libcamera on
irc.oftc.net if you would like any support in getting libcamera running
successfully on the pinephone too, and the support integrated upstream.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you were mentioned.<
|
I also know Ondrej Jirman as @Megous . But as far as I can see it doesn't contain required patched yet: https://github.com/megous/linux/commits/orange-pi-5.16/drivers/media/i2c/ov5640.c |
Hereby I have uploaded the promised patchsets to pastebin.
Hopefully you'll find them usefull in the bring-up of the PinePhone camera stack on GloDroid |
Can anyone confirm libcamera is working on pinephone? Not yet for me with kernel 5.15... |
Can you update your kernel? I know Pavel Machek has been discussing Pinephone on the libcamera mailing list in the last few days. |
You said 'not yet' - what have you tried, and what was the errors? |
Right. I compile the source from git. Running: MegaPixels software identifies the camera and I can use it. Help me debug the issue? Some info: ls -lR /dev/v4l* /dev/v4l: /dev/v4l/by-path: |
More info. media-ctl -d /dev/media0 -pMedia controller API version 5.15.48 Media device informationdriver cedrus Device topology
media-ctl -d /dev/media1 -pMedia controller API version 5.15.48 Media device informationdriver sun6i-csi Device topology
|
I advanced a bit here. Here I am: |
That looks like error messages about the kernel that are referenced as fixed by the patches listed in #28 (comment) and - as I understand it from that post - merged in Linux 5.17. |
@rafael2k Are you able to update the kernel? or build the latest kernel from source? |
I saw the patches in comment #28 and indeed tried to backport them to 5.15. No success. Did anyone mentioned success with 5.17? |
Could someone post the sun6i-csi patches to the linux-media mailing list, to get them merged upstream ? Ideally that should be done by Benjamin, as the patches linked above are missing his SoB. |
Indeed. That would be wonderful. But it would be better the authors submit them upstream. |
@rafael2k can you contact Benjamin and see how he'd like to proceed, (and check if he's the author) or take over the patches yourself if he doesn't want to? |
Wrote to him, with you in CC. |
@rafael2k Megi (the original author of the patches) maintains a kernel version with many patches for PinePhone and provides binaries to download if you don't want to build from source (see here, |
But could you please tell me what is not working with this: |
"Works fine with libcamera" - or something else? |
Works with libcamera. But we still have a weird color conversion issue with qcam and gles driver. Without gles driver, we get: |
Can you save a picture with qcam (with gles) and upload it here? |
LIBCAMERA_LOG_LEVELS=*:0 qcam
|
Two sample pictures with qcam (and gles driver): |
Thanks, ok - so interesting - the simple pipeline handler is preferring RAW formats over the YUV formats (which would be much better for your usage already). The reason it works with the GLES back end is because we have a (very basic) debayering shader to allow displaying RAW bayer formats (which is what is being configured). Try experimenting with forcing the pixelformat: qcam -c1 -s pixelformat=YUYV |
If those formats work well, we should probably try to encourage the simple pipeline handler to have preferences on which format gets selected when there is no ISP ;-) |
(As well as have better negotiation between cam/qcam and the default format selection) |
Got worse. Garbled image.
|
New test files setting YUYV: |
That looks like a stride issue. I've just realised it also says JPEG is supported. Can you post the same with the RGB565 and JPEG?
I should have also already asked for the output from:
|
And I see we're also dealing with two cameras on this platform. Perhaps best check both cameras too. |
For RGB565: For MJPEG: cam -I for both cammeras:
|
Results among both cameras are similar. But lets focus on the ov5640 camera, which is rear camera, and has a much more mature driver (mainline). Once we get it working fine, I can do all the tests with the front camera. |
Can you add this script to your path: and then run:
The script will just make it easier to track adding strace and log levels. It should expand to:
But perhaps given the iterations here already - would it be possible to set up some live / remote debugging? Could we join a video call to go through this in realtime perhaps? If you can join the IRC/Matrix channel (oftc.net #libcamera, https://matrix.to/#/#_oftc_#libcamera:matrix.org) we can organise getting on a call to figure this out. |
I'll show up in irc. I'll run the tests you suggest also, later in the day I publish the results. |
Here the output of |
Latest tests with YUYV in qcam: |
@rafael2k as rsglobal has closed this issue, please either raise any remaining issues on the libcamera development mailing list, or bugs.libcamera.org. (You can open another issue in this repository, but please remember that only I follow this repo. It's my personal fork - it's not an official libcamera repository). |
Tks @kbingham! I agree better we discuss in the mailing list. I might open a bug in bugs.libcamera.org too. |
a last comment: the camera patches listed by @PsychoGame I uploaded here: |
Ok - those patches need to get posted to the linux kernel though. Not libcamera. (Or check what the state is compared to an upstream linux kernel). Thanks for tracking them. |
I've successfully enabled all components required to run libcamera on Android (pre-12 master branch).
But during probing cameras it appears that some of mandatory controls aren't available.
Linux guys somehow uses these cameras. Are those controls really mandatory?
Please help. Here is the log:
The text was updated successfully, but these errors were encountered: