Custom MIPI Camera

I would like to add a custom MIPI Camera to VIM 3 and VIM 3L running Android 9 (or above).

I know that Khadas don’t support third party cameras, but maybe you could give some tips or ideas.

I had success building a custom MIPI display, touchscreen, flats and compiling Android form VIM 3. So I have some knowledge about MIPI DSI for VIM3.

What I have for this new product:

  • Industrial sensors that uses a camera with MIPI CSI.
  • I already manufactured the cables to VIM 3 & 3L.
  • Cameras are 1 MP and uses just one lane.
  • I already control them using I2C.
  • Calibration is not a must (like color pallet and things like this). I also don´t need functions as zoom, fps adjustment, neither of that.

What I would like to ask:

  • How to add Camera2 app & SDL to Android 9 source ? (looks like it is on the image, but it is not working)
  • It is possible to force CSI to accept a “default” sensor ?
    - I don’ t know the name of the sensor that goes inside of my camera (knowing this would make the work much easier, maybe you could suggest a way ?).
    - Maybe one of the places to froce a default configuration would be “acamera_init” located on “vendor/amlogic/common/arm_isp/driver/linux/kernel/v4l2_dev/src/fw_lib/acamera.c” ?
    - On vendor/amlogic/common/arm_isp/driver/linux/kernel/subdev/sensor/src/driver/sensor/ I saw aCameraDefault .c and .h but not much inside of the files. I don’t see for instance information about the lanes used as I saw in files like the IMX224 ones.

You can refer to the camera related modifications in the following path

vendor/amlogic/common/arm_isp/driver/linux/kernel/subdev/sensor/src/driver/sensor/IMX415_drv.c

You can refer to the submission below

xiong@builder:~/work/rockchip/vim3_64bit/vendor/amlogic/common/arm_isp$ git show 27c61a0030a2bfe920a08b8879e80349675130c0 --stat 
commit 27c61a0030a2bfe920a08b8879e80349675130c0
Author: Xiong Zhang <xiong.zhang@wesion.com>
Date:   2023-01-05 11:16:34 +0800

    Camera: add khadas imx415 module support
    
    Signed-off-by: Xiong Zhang <xiong.zhang@wesion.com>

 driver/linux/kernel/subdev/iq/app/soc_iq.c                       |  7 ++++++-
 driver/linux/kernel/subdev/sensor/src/driver/sensor/IMX415_drv.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 60 insertions(+), 4 deletions(-)
xiong@builder:~/work/rockchip/vim3_64bit/vendor/amlogic/common/arm_isp$ git show 27c61a0030a2bfe920a08b8879e80349675130c0

@xiong.zhang , thanks for the info.

Just double checking, with the IMX415 driver doesn use the pins of CSI connector CAM_PDN0, CAM_PDN1, CAM_MCLK, CAM_RESET. is this correct ?

(that’s what I understand by reading the code you suggested and the docs from dl.khadas.com - Index of /products/add-ons/imx415/datasheet/)

These few are extensions from tca6408. You can follow the modifications I made to add IMX415 above and do not need to use them, provided that your camera driver is correct

vendor/amlogic/common/arm_isp/driver/linux/kernel/subdev/sensor/src/driver/sensor/IMX415_drv.c

@xiong.zhang , thanks.

Actually I’m writing the driver myself. The IMX415 files yousuggested are the ones that I’m trying to adapt.

It is not working yet and Iḿ having a “camera not found” error on Camera2 app.

Do you know if there is a simple camera example with only D-Phy ? (= MIPI lanes). Today I use other board to activate the camera over I2C (that part is working) and the idea is to only use Khadas to receive the images to process.

Has DTS added the corresponding camera

Does the pin definition match our motherboard

Thanks for the info.

About the pinouts, yes, the pinouts are OK. It is a 1 MP that uses just one lane so I use the pins marked in red 17, 18, 14 and 15 (the clock lanes and the D0 data lanes). I also use the I2C pins connected to other board to control the camera (this part is working - btw it is an industrial device so I only need to turn it on, the is no zoom or other funcions).

About DTS, I tried to force the imx415 with things like…

kvim3.dts:

sensor: sensor {
		compatible = "soc, sensor";
		status = "okay";
		//
		//sensor_name = "os08a10"; /*os08a10;imx415*/
		sensor_name = "imx415"; /*os08a10;imx415*/

		pinctrl-names="default";
		pinctrl-0=<&gen_clk_ee_ao>;
		clocks = <&clkc CLKID_GEN_CLK>;
		clock-names = "gen_clk";
	};

	iq: iq {
		compatible = "soc, iq";
		status = "okay";
		//
		//sensor_name = "os08a10"; /*os08a10;imx415*/
		sensor_name = "imx415"; /*os08a10;imx415*/
	};

cmd_kbi.c:

static int do_check_camera(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
	
	khadas_camera_id = camera_i2c_read(0x00,IMX415_CHIP_ADDR);
	printf("khadas camera id=0x%x\n",khadas_camera_id);
	//
	//if(khadas_camera_id == 0x00) {// IMX415 = 0x00
		khadas_camera_id = 2;
		setenv("khadas_camera_id", "2");
	//} else {
	//	khadas_camera_id = 1;
	//	setenv("khadas_camera_id", "1");
	//}
	printf("khadas_camera_id=%d   id=1---is OS08A10   id=2---is IMX415\n",khadas_camera_id);


	return 0;
}

I also disabled the IMX415 calibrations on soc_iq.c

And on IMX415_drv.c I also disabled all the I2C communications - as this is done with other board, and on supported_modes I adjusted the resolution. width, resolution.height. lanes (in my case just one) and bits (in my case 8).

Some questions:

  1. Do you know if these supported_modes are used by the MIPI D-Phy or are only sent to the scanner over I2C ?
  2. Do you know where the code starts the MIPI signal (data lane) listening ?

Iḿ aware that these are very specific questions :slight_smile:

Just disable the camera detection switch below

xiong@server:/users/xiong/work/amlogic/vim3/vim3_64bit/bootloader/uboot$ git diff
diff --git a/board/khadas/kvim3/kvim3.c b/board/khadas/kvim3/kvim3.c
index 7ca8897a93..dff163bdbe 100644
--- a/board/khadas/kvim3/kvim3.c
+++ b/board/khadas/kvim3/kvim3.c
@@ -772,7 +772,7 @@ int board_late_init(void)
                                                "defenv_reserv; setenv upgrade_step 2; saveenv; fi;", 0);
                /*add board late init function here*/
                run_command("kbi check_panel", 0);//kbi check_panel - check TS050 or TS101
-               run_command("kbi check_camera", 0);//kbi check_camera - check OS08A10 or IMX415
+               //run_command("kbi check_camera", 0);//kbi check_camera - check OS08A10 or IMX415
                run_command("kbi check_m2x", 0);//check M2X
 #ifndef DTB_BIND_KERNEL
                int ret;

Did you modify the code based on IMX415? Then you can send me the boot log to take a look

Thanks for the tips. I modified kvim3c as suggested.

Yes, I’m modifying the code based on IMX415

I got some interesting stuff like:

[ 1402.872685@2] 
[ 1403.019657@2] sensors 4-000e: set sensor poll time to 66ms
[ 1410.179586@2] isp_v4l2_stream_try_format@:1322 GENERIC(CRIT) :[Stream#0] format 0x00000000 is not supported, setting default format 0x59455247.
[ 1410.187070@4] 
[ 1410.194863@4] isp_v4l2_stream_try_format@:1322 GENERIC(CRIT) :[Stream#0] format 0x00000000 is not supported, setting default format 0x59455247.
[ 1410.202194@4] 
[ 1410.231364@4] isp_v4l2_s_fmt_vid_cap@:384 GENERIC(CRIT) :isp_v4l2_s_fmt_vid_cap sid:0
[ 1410.233610@4] fw_intf_stream_set_resolution@:643 GENERIC(CRIT) :Leaving same sensor settings resolution : width = 1280, height = 800 (preset idx = 0)
[ 1410.249977@3] AM_MIPI: am_mipi_init:Success mipi init
[ 1410.251927@3] AM_ADAP: inject_data_flag = 0, dump_data_flag = 0
[ 1410.259051@4] AM_ADAP: frontend : width = 1280, val = 80
[ 1410.319964@4] acamera_interrupt_handler@:577 GENERIC(CRIT) :DMA is not finished, cfg: 0, meter: 0, skip this frame.
[ 1410.430932@0] acamera_interrupt_handler@:577 GENERIC(CRIT) :DMA is not finished, cfg: 0, meter: 0, skip this frame.
[ 1410.631524@0] acamera_interrupt_handler@:577 GENERIC(CRIT) :DMA is not finished, cfg: 0, meter: 0, skip this frame.
[ 1410.784826@0] acamera_interrupt_handler@:577 GENERIC(CRIT) :DMA is not finished, cfg: 0, meter: 0, skip this frame.
[ 1410.900573@0] acamera_interrupt_handler@:577 GENERIC(CRIT) :DMA is not finished, cfg: 0, meter: 0, skip this frame.
[ 1410.925632@0] acamera_interrupt_handler@:577 GENERIC(CRIT) :DMA is not finished, cfg: 0, meter: 0, skip this frame.
[ 1411.006791@0] acamera_interrupt_handler@:577 GENERIC(CRIT) :DMA is not finished, cfg: 0, meter: 0, skip this frame.
[ 1411.050475@0] acamera_interrupt_handler@:577 GENERIC(CRIT) :DMA is not finished, cfg: 0, meter: 0, skip this frame.
[ 1411.136044@0] acamera_interrupt_handler@:577 GENERIC(CRIT) :DMA is not finished, cfg: 0, meter: 0, skip this frame.
[ 1411.189183@0] acamera_interrupt_handler@:577 GENERIC(CRIT) :DMA is not finished, cfg: 0, meter: 0, skip this frame.
[ 1411.215385@0] acamera_interrupt_handler@:577 GENERIC(CRIT) :DMA is not finished, cfg: 0, meter: 0, skip this frame.
[ 1411.297648@0] acamera_interrupt_handler@:577 GENERIC(CRIT) :DMA is not finished, cfg: 0, meter: 0, skip this frame.
[ 1412.242692@0] acamera_interrupt_handler@:577 GENERIC(CRIT) :DMA is not finished, cfg: 0, meter: 1, skip this frame.
[ 1412.324683@0] acamera_interrupt_handler@:577 GENERIC(CRIT) :DMA is not finished, cfg: 0, meter: 0, skip this frame.
[ 1412.346747@0] acamera_interrupt_handler@:577 GENERIC(CRIT) :DMA is not finished, cfg: 0, meter: 0, skip this frame.
[ 1412.381079@0] acamera_interrupt_handler@:577 GENERIC(CRIT) :DMA is not finished, cfg: 0, meter: 0, skip this frame.
[ 1412.449790@0] acamera_interrupt_handler@:577 GENERIC(CRIT) :DMA is not finished, cfg: 0, meter: 0, skip this frame.
[ 1412.491936@0] acamera_interrupt_handler@:577 GENERIC(CRIT) :DMA is not finished, cfg: 0, meter: 0, skip this frame.
[ 1412.522245@0] acamera_interrupt_handler@:577 GENERIC(CRIT) :DMA is not finished, cfg: 0, meter: 0, skip this frame.
[ 1412.628130@0] acamera_interrupt_handler@:577 GENERIC(CRIT) :DMA is not finished, cfg: 0, meter: 0, skip this frame.
[ 1552.707777@0] [dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 11, bssidx: 0
[ 1827.873172@0] [dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 12, bssidx: 0
[ 1987.873200@0] [dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 13, bssidx: 0
[ 2147.873951@0] [dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 14, bssidx: 0
[ 2231.488226@2] input input2: key 116 down.
[ 2231.756190@2] input input2: key 116 up.
[ 2232.334819@2] sensors 4-000e: set sensor poll time to 66ms
[ 2232.336230@4] sensors 4-000e: set sensor poll time to 200ms
[ 2232.351079@4] AM_MIPI: am_mipi_deinit:Success mipi deinit

and


[   14.135556@2] sensor_get_id@:373 GENERIC(CRIT) :sensor_get_id: Failed to read sensor imx415 id
[   14.143297@2] 
[   14.145766@2] sensor_get_id@:373 GENERIC(CRIT) :sensor_get_id: Failed to read sensor imx415 id
[   14.153521@2] 
[   14.155162@2] sensor_detect_imx415 id:0xff
[   14.159267@2] arm_sensor_i2c_remove: remove i2c sensor
[   14.298340@5] arm_isp ff140000.isp: assigned reserved memory node linux,isp_cma
[   14.300029@5] AM_SC: am_sc_parse_dt: rs idx info: name: isp_sc
[   14.305866@5] AM_SC: am_sc_parse_dt:rs info: irq: 59
[   14.315981@0] interrupt comes in (irq = 60) without app handler, status: 0x200, pusle mode:0
[   14.323271@0] acamera_fw_init@:106 GENERIC(CRIT) :seamless:0
[   14.338886@2] init clock is 24 MHZ
[   14.380543@2] arm_sensor_i2c_probe: start to probe
[   14.380616@2] arm_sensor_i2c_probe: success get link device:phy-csi
[   14.386052@2] AM_MIPI: am_mipi_parse_dt:Success to get link device: isp-adapter
[   14.393294@2] platform ff650000.isp-adapter: assigned reserved memory node linux,adapt_cma
[   14.401460@2] AM_ADAP: adapter alloc 24M memory
[   14.406050@2] system_i2c_init:success to add i2c driver
[   14.517549@2] sensor_get_id@:373 GENERIC(CRIT) :sensor_get_id: Failed to read sensor imx415 id
[   14.520517@2] 

Please note the “format 0x00000000 is not supported” - thatś because I disabled the I2C line of Khadas and using another board.

So I’m forcing the pixel format on isp_v4l2-stream.c

#define ISP_DEFAULT_FORMAT V4L2_PIX_FMT_NV12 

I’m not sure yet if it is NV12. What I know for sure is that it is 8 bit pixel.

On imx415_drv.c I also made some modifications:


static sensor_mode_t supported_modes[] = {
    {
//Outros modos
/*
wdr:
 WDR_MODE_LINEAR       
 WDR_MODE_NATIVE       
WDR_MODE_FS_LIN         
WDR_MODE_COUNT   

dol type
	DOL_NON = 0,
	DOL_VC,
	DOL_LINEINFO,

    bayer:
    BAYER_GBRG
    BAYER_GRBG

*/
        .wdr_mode = WDR_MODE_NATIVE , //WDR_MODE_FS_LIN, //WDR_MODE_LINEAR,
        .fps = 30 * 256,
        .resolution.width = 1280, //3840,
        .resolution.height = 800, //2160,
        .bits = 8, //10,
        .exposures = 1,
        .lanes = 1, //era 4,
        .bps = 360, //720,
        .bayer = BAYER_GBRG,
        .dol_type = DOL_VC, //DOL_NON,
        .num = 0,
    },
    {
        .wdr_mode = WDR_MODE_FS_LIN,
        .fps = 30 * 256,
        .resolution.width = 1280, //era 3840,
        .resolution.height = 800, //era 2160,
        .bits = 8, //10,
        .exposures = 2,
        .lanes =  1, //era 4,
        .bps = 1440,
        .bayer = BAYER_GBRG,
        .dol_type = DOL_VC,
        .num = 7,
    },
    {
        .wdr_mode = WDR_MODE_LINEAR,
        .fps = 30 * 256,
        .resolution.width = 1280, //1920,
        .resolution.height = 800, //1080,
        .bits = 8, //10,
        .exposures = 1,
        .lanes =  1, //era 4,
        .bps = 720,
        .bayer = BAYER_GBRG,
        .dol_type = DOL_NON,
        .num = 2,
    },
    {
        .wdr_mode = WDR_MODE_FS_LIN,
        .fps = 30 * 256,
        .resolution.width = 1280, //1920,
        .resolution.height = 800, //1080,
        .bits = 8, //10,
        .exposures = 2,
        .lanes =  1, //era 4,
        .bps = 1440,
        .bayer = BAYER_GBRG,
        .dol_type = DOL_VC,
        .num = 3,
    },
};

I also have 2 complicated and ultra specific questions:

  1. do you know if:
		{
			.name = "GREY",
			.fourcc = V4L2_PIX_FMT_GREY,
			.depth = 8,
			.is_yuv = true,
			.planes = 1,
		},

of isp-v42l-stream.c is the same as RAW8 ? (I found RAW16 but not RAW8).

  1. Do you know how to send blocks of bytes to I2C ?
    I found the command acamera_sbus_write_u8, but looks like it only send a bit. So it start the I2C line, send the header with the address of the device, and then one Byte.
    In my case I need to send several bytes at a time and the checksum. I was wondering to make connect the I2C to Khadas board to activate the camera.

Btw, for these tests Iḿ using VIM3, more than one, just in case.

Which I2C channel are you disabling?

I2C4 cannot be disabled

sensor-i2c@6c {
		compatible = "arm, i2c-sensor";
		reg = <0x6c>;
		reg-names = "i2c-sensor";
		slave-addr = <0x6c>;
		reg-type = <2>;
		reg-data-type = <1>;
		link-device = <&phycsi>;
	};

I mean physically disabled. The I2C lines of VIM3 CSI are connected no-where.

The D-Phy lines of the sensor (MIPI CLK and MIPI data lane) are connected to a VIM3 with the correct pin out.

The I2C line is connected to other board (for testing purposes I’m using an Arduino). So I start the camera over I2C from Arduino and Camera2 on VIM3 at same time.

@xiong.zhang, I made some progress here.

As I stated, my format is raw8 monochrome. So I changed camera_metadata_tags.h and changed amera_metadata_enum_android_scaler_available_formats to force RAW16 to use the same prefix as RAW8:

// ANDROID_SCALER_AVAILABLE_FORMATS
typedef enum camera_metadata_enum_android_scaler_available_formats {

    //changed
    ANDROID_SCALER_AVAILABLE_FORMATS_RAW16                           = 0x2A, //was  0x20, // HIDL v3.2

    //I added, for future use
    ANDROID_SCALER_AVAILABLE_FORMATS_RAW8                           = 0x2A, // HIDL v3.2

    ANDROID_SCALER_AVAILABLE_FORMATS_RAW_OPAQUE                      = 0x24, // HIDL v3.2
    ANDROID_SCALER_AVAILABLE_FORMATS_YV12                            = 0x32315659, // HIDL v3.2

Now the Camera accepts the data. It shows the menu “Camera / VIdeo” as see in the pictutes and also a tiny line on the top of the screen with changes as I start the camera (using the independent I2C board, in this case an Arduino)

Log files from the VIM3 serial (maybe doesn help much):


[  124.771970@4] asoc-aml-card auge_sound: tdm playback stop
[  124.793168@2] type=1400 audit(1293883323.328:91): avc: denied { write } for pid=4074 comm="droid.launcher3" name="property_service" dev="tmpfs" ino=14232 scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=1
[  124.815989@2] type=1400 audit(1293883323.328:91): avc: denied { write } for pid=4074 comm="droid.launcher3" name="property_service" dev="tmpfs" ino=14232 scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=1
[  124.838622@2] type=1400 audit(1293883323.328:92): avc: denied { connectto } for pid=4074 comm="droid.launcher3" path="/dev/socket/property_service" scontext=u:r:priv_app:s0:c512,c768 tcontext=u:r:init:s0 tclass=unix_stream_socket permissive=1
[  124.932905@3] asoc-aml-card auge_sound: tdm playback enable
[  134.644010@3] isp_v4l2_stream_try_format@:1338 GENERIC(CRIT) :[Stream#0] format 0x00000000 is not supported, setting default format 0x32525942.
[  134.651528@2] 
[  134.653507@2] isp_v4l2_stream_try_format@:1338 GENERIC(CRIT) :[Stream#0] format 0x00000000 is not supported, setting default format 0x32525942.
[  134.666053@3] 
[  134.681479@1] type=1400 audit(1293883323.328:92): avc: denied { connectto } for pid=4074 comm="droid.launcher3" path="/dev/socket/property_service" scontext=u:r:priv_app:s0:c512,c768 tcontext=u:r:init:s0 tclass=unix_stream_socket permissive=1
[  134.697436@2] type=1400 audit(1293883333.268:93): avc: denied { open } for pid=3215 comm="Binder:3215_3" path="/dev/__properties__/u:object_r:media_prop:s0" dev="tmpfs" ino=14186 scontext=u:r:cameraserver:s0 tcontext=u:object_r:media_prop:s0 tclass=file permissive=1
[  134.721070@2] type=1400 audit(1293883333.268:93): avc: denied { open } for pid=3215 comm="Binder:3215_3" path="/dev/__properties__/u:object_r:media_prop:s0" dev="tmpfs" ino=14186 scontext=u:r:cameraserver:s0 tcontext=u:object_r:media_prop:s0 tclass=file permissive=1
[  134.744437@2] type=1400 audit(1293883333.268:94): avc: denied { getattr } for pid=3215 comm="Binder:3215_3" path="/dev/__properties__/u:object_r:media_prop:s0" dev="tmpfs" ino=14186 scontext=u:r:cameraserver:s0 tcontext=u:object_r:media_prop:s0 tclass=file permissive=1
[  135.181935@2] isp_v4l2_stream_try_format@:1338 GENERIC(CRIT) :[Stream#0] format 0x00000000 is not supported, setting default format 0x32525942.
[  135.189878@2] 
[  135.192977@2] isp_v4l2_stream_try_format@:1338 GENERIC(CRIT) :[Stream#0] format 0x00000000 is not supported, setting default format 0x32525942.
[  135.203722@5] 
[  135.381721@5] isp_v4l2_s_fmt_vid_cap@:384 GENERIC(CRIT) :isp_v4l2_s_fmt_vid_cap sid:0
[  135.383915@5] fw_intf_stream_set_resolution@:634 GENERIC(CRIT) :Setting new resolution : width = 1280, height = 800 (preset idx = 0, fps = 30)
[  135.500574@3] AM_MIPI: am_mipi_init:Success mipi init
[  135.500606@3] AM_ADAP: inject_data_flag = 0, dump_data_flag = 0
[  135.507264@3] AM_ADAP: frontend : width = 1280, val = 80
[  135.511182@3] sensor_set_mode@:535 GENERIC(CRIT) :Mode 0, Setting num: 0, RES:1280x800
[  135.519070@3] 
[  135.520791@3] get_cali_name_id@:169 SUBDEV_IQ(CRIT) :Loading Calibration for IMX415
[  135.528456@3] 
[  135.529972@3] iq_ioctl@:260 SUBDEV_IQ(CRIT) :soc_iq get config imx415 according to sensor drv
[  135.543448@4] AM_MIPI: am_mipi_init:Success mipi init
[  135.543491@4] AM_ADAP: inject_data_flag = 0, dump_data_flag = 0
[  135.550594@4] AM_ADAP: frontend : width = 1280, val = 80
[  140.669060@4] acamera_interrupt_handler@:577 GENERIC(CRIT) :DMA is not finished, cfg: 0, meter: 1, skip this frame.
[  154.856729@1] binder: send failed reply for transaction 56033 to 3401:3416
[  154.890464@3] sensors 4-000e: set sensor poll time to 66ms
[  155.565047@0] AM_MIPI: am_mipi_deinit:Success mipi deinit
[  155.565120@0] fw_intf_stream_stop@:448 GENERIC(CRIT) :Stream off 0, user: 1
[  155.571753@0] 
[  156.630624@0] isp_v4l2_stream_try_format@:1338 GENERIC(CRIT) :[Stream#0] format 0x00000000 is not supported, setting default format 0x32525942.
[  156.640211@2] 
[  156.648060@2] isp_v4l2_stream_try_format@:1338 GENERIC(CRIT) :[Stream#0] format 0x00000000 is not supported, setting default format 0x32525942.
[  156.655578@2] 
[  157.152948@2] isp_v4l2_stream_try_format@:1338 GENERIC(CRIT) :[Stream#0] format 0x00000000 is not supported, setting default format 0x32525942.
[  157.161643@3] 
[  157.166840@3] isp_v4l2_stream_try_format@:1338 GENERIC(CRIT) :[Stream#0] format 0x00000000 is not supported, setting default format 0x32525942.
[  157.174901@2] 
[  157.311876@2] isp_v4l2_s_fmt_vid_cap@:384 GENERIC(CRIT) :isp_v4l2_s_fmt_vid_cap sid:0
[  157.314077@2] fw_intf_stream_set_resolution@:643 GENERIC(CRIT) :Leaving same sensor settings resolution : width = 1280, height = 800 (preset idx = 0)
[  157.336774@4] AM_MIPI: am_mipi_init:Success mipi init
[  157.336808@4] AM_ADAP: inject_data_flag = 0, dump_data_flag = 0
[  157.343796@3] AM_ADAP: frontend : width = 1280, val = 80
[  161.293172@1] [dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 3, bssidx: 0
[  185.656517@1] type=1400 audit(1293883333.268:94): avc: denied { getattr } for pid=3215 comm="Binder:3215_3" path="/dev/__properties__/u:object_r:media_prop:s0" dev="tmpfs" ino=14186 scontext=u:r:cameraserver:s0 tcontext=u:object_r:media_prop:s0 tclass=file permissive=1
[  185.661186@5] sensors 4-000e: set sensor poll time to 66ms
[  185.680385@5] type=1400 audit(1293883384.240:95): avc: denied { write } for pid=4074 comm="droid.launcher3" name="property_service" dev="tmpfs" ino=14232 scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=1
[  185.703086@5] type=1400 audit(1293883384.240:95): avc: denied { write } for pid=4074 comm="droid.launcher3" name="property_service" dev="tmpfs" ino=14232 scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=1
[  185.726051@5] type=1400 audit(1293883384.244:96): avc: denied { connectto } for pid=4074 comm="droid.launcher3" path="/dev/socket/property_service" scontext=u:r:priv_app:s0:c512,c768 tcontext=u:r:init:s0 tclass=unix_stream_socket permissive=1
[  244.372134@0] USB RESET
[  244.503952@0] USB RESET
[  244.656031@0] configfs-gadget gadget: high-speed config #1: b
[  244.657519@0] android_work: sent uevent USB_STATE=CONFIGURED
[  244.876206@0] USB RESET
[  245.004980@0] USB RESET

@xiong.zhang it wopuld be possible for Khadas to implement RAW8 for the camera ?

If not, do you know where do I need to change to make RAW16 behaves as RAW8. Comments all over the code states that the formats are very similar with just some slight changes.

@xiong.zhang, I also found this v42l_test.c which sound like some executable that could help a lot. Do you know something about it ?

Looks like it allows me to call it sending some parameters - that is it would allow me to make tests without the need to recompile everything.

@xiong.zhang, I made more progress here and got some screens with aleatory pixels.

But I made a new discover: my camera also send data in JPEG format. There is a way to receive the JEPG 8bit stream from the camera ? If I understant right I can do it without ISP, which could make things easier.