From 62a93837896f4ec954eb0543af93445df63b8218 Mon Sep 17 00:00:00 2001 From: cronyx Date: Sat, 29 Oct 2022 22:43:49 +0300 Subject: [PATCH] add imx307 config for the new smtsec board (#530) --- .../config/smtsec_imx307_i2c_4l_1080p.ini | 149 ++++++++++++++++++ general/package/wifibroadcast/files/tweaksys | 22 ++- 2 files changed, 164 insertions(+), 7 deletions(-) create mode 100644 general/package/goke-osdrv-gk7205v200/files/sensor/config/smtsec_imx307_i2c_4l_1080p.ini diff --git a/general/package/goke-osdrv-gk7205v200/files/sensor/config/smtsec_imx307_i2c_4l_1080p.ini b/general/package/goke-osdrv-gk7205v200/files/sensor/config/smtsec_imx307_i2c_4l_1080p.ini new file mode 100644 index 00000000..93e127c5 --- /dev/null +++ b/general/package/goke-osdrv-gk7205v200/files/sensor/config/smtsec_imx307_i2c_4l_1080p.ini @@ -0,0 +1,149 @@ +[sensor] +Sensor_type =stSnsImx307Obj ;sensor name +Mode =0 ;WDR_MODE_NONE = 0 + ;WDR_MODE_BUILT_IN = 1 + ;WDR_MODE_QUDRA = 2 + ;WDR_MODE_2To1_LINE = 3 + ;WDR_MODE_2To1_FRAME = 4 + ;WDR_MODE_2To1_FRAME_FULL_RATE = 5 + ;WDR_MODE_3To1_LINE = 6 + ;WDR_MODE_3To1_FRAME = 7 + ;WDR_MODE_3To1_FRAME_FULL_RATE = 8 + ;WDR_MODE_4To1_LINE = 9 + ;WDR_MODE_4To1_FRAME = 10 + ;WDR_MODE_4To1_FRAME_FULL_RATE = 11 +DllFile = /usr/lib/sensors/libsns_imx307.so ;sensor lib path + + +[mode] +input_mode =0 ;INPUT_MODE_MIPI = 0 + ;INPUT_MODE_SUBLVDS = 1 + ;INPUT_MODE_LVDS = 2 ...etc + +raw_bitness = 12 + +[mipi] +;----------only for mipi_dev--------- +data_type = 2 ;raw data type: 8/10/12/14 bit + ;DATA_TYPE_RAW_8BIT = 0, + ;DATA_TYPE_RAW_10BIT, + ;DATA_TYPE_RAW_12BIT, + ;DATA_TYPE_RAW_14BIT, + ;DATA_TYPE_RAW_16BIT, + ;DATA_TYPE_YUV420_8BIT_NORMAL, + ;DATA_TYPE_YUV420_8BIT_LEGACY, + ;DATA_TYPE_YUV422_8BIT, +lane_id = 0|1|2|3|-1|-1|-1|-1| ;lane_id: -1 - disable + +[isp_image] +Isp_x =0 +Isp_y =0 +Isp_W =1920 +Isp_H =1080 +Isp_FrameRate=25 +Isp_Bayer =0 ;BAYER_RGGB=0, BAYER_GRBG=1, BAYER_GBRG=2, BAYER_BGGR=3 + +[vi_dev] +Input_mod = 6 + ; VI_MODE_BT656 = 0, /* ITU-R BT.656 YUV4:2:2 */ + ; VI_MODE_BT656_PACKED_YUV, /* ITU-R BT.656 packed YUV4:2:2 */ + ; VI_MODE_BT601, /* ITU-R BT.601 YUV4:2:2 */ + ; VI_MODE_DIGITAL_CAMERA, /* digatal camera mode */ + ; VI_MODE_BT1120_STANDARD, /* BT.1120 progressive mode */ + ; VI_MODE_BT1120_INTERLEAVED, /* BT.1120 interstage mode */ + ; VI_MODE_MIPI, /* MIPI RAW mode */ + ; VI_MODE_MIPI_YUV420_NORMAL, /* MIPI YUV420 normal mode */ + ; VI_MODE_MIPI_YUV420_LEGACY, /* MIPI YUV420 legacy mode */ + ; VI_MODE_MIPI_YUV422, /* MIPI YUV422 mode */ + ; VI_MODE_LVDS, /* LVDS mode */ + ; VI_MODE_HISPI, /* HiSPi mode */ + ; VI_MODE_SLVS, /* SLVS mode */ +Work_mod =0 ;VI_WORK_MODE_1Multiplex = 0 + ;VI_WORK_MODE_2Multiplex, + ;VI_WORK_MODE_4Multiplex +Combine_mode =0 ;Y/C composite or separation mode + ;VI_COMBINE_COMPOSITE = 0 /*Composite mode */ + ;VI_COMBINE_SEPARATE, /*Separate mode */ +Comp_mode =0 ;Component mode (single-component or dual-component) + ;VI_COMP_MODE_SINGLE = 0, /*single component mode */ + ;VI_COMP_MODE_DOUBLE = 1, /*double component mode */ +Clock_edge =1 ;Clock edge mode (sampling on the rising or falling edge) + ;VI_CLK_EDGE_SINGLE_UP=0, /*rising edge */ + ;VI_CLK_EDGE_SINGLE_DOWN, /*falling edge */ +Mask_num =2 ;Component mask +Mask_0 =0xFFC00000 +Mask_1 =0x0 +Scan_mode = 1;VI_SCAN_INTERLACED = 0 + ;VI_SCAN_PROGRESSIVE, +Data_seq =2 ;data sequence (ONLY for YUV format) + ;----2th component U/V sequence in bt1120 + ; VI_INPUT_DATA_VUVU = 0, + ; VI_INPUT_DATA_UVUV, + ;----input sequence for yuv + ; VI_INPUT_DATA_UYVY = 0, + ; VI_INPUT_DATA_VYUY, + ; VI_INPUT_DATA_YUYV, + ; VI_INPUT_DATA_YVYU + +Vsync =1 ; vertical synchronization signal + ;VI_VSYNC_FIELD = 0, + ;VI_VSYNC_PULSE, +VsyncNeg=1 ;Polarity of the vertical synchronization signal + ;VI_VSYNC_NEG_HIGH = 0, + ;VI_VSYNC_NEG_LOW /*if VIU_VSYNC_E +Hsync =0 ;Attribute of the horizontal synchronization signal + ;VI_HSYNC_VALID_SINGNAL = 0, + ;VI_HSYNC_PULSE, +HsyncNeg =0 ;Polarity of the horizontal synchronization signal + ;VI_HSYNC_NEG_HIGH = 0, + ;VI_HSYNC_NEG_LOW +VsyncValid =1 ;Attribute of the valid vertical synchronization signal + ;VI_VSYNC_NORM_PULSE = 0, + ;VI_VSYNC_VALID_SINGAL, +VsyncValidNeg =0;Polarity of the valid vertical synchronization signal + ;VI_VSYNC_VALID_NEG_HIGH = 0, + ;VI_VSYNC_VALID_NEG_LOW +Timingblank_HsyncHfb =0 ;Horizontal front blanking width +Timingblank_HsyncAct =1920 ;Horizontal effetive width +Timingblank_HsyncHbb =0 ;Horizontal back blanking width +Timingblank_VsyncVfb =0 ;Vertical front blanking height +Timingblank_VsyncVact =1080 ;Vertical effetive width +Timingblank_VsyncVbb=0 ;Vertical back blanking height +Timingblank_VsyncVbfb =0 ;Even-field vertical front blanking height(interlace, invalid progressive) +Timingblank_VsyncVbact=0 ;Even-field vertical effetive width(interlace, invalid progressive) +Timingblank_VsyncVbbb =0 ;Even-field vertical back blanking height(interlace, invalid progressive) + +;----- only for bt656 ---------- +FixCode =0 ;BT656_FIXCODE_1 = 0, + ;BT656_FIXCODE_0 +FieldPolar=0 ;BT656_FIELD_POLAR_STD = 0 + ;BT656_FIELD_POLAR_NSTD +DataPath =1 ;ISP enable or bypass + ;VI_PATH_BYPASS = 0,/* ISP bypass */ + ;VI_PATH_ISP = 1,/* ISP enable */ + ;VI_PATH_RAW = 2,/* Capture raw data, for debug */ +InputDataType=1 ;VI_DATA_TYPE_YUV = 0,VI_DATA_TYPE_RGB = 1, +DataRev =FALSE ;Data reverse. FALSE = 0; TRUE = 1 +DevRect_x=200 ; +DevRect_y=20 ; +DevRect_w=1920 ; +DevRect_h=1080 ; + +[vi_chn] +CapRect_X =0 +CapRect_Y =0 +CapRect_Width=1920 +CapRect_Height=1080 +DestSize_Width=1920 +DestSize_Height=1080 +CapSel =2 ;Frame/field select. ONLY used in interlaced mode + ;VI_CAPSEL_TOP = 0, /* top field */ + ;VI_CAPSEL_BOTTOM, /* bottom field */ + ;VI_CAPSEL_BOTH, /* top and bottom field */ + +PixFormat =26;PIXEL_FORMAT_YVU_SEMIPLANAR_420 = 26 ...etc +CompressMode =0 ;COMPRESS_MODE_NONE = 0 + ;COMPRESS_MODE_SEG =1 ...etc + +SrcFrameRate=-1 ;Source frame rate. -1: not controll +FrameRate =-1 ;Target frame rate. -1: not controll diff --git a/general/package/wifibroadcast/files/tweaksys b/general/package/wifibroadcast/files/tweaksys index 8e2cf839..ca079ab7 100755 --- a/general/package/wifibroadcast/files/tweaksys +++ b/general/package/wifibroadcast/files/tweaksys @@ -12,7 +12,9 @@ all_other() { if [ ${vendor} = "hisilicon" ]; then prefix="open" fi - # remove unneded modules + # don't load f2fs module (disabled in kernel) + sed -i "s!f2fs!#f2fs!g" /etc/modules + # remove unneeded modules sed -i "s!insmod ${prefix}_rgn.ko!#insmod ${prefix}_rgn.ko!g" /usr/bin/load_${vendor} sed -i "s!insmod ${prefix}_jpege.ko!#insmod ${prefix}_jpege.ko!g" /usr/bin/load_${vendor} sed -i "s!insmod ${prefix}_ive.ko save_power=0!#insmod ${prefix}_ive.ko save_power=0!g" /usr/bin/load_${vendor} @@ -24,13 +26,14 @@ all_other() { sed -i "s!insmod ${prefix}_acodec.ko!#insmod ${prefix}_acodec.ko!g" /usr/bin/load_${vendor} # change fps 25 -> 30 sed -i "s!Isp_FrameRate=25!Isp_FrameRate=30!g" /etc/sensors/imx307_i2c_2l_1080p.ini + sed -i "s!Isp_FrameRate=25!Isp_FrameRate=30!g" /etc/sensors/smtsec_imx307_i2c_4l_1080p.ini # disable mavlink routerd autostart sed -i "s!/usr/bin/mavlink-routerd &!#/usr/bin/mavlink-routerd &!g" /etc/init.d/S97mavlink # majestic basic settings ${cli} -s .isp.slowShutter disabled ${cli} -s .image.contrast 50 ${cli} -s .image.luminance 50 - ${cli} -s .video0.bitrate 5120 + ${cli} -s .video0.bitrate 4096 ${cli} -s .video0.codec h264 ${cli} -s .video0.rcMode cbr ${cli} -s .video0.gopSize 0.1 @@ -40,7 +43,9 @@ all_other() { ${cli} -s .jpeg.enabled false # lowdelay support only imx307 sensor if [ ${sensor} = "imx307" ]; then - ${cli} -s .isp.lowDelay true + ${cli} -s .video0.size 1920x1080 + ${cli} -s .video0.fps 30 + ${cli} -s .isp.lowDelay true # ${cli} -s .video0.sliceUnits: 4 fi # add outgoing rtp stream to udp @@ -60,15 +65,18 @@ case "$1" in # set osmem fw_setenv osmem 40M # change uart1 to uart0 - sed -i "s!Device = /dev/ttyAMA1!Device = /dev/ttyAMA0!g" /etc/mavlink.conf + sed -i "s!Device = /dev/ttyAMA1!Device = /dev/ttyAMA0!g" /etc/mavlink.conf sed -i "s!console::respawn:/sbin/getty -L console 0 vt100 # GENERIC_SERIAL!#console::respawn:/sbin/getty -L console 0 vt100 # GENERIC_SERIAL!g" /etc/inittab - # remove unneded - rm -f /etc/modules /etc/init.d/S60crond /etc/init.d/S49ntpd /etc/init.d/S50httpd /etc/init.d/S02klogd - + # remove unneeded to reduce some memory + rm -f /etc/init.d/S60crond /etc/init.d/S49ntpd /etc/init.d/S02klogd all_other ;; gk7205v300 | hi3516ev300) echo "Preparig system tweaks for ${chip}..." + # set sensor config for smtsec board + if [ ${chip} = "gk7205v300" ] && [ ${sensor} = "imx307" ]; then + ${cli} -s .isp.sensorConfig /etc/sensors/smtsec_imx307_i2c_4l_1080p.ini + fi all_other ;; *)