SM6350-mainline : IMX412 Hack to IMX576 driver and CAMSS
A message that is not in the archive (sent off-list or not yet received): 487-6634c200-31-76b8f080@88927481
Quoted 54 lines · Joffrey
Hi all,
I'm working in my free time on camss driver and *imx412 hack for imx576 driver camera* for Fairphone 4 (*sm7225 from sm6350-mainline*). I want the sm6350-mainline progress in the futur, postmarketos and linux for mobile.
Targets are 750G (SM7225) and 690G (SM6350) Qualcomm Snapdragon.
The source code is : https://github.com/sm6350-mainline/linux/tree/sm6350-6.9-wip-camera <https://github.com/sm6350-mainline/linux/tree/sm6350-6.9-wip-camera>
**Some work have been initialised by z3ntu (lweiss-fairphone) but he don't arrived to get data from imx576 camera. Just arrived to generate a
test_pattern= 2 frommsm_csid0until msm_vfe0_rdi0.**The relation between v4l2 and msm entity is the following what i've create from dot file.
https://debian-facile.org/images/file-Rc0e5e8df8ab6edd1812f4be9187b1ad3 <https://debian-facile.org/images/file-Rc0e5e8df8ab6edd1812f4be9187b1ad3>I followed his advice and adapt command to get data from imx576 camera.
fairphone-fp4:~$ media-ctl -d /dev/media0 -l '"msm_csid0":1->"msm_vfe0_rdi0":0[1]' fairphone-fp4:~$ media-ctl -d /dev/media0 -l '"msm_csiphy3":1->"msm_csid0":0[1]' fairphone-fp4:~$ media-ctl -d /dev/media0 -V '"msm_csid0":1[fmt:UYVY8_2X8/1920x1080 field:none],"msm_vfe0_rdi0":0[fmt:UY VY8_2X8/1920x1080 field:none]' fairphone-fp4:~$ media-ctl -d /dev/media0 -V '"msm_csiphy3":1[fmt:UYVY8_2X8/1920x1080 field:none],"msm_csid0":0[fmt:UYVY 8_2X8/1920x1080 field:none]' fairphone-fp4:~$ gst-launch-1.0 -v v4l2src device=/dev/video0 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1920,height =1080' ! jpegenc ! filesink location=image01.jpgI have this error log.
https://debian-facile.org/paste-BEAC75F7C4-6eda8795dcd0e61b297cbbeac1aa0f26 <https://debian-facile.org/paste-BEAC75F7C4-6eda8795dcd0e61b297cbbeac1aa0f26>And dmesg log.
https://debian-facile.org/paste-E52C41445A-f50445aa608fd5a868d84f8253db091b <https://debian-facile.org/paste-E52C41445A-f50445aa608fd5a868d84f8253db091b>I talk about this problem to the community and said it to me.
Yeah we need to find a tag in that repo
that matches in some way one of the tags here
https://git.codelinaro.org/clo/la/platform/vendor/opensource/camera-kernel.git
that's the CPHY/CSID/IFE version to target
i.e. know which CSIPHY init sequence to use - if we can reuse an upstream CSID/IFE - and get the reg offsets rightHere is the good tree about sm6350/sm7225.
LA.QSSI.11.0.R1.11.00.00.668.170.00
https://git.codelinaro.org/clo/la/platform/vendor/opensource/camera-kernel/-/tree/camera-kernel.lnx.3.1.r9-rel?ref_type=heads <https://git.codelinaro.org/clo/la/platform/vendor/opensource/camera-kernel/-/tree/camera-kernel.lnx.3.1.r9-rel?ref_type=heads>=> What are differencies to adapt between camss driver and imx driver architecture between this two project ?
-this link
https://github.com/sm6350-mainline/linux/tree/sm6350-6.9-wip-camera <https://github.com/sm6350-mainline/linux/tree/sm6350-6.9-wip-camera>
-this link
https://git.codelinaro.org/clo/la/platform/vendor/opensource/camera-kernel/-/tree/camera-kernel.lnx.3.1.r9-rel?ref_type=heads <https://git.codelinaro.org/clo/la/platform/vendor/opensource/camera-kernel/-/tree/camera-kernel.lnx.3.1.r9-rel?ref_type=heads>
Quoted 4 lines
@bryan,
I contact you for your work here [PATCH v2 0/3] Add imx577 compatible to imx412.
https://www.spinics.net/lists/linux-media/msg215880.html <https://www.spinics.net/lists/linux-media/msg215880.html>
Have you arrived to get data from imx577 camera ?
Yes it works on RB5 upstream.
Taking a quick look
I would double check the MCLK value there - pairing of MCLK1 with CSIPHY3 is a bit unusual - 100% valid but, unusual.
Quoted 7 lines
Be appear, the job to adapt is to check in the following code these steps but it's hard to identify for me.
https://git.codelinaro.org/clo/la/platform/vendor/opensource/camera-kernel/-/tree/camera-kernel.lnx.3.1.r9-rel?ref_type=heads <https://git.codelinaro.org/clo/la/platform/vendor/opensource/camera-kernel/-/tree/camera-kernel.lnx.3.1.r9-rel?ref_type=heads>"that's the CPHY/CSID/IFE version to target" -> What mean exactly ? 1 - i.e. know which CSIPHY init sequence to use
2 - if we can reuse an upstream CSID/IFE
3 - and get the reg offsets right
So there are a number of things here.
1. Identify the correct CSIPHY init sequence
I'd guess @Luca probably has that right but, I suggest you double check.
2. Identify the IFE and CSID versions
As I posted on IRC its definitely IFE 17x
Probably the same CSID as on sdm845 too
3. My understanding is the TPG partially works on this platform I suggest trying different pixel formats and resolutions
Here's an example for the RB5
# CSID0 TPG RB5
media-ctl --reset
yavta --no-query -w '0x009f0903 2' /dev/v4l-subdev6 yavta --list /dev/v4l-subdev6
media-ctl -V '"msm_csid0":0[fmt:SRGGB10/4056x3040]' media-ctl -V '"msm_vfe0_rdi0":0[fmt:SRGGB10/4056x3040]' media-ctl -l '"msm_csid0":1->"msm_vfe0_rdi0":0[1]' media-ctl -d /dev/media0 -p
Figure out which V4L subdev == msm_csid0 on your platform and then set the yavta command appropriately.
Quoted 1 line
If it's possible to have advice, documentation, identifying parts or solution ? (Maybe more simple to do video call or audio ?)
What you need to get say Hangouts or Zoom going is
1. Delivery of data to userpsace via RDI
2. libcamera >= below [1]
zoom and cheese will work that this stage
3. pipewire compiled up to talk to libcamera
Assuming this works as below [2] you will get
Hangouts
4. For postmarketos you will need to adapt the camera application - I guess - to talk to libcamera
Quoted 2 lines
Maybe it's better i learn some part before discuss.
I'd suggest replicating Luca's TPG work and then trying different pixel formats and resolutions.
Is it always the case you get partial data or do you get a full frame at a different _resolution_ ?
Next step then is to bring up the sensor.
The "cam" application in libcamera will probably be lots of help.
[1] SoftISP in libcamera
https://git.libcamera.org/libcamera/libcamera.git/commit/?id=b2ef255295871fb6246d99bdd5b41aa65e3fc3b2
[2] Firefox/pipewire integration with libcamera
https://jgrulich.cz/2023/05/29/pipewire-camera-support-in-firefox/
---
bod