@xiaowenge 那是,性价比这块全志芯片还不错的,如果能自己搞定软件的话... 确实难就难在这,我这里东西都做得差不多了,只是老板想叫我去做bios编程的工作内容,我不同意,试用期也就这样了。
xjy_5 发布的帖子
-
回复: 再见了各位!
-
回复: v853上电自动打开eth0怎么设置
@sunxi vi /etc/init.d/S40network
学一下vi编辑器,用vi来改或者你在电脑改好这个文件,adb传到开发板
adb push ./S40network /etc/init.d/S40Network -
回复: v853上电自动打开eth0怎么设置
@sunxi 修改脚本/etc/init.d/S40network
添加 ifconfig eth0 up
ifconfig eth0 "192.168.1.1" netmask "255.255.255.0"参考例子
#!/bin/sh # # Start the network.... # # Debian ifupdown needs the /run/network lock directory mkdir -p /run/network MAC_ADDR="`cat /sys/class/sunxi_info/sys_info | awk '$1=="sunxi_chipid" {print $3}' | sed 's/../&:/g' | cut -c1-14`" ipaddr="192.168.20.162" netmask="255.255.255.0" case "$1" in start) printf "Starting network: " /sbin/ifup -a [ $? = 0 ] && echo "OK" || echo "FAIL" /sbin/ifconfig eth0 hw ether "00:$MAC_ADDR" #udhcpc -b -R & ifconfig eth0 up ifconfig eth0 "$ipaddr" netmask "$netmask" ;; stop) printf "Stopping network: " /sbin/ifdown -a [ $? = 0 ] && echo "OK" || echo "FAIL" ;; restart|reload) "$0" stop "$0" start ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 esac exit $?
可以修改openwrt/target/v853/v853-vision/busybox-init-base-files/etc/init.d/S40network,这样每次打包都会把这个脚本改好
-
回复: uhttpd服务启动报错
@awwwwa 还是一样的,luci加进来了,官网的配置暂时没找着这个内容
root@TinaLinux:/# luci-
luci-bwc luci-reload
root@TinaLinux:/# /etc/init.d/uhttpd start
root@TinaLinux:/# /etc/rc.common: line 128: uci_load: not foundroot@TinaLinux:/#
-
uhttpd服务启动报错
root@TinaLinux:/# /etc/init.d/uhttpd start
root@TinaLinux:/# /etc/rc.common: line 128: uci_load: not found不知道怎么添加uci的调用,没找到uci的配置路径,在menuconfig下直接搜索uci信息太多,搜索uci_load就没信息
-
求个uhttpd的配置教程
换了个企业版的V853SDK,menuconfig 没有lighttp可以选,uhttpd找半天没找着教程,这玩意哪有比较全面的配置步骤啊?只要能把html网页发布出去就行了
-
回复: V853使用MIPI CSI接口是否只支持RAW格式像素?
@awwwwa 我这边想走硬件获取视频输入好适配H264编码,像素格式YUV422P,默认mpp的程序里是不支持这个格式的,原来的就只有YUV420,请问有哪个设备的SDK适配了YUV422P像素格式的摄像头吗?我参考参考程序
在videoInputHW.c里有
-
回复: V853移植rk628成功出图,但是图片颜色异常,求个排查思路
@awwwwa 通过sample_virvi抓到的图比sample_driverVipp小一半,应该是哪没设置好吧
-
回复: V853移植rk628成功出图,但是图片颜色异常,求个排查思路
@awwwwa 现在又开始烦了,我在sample_driverVipp里面用 V4L2_PIX_FMT_YUV422P 抓图,很顺利,不过得到的是1920x1088的图片,然后用sample_virvi抓图,怎么抓出来的图都是红红绿绿蓝蓝的,不过出来的图是1920x1080的了,理论上我应该选MM_PIXEL_FORMAT_UYVY_PACKAGE_422就对了
-
V853移植rk628成功出图,但是图片颜色异常,求个排查思路
驱动里设置
/* * Store information about the video data format. */ static struct sensor_format_struct sensor_formats[] = { { .desc = "UYVY 4:2:2", .mbus_code = MEDIA_BUS_FMT_UYVY8_2X8, /*.mbus_code = MEDIA_BUS_FMT_SBGGR10_1X10, */ .regs = 0, .regs_size = 0, .bpp = 4, }, }; #define N_FMTS ARRAY_SIZE(sensor_formats) /* * Then there is the issue of window sizes. Try to capture the info here. */ static struct sensor_win_size sensor_win_sizes[] = { { .width = 1920, .height = 1080, .hoffset = 0, .voffset = 0, .hts = 2200, .vts = 1125, .pclk = 74250000*2, .mipi_bps = 375 * 1000 * 1000, .fps_fixed = 60, .regs = 0, .regs_size = 0, .set_size = NULL, }, };
修改了sunxi_isp.c和vin_tdm.c,增加对MEDIA_BUS_FMT_UYVY8_2X8的支持,设备树里设置 sensor0_isp_used = <0>; sensor0_fmt = <0>;
static struct tdm_format sunxi_tdm_formats[] = { { .code = MEDIA_BUS_FMT_UYVY8_2X8, .input_type = INPUTTPYE_8BIT, .input_bit_width = RAW_8BIT, .raw_fmt = BAYER_RGGB, },{ ...
static struct isp_pix_fmt sunxi_isp_formats[] = { { .fourcc = V4L2_PIX_FMT_UYVY, .mbus_code = MEDIA_BUS_FMT_UYVY8_2X8, .infmt = ISP_BGGR, .input_bit = RAW_8, },{
使用camerademo setting 抓图
root@TinaLinux:/# camerademo setting [CAMERA]********************************************************** [CAMERA]* * [CAMERA]* this is camera test. * [CAMERA]* * [CAMERA]********************************************************** [CAMERA] Please input the setting parameters according to the prompts. [CAMERA]********************************************************** [CAMERA] open /dev/video0! [CAMERA]********************************************************** [CAMERA]********************************************************** [CAMERA] Please enter the data save path: /root/pic [CAMERA] Please enter the number of captured photos: 1 [CAMERA] Please enter the data save type: [CAMERA] 0:save BMP and YUV formats [CAMERA] 1:save BMP format [CAMERA] 2:save YUV format 2 [CAMERA]************************[ 38.522814] [rk628_mipi]PWR_ON! ********************************[ 38.530221] [rk628_mipi]sensor_init ** [CAMERA] The path to data sa[ 38.536887] rk628_mipi 1-0050: RK628 I2C driver version: 00.00.08 ving is /root/pic. [CAMERA] The[ 38.545311] [rk628_mipi]do nothing rk628 init over number of captured photos is 1.[ 38.553725] [VIN]fmt yuv mask [CAMERA] save yuv format [ 38.559577] [VIN]fmt yuv mask [ 38.565431] [VIN]fmt yuv mask [ 38.568777] [VIN]fmt yuv mask [ 38.572136] [VIN]fmt yuv mask [ 38.575590] [VIN]fmt yuv mask [ 38.578934] [VIN]fmt yuv mask [ 38.582275] [VIN]no fmt yuv mask mask:0x2 vinc->support_raw:0x0 [ 38.589048] [VIN]no fmt yuv mask mask:0x2 vinc->support_raw:0x0 [ 38.595745] [VIN]no fmt yuv mask mask:0x2 vinc->support_raw:0x0 [ 38.602458] [VIN]no fmt yuv mask mask:0x2 vinc->support_raw:0x0 [ 38.609179] [VIN]no fmt yuv mask mask:0x2 vinc->support_raw:0x0 [ 38.615919] [VIN]no fmt yuv mask mask:0x2 vinc->support_raw:0x0 [ 38.622589] [VIN]no fmt yuv mask mask:0x2 vinc->support_raw:0x0 [ 38.629328] [VIN]no fmt yuv mask mask:0x2 vinc->support_raw:0x0 [ 38.636020] [VIN]no fmt yuv mask mask:0x2 vinc->support_raw:0x0 [ 38.642742] [VIN]no fmt yuv mask mask:0x2 vinc->support_raw:0x0 [ 38.649440] [VIN]no fmt yuv mask mask:0x2 vinc->support_raw:0x0 [ 38.656219] [VIN]no fmt yuv mask mask:0x2 vinc->support_raw:0x0 [ 38.662874] [VIN]fmt yuv mask [ 38.666308] [VIN]fmt yuv mask [ 38.669643] [VIN]fmt yuv mask [ 38.672999] [VIN]fmt yuv mask [ 38.676424] [VIN]fmt yuv mask [ 38.679768] [VIN]fmt yuv mask [ 38.683100] [VIN]fmt yuv mask [ 38.686521] [VIN]fmt yuv mask [ 38.689881] [VIN]fmt yuv mask [ 38.693214] [VIN]fmt yuv mask [ 38.696641] [VIN]fmt yuv mask [ 38.699984] [VIN]fmt yuv mask [CAMERA]********************************************************* [CAMERA] The sensor supports the following formats : [CAMERA] index 0 : YUV422P [CAMERA] index 1 : NV16 [CAMERA] index 2 : NV61 [CAMERA] index 3 : YUV420 [CAMERA] index 4 : YVU420 [CAMERA] index 5 : NV12 [CAMERA] index 6 : NV21 [CAMERA] index 7 : BGGR8 [CAMERA] index 8 : GBRG8 [CAMERA] index 9 : GRBG8 [CAMERA] index 10 : RGGB8 [CAMERA] index 11 : BGGR10 [CAMERA] index 12 : GBRG10 [CAMERA] index 13 : GRBG10 [CAMERA] index 14 : RGGB10 [CAMERA] index 15 : BGGR12 [CAMERA] index 16 : GBRG12 [CAMERA] index 17 : GRBG12 [CAMERA] index 18 : RGGB12 [CAMERA] index 19 : YUYV [CAMERA] index 20 : UYVY [CAMERA] index 21 : VYUY [CAMERA] index 22 : YVYU [CAMERA] index 23 : YUYV [CAMERA] index 24 : UYVY [CAMERA] index 25 : VYUY [CAMERA] index 26 : YVYU [CAMERA] index 27 : UYVY [CAMERA] index 28 : VYUY [CAMERA] index 29 : YVYU [CAMERA] index 30 : YUYV [CAMERA] Please enter the serial number you need for pixelformat: 0 [CAMERA] The input value is 0. [CAMERA] camera pixelformat: YUV422P [CAMERA]********************************************************** [CAMERA] The YUV422P supports the following resolutions: [CAMERA] Index 0 : 1920 * 1080 [CAMERA] Please enter the serial number you need for windows size: 0 [CAMERA] The input value is 0. [ 45.692968] [VIN]fmt yuv mask [CAMERA] Resolution size : 1920 [ 45.699066] [rk628_mipi]ioctl cmd:0x0 * 1080 [CAMERA] The photo save path is /root/pic. [CAMERA] The number of photos taken is 1. [CAMERA]usr cap mplane begin io[ 45.714464] [cmb_phy_set_deskew_laneck0]-[239]:sel:0, delay:2 n_alloc_open pid: 1118, g_allo[ 45.723594] [cmb_phy_set_deskew_laneck0]-[239]:sel:1, delay:7 c_context = 0xb6efcf70 [CAMERA[ 45.733361] [rk628_mipi]s_stream enable val:1 ] Camera capture framerate is 60/1 [CAMERA] VIDIOC_S_FMT succeed [CAMERA] fmt.type = 9 [CAMER[ 45.747495] rk628_mipi 1-0050: src 1920x1080 clock:148500000 A] fmt.fmt.pix_mp.width = 1920 [ 45.755089] rk628_mipi 1-0050: dst 1920x1080 clock:148500000 [CAMERA] fmt.fmt.pix_mp.height = 1080 [CAMERA] fmt.fmt.pix_mp.pixelformat = YUV422P [CAMERA] fmt.fmt.pix_mp.field = 1 [ 45.901485] rk628_mipi 1-0050: rk628_is_avi_ready PDEC_AVI_PB:0x1084a80c, avi_rcv_rdy:1 [ 45.954623] rk628_mipi 1-0050: rk628_is_avi_ready PDEC_AVI_PB:0x1084a80c, avi_rcv_rdy:1 [ 46.014629] rk628_mipi 1-0050: rk628_is_avi_ready PDEC_AVI_PB:0x1084a80c, avi_rcv_rdy:1 [ 46.074626] rk628_mipi 1-0050: rk628_is_avi_ready PDEC_AVI_PB:0x1084a80c, avi_rcv_rdy:1 [ 46.134614] rk628_mipi 1-0050: rk628_is_avi_ready PDEC_AVI_PB:0x1084a80c, avi_rcv_rdy:1 [ 46.194637] rk628_mipi 1-0050: rk628_is_avi_ready PDEC_AVI_PB:0x1084a80c, avi_rcv_rdy:1 [CAMERA] stream on succeed [CAMERA] camera0 capture num is [0] [CAMERA_PROMPT] the time interval from the start to the first frame is 28 ms [CAMERA] Capture thread finish[ 46.583099] [rk628_mipi]s_stream enable val:0 [CAMERA] close /dev/video0[ 46.594185] [rk628_mipi]PWR_OFF!do nothing ion_alloc_close pid: 1118, release g_alloc_context = 0xb6efcf70 root@TinaLinux:/#
图片格式YUV422,宽高19201080理论上大小是19201080*2=4147200字节,实际上得到的图是4177920字节,多出来啥了?
用yuvplayer看图,颜色设置YUV422,能看到图片还白加点偏移的颜色的
-
回复: V853使用MIPI CSI接口是否只支持RAW格式像素?
@awwwwa 看来设备树里关ISP只是不使用硬件ISP但set_fmt还是会在代码里面过过,我开了ISP就出现isp error了,现在看来抓图应该是抓成功了,但数据格式不太对,有颜色,颜色都有偏移,文件大小也稍大了些,理论上192010802=417200字节,实际上是4177920字节,多出来什么了?
我截图桌面用ffmpeg转成yuv422图片确实是417200字节
-
回复: V853使用MIPI CSI接口是否只支持RAW格式像素?
@awwwwa 果然这邪门方法还是不想,出图了,黑白色搞不定,除非继续深挖改写代码,这样这块只会变得越来越像屎山,有没有什么靠谱的办法啊。
-
回复: V853使用MIPI CSI接口是否只支持RAW格式像素?
@awwwwa 出图了,黑白色,我的天,今晚做梦都能笑出来了,哈哈
主要改了sunxi_isp_formats 和 sunxi_tdm_formats ,添加了含MEDIA_BUS_FMT_UYVY8_2X8的定义static struct tdm_format sunxi_tdm_formats[] = { { .code = MEDIA_BUS_FMT_UYVY8_2X8, .input_type = INPUTTPYE_8BIT, .input_bit_width = RAW_8BIT, .raw_fmt = BAYER_RGGB, },{ ...
static struct isp_pix_fmt sunxi_isp_formats[] = { { .fourcc = V4L2_PIX_FMT_YUV422P, .mbus_code = MEDIA_BUS_FMT_UYVY8_2X8, .infmt = ISP_BGGR, .input_bit = RAW_8, },{ ...
用yuvplayer看的图
-
回复: V853使用MIPI CSI接口是否只支持RAW格式像素?
@awwwwa 要是有办法绕掉sunxi_isp.c就好了 ,sunxi_csi_formats里都有MEDIA_BUS_FMT_UYVY8_2X8的定义了
-
回复: V853使用MIPI CSI接口是否只支持RAW格式像素?
@awwwwa reset脚,中断脚我在设备树其他地方定义,在驱动的sensor_init里获取来用了,也能用,iic是用rk628原本的regmap,也能用,不过这些放一边先。
驱动里设置 MEDIA_BUS_FMT_UYVY8_2X8 用camerademo抓图应该设置那个像素格式?使用gc2053的经验告诉我,设备树里关掉isp后抓图设置的像素格式应该和驱动里设置的一致,那MEDIA_BUS_FMT_UYVY8_2X8 对应的是哪个?int return_format(char *short_name) { if (strcmp(short_name, "YUV422P") == 0) return V4L2_PIX_FMT_YUV422P; else if (strcmp(short_name, "YUV420") == 0) return V4L2_PIX_FMT_YUV420; else if (strcmp(short_name, "YVU420") == 0) return V4L2_PIX_FMT_YVU420; else if (strcmp(short_name, "NV16") == 0) return V4L2_PIX_FMT_NV16; else if (strcmp(short_name, "NV12") == 0) return V4L2_PIX_FMT_NV12; else if (strcmp(short_name, "NV61") == 0) return V4L2_PIX_FMT_NV61; else if (strcmp(short_name, "NV21") == 0) return V4L2_PIX_FMT_NV21; else if (strcmp(short_name, "YUYV") == 0) return V4L2_PIX_FMT_YUYV; else if (strcmp(short_name, "YVYU") == 0) return V4L2_PIX_FMT_YVYU; else if (strcmp(short_name, "UYVY") == 0) return V4L2_PIX_FMT_UYVY; else if (strcmp(short_name, "VYUY") == 0) return V4L2_PIX_FMT_VYUY; else if (strcmp(short_name, "MJPEG") == 0) return V4L2_PIX_FMT_MJPEG; else if (strcmp(short_name, "H264") == 0) return V4L2_PIX_FMT_H264; else if (strcmp(short_name, "BGGR8") == 0) return V4L2_PIX_FMT_SBGGR8; else if (strcmp(short_name, "GBRG8") == 0) return V4L2_PIX_FMT_SGBRG8; else if (strcmp(short_name, "GRBG8") == 0) return V4L2_PIX_FMT_SGRBG8; else if (strcmp(short_name, "RGGB8") == 0) return V4L2_PIX_FMT_SRGGB8; else if (strcmp(short_name, "BGGR10") == 0) return V4L2_PIX_FMT_SBGGR10; else if (strcmp(short_name, "GBRG10") == 0) return V4L2_PIX_FMT_SGBRG10; else if (strcmp(short_name, "GRBG10") == 0) return V4L2_PIX_FMT_SGRBG10; else if (strcmp(short_name, "RGGB10") == 0) return V4L2_PIX_FMT_SRGGB10; else if (strcmp(short_name, "BGGR12") == 0) return V4L2_PIX_FMT_SBGGR12; else if (strcmp(short_name, "GBRG12") == 0) return V4L2_PIX_FMT_SGBRG12; else if (strcmp(short_name, "GRBG12") == 0) return V4L2_PIX_FMT_SGRBG12; else if (strcmp(short_name, "RGGB12") == 0) return V4L2_PIX_FMT_SRGGB12; else return -1; }
-
回复: V853使用MIPI CSI接口是否只支持RAW格式像素?
@awwwwa 现在这个VIN_LOG_FMT信息就是用camerademo出来的
root@TinaLinux:/# camerademo setting [CAMERA]********************************************************** [CAMERA]* * [CAMERA]* this is camera test. * [CAMERA]* * [CAMERA]********************************************************** [CAMERA] Please input the setting parameters according to the prompts. [CAMERA]********************************************************** [CAMERA] open /dev/video0! [CAMERA]********************************************************** [CAMERA]********************************************************** [CAMERA] Please enter the data save path: /root/pic [CAMERA] Please enter the number of captured photos: 3 [CAMERA] Please enter the data save type: [CAMERA] 0:save BMP and YUV formats [CAMERA] 1:save BMP format [CAMERA] 2:save YUV format 2 [CAMERA]************************[ 8937.879172] [rk628_mipi]PWR_ON! ********************************[ 8937.886596] [rk628_mipi]sensor_init ** [CAMERA] The path to data sa[ 8937.893118] rk628_mipi 1-0050: RK628 I2C driver version: 00.00.08 ving is /root/pic. [CAMERA] The[ 8937.901698] [rk628_mipi]do nothing rk628 init over number of captured photos is 3.[ 8937.909981] [VIN]fmt yuv mask [CAMERA] save yuv format [ 8937.916008] [VIN_LOG_FMT]rk628_mipi sensor_set_fmt 640*480 0x2008 0xffffffff [ 8937.926317] [VIN_LOG_FMT]sunxi_mipi_subdev_set_fmt 1920*1080 2006 1 [ 8937.933353] [VIN_LOG_FMT]sunxi_mipi_subdev_set_fmt 1920*1080 2006 1 [ 8937.940457] [VIN_LOG_FMT]sunxi_csi_subdev_set_fmt 1920*1080 2006 1 [ 8937.947415] [VIN_LOG_FMT]sunxi_csi_subdev_set_fmt 1920*1080 2006 1 [ 8937.954397] [VIN_LOG_FMT]sunxi_tdm_subdev_set_fmt 1920*1080 2006 1 [ 8937.961354] [VIN_LOG_FMT]sunxi_tdm_subdev_set_fmt 1920*1080 3001 1 [ 8937.968357] [VIN]sd coutinue sd:-562396204 pipesd:-563186176 [ 8937.974701] [VIN_LOG_FMT]sunxi_isp_subdev_set_fmt 1920*1080 3001 1 [ 8937.981689] [VIN_LOG_FMT]sunxi_isp_subdev_set_fmt 1920*1080 3001 1 [ 8937.988660] [VIN_LOG_FMT]sunxi_scaler_subdev_set_fmt 1920*1080 3001 1 [ 8937.995940] [VIN_LOG_FMT]sunxi_scaler_subdev_set_fmt 640*480 3001 1 [ 8938.002974] [VIN]sd coutinue sd:-546217488 pipesd:-563186176 ... [CAMERA]********************************************************* [CAMERA] The sensor supports the following formats : [CAMERA] index 0 : YUV422P [CAMERA] index 1 : NV16 [CAMERA] index 2 : NV61 [CAMERA] index 3 : YUV420 [CAMERA] index 4 : YVU420 [CAMERA] index 5 : NV12 [CAMERA] index 6 : NV21 [CAMERA] index 7 : BGGR8 [CAMERA] index 8 : GBRG8 [CAMERA] index 9 : GRBG8 [CAMERA] index 10 : RGGB8 [CAMERA] index 11 : BGGR10 [CAMERA] index 12 : GBRG10 [CAMERA] index 13 : GRBG10 [CAMERA] index 14 : RGGB10 [CAMERA] index 15 : BGGR12 [CAMERA] index 16 : GBRG12 [CAMERA] index 17 : GRBG12 [CAMERA] index 18 : RGGB12 [CAMERA] index 19 : YUYV [CAMERA] index 20 : UYVY [CAMERA] index 21 : VYUY [CAMERA] index 22 : YVYU [CAMERA] index 23 : YUYV [CAMERA] index 24 : UYVY [CAMERA] index 25 : VYUY [CAMERA] index 26 : YVYU [CAMERA] index 27 : UYVY [CAMERA] index 28 : VYUY [CAMERA] index 29 : YVYU [CAMERA] index 30 : YUYV [CAMERA] Please enter the serial number you need for pixelformat: 0 [CAMERA] The input value is 0. [CAMERA] camera pixelformat: YUV422P [CAMERA]********************************************************** [CAMERA] The YUV422P supports the following resolutions: [CAMERA] Index 0 : 1920 * 1080 [CAMERA] Please enter the serial number you need for windows size: 0 [CAMERA] The input value is 0. [ 9072.528405] [VIN]fmt yuv mask [CAMERA] Resolution size : 1920 [ 9072.534471] [VIN_LOG_FMT]rk628_mipi sensor_set_fmt 1920*1080 0x2008 0x1 * 1080 [CAMERA] The photo save [ 9072.544715] [VIN_LOG_FMT]sunxi_mipi_subdev_set_fmt 1920*1080 2006 1 path is /root/pic. [CAMERA] The[ 9072.554467] [VIN_LOG_FMT]sunxi_mipi_subdev_set_fmt 1920*1080 2006 1 number of photos taken is 3. [[ 9072.564306] [VIN_LOG_FMT]sunxi_csi_subdev_set_fmt 1920*1080 2006 1 CAMERA]usr cap mplane begin io[ 9072.573988] [VIN_LOG_FMT]sunxi_csi_subdev_set_fmt 1920*1080 2006 1 n_alloc_open pid: 1398, g_allo[ 9072.583725] [VIN_LOG_FMT]sunxi_tdm_subdev_set_fmt 1920*1080 2006 1 c_context = 0xb6ea2f70 [CAMERA[ 9072.593411] [VIN_LOG_FMT]sunxi_tdm_subdev_set_fmt 1920*1080 3001 1 ] Camera capture framerate is 60[ 9072.603182] [VIN]sd coutinue sd:-562396204 pipesd:-563186176 /1 [ 9072.612239] [VIN_LOG_FMT]sunxi_isp_subdev_set_fmt 1920*1080 3001 1 [ 9072.619571] [VIN_LOG_FMT]sunxi_isp_subdev_set_fmt 1920*1080 3001 1 [ 9072.626530] [VIN_LOG_FMT]sunxi_scaler_subdev_set_fmt 1920*1080 3001 1 [ 9072.633790] [VIN_LOG_FMT]sunxi_scaler_subdev_set_fmt 1920*1080 3001 1 [ 9072.641057] [VIN]sd coutinue sd:-546217488 pipesd:-563186176 [ 9072.647460] [VIN]code coutinue code:12289 tcode:8200 [ 9072.653041] [VIN_LOG_FMT]rk628_mipi sensor_set_fmt 1920*1080 0x2006 0x1 [ 9072.660520] [VIN_LOG_FMT]sunxi_mipi_subdev_set_fmt 1920*1080 2006 1 [ 9072.667605] [VIN_LOG_FMT]sunxi_mipi_subdev_set_fmt 1920*1080 2006 1 [ 9072.674677] [VIN_LOG_FMT]sunxi_csi_subdev_set_fmt 1920*1080 2006 1 [ 9072.681636] [VIN_LOG_FMT]sunxi_csi_subdev_set_fmt 1920*1080 2006 1 [ 9072.688640] [VIN_LOG_FMT]sunxi_tdm_subdev_set_fmt 1920*1080 2006 1 [ 9072.695596] [VIN_LOG_FMT]sunxi_tdm_subdev_set_fmt 1920*1080 3001 1 [ 9072.702569] [VIN]sd coutinue sd:-562396204 pipesd:-563186176 [ 9072.708941] [VIN_LOG_FMT]sunxi_isp_subdev_set_fmt 1920*1080 3001 1 [ 9072.715923] [VIN_LOG_FMT]sunxi_isp_subdev_set_fmt 1920*1080 3001 1 [ 9072.722860] [VIN_LOG_FMT]sunxi_scaler_subdev_set_fmt 1920*1080 3001 1 [ 9072.730157] [VIN_LOG_FMT]sunxi_scaler_subdev_set_fmt 1920*1080 3001 1 [ 9072.737419] [VIN]sd coutinue sd:-546217488 pipesd:-563186176 [ 9072.743803] [VIN]code coutinue code:12289 tcode:8198 ... [ 9073.672793] [VIN_LOG_FMT]sunxi_isp_subdev_set_fmt 1920*1080 3001 1 [ 9073.679792] [VIN_LOG_FMT]sunxi_isp_subdev_set_fmt 1920*1080 3001 1 [ 9073.686747] [VIN_LOG_FMT]sunxi_scaler_subdev_set_fmt 1920*1080 3001 1 [ 9073.694002] [VIN_LOG_FMT]sunxi_scaler_subdev_set_fmt 1920*1080 3001 1 [ 9073.701259] [VIN]sd coutinue sd:-546217488 pipesd:-563186176 [ 9073.707658] [VIN]code coutinue code:12289 tcode:8203 [ 9073.713228] [VIN]fin code:0x3001 fincou:13 [ 9073.717871] [VIN_ERR]vin is not support this pixelformat [ 9073.723821] [VIN_ERR]vin_pipeline_try_format failed [CAMERA_ERR] setting t[ 9073.729444] [rk628_mipi]PWR_OFF!do nothing he data format failed! root@TinaLinux:/#
-
回复: V853使用MIPI CSI接口是否只支持RAW格式像素?
@awwwwa 我这边设备树的设置
sensor0:sensor@0 { device_type = "sensor0"; sensor0_mname = "rk628_mipi"; sensor0_twi_cci_id = <1>; sensor0_twi_addr = <0xA0>; sensor0_mclk_id = <0>; sensor0_pos = "rear"; sensor0_isp_used = <0>; sensor0_fmt = <0>; sensor0_stby_mode = <0>; sensor0_vflip = <0>; sensor0_hflip = <0>; sensor0_iovdd-supply = <®_aldo2>; sensor0_iovdd_vol = <1800000>; sensor0_avdd-supply = <>; sensor0_avdd_vol = <>; sensor0_dvdd-supply = <>; sensor0_dvdd_vol = <>; flash_handle = <&flash0>; act_handle = <&actuator0>; device_id = <0>; status = "okay"; };
驱动里的设置
/* * Store information about the video data format. */ static struct sensor_format_struct sensor_formats[] = { { .desc = "UYVY 4:2:2", .mbus_code = MEDIA_BUS_FMT_UYVY8_2X8, /*.mbus_code = MEDIA_BUS_FMT_SBGGR10_1X10, */ .regs = 0, .regs_size = 0, .bpp = 2, }, };
根据VIN_LOG_FMT的debug信息,抓图时它会调用到sunxi_isp_subdev_set_fmt函数,而sunxi_isp_formats的定义并未包含YUV格式像素,我想问题应该就在这,但是不敢乱改代码,也不知道怎么改
static struct isp_pix_fmt sunxi_isp_formats[] = { { .fourcc = V4L2_PIX_FMT_SBGGR8, .mbus_code = MEDIA_BUS_FMT_SBGGR8_1X8, .infmt = ISP_BGGR, .input_bit = RAW_8, }, { .fourcc = V4L2_PIX_FMT_SGBRG8, .mbus_code = MEDIA_BUS_FMT_SGBRG8_1X8, .infmt = ISP_GBRG, .input_bit = RAW_8, }, { .fourcc = V4L2_PIX_FMT_SGRBG8, .mbus_code = MEDIA_BUS_FMT_SGRBG8_1X8, .infmt = ISP_GRBG, .input_bit = RAW_8, }, { .fourcc = V4L2_PIX_FMT_SRGGB8, .mbus_code = MEDIA_BUS_FMT_SRGGB8_1X8, .infmt = ISP_RGGB, .input_bit = RAW_8, }, { .fourcc = V4L2_PIX_FMT_SBGGR10, .mbus_code = MEDIA_BUS_FMT_SBGGR10_1X10, .infmt = ISP_BGGR, .input_bit = RAW_10, }, { .fourcc = V4L2_PIX_FMT_SGBRG8, .mbus_code = MEDIA_BUS_FMT_SGBRG10_1X10, .infmt = ISP_GBRG, .input_bit = RAW_10, }, { .fourcc = V4L2_PIX_FMT_SGRBG10, .mbus_code = MEDIA_BUS_FMT_SGRBG10_1X10, .infmt = ISP_GRBG, .input_bit = RAW_10, }, { .fourcc = V4L2_PIX_FMT_SRGGB10, .mbus_code = MEDIA_BUS_FMT_SRGGB10_1X10, .infmt = ISP_RGGB, .input_bit = RAW_10, }, { .fourcc = V4L2_PIX_FMT_SBGGR12, .mbus_code = MEDIA_BUS_FMT_SBGGR12_1X12, .infmt = ISP_BGGR, .input_bit = RAW_12, }, { .fourcc = V4L2_PIX_FMT_SGBRG12, .mbus_code = MEDIA_BUS_FMT_SGBRG12_1X12, .infmt = ISP_GBRG, .input_bit = RAW_12, }, { .fourcc = V4L2_PIX_FMT_SGRBG12, .mbus_code = MEDIA_BUS_FMT_SGRBG12_1X12, .infmt = ISP_GRBG, .input_bit = RAW_12, }, { .fourcc = V4L2_PIX_FMT_SRGGB12, .mbus_code = MEDIA_BUS_FMT_SRGGB12_1X12, .infmt = ISP_RGGB, .input_bit = RAW_12, }, };
-
回复: V853使用MIPI CSI接口是否只支持RAW格式像素?
@awwwwa 应该后端设置出问题了,开了VIN_LOG_FMT,能看到这些内容
[ 275.372862] [VIN_LOG_FMT]sunxi_mipi_subdev_set_fmt 1920*1080 2006 1 [ 275.379926] [VIN_LOG_FMT]sunxi_mipi_subdev_set_fmt 1920*1080 2006 1 [ 275.387026] [VIN_LOG_FMT]sunxi_csi_subdev_set_fmt 1920*1080 2006 1 [ 275.393968] [VIN_LOG_FMT]sunxi_csi_subdev_set_fmt 1920*1080 2006 1 [ 275.400968] [VIN_LOG_FMT]sunxi_tdm_subdev_set_fmt 1920*1080 2006 1 [ 275.407939] [VIN_LOG_FMT]sunxi_tdm_subdev_set_fmt 1920*1080 3001 1 [ 275.414908] [VIN]sd coutinue sd:-562396204 pipesd:-563186176 [ 275.421282] [VIN_LOG_FMT]sunxi_isp_subdev_set_fmt 1920*1080 3001 1 [ 275.428284] [VIN_LOG_FMT]sunxi_isp_subdev_set_fmt 1920*1080 3001 1 [ 275.435211] [VIN_LOG_FMT]sunxi_scaler_subdev_set_fmt 1920*1080 3001 1 [ 275.442505] [VIN_LOG_FMT]sunxi_scaler_subdev_set_fmt 1920*1080 3001 1
-
回复: V853使用MIPI CSI接口是否只支持RAW格式像素?
@awwwwa 难怪这么久都没有成,一开始就错了,呜呜呜...
现在又有了另一个问题,TC358743里有另一个模式使用的是MEDIA_BUS_FMT_RGB888_1X24,这个V853支持吗?现在我找了半天大概也是不支持 -
有没有关于MEDIA_BUS_FMT_SGBRG10_1X10之类,各种像素格式的详解啊?
实在不知道这些代表什么意思,该查什么词语?现在找到相关文档但是全英文,有没有国人总结的教程啊
-
V853使用MIPI CSI接口是否只支持RAW格式像素?
因为给的V853 sensor支持列表全都是raw格式的摄像头,我再在/tina-v853-open/lichee/linux-4.9/drivers/media/platform/sunxi-vin/modules/sensor文件夹下搜索mipi_bps,因为mipi摄像头肯定要设置这个参数,结果只找到rn6854和nvp名称开头的驱动是使用YUV像素的,但这些传感器在kernel_menuconfig里都不能选中。
我再仔细看了看教程,用到的名词是"YUV 的并口模组",用的是例子是OV5640,它的驱动里没有设置mipi_bps,所以,,是我误解了?V853的MIPI CSI不能接收YUV格式像素? -
V853移植YUV sensor和RAW sensor有什么区别?
我所知道的是设备树里写 sensor0_fmt = <0>;
驱动里设置.mbus_code = MEDIA_BUS_FMT_UYVY8_2X8,
应用层时使用 V4L2_PIX_FMT_YUV422P
初次以外还需要注意啥?我现在的报错是vin is not support this pixelformat,看源码它会调用好几次vin_find_format,前面几次都查询成功了,直到开始查找 MEDIA_BUS_FMT_SBGGR8_1X8 ,报错退出,我还不清楚这个函数干啥的,得看一会。顺带一提,我设置的MEDIA_BUS_FMT_UYVY8_2X8是0x2006,在就找到了,为什么会要找其他格式像素?
[CAMERA] The input value is 0. [ 271.154445] [VIN]vin suport this fmt:0x2008 [CAMERA] Resolution size : 1920 [ 271.161927] [VIN]vin suport this fmt:0x2006 * 1080 [CAMERA] The photo save [ 271.169375] [VIN]vin suport this fmt:0x2007 path is /root/pic. [CAMERA] The[ 271.176899] [VIN]vin suport this fmt:0x2009 number of photos taken is 3. b[ 271.184300] [VIN]vin suport this fmt:0x2011 egin ion_alloc_open pid: 1123,[ 271.191803] [VIN]vin suport this fmt:0x200f g_alloc_context = 0xb6ec1f70 [ 271.199242] [VIN]vin suport this fmt:0x2010 [CAMERA] Camera capture framerat[ 271.206768] [VIN]vin suport this fmt:0x2012 e is 60/1 [ 271.214185] [VIN]vin suport this fmt:0x2018 [ 271.219847] [VIN]vin suport this fmt:0x2019 [ 271.224592] [VIN]vin suport this fmt:0x200c [ 271.229284] [VIN]vin suport this fmt:0x200b [ 271.234048] [VIN]fin code:0x3001 [ 271.237659] [VIN_ERR]vin is not support this pixelformat [ 271.243652] [VIN_ERR]vin_pipeline_try_format failed
-
vin驱动内设置mbus_code = MEDIA_BUS_FMT_UYVY8_2X8,应用层开启采集时应该使用哪种像素格式?
兜兜转转又回到了RK628驱动,老板要求的,因为它比较新,有公司可以问,它做hdmi转mipi csi只能输出YUV422格式像素,驱动对应的是 MEDIA_BUS_FMT_UYVY8_2X8 ,抓图例程用/root/sample_driverVipp,不过我发现实际运行起来后被设成了MEDIA_BUS_FMT_SBGGR8_1X8,只有用 V4L2_PIX_FMT_SBGGR8作为像素格式不会报错,不过也没出图,看mipi clk有1.2V波形,这该咋办?
讲真卡在这里真的太久了,哎,烦
-
回复: 求高人指点! ISP通路测试 sample_vin_isp_test 报错
@kunyi 开ISP当然可以用,现在关ISP也能用了,就是抓图的时候像素格式没设置对
-
回复: GC2053怎么关闭ISP使用?
RK628驱动里的 format设置
static struct sensor_format_struct sensor_formats[] = { { .desc = "YUV 4:2:2", .mbus_code = MEDIA_BUS_FMT_UYVY8_2X8, .regs = NULL, .regs_size = 0, .bpp = 2, }, };
-
回复: GC2053怎么关闭ISP使用?
@xjy_5 成了,用/root/sample_driverVipp 0 1920 1080 5 60 1 1 30 /root/pic可以抓图,注意像素格式要和驱动里的一样是SBGGR10就行,这里对应的是V4L2_PIX_FMT_SBGGR10,
但是我用RK628还是抓不到,RK628驱动设置的是 MEDIA_BUS_FMT_UYVY8_2X8 ,对应的像素格式是V4L2_PIX_FMT_UYVY??
root@TinaLinux:/# /root/sample_driverVipp 0 1920 1080 4 60 1 1 30 /root/pic sample_driverVipp running! <convertParamToV4L2PixFmt:90> SET FMT V4L2_PIX_FMT_UYVY! <main:283> before open MEDIA_DEVICE[/dev/media0] <main:285> after open MEDIA_DEVICE[/dev/media0] <main:305> mediaDeviceInfo: driver:[sunxi-vin-media] model:[Allwinner Vin] serial:[] bus_info:[] media_version:256, hw_revision:0, driver_version:0 <main:335> media_entity_desc: id[0x1], type[0x20001], name[m00_b_rk628-csi 1-0028], pads[1], links[1], major/minor[81/1] <main:352> sysname[/sys/dev/char/81:1], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev0] <main:369> make devName[/dev/v4l-subdev0] <main:335> media_entity_desc: id[0x3], type[0x10001], name[vin_cap.0], pads[2], links[1], major/minor[81/2] <main:352> sysname[/sys/dev/char/81:2], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev1] <main:369> make devName[/dev/v4l-subdev1] <main:335> media_entity_desc: id[0x6], type[0x10001], name[vin_video0], pads[1], links[0], major/minor[81/0] <main:352> sysname[/sys/dev/char/81:0], target[../../devices/platform/soc/5800800.vind/video4linux/video0] <main:369> make devName[/dev/video0] <main:335> media_entity_desc: id[0xa], type[0x10001], name[sunxi_csi.0], pads[2], links[1], major/minor[81/3] <main:352> sysname[/sys/dev/char/81:3], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev2] <main:369> make devName[/dev/v4l-subdev2] <main:335> media_entity_desc: id[0xd], type[0x10001], name[sunxi_csi.1], pads[2], links[0], major/minor[81/4] <main:352> sysname[/sys/dev/char/81:4], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev3] <main:369> make devName[/dev/v4l-subdev3] <main:335> media_entity_desc: id[0x10], type[0x10001], name[sunxi_tdm_rx.0], pads[2], links[1], major/minor[81/5] <main:352> sysname[/sys/dev/char/81:5], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev4] <main:369> make devName[/dev/v4l-subdev4] <main:335> media_entity_desc: id[0x13], type[0x10001], name[sunxi_tdm_rx.1], pads[2], links[0], major/minor[81/6] <main:352> sysname[/sys/dev/char/81:6], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev5] <main:369> make devName[/dev/v4l-subdev5] <main:335> media_entity_desc: id[0x16], type[0x10001], name[sunxi_tdm_rx.2], pads[2], links[0], major/minor[81/7] <main:352> sysname[/sys/dev/char/81:7], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev6] <main:369> make devName[/dev/v4l-subdev6] <main:335> media_entity_desc: id[0x19], type[0x10001], name[sunxi_tdm_rx.3], pads[2], links[0], major/minor[81/8] <main:352> sysname[/sys/dev/char/81:8], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev7] <main:369> make devName[/dev/v4l-subdev7] <main:335> media_entity_desc: id[0x1c], type[0x10001], name[sunxi_mipi.0], pads[2], links[1], major/minor[81/9] <main:352> sysname[/sys/dev/char/81:9], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev8] <main:369> make devName[/dev/v4l-subdev8] <main:335> media_entity_desc: id[0x1f], type[0x10001], name[sunxi_mipi.1], pads[2], links[0], major/minor[81/10] <main:352> sysname[/sys/dev/char/81:10], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev9] <main:369> make devName[/dev/v4l-subdev9] <main:335> media_entity_desc: id[0x22], type[0x20000], name[sunxi_isp.0], pads[3], links[17], major/minor[81/11] <main:352> sysname[/sys/dev/char/81:11], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev10] <main:369> make devName[/dev/v4l-subdev10] <main:335> media_entity_desc: id[0x26], type[0x20000], name[sunxi_h3a.0], pads[1], links[0], major/minor[81/12] <main:352> sysname[/sys/dev/char/81:12], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev11] <main:369> make devName[/dev/v4l-subdev11] <main:335> media_entity_desc: id[0x28], type[0x20000], name[sunxi_isp.1], pads[3], links[17], major/minor[81/13] <main:352> sysname[/sys/dev/char/81:13], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev12] <main:369> make devName[/dev/v4l-subdev12] <main:335> media_entity_desc: id[0x2c], type[0x20000], name[sunxi_h3a.1], pads[1], links[0], major/minor[81/14] <main:352> sysname[/sys/dev/char/81:14], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev13] <main:369> make devName[/dev/v4l-subdev13] <main:335> media_entity_desc: id[0x2e], type[0x20000], name[sunxi_isp.2], pads[3], links[17], major/minor[81/15] <main:352> sysname[/sys/dev/char/81:15], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev14] <main:369> make devName[/dev/v4l-subdev14] <main:335> media_entity_desc: id[0x32], type[0x20000], name[sunxi_h3a.2], pads[1], links[0], major/minor[81/16] <main:352> sysname[/sys/dev/char/81:16], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev15] <main:369> make devName[/dev/v4l-subdev15] <main:335> media_entity_desc: id[0x34], type[0x20000], name[sunxi_isp.3], pads[3], links[17], major/minor[81/17] <main:352> sysname[/sys/dev/char/81:17], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev16] <main:369> make devName[/dev/v4l-subdev16] <main:335> media_entity_desc: id[0x38], type[0x20000], name[sunxi_h3a.3], pads[1], links[0], major/minor[81/18] <main:352> sysname[/sys/dev/char/81:18], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev17] <main:369> make devName[/dev/v4l-subdev17] <main:335> media_entity_desc: id[0x3a], type[0x20000], name[sunxi_isp.4], pads[3], links[17], major/minor[81/19] <main:352> sysname[/sys/dev/char/81:19], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev18] <main:369> make devName[/dev/v4l-subdev18] <main:335> media_entity_desc: id[0x3e], type[0x20000], name[sunxi_h3a.4], pads[1], links[0], major/minor[81/20] <main:352> sysname[/sys/dev/char/81:20], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev19] <main:369> make devName[/dev/v4l-subdev19] <main:335> media_entity_desc: id[0x40], type[0x20000], name[sunxi_scaler.0], pads[2], links[1], major/minor[81/21] <main:352> sysname[/sys/dev/char/81:21], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev20] <main:369> make devName[/dev/v4l-subdev20] <main:335> media_entity_desc: id[0x43], type[0x20000], name[sunxi_scaler.1], pads[2], links[0], major/minor[81/22] <main:352> sysname[/sys/dev/char/81:22], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev21] <main:369> make devName[/dev/v4l-subdev21] <main:335> media_entity_desc: id[0x46], type[0x20000], name[sunxi_scaler.2], pads[2], links[0], major/minor[81/23] <main:352> sysname[/sys/dev/char/81:23], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev22] <main:369> make devName[/dev/v4l-subdev22] <main:335> media_entity_desc: id[0x49], type[0x20000], name[sunxi_scaler.3], pads[2], links[0], major/minor[81/24] <main:352> sysname[/sys/dev/char/81:24], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev23] <main:369> make devName[/dev/v4l-subdev23] <main:335> media_entity_desc: id[0x4c], type[0x20000], name[sunxi_scaler.4], pads[2], links[0], major/minor[81/25] <main:352> sysname[/sys/dev/char/81:25], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev24] <main:369> make devName[/dev/v4l-subdev24] <main:335> media_entity_desc: id[0x4f], type[0x20000], name[sunxi_scaler.5], pads[2], links[0], major/minor[81/26] <main:352> sysname[/sys/dev/char/81:26], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev25] <main:369> make devName[/dev/v4l-subdev25] <main:335> media_entity_desc: id[0x[ 111.850667] [rk628_mipi]PWR_ON! 52], type[0x20000], name[sunxi_s[ 111.857055] [rk628_mipi]sensor_init caler.6], pads[2], links[0], maj[ 111.862730] [VIN_ERR]vin is not support this pixelformat or/minor[81/27] <main:352> sysn[ 111.871265] [VIN_ERR]vin_pipeline_try_format failed ame[/sys/dev/char/81:27], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev26] <main:369> make devName[/dev/v4l-subdev26] <main:335> media_entity_desc: id[0x55], type[0x20000], name[sunxi_scaler.7], pads[2], links[0], major/minor[81/28] <main:352> sysname[/sys/dev/char/81:28], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev27] <main:369> make devName[/dev/v4l-subdev27] <main:335> media_entity_desc: id[0x58], type[0x20000], name[sunxi_scaler.8], pads[2], links[0], major/minor[81/29] <main:352> sysname[/sys/dev/char/81:29], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev28] <main:369> make devName[/dev/v4l-subdev28] <main:335> media_entity_desc: id[0x5b], type[0x20000], name[sunxi_scaler.9], pads[2], links[0], major/minor[81/30] <main:352> sysname[/sys/dev/char/81:30], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev29] <main:369> make devName[/dev/v4l-subdev29] <main:335> media_entity_desc: id[0x5e], type[0x20000], name[sunxi_scaler.10], pads[2], links[0], major/minor[81/31] <main:352> sysname[/sys/dev/char/81:31], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev30] <main:369> make devName[/dev/v4l-subdev30] <main:335> media_entity_desc: id[0x61], type[0x20000], name[sunxi_scaler.11], pads[2], links[0], major/minor[81/32] <main:352> sysname[/sys/dev/char/81:32], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev31] <main:369> make devName[/dev/v4l-subdev31] <main:335> media_entity_desc: id[0x64], type[0x20000], name[sunxi_scaler.12], pads[2], links[0], major/minor[81/33] <main:352> sysname[/sys/dev/char/81:33], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev32] <main:369> make devName[/dev/v4l-subdev32] <main:335> media_entity_desc: id[0x67], type[0x20000], name[sunxi_scaler.13], pads[2], links[0], major/minor[81/34] <main:352> sysname[/sys/dev/char/81:34], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev33] <main:369> make devName[/dev/v4l-subdev33] <main:335> media_entity_desc: id[0x6a], type[0x20000], name[sunxi_scaler.14], pads[2], links[0], major/minor[81/35] <main:352> sysname[/sys/dev/char/81:35], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev34] <main:369> make devName[/dev/v4l-subdev34] <main:335> media_entity_desc: id[0x6d], type[0x20000], name[sunxi_scaler.15], pads[2], links[0], major/minor[81/36] <main:352> sysname[/sys/dev/char/81:36], target[../../devices/platform/soc/5800800.vind/video4linux/v4l-subdev35] <main:369> make devName[/dev/v4l-subdev35] <main:323> enum media entity done! num:37 <main:375> name of media_entity_desc we wanted is vin_video0 <main:431> VIDIOC_S_FMT error! <main:439> VIDIOC_G_FMT: resolution: 0x0, num_planes: 1 <main:445> VIDIOC_G_PARM: capturemode:0x2 <main:452> devname[/dev/video0] reqbufs: nr[5], type[9] <main:456> devname[/dev/video0] reqbufs: nr[5], type[9] done, ret[-1] <main:458> fatal error! devname[/dev/video0]: unable to request buffers (22) <main:493> fatal error! devname[/dev/video0]: unable to query buffer 0 (22). <main:508> fatal error! devname[/dev/video0]: unable to map buffer 0 plane 0, errno(22) <main:512> devname[/dev/video0]: buffer 0 planes 0 mapped at address 0xffffffff <main:493> fatal error! devname[/dev/video0]: unable to query buffer 1 (22). <main:508> fatal error! devname[/dev/video0]: unable to map buffer 1 plane 0, errno(22) <main:512> devname[/dev/video0]: buffer 1 planes 0 mapped at address 0xffffffff <main:493> fatal error! devname[/dev/video0]: unable to query buffer 2 (22). <main:508> fatal error! devname[/dev/video0]: unable to map buffer 2 plane 0, errno(22) <main:512> devname[/dev/video0]: buffer 2 planes 0 mapped at address 0xffffffff <main:493> fatal error! devname[/dev/video0]: unable to query buffer 3 (22). <main:508> fatal error! devname[/dev/video0]: unable to map buffer 3 plane 0, errno(22) <main:512> devname[/dev/video0]: buffer 3 planes 0 mapped at address 0xffffffff <main:493> fatal error! devname[/dev/video0]: unable to query buffer 4 (22). <main:508> fatal error! devname[/dev/video0]: unable to map buffer 4 plane 0, errno(22) <main:512> devname[/dev/video0]: buffer 4 planes 0 mapped at address 0xffffffff <main:580> fatal error! devname[/dev/video0]: unable to queue buffer index 0/5 errno(22) <main:580> fatal error! devname[/dev/video0]: unable to queue buffer index 1/5 errno(22) <main:580> fatal error! devname[/dev/video0]: unable to queue buffer index 2/5 errno(22) <main:580> fatal error! devname[/dev/video0]: unable to queue buffer index 3/5 errno(22) <main:580> fatal error! devname[/dev/video0]: unable to queue buffer index 4/5 errno(22) <main:586> fatal error! stream on fail, ret(-1), errno(22) <main:620> Be careful! devname[/dev/video0] select timeout! <main:620> Be careful! devname[/dev/video0] select timeout! <main:620> Be careful! devname[/dev/video0] select timeout! <main:620> Be careful! devname[/dev/video0] select timeout! ^C<handle_exit:215> user want to e[ 120.531508] [VIN_ERR]video0 has already stream off xit! <handle_exit:219> signal E[ 120.539889] [rk628_mipi]PWR_OFF!do nothing xitFlag:1 <main:611> check ExitFlag:1, exit loop of getting frames <main:710> fatal error! devname[/dev/video0]: unable to unmap buffer 0 (22) <main:710> fatal error! devname[/dev/video0]: unable to unmap buffer 1 (22) <main:710> fatal error! devname[/dev/video0]: unable to unmap buffer 2 (22) <main:710> fatal error! devname[/dev/video0]: unable to unmap buffer 3 (22) <main:710> fatal error! devname[/dev/video0]: unable to unmap buffer 4 (22) <main:787> /root/sample_driverVipp test result: success
root@TinaLinux:/# cat /sys/kernel/debug/mpp/vi ***************************************************** VIN hardware feature list: mcsi 2, ncsi 1, parser 3, isp 1, vipp 4, dma 4 CSI_VERSION: CSI300_200, ISP_VERSION: ISP0_0 CSI_CLK: 396000000, ISP_CLK: 24000000 ***************************************************** vi0: m00_b_rk628-csi 1-0028 => mipi0 => csi0 => tdm_rx0 => isp0 => vipp0 input => hoff: 0, voff: 0, w: 0, h: 0, fmt: UYVY8 output => width: 0, height: 0, fmt: NULL interface: PARALLEL, isp_mode: NORMAL, hflip: 0, vflip: 0 prs_in => x: 0, y: 0, hb: 0, hs: 0 bkbuf => cnt: 0 size: 0 rest: 0, work_mode: online frame => cnt: 0, lost_cnt: 0, error_cnt: 0 internal => avg: 0(ms), max: 0(ms), min: 0(ms) ***************************************************** root@TinaLinux:/#
奇怪的是这里ouput fmt居然是NULL,以前都是INPUT fmt NULL
-
回复: 求高人指点! ISP通路测试 sample_vin_isp_test 报错
@kunyi 现在用原厂摄像头,关闭ISP,出现了同样的错误,理论上应该不会有错才对,也有可能是我用的例程不对
-
GC2053怎么关闭ISP使用?
我移植HDMI转MIPI驱动,不论是RK628还是TC358743,开启最后都会出现vin_pipeline_try_format failed无法解决,
而开启ISP,又会去用GC2053的isp 配置文件,出现 [VIN_ERR]isp0 configuration error
现在还是买来GC2053参考参考,照着教程走最后确实出视频了,但如果我在设备树里写sensor0_isp_used = <0>;,就一样会出现SET_FMT errorroot@TinaLinux:/# /root/sample_vin_isp_test 0 1920 1080 /root/pic 1 3 30 0 [ISP]>>>>>>>>>>>>>>>>>>>> ISP VE[ 15.849895] [gc2053_mipi]PWR_ON! RSION INFO <<<<<<<<<<<<<<<<<<< IPCORE: ISP600 branch: libisp-dev commit: 14df8348718d093707641fea73eba7db962885f5 date : Thu Jul 14 15:40:38 2022 +0800 author: <mayifei@allwinnertech.com> -------------------------------------------------------- [ISP]video device name is vin_video0 [ISP]open video device[0], detect isp0 success! [ 15.887433] [gc2053_mipi]sensor_init [ 15.891753] [gc2053_mipi]eRet:0, ID_VAL_HIGH:0x20, times_out:3 [ 16.117668] [gc2053_mipi]ID_VAL_HIGH = 20, Done! [ 16.123153] [gc2053_mipi]ID_VAL_LOW = 53, Done! [ 16.128278] [gc2053_mipi]Done! [ISP]video0 fd[4] ve_online_en=0[ 16.131795] [VIN]ve_online close , dma_buf_num=0 [ 16.138474] [VIN_ERR]vin is not support this pixelformat [ 16.145613] [VIN_ERR]vin_pipeline_try_format failed [ISP_ERR]video_set_fmt, line: 19[ 16.151431] [gc2053_mipi]sensor_init 4,VIDIOC_S_FMT error! video_set[ 16.158350] [gc2053_mipi]eRet:0, ID_VAL_HIGH:0x20, times_out:3 _fmt failed vin isp test 1, return -1 [ISP]mpi_vi already init [ISP]>>>>>>>>>>>>>>>>>>>> ISP VERSION INFO <<<<<<<<<<<<<<<<<<< IPCORE: ISP600 branch: libisp-dev commit: 14df8348718d093707641fea73eba7db962885f5 date : Thu Jul 14 15:40:38 2022 +0800 author: <mayifei@allwinnertech.com> --------------------------------------------------------
搞得我看了半天mbus_code,那gc2053关ISP还有什么地方要改?
-
回复: 求高人指点! ISP通路测试 sample_vin_isp_test 报错
@kunyi 那也就是说可能已经在传图像了??不过我一直都没出过图,坏图也没见,就是不通,资料匮乏啊。
-
回复: 求高人指点! ISP通路测试 sample_vin_isp_test 报错
@awwwwa 又有新发现,CLKP,CLKN在初始化TC358743前和其他数据脚一样维持在1.2V,初始化后就变成了0.2V,后来我再开测试程序,它还是保持0.2V,其他引脚则产生波形
-
关于MIPI接口的疑惑
在此之前没学过MIPI的内容,现在只知道它的引脚定义P , N 对的差分信号做数据传输,我移植TP358743驱动到现在IIC已经通了,MIPI数据脚也有信号了,但是MIPI_CLKP, MIPI_CLKN并没有信号,这个接口在工作时是采集端控制时钟脚还是主控端在控制时钟脚啊?另外我用的是sample_virvi验证抓图功能,但从来没成功过,每次都会有这句
[ISP]video0 fd[14] ve_online_en=0, dma_buf_num=0 [ISP_ERR]video_set_fmt, line: 194,VIDIOC_S_FMT error! E0101 00:29:47.762225 1150 videoInputHw.c:1055] <videoInputHw_SetChnAttr> video set_fmt failed, chn[0] E0101 00:29:47.762353 1150 sample_virvi.c:758] <prepare> fatal error! vi dev[0] set vipp attr fail!
set_fmt 失败!!到底咋样才能成啊??
另外,求一波关于mipi的教程,感谢 -
回复: 求高人指点! ISP通路测试 sample_vin_isp_test 报错
@awwwwa 现在又发现其他问题,有时候会出现报错
tc_write8 failed, addr:8514 value:0x00
或者
tc_write8 failed, addr:8543 value:0x32
然后mipi信号就不会发生。
有时候mipi信号有了,但是只在数据线上有信号,CLKP,CLKN没信号 -
回复: 求高人指点! ISP通路测试 sample_vin_isp_test 报错
@awwwwa 其实我挺疑惑 mbus_code到底选哪个,看了规格书和其他tc358743的驱动都和这个芯片不太配的样子。
-
回复: 求高人指点! ISP通路测试 sample_vin_isp_test 报错
@awwwwa 驱动运行起来了,mipi也有信号,运行sample_virvi抓图失败,报错信息入下,讲真星期五没什么心情写代码了,今天能看多少看多少吧。顺带说一下,我实在不清楚reset函数是什么时候调用的,我把驱动里reset脚的操作放在了PWR_ON里,把sensor_probe里的iic操作放到了sensor_init里。这样就能确定寄存器是重置后配的了
root@TinaLinux:/# /root/sample_virvi -path /root/sample_virvi.conf WARNING: Logging before InitGoogleLogging() is written to STDERR I0101 03:45:59.285326 1128 dup2SeldomUsedFd.c:20] <dup2SeldomUsedFdInit> gFdLock init Sample virvi buile time = Oc[ 31.698292] VE: before freq=400000000 t 13 2023, 09:12:40. I0101 03:[ 31.703777] VE: real freq=400000000 45:59.292222 1128 sample_virvi.c:54] <ParseCmdLine> sample virvi path:[/root/sample_virvi], arg number is [3] I0101 03:45:59.293594 1128 confparser.c:60] <createConfParser> load conf file /root/sample_virvi.conf ok! I0101 03:45:59.296145 1128 sample_virvi.c:279] <loadConfigPara> user did not specify buf len. set a default value 3110400 bytes I0101 03:45:59.296290 1128 sample_virvi.c:289] <loadConfigPara> capture[0] dev num[0], capture size[1920x1080] format[20] framerate[60] colorspace[31] drop frm[50] I0101 03:45:59.296371 1128 sample_virvi.c:289] <loadConfigPara> capture[1] dev num[-1], capture size[1920x1080] format[32] framerate[20] colorspace[31] drop frm[50] I0101 03:45:59.296443 1128 sample_virvi.c:289] <loadConfigPara> capture[2] dev num[-1], capture size[1920x1080] format[32] framerate[20] colorspace[31] drop frm[50] I0101 03:45:59.296506 1128 sample_virvi.c:289] <loadConfigPara> capture[3] dev num[-1], capture size[1920x1080] format[32] framerate[20] colorspace[31] drop frm[50] I0101 03:45:59.296580 1128 sample_virvi.c:295] <loadConfigPara> save pic dev[0], yuv count[100] file[/root/pic/test.yuv], raw count[0] interval[20] save dir[/root/pic], buf len[3110400] num[5] I0101 03:45:59.296645 1128 sample_virvi.c:297] <loadConfigPara> test duration[10] I0101 03:45:59.296777 1128 mpi_sys.c:840] <AW_MPI_SYS_SetConf> kfctmpdir is [/tmp] >>>>>>>>>>>>>>>>>>>>>>>>>>>>> Media Process Platform<<<<<<<<<<<<<<<<<<<<<<<<<<<< modName : MPP-Platform tag : V1.0 Release branch: v5-dev commit: 4eed413532ad87725895a8cb1ba75e22fc328233 date : 20170725 author: jenkins I0101 03:45:59.302180 1128 mpi_sys.c:1280] <AW_MPI_SYS_Init> ISP init [ISP]>>>>>>>>>>>>>>>>>>>> ISP VERSION INFO <<<<<<<<<<<<<<<<<<< IPCORE: ISP600 branch: libisp-dev commit: 14df8348718d093707641fea73eba7db962885f5 date : Thu Jul 14 15:40:38 2022 +0800 author: <mayifei@allwinnertech.com> -------------------------------------------------------- I0101 03:45:59.302545 1128 mpi_sys.c:1282] <AW_MPI_SYS_Init> ISP init done INFO : cedarc <VeInitialize:1185>: *** ic_version = 0x1302000023010, I0101 03:45:59.319500 1128 hwdisplay.c:84] <hw_display_init> I0101 03:45:59.319673 1128 hwdisplay.c:993] <hwd_init> (hwd_init 993) I0101 03:45:59.319821 1128 hwdisplay.c:1048] <hwd_init> ret[0][2,0]ch[0]lyl[0] init: enable[0], screenwin[0,0, 0x0], zorder[0], alpha[mode:0, value:0] W0101 03:45:59.322032 1128 audio_hw.c:243] <audioHw_Construct> W0101 03:45:59.322181 1128 audio_hw.c:216] <MakeAllMixerElemsAvailable> I0101 03:45:59.368130 1128 audio_hw.c:223] <MakeAllMixerElemsAvailable> pcm open and close, all MixerElems maybe exist. I0101 03:45:59.368302 1128 alsa_interface.c:701] <alsaOpenMixer> open mixer:hw:0 I0101 03:45:59.372998 1128 alsa_interface.c:736] <alsaOpenMixer> alsa_elem:ADC1 ADC2 swap I0101 03:45:59.373184 1128 alsa_interface.c:736] <alsaOpenMixer> alsa_elem:ADC1 volume I0101 03:45:59.373263 1128 alsa_interface.c:736] <alsaOpenMixer> alsa_elem:ADC2 volume I0101 03:45:59.373324 1128 alsa_interface.c:736] <alsaOpenMixer> alsa_elem:ADCDRC I0101 03:45:59.373384 1128 alsa_interface.c:736] <alsaOpenMixer> alsa_elem:ADCHPF I0101 03:45:59.373544 1128 alsa_interface.c:736] <alsaOpenMixer> alsa_elem:DAC volume I0101 03:45:59.373632 1128 alsa_interface.c:736] <alsaOpenMixer> alsa_elem:DACDRC I0101 03:45:59.373695 1128 alsa_interface.c:736] <alsaOpenMixer> alsa_elem:DACHPF I0101 03:45:59.373754 1128 alsa_interface.c:736] <alsaOpenMixer> alsa_elem:LINEIN I0101 03:45:59.373811 1128 alsa_interface.c:736] <alsaOpenMixer> alsa_elem:LINEINL gain volume I0101 03:45:59.373865 1128 alsa_interface.c:736] <alsaOpenMixer> alsa_elem:LINEINR gain volume I0101 03:45:59.373917 1128 alsa_interface.c:736] <alsaOpenMixer> alsa_elem:LINEOUT I0101 03:45:59.373971 1128 alsa_interface.c:736] <alsaOpenMixer> alsa_elem:LINEOUT Output Select I0101 03:45:59.374163 1128 alsa_interface.c:736] <alsaOpenMixer> alsa_elem:LINEOUT volume I0101 03:45:59.374291 1128 alsa_interface.c:756] <alsaOpenMixer> set playback vol_val to value: 27 I0101 03:45:59.374381 1128 alsa_interface.c:736] <alsaOpenMixer> alsa_elem:MIC1 I0101 03:45:59.374557 1128 alsa_interface.c:736] <alsaOpenMixer> alsa_elem:MIC1 Input Select I0101 03:45:59.374641 1128 alsa_interface.c:736] <alsaOpenMixer> alsa_elem:MIC1 gain volume I0101 03:45:59.374705 1128 alsa_interface.c:736] <alsaOpenMixer> alsa_elem:MIC2 I0101 03:45:59.705919 1128 alsa_interface.c:736] <alsaOpenMixer> alsa_elem:MIC2 In[ 32.135476] [tc358743_mipi]sensor_power put Select I0101 03:45:59.70604[ 32.142119] [tc358743_mipi]PWR_ON! 1 1128 alsa_interface.c:736] <alsaOpenMixer> alsa_elem:MIC2 gain volume I0101 03:45:59.706113 1128 alsa_interface.c:736] <alsaOpenMixer> alsa_elem:SPK I0101 03:45:59.706173 1128 alsa_interface.c:736] <alsaOpenMixer> alsa_elem:digital volume I0101 03:45:59.706228 1128 alsa_interface.c:736] <alsaOpenMixer> alsa_elem:rx sync mode I0101 03:45:59.706281 1128 alsa_interface.c:736] <alsaOpenMixer> alsa_elem:tx hub mode I0101 03:45:59.712543 1128 sample_virvi.c:633] <initSaveB[ 32.193321] [tc358743_mipi]sensor_init ufMgr> node[0] alloc data len[3110400] phy addr[1221591040] vir addr[0xb6966000] I0101 03:45:59.719106 1128 sample_virvi.c:633] <initSaveBufMgr> node[1] alloc data len[3110400] phy addr[1224736768] vir addr[0xb666e000] I0101 03:45:59.725542 1128 sample_virvi.c:633] <initSaveBufMgr> node[2] alloc data len[3110400] phy addr[1227882496] vir addr[0xb6376000] I0101 03:45:59.731885 1128 sample_virvi.c:633] <initSaveBufMgr> node[3] alloc data len[3110400] phy addr[1231028224] vir addr[0xb607e000] I0101 03:45:59.738354 1128 sample_virvi.c:633] <initSaveBufMgr> node[4] alloc data len[3110400] phy addr[1234173952] vir addr[0xb5d86000] [ISP]video device name is vin_video0 [ISP]open video device[0], detect isp0 success! I0101 03:45:59.739078 1128 media_debug.c:45] <getDictByConfPath> MPP_DEDIA_DEBUG_FILE_PATH=(null) I0101 03:45:59.739625 1128 videoInputHw.c:1015] <videoInputHw_SetChnAttr> ViCh[0], user set disable Encpp [ 32.375465] v4l2_dev:ddc438b8 [ 32.379612] [TC358743]tc358743 chipid:0x0 [ISP]video0 fd[14] ve_online_en=[ 32.384193] [VIN]ve_online close 0, dma_buf_num=0 [ 32.391026] [VIN_ERR]vin is not support this pixelformat [ 32.398110] [VIN_ERR]vin_pipeline_try_format failed [ISP_ERR]video_set_fmt, line: 194,VIDIOC_S_FMT error! E0101 03:[ 32.406800] [tc358743_mipi]sensor_ioctl cmd:-1069787396 46:00.008377 1128 videoInputHw.c:1055] <videoInputHw_SetChnAttr> video set_fmt failed, chn[0] E0101 03:46:00.008512 1128 sample_virvi.c:758] <prepare> fatal error! vi dev[0] set vipp attr fail! [ISP]open isp device[0] success! [ISP_ERR]isp_sensor_get_configs, line: 810,tc358743_mipi get config failed: Invalid argument (22). [ISP_WARN]open /mnt/extsd/isp0_0_0_0_ctx_saved.bin failed, err:No such file or directory. [ISP]prefer isp config: [tc358743_mipi], 0x0, 0, 0, 0 [ISP_WARN]cannot find tc358743_mipi_0_0_0_0_0 isp config, use gc2053_mipi_1920_1088_20_0_0 -> [gc2053_mipi_isp600_20220511_164617_vlc4_day] [ISP_ERR]isp_ctx_config_init, line: 2305,sensor attribute is not init. [ISP]create isp0 server thread! planes number is error! E0101 03:46:00.031350 1128 sample_virvi.c:775] <prepare> fatal error! vi dev[0] enable fail! I0101 03:46:00.031531 1128 mpi_vi.c:1018] <AW_MPI_VI_CreateVirChn> we allow to create virChn[0] in disable status of vipp[0] I0101 03:46:00.031800 1128 VideoVirVi_Component.c:1160] <VideoViComponentInit> VideoVirvi component Init! thread_id[0xb5c4ed50] I0101 03:46:00.031994 1128 sample_virvi.c:787] <prepare> create vi dev[0] vi chn[0] success! I0101 03:46:00.032589 1139 sample_virvi.c:533] <GetCSIFrameThread> loop Sample_virvi, Cap threadid=0xb5c2bd50, ViDev = 0, ViCh = 0 [ISP_ERR]events_loop, line: 162,isp0 event select timeout [ 36.799404] random: crng init done [ISP_ERR]events_loop, line: 162,isp0 event select timeout [ISP_ERR]events_loop, line: 162,isp0 event select timeout I0101 03:46:10.032343 1139 sample_virvi.c:589] <GetCSIFrameThread> vi dev[0] get csi frame trd exit! I0101 03:46:10.032675 1138 VideoVirVi_Component.c:1206] <Vi_ComponentThread> vipp[0]virChn[0]:begin to wait using frame return I0101 03:46:10.032951 1128 VideoVirVi_Component.c:1056] <VideoViComponentDeInit> VideoVirvi component exited! [ 42.503109] [tc358743_mipi]sensor_power [ 42.507547] [DISP] disp_mgr_set_layer_config,line:1504: [ 42.513378] NULL hdl! [ 42.538965] [ICN6202 TO LVDS] LINE:0152-->lcd_close_flow: [ 42.545074] [ICN6202 TO LVDS] LINE:0206-->lcd_bl_close: [ 42.758954] [ICN6202 TO LVDS] LINE:0185-->lcd_power_off: [ 42.859128] [DISP] de_fcm_set_para,line:491: [ 42.863721] fcm lut 0 not find, auto retry after init [ 42.869776] [DISP] de_fcm_set_para,line:491: [ 42.874363] fcm lut 0 not find, auto retry after init Segmentation fault (core dumped)
配置文件内容
########### paramter (ref to tulip_cedarx.conf)############ [parameter] dev_num_0 = 0 isp_dev_num_0 = 0 pic_width_0 = 1920 pic_height_0 = 1080 frame_rate_0 = 60 pic_format_0 = "yu12" color_space_0 = "rec709_part_range" enable_wdr_mode_0 = 0 drop_frm_num_0 = 50 dev_num_1 = -1 isp_dev_num_1 = 0 pic_width_1 = 1920 pic_height_1 = 1080 frame_rate_1 = 20 pic_format_1 = "nv21" color_space_1 = "rec709_part_range" enable_wdr_mode_1 = 0 drop_frm_num_1 = 50 dev_num_2 = -1 isp_dev_num_2 = 0 pic_width_2 = 1920 pic_height_2 = 1080 frame_rate_2 = 20 pic_format_2 = "nv21" color_space_2 = "rec709_part_range" enable_wdr_mode_2 = 0 drop_frm_num_2 = 50 dev_num_3 = -1 isp_dev_num_3 = 0 pic_width_3 = 1920 pic_height_3 = 1080 frame_rate_3 = 20 pic_format_3 = "nv21" color_space_3 = "rec709_part_range" enable_wdr_mode_3 = 0 drop_frm_num_3 = 50 save_pic_dev = 0 yuv_frm_count = 100 yuv_file = "/root/pic/test.yuv" raw_store_count = 0 raw_store_interval = 20 store_dir = "/root/pic" save_pic_buffer_len = 0 # 0: Specify the buffer length according to the pixel and resolution. save_pic_buffer_num = 5 test_duration = 10
-
回复: 求高人指点! ISP通路测试 sample_vin_isp_test 报错
@awwwwa 原来是把TWI的驱动能力改成3,上下拉去掉就可以了
twi0_pins_a: twi0@0 { allwinner,pins = "PA16", "PA17"; allwinner,pname = "twi0_scl", "twi0_sda"; allwinner,function = "twi0"; allwinner,muxsel = <4>; allwinner,drive = <3>;//IO驱动能力: Level 3 allwinner,pull = <0>;//不需要内部上下拉电阻 };
-
回复: 求高人指点! ISP通路测试 sample_vin_isp_test 报错
@awwwwa 运行起来了,不过一直出这句话
twi_stop()535 - engine-mode: STOP can't sendout! -
回复: v853运行sample_venc出错
理清了点头绪但又没完全有,现在发现是这个if不满足,一直都没有读取文件,是venc没准备好吗,还得研究一段时间。
if (!list_empty(&pVencPara->mInBuf_Q.mIdleList)) {
I0101 06:57:02.989159 1255 sample_venc.c:1145] <readInFrameThread> idle list empty!! I0101 06:57:02.989212 1255 sample_venc.c:1063] <readInFrameThread> ready list empty I0101 06:57:02.989262 1255 sample_venc.c:1145] <readInFrameThread> idle list empty!! I0101 06:57:02.989313 1255 sample_venc.c:1063] <readInFrameThread> ready list empty I0101 06:57:02.989448 1255 sample_venc.c:1145] <readInFrameThread> idle list empty!!
-
v853运行sample_venc出错
用ffpmeg指令制作了yuv360p视频
ffmpeg -i xk360.mp4 -s 640x360 -pix_fmt yuv420p xk360.yuv
修改sample_venc.conf,只修改了开头几个选项
########### paramter (ref to tulip_cedarx.conf)############^M [parameter]^M src_file = "/root/xk360.yuv"^M src_width = 640^M src_height = 360^M dst_file = "/root/xk360.raw"^M dst_width = 640^M dst_height = 360^M ^M ####yuv_src_pixfmt just support nv21(yvu420sp) , yu12(yuv420p) , aw_afbc(allwinner private define yuv format) in sample code at now####^M src_pixfmt = "yu12" #"aw_afbc" "yu12" "nv21"^M
运行 ./sample_venc -path /root/sample_venc.conf,报错信息如下
WARNING: Logging before InitGoogleLogging() is written to STDERR I0101 04:13:57.872536 1145 confparser.c:60] <createConfParser> load conf file /root/sample_venc.conf ok!
author: jenkins iniparser: cannot open /etc/cedarx.conf iniparser: cannot open /vendor/etc/cedarx.conf I0101 04:13:57.887878 1145 mpi_sys.c:1280] <AW_MPI_SYS_Init> ISP init
iniparser: cannot open /etc/cedarc.conf iniparser: cannot open (null) iniparser: cannot open /etc/cedarc.conf INFO : cedarc <cdc_log_set_level:43>: Set log level to 3 from /vendor/etc/cedarc.conf WARNING: cedarc <LogVersionInfo:44>:
I0101 04:13:58.296865 1146 media_debug.c:45] <getDictByConfPath> MPP_DEDI[ 197.886956] L1 PageTable Invalid [ 197.891128] 0x5d800000 is not mapped! [ 197.895229] VE invalid address: 0x5d800000, data:0x0, id:0x1 A_DEBUG_FILE_PATH=(null) DEBUG : cedarc <h264SetH264Param:363>: **********H264SetParameter**********
最后卡在
I0101 04:13:59.000297 1146 VideoEnc_Component.c:2121] <CedarvVideoEncInit> set Color2Grey [0], in Venchn[0] I0101 04:13:59.000399 1146 VideoEnc_Component.c:2128] <CedarvVideoEncInit> vencChn[0] had init! I0101 04:13:59.000486 1146 VideoEnc_Component.c:8042] <ComponentThread> VencChn[0]: idle/pause[0x2]->executing ... I0101 04:14:29.000939 1145 VideoEnc_Component.c:5422] <VideoEncSendCommand> set VencChn[0] Comp StateIdle I0101 04:14:29.001170 1146 VideoEnc_Component.c:7943] <ComponentThread> VencChn[0]: pause/executing[0x3]->idle ... W0101 04:14:29.001274 1146 VideoEnc_Component.c:7405] <ReturnUseOrigFrameBeforeSetStateIdle> wait for VencChn[0] input orig usingFrameList empty, left frames cnt = [6] I0101 04:14:29.001396 1147 sample_venc.c:1150] <readInFrameThread> read thread exit! I0101 04:14:29.004612 1148 sample_venc.c:1243] <saveFromEncThread> get thread exit!
-
回复: v853做gadget键盘,进入bios后无法使用
@xjy_5 妈耶,原来是少了一句配置,现在搞定了
elif [ $1 == "hid" ]; then [ -d /sys/kernel/config/usb_gadget/g1/functions/hid.usb0 ] || { mkdir /sys/kernel/config/usb_gadget/g1/functions/hid.usb0 } echo "Tina Keyboard" > /sys/kernel/config/usb_gadget/g1/strings/0x409/product echo 1 > /sys/kernel/config/usb_gadget/g1/functions/hid.usb0/subclass echo 1 > /sys/kernel/config/usb_gadget/g1/functions/hid.usb0/protocol echo 8 > /sys/kernel/config/usb_gadget/g1/functions/hid.usb0/report_length echo -ne \\05\\x01\\x09\\x06\\xa1\\x01\\x05\\x07\\x19\\xe0\\x29\\xe7\\x15\\x00\\x25\\x01\\x75\\x01\\x95\\x08\\x81\\x02\\x95\\x01\\x75\\x08\\x81\\x03\\x95\\x05\\x75\\x01\\x05\\x08\\x19\\x01\\x29\\x05\\x91\\x02\\x95\\x01\\x75\\x03\\x91\\x03\\x95\\x06\\x75\\x08\\x15\\x00\\x25\\x65\\x05\\x07\\x19\\x00\\x29\\x65\\x81\\x00\\xc0 > /sys/kernel/config/usb_gadget/g1/functions/hid.usb0/report_desc ln -s /sys/kernel/config/usb_gadget/g1/functions/hid.usb0/ /sys/kernel/config/usb_gadget/g1/configs/c.1/hid.usb0
-
回复: 关于全志4.9版本内核一个bug
@sofia 你看电路图呗,100ask上是把usbhub和otg接口用一个开关芯片一起接到typec,又用两个电阻把otg接口接到typec,我用的时候老是不稳定,现在把usbhub摘掉了,稳多了。
-
v853做gadget键盘,进入bios后无法使用
如题,暂时还不知道有什么办法解决,试着抓了另一个能用的键盘的报文来做初始化结果还是一样,接上后打开/dev/hidg0,发送三次报文就死机了,对面一点反应都没有
elif [ $1 == "hid" ]; then
[ -d /sys/kernel/config/usb_gadget/g1/functions/hid.usb0 ] || {
mkdir /sys/kernel/config/usb_gadget/g1/functions/hid.usb0
}echo "Tina Keyboard" > /sys/kernel/config/usb_gadget/g1/strings/0x409/product echo 1 > /sys/kernel/config/usb_gadget/g1/functions/hid.usb0/protocol echo 8 > /sys/kernel/config/usb_gadget/g1/functions/hid.usb0/report_length echo -ne \\x05\\x01\\x09\\x06\\xa1\\x01\\x05\\x08\\x19\\x01\\x29\\x03\\x15\\x00\\x25\\x01\\x75\\x01\\x95\\x03\\x91\\x02\\x95\\x05\\x91\\x01\\x05\\x07\\x19\\xe0\\x29\\xe7\\x95\\x08\\x81\\x02\\x75\\x08\\x95\\x01\\x81\\x01\\x19\\x00\\x29\\x91\\x26\\xff\\x00\\x95\\x06\\x81\\x00\\xc0 > /sys/kernel/config/usb_gadget/g1/functions/hid.usb0/report_desc ln -s /sys/kernel/config/usb_gadget/g1/functions/hid.usb0/ /sys/kernel/config/usb_gadget/g1/configs/c.1/hid.usb0
发送报文
keyboard values:
[a-z] or
--return --esc
--bckspc --tab
--spacebar --caps-lock
--f1 --f2
--f3 --f4
--f5 --f6
--f7 --f8
--f9 --f10
--f11 --f12
--insert --home
--pageup --del
--end --pagedown
--right --left
--down --kp-enter
--up --num-lock--down
repo data:0x0, 0x0, 0x51, 0x0, 0x0, 0x0, 0x0, 0x0,
hold repo data:0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
--down
repo data:0x0, 0x0, 0x51, 0x0, 0x0, 0x0, 0x0, 0x0, -
回复: 关于全志4.9版本内核一个bug
@sofia 你用的什么版本开发板,我用的100ask,otg口和hub扩展芯片电路上冲突,拆了hub扩展芯片才好用,你看看你的有没有这个问题
-
回复: 电脑接v853otg口电脑显示hub接口,v853hub口接U盘电脑能识别到U盘
总算是搞定usb 做gadget老是不稳定的问题了,把usb hub芯片拆下来就行了,看电路它可能和usb otg引脚互相干扰,没想到是直接原因啊
-
回复: 电脑接v853otg口电脑显示hub接口,v853hub口接U盘电脑能识别到U盘
@xjy_5 解决了,真是个玄学问题,我把usb线换成原装的就正常了,另买的偶尔用得了,试出了点经验,开发板开机后再插usb容易识别成功,otg口转换功能前先拔掉usb再操作,再用下面的命令重置usb口,更容易成功
cat /sys/devices/platform/soc/usbc0/usb_host cat /sys/devices/platform/soc/usbc0/usb_device
-
电脑接v853otg口电脑显示hub接口,v853hub口接U盘电脑能识别到U盘
很奇怪的现象,我把开发板许多不用的功能裁剪掉了,但是otg口工作不正常了,之前用它gadget配置都是能用的,但现在死活不识别,插电脑上就显示多了个hub口,还能识别开发板上hub插的U盘,这是我改掉了什么配置??
-
关于V853做网络摄像头推流的问题
没搞过开发板做服务器,老板要求开发板实现屏幕采集,usb键盘鼠标转发,这就涉及开发板视频流推流的问题,预想是的采集后h264编码发送。
现在找着的方法是用nginx服务器+fastcgi做程序和服务器的数据共享,这些都是openwrt自带有的组件,但问题来了,开发板的程序要想用Fastcgi要libfcgi库,我找了半天就找到几个patch文件,具体的库究竟是在哪完成的编译的??
自己完成libfcgi的交叉编译还是颇有难度,没搞定。
可以用的是cgi,但它每次都要创建线程再删除,性能实在太差了。 -
回复: 求高人指点! ISP通路测试 sample_vin_isp_test 报错
好了,总算能生成的ko文件了,把tc358743文件夹放在/tina-v853-open/kernel/linux-4.9/drivers/media/platform/sunxi-vin/modules/sensor/,修改 Makefile
再修改tc358743文件夹内的makefile
还要配置一下make kernel_menuconfig,搜索dv_timi,选第一个
这就能生成.ko文件了 -
回复: 求高人指点! ISP通路测试 sample_vin_isp_test 报错
@awwwwa 我改了设备树,在sensor文件夹下添加了tc358743,修改了makefile
编译是通过了,不过我怎么调用? -
回复: 求高人指点! ISP通路测试 sample_vin_isp_test 报错
@awwwwa
手册上说每条land支持1.2Gbps的带宽,也就是说最高频率是600MHZ,但RK628最低是到750MHZ的,用不了,现在看看tc358743怎么样了 -
回复: 求高人指点! ISP通路测试 sample_vin_isp_test 报错
@awwwwa V853的mipi csi总线到不了750MHZ,这是RK628的最低频率。禁用ISP的话我还有什么方法调用MIPI CSI?在应用层我只知道ISP的应用接口。
-
求高人指点! ISP通路测试 sample_vin_isp_test 报错
我在移植RK628D屏幕采集模块到v853上,是CSI 4land接口,开机后电脑已经识别到第二个显示器了
不过信号采集一直有问题,isp一直是config error,我并不清除它究竟是在哪config的
驱动程序里的参数配置如下,IIC是移植RK628驱动原有的regmap操作的,没用到原本的iic操作函数/* * Store information about the video data format. */ static struct sensor_format_struct sensor_formats[] = { { .desc = "UYVY 4:2:2", .mbus_code = MEDIA_BUS_FMT_UYVY8_2X8, .regs = NULL, .regs_size = 0, .bpp = 2 }, }; static struct sensor_win_size sensor_win_sizes[] = { { .width = 1920, .height = 1080, .hoffset = 0, .voffset = 0, .hts = 2200, .vts = 1125, .pclk = 148500*1000, .mipi_bps = 750 * 1000 * 1000, .fps_fixed = 60, .bin_factor = 1, .intg_min = 1 << 4, .intg_max = 1125 << 4, .gain_min = 1 << 4, .gain_max = 110 << 4, .regs = NULL, .regs_size = 0, .set_size = NULL, }, }; static int rk628_csi_g_mbus_config(struct v4l2_subdev *sd, struct v4l2_mbus_config *cfg) { struct rk628_csi *csi = to_csi(sd); cfg->type = V4L2_MBUS_CSI2; cfg->flags = 0 | V4L2_MBUS_CSI2_CONTINUOUS_CLOCK | V4L2_MBUS_CSI2_CHANNEL_0 | V4L2_MBUS_CSI2_4_LANE; return 0; }
[ISP]open isp device[0[ 800.284516] [gc2053_mipi]sensor_ioctl lin:4744 cmd:0xc03c56fc ] success! [ISP_WARN]open /mnt/extsd/isp0_1920_1080_60_ctx_saved.bin failed, err:No such file or directory. [ISP]prefer isp config: [gc2053_mipi], 1920x1080, 60, 0, 0 [ISP_WARN]cannot find gc2053_mipi_1920_1080_60_0_0 isp config, use gc2053_mipi_1920_1088_20_0_0 -> [gc2053_mipi_isp600_20220511_164617_vlc4_day] [ISP]create isp0 server thread! isp0 server wait to exit!!! current vi channel[ 800.326460] [gc2053_mipi]enable wsize is = 0 [ 800.331379] [gc2053_mipi]info->width:1920 height:1080 [ 800.337865] [gc2053_mipi]enable_stream: enable [ 800.342893] [gc2053_mipi]rk628_hdmirx_vid_enable: enable [ 800.353193] [gc2053_mipi]src 1920x1080 clock:148500000 [ 800.359079] [gc2053_mipi]dst 1920x1080 clock:148500000 [ 800.371658] [gc2053_mipi]dsp_frame_vst=5, dsp_frame_hst=0 [ 800.377707] [gc2053_mipi]horizontal no scale [ 800.382572] [gc2053_mipi]vertical no scale [ 800.390748] [gc2053_mipi]rk628_csi_set_csi: txphy already power on, power off [ 800.399554] [gc2053_mipi]mipi_dphy_power_on mipi bitrate:750 mbps [ 800.471475] [gc2053_mipi]rk628_csi_set_csi: txphy power on! [ 800.483222] [gc2053_mipi]rk628_csi_set_csi csi cofig done [ 800.490117] [gc2053_mipi]rk628_is_avi_ready PDEC_AVI_PB:0x1084a80c, avi_rcv_rdy:1 [ 800.539469] [gc2053_mipi]rk628_is_avi_ready PDEC_AVI_PB:0x1084a80c, avi_rcv_rdy:1 [ 800.589452] [gc2053_mipi]rk628_is_avi_ready PDEC_AVI_PB:0x1084a80c, avi_rcv_rdy:1 [ 800.668255] [VIN_ERR]isp0 configuration error [ 800.673140] [VIN_ERR]isp0 width error [ 800.677241] [VIN]__sunxi_isp_reset:isp0 reset!!!,ISP frame number is 0 [ 800.684555] [VIN_ERR]isp0 internal fifo full [ 800.689335] [VIN_ERR]isp0 the write full flag of LCA_BYR_FIFO [ 800.695770] [VIN_ERR]isp0 the read empty flag of LCA_BYR_FIFO [ 800.702205] [VIN_ERR]isp0 the write full flag of LCA_RGB0_FIFO [ 800.708738] [VIN_ERR]isp0 the read empty flag of LCA_RGB0_FIFO [ 800.715271] [VIN_ERR]isp0 the write full flag of DMSC_AVG_FIFO [ 800.721803] [VIN_ERR]isp0 the read empty flag of DMSC_AVG_FIFO [ 800.728336] [VIN_ERR]isp0 the write full flag of DMSC_RATIO_FIFO [ 800.735065] [VIN]__sunxi_isp_reset:isp0 reset!!!,ISP frame number is 0 [ 800.742417] [VIN_ERR]isp0 frame lost! [ 800.746519] [VIN]__sunxi_isp_reset:isp0 reset!!!,ISP frame number is 0 [ 800.753830] [VIN_ERR]isp0 configuration error [ 800.758708] [VIN_ERR]isp0 the bytpe signal of channel 0 is changed [ 800.765630] [VIN_ERR]isp0 height error [ 800.769826] [VIN]__sunxi_isp_reset:isp0 reset!!!,ISP frame number is 0 [ 800.777152] [VIN_ERR]isp0 frame lost! [ 800.781252] [VIN]__sunxi_isp_reset:isp0 reset!!!,ISP frame number is 0
这个/mnt/extsd/isp0_1920_1080_60_ctx_saved.bin文件是怎么来的,应该往哪个方向排故?
-
编译usbip功能排错笔记
开启usbip Client功能,
make kernel_menuconfig
make menuconfig,搜索usbip
编译报错 error: “_GNU_SOURCE“ redefined [-Werror]
修改文件 tina-v853-open/out/v853/100ask/openwrt/build_dir/target/linux-v853-100ask/usbip-2.0/src/usbipd.c
把#define _GNU_SOURCE
改成
#ifndef _GNU_SOURCE #define _GNU_SOURCE #endif
又报错 libtool: Version mismatch error. This is libtool 2.4, but the
到tina-v853-open/out/v853/100ask/openwrt/build_dir/target/linux-v853-100ask/usbip-2.0
输入指令cd ~/tina-v853-open/out/v853/100ask/openwrt/build_dir/target/linux-v853-100ask/usbip-2.0 autoreconf -ivf
编译通过,后头又有啥问题再写
-
回复: losetup 无法设置循环设备:没有这样的文件或目录
@awwwwa 感谢回复,现在可以用了,我都不知道有这些配置
现在的make menuconfig 的配置
make kernel_menuconfig的配置,搜loop,选的第二个
-
回复: losetup 无法设置循环设备:没有这样的文件或目录
@awwwwa 修改了分区大小了,现在打包能放下了,但结果还是说 cannot find an unused loop device
-
回复: losetup 无法设置循环设备:没有这样的文件或目录
@awwwwa 我在 make menuconfig 后,搜索losetup,修改了些配置
把PACKAGE_schroot设置为M,SCHROOT_LOOPBACK设置成y,编译后开机losetup结果
root@TinaLinux:~# losetup -f a.img losetup: cannot find an unused loop device
是另外的问题了,如果PACKAGE_schroot设为y,pack就会说rootfs太大
ERROR: dl file rootfs.fex size too large
ERROR: filename = rootfs.fex
ERROR: dl_file_size = 49408 sector -
回复: V853做hid gadget小机排故笔记
@sofia 测试USB的APP的源码已经放上来了。我在串口命令行运行app马上就会从开发板的usb发出‘a’,所以就打在命令行上了
-
回复: V853做hid gadget小机排故笔记
妈呀,突然发现这部分内容在v853系统开发手册里面有说,但我之前都不知道!不过里面没有给出文件路径,只说了可以修改这些定义,有点云里雾里
-
回复: V853做hid gadget小机排故笔记
现在有点眉目了,看了一上午的gadget初始化流程,困得不行,现在V853已经可以做HID设备发出'a'了,但不确定这么改会不会出什么bug,主要是修改了sunxi_udc的默认配置
修改了 sunxi_usb\include\sunxi_udc.h 的ep2的相关内容,把bulk改成了int,把ep_fifo的偏移地址做了修改static const char ep0name[] = "ep0";
static const char ep1in_bulk_name[] = "ep1in-bulk";
static const char ep1out_bulk_name[] = "ep1out-bulk";
static const char ep2in_int_name[] = "ep2in-int";
static const char ep2out_int_name[] = "ep2out-int";
static const char ep3_iso_name[] = "ep3-iso";
static const char ep4_int_name[] = "ep4-int";
static const char ep5in_bulk_name[] = "ep5in-bulk";
static const char ep5out_bulk_name[] = "ep5out-bulk";static const struct sw_udc_fifo ep_fifo[] = {
{ep0name, 0, 512, 0},
{ep1in_bulk_name, 512, 1024, 1},
{ep1out_bulk_name, 1536, 1024, 1},
{ep2in_int_name, 2560, 512, 0},
{ep2out_int_name, 3584-512, 512, 0},
{ep3_iso_name, 4608-1024, 1024, 0},
{ep4_int_name, 5632-1024, 512, 0},
{ep5in_bulk_name, 6144-1024, 1024, 1},
{ep5out_bulk_name, 7168-1024, 1024, 1},
};sunxi_usb\udc\sunxi_udc.c 也是类似,对应的内容在sunxi_udc的 ep[3],ep[4]
.ep[3] = { .num = 2, .ep = { .name = ep2in_int_name, .ops = &sunxi_udc_ep_ops, .maxpacket = SW_UDC_EP_FIFO_SIZE, .maxpacket_limit = SW_UDC_EP_FIFO_SIZE, .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_INT, USB_EP_CAPS_DIR_IN), }, .dev = &sunxi_udc, .bEndpointAddress = (USB_DIR_IN | 2), .bmAttributes = USB_ENDPOINT_XFER_INT, }, .ep[4] = { .num = 2, .ep = { .name = ep2out_int_name, .ops = &sunxi_udc_ep_ops, .maxpacket = SW_UDC_EP_FIFO_SIZE, .maxpacket_limit = SW_UDC_EP_FIFO_SIZE, .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_INT, USB_EP_CAPS_DIR_OUT), }, .dev = &sunxi_udc, .bEndpointAddress = (USB_DIR_OUT | 2), .bmAttributes = USB_ENDPOINT_XFER_INT, },
这就完了,然后重新编译,打包,找个了hid gadget键盘的例程,简化了下,只发送‘a’
/*a~z,A~Z通过usb循环回显到host端*/ #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <stdbool.h> #include <poll.h> #include <string.h> #include <time.h> #include <signal.h> #include <fcntl.h> #include <pthread.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/stat.h> #include <sys/time.h> #define DevName "/dev/hidg0" static int key_fd = -1; static int g_bExit = 0; #define DELAY_WAIT_TIME(); usleep(100*1000); static int Hid_Send_OneGBKEnglish(const unsigned char charactor) { int offset = 0; static unsigned char charBase = 0x04; /* A or a */ unsigned char keyType = 0; unsigned char report[8] = {0}; if(charactor >= 'a' && charactor <= 'z') { keyType = 0; offset = charactor - 'a'; } else if(charactor >= 'A' && charactor <= 'Z') { keyType = 0x02; offset = charactor - 'A'; } else { printf("[fun:%s - Line:%d]unable to support charactor:0x%02x\n", __FUNCTION__, __LINE__, charactor); } memset(report, 0, 8); report[0] = 0x00; report[2] = 0x00; write(key_fd, report, 8); memset(report, 0, 8); report[0] = keyType; report[2] = charBase + offset; write(key_fd, report, 8); memset(report, 0, 8); report[0] = keyType; report[2] = 0x00; write(key_fd, report, 8); memset(report, 0, 8); report[0] = 0x00; report[2] = 0x00; write(key_fd, report, 8); DELAY_WAIT_TIME(); return 0; } static int Hid_Send_Enter() { unsigned char report[8] = {0}; memset(report, 0, 8); report[0] = 0x00; report[2] = 0x28; write(key_fd, report, 8); memset(report, 0, 8); report[0] = 0x00; report[2] = 0x00; write(key_fd, report, 8); DELAY_WAIT_TIME(); return 0; } static int Hid_Send_Space() { unsigned char report[8] = {0}; memset(report, 0, 8); report[0] = 0x00; report[2] = 0x2C; write(key_fd, report, 8); memset(report, 0, 8); report[0] = 0x00; report[2] = 0x00; write(key_fd, report, 8); DELAY_WAIT_TIME(); return 0; } void HandleSig(signed int signo) { if (signo == SIGINT) { printf("catch Ctrl + C, exit normally\n"); g_bExit = 1; } } extern void HandleSig(signed int signo); int main(int argc, char *argv[]) { unsigned char charactor; key_fd = open("/dev/hidg0", O_RDWR, 0666); if (key_fd<0) { printf("error\n"); return -1; } charactor = 'a'; Hid_Send_OneGBKEnglish(charactor++); Hid_Send_Space(); Hid_Send_Enter(); close(key_fd); return 0; }
上传上面的代码编译成app,chmod 给予运行权限,我这里是编译成了hidapp
chmod 777 ./hidapp
kernel/linux-4.9/Documentation/usb/gadget_hid.txt也有例程,但比较复杂全面,一时半会我也看不懂,
然后就是指令
killall adbd 2>/dev/null
setusbconfig hid
cat /sys/devices/platform/soc/usbc0/usb_host
cat /sys/devices/platform/soc/usbc0/usb_device
先关掉ADB程序,再开脚本设置hid键盘,现在就没报错了,但电脑还是没识别到键盘,需要转换usb口到host再转到device才能用,这个时候设备管理器就能看到新键盘了
app测试
说一下其他问题,我用的adb上传文件,每次都要cat /sys/devices/platform/soc/usbc0/usb_host
cat /sys/devices/platform/soc/usbc0/usb_device才能用,完了要是拔插usb口,虚拟机的usb就会卡死再也无法识别,电脑也关不了机,只能强制重启,这个问题很影响调试,有办法解决吗? -
V853做hid gadget小机排故笔记
报错排故笔记,USB新手,许多概念不清楚,可能最后也搞不定,梳理一下今天读代码知道的东西,当然也是希望有大佬指点迷津,那是莫大的帮助
V853自带setusbconfig脚本,可以很方便的配置gadget,我把D1-H的setusbconfig放到这儿,用setusbconfig hid,回复root@TinaLinux:/# setusbconfig hid [ 52.903876] configfs-gadget gadget: adding 'hid'/ddc84c70 to config 'c'/dde4b6a8 [ 52.912290] configfs-gadget gadget: fun:usb_gadget_ep_match_desc [ 52.919176] configfs-gadget gadget: line:960 [ 52.924104] configfs-gadget gadget: fun:usb_gadget_ep_match_desc [ 52.930835] configfs-gadget gadget: fun:usb_gadget_ep_match_desc [ 52.937651] configfs-gadget gadget: line:960 [ 52.942433] configfs-gadget gadget: fun:usb_gadget_ep_match_desc [ 52.949231] configfs-gadget gadget: fun:usb_gadget_ep_match_desc [ 52.955992] configfs-gadget gadget: line:960 [ 52.960812] configfs-gadget gadget: fun:usb_gadget_ep_match_desc [ 52.967572] configfs-gadget gadget: line:960 [ 52.972388] configfs-gadget gadget: line:967 [ 52.977350] configfs-gadget gadget: line:973 [ 52.982145] configfs-gadget gadget: fun:usb_ep_autoconfig_ss line:90 [ 52.989501] configfs-gadget gadget: fun:usb_gadget_ep_match_desc [ 52.996313] configfs-gadget gadget: fun:usb_gadget_ep_match_desc [ 53.003148] configfs-gadget gadget: line:960 [ 53.007959] configfs-gadget gadget: fun:usb_gadget_ep_match_desc [ 53.014768] configfs-gadget gadget: fun:usb_gadget_ep_match_desc [ 53.021498] configfs-gadget gadget: line:960 [ 53.026439] configfs-gadget gadget: fun:usb_gadget_ep_match_desc [ 53.033213] configfs-gadget gadget: line:960 [ 53.038039] configfs-gadget gadget: fun:usb_gadget_ep_match_desc [ 53.044804] configfs-gadget gadget: fun:usb_gadget_ep_match_desc [ 53.051575] configfs-gadget gadget: fun:usb_gadget_ep_match_desc [ 53.058336] configfs-gadget gadget: line:960 [ 53.063177] configfs-gadget gadget: fun:usb_ep_autoconfig_ss line:94 [ 53.070297] configfs-gadget gadget: fail line:715 ep:0 [ 53.076112] configfs-gadget gadget: hidg_bind FAILED [ 53.081675] configfs-gadget gadget: adding 'hid'/ddc84c70 --> -19 [ 53.088582] configfs-gadget 4100000.udc-controller: failed to start g1: -19 sh: write error: No such device root@TinaLinux:/#
原本这里只回复
[ 68.343732] configfs-gadget gadget: hidg_bind FAILED [ 68.349296] configfs-gadget gadget: adding 'hid'/ddc84c70 --> -19 [ 68.356214] configfs-gadget 4100000.udc-controller: failed to start g1: -19 sh: write error: No such device
为了了解究竟发生了什么,在这三个文件里加了打印来确定哪个if没通过
linux-4.9/drivers/usb/gadget/function/f_hid.c linux-4.9/drivers/usb/gadget/epautoconf.c linux-4.9/drivers/usb/gadget/udc/core.c
出错的地方是 f_hid.c-> hidg_bind -> usb_ep_autoconfig
而usb_ep_autoconfig用到的是 epautoconf.c -> usb_ep_autoconfig_ss,usb_gadget_ep_match_desc 没找着匹配的端点
最后是在gadget/udc/core.c的usb_gadget_ep_match_desc函数没通过if (!ep->caps.type_int)
原来是没通过支持中断传输的检查
-
V853的gadget支持模拟键盘鼠标设备吗?
linux4.9内核的gadget好像有BUG,不能模拟hid设备,V853的sdk刚好就是这个版本的内核,我自己试过确实不行,查了资料找到了远古帖子,好像有补丁能用,但那帖子里的链接已经失效了,我也不懂怎么找补丁,有人有解决办法吗?
-
抓图报错[VIN_ERR]isp0 width error,求给个排查思路
移植rk628_csi_v4l2驱动到V853上,算是完成了,用命令/sample_driverVipp 0 1920 1080 2 30 0 10 /mnt,能测到MIPI信号了,回复如下
main:367 make devName[/dev/v4l-subdev35] main:333 media_entity_desc: id[0x74], type[0x20000], name[sunxi_scaler.15], pads[2], links[0], major/minor[81/38] main:350 sysname[/sys/dev/char/81:38], target[…/…/devices/platform/soc/5800800.vind/video4linux/v4l-subdev36] main:367 make devName[/dev/v4l-subdev36] main:321 enum media entity done! num:39 main:373 name of media_entity_desc we wanted is vin_video0 main:437 VIDIOC_G_FMT: resolution: 1920x1080, num_planes: 1 main:443 VIDIOC_G_PARM: capturemode:0x2 main:450 devname[/dev/video0] reqbufs: nr[5], type[9] main:454 devname[/dev/video0] reqbufs: nr[5], type[9] done, ret[0] main:510 devname[/dev/video0]: buffer 0 planes 0 mapped at address 0xb696d000 main:510 devname[/dev/video0]: buffer 1 planes 0 mapped at address 0xb6670000 main:510 devname[/dev/video0]: buffer 2 planes 0 mapped at address 0xb6373000 main:510 devname[/dev/video0]: b[ 50.356792] gc2053_mipi 1-0028: rk628_is_avi_ready PDEC_AVI_PB:0x2284a80d, avi_rcv_rdy:1 uffer 3 planes 0 mapped at address 0xb6076000 main:510 devname[/dev/video0]: buffer 4 planes 0 mapped at address 0xb5d79000 [ 50.418534] gc2053_mipi 1-0028: rk628_is_avi_ready PDEC_AVI_PB:0x2284a80d, avi_rcv_rdy:1 [ 50.468454] gc2053_mipi 1-0028: rk628_is_avi_ready PDEC_AVI_PB:0x2284a80d, avi_rcv_rdy:1 [ 50.518461] gc2053_mipi 1-0028: rk628_is_avi_ready PDEC_AVI_PB:0x2284a80d, avi_rcv_rdy:1 [ 50.568458] gc2053_mipi 1-0028: rk628_is_avi_ready PDEC_AVI_PB:0x2284a80d, avi_rcv_rdy:1 [ 50.618470] gc2053_mipi 1-0028: rk628_is_avi_ready PDEC_AVI_PB:0x2284a80d, avi_rcv_rdy:1 [ 50.695265] [VIN_ERR]isp0 configuration error [ 50.700149] [VIN_ERR]isp0 width error [ 50.704250] [VIN]__sunxi_isp_reset:isp0 reset!!!,ISP frame number is 0 [ 50.711563] [VIN_ERR]isp0 internal fifo full [ 50.716344] [VIN_ERR]isp0 the write full flag of DMSC_AVG_FIFO [ 50.722876] [VIN_ERR]isp0 the read empty flag of DMSC_AVG_FIFO [ 50.729411] [VIN]__sunxi_isp_reset:isp0 reset!!!,ISP frame number is 0 [ 50.736759] [VIN_ERR]isp0 configuration error [ 50.741638] [VIN_ERR]isp0 height error [ 50.745833] [VIN]__sunxi_isp_reset:isp0 reset!!!,ISP frame number is 0 [ 50.753653] [gc2053_mipi]enable csi stream [ 50.761955] [VIN_ERR]isp0 frame lost! [ 50.766056] [VIN]__sunxi_isp_reset:isp0 reset!!!,ISP frame number is 0 [ 50.795335] [VIN_ERR]isp0 configuration error [ 50.800217] [VIN_ERR]isp0 width error [ 50.804317] [VIN]__sunxi_isp_reset:isp0 reset!!!,ISP frame number is 0 [ 50.828723] [VIN_ERR]isp0 configuration error [ 50.833605] [VIN_ERR]isp0 width error
gc2053是原驱动文件的名称,直接在这个文件里改的
报错代码是写在sunxi_isp.c,static irqreturn_t isp_isr(int irq, void *priv)里的,求大佬给个排查思路 -
gadget做HID键盘报错
报错:
[ 808.059280] configfs-gadget gadget: hidg_bind FAILED
[ 808.065144] configfs-gadget 4100000.udc-controller: failed to start g1: -19
echo: write error: No such device指令:
mount -t configfs none /sys/kernel/config/
mkdir /sys/kernel/config/usb_gadget/g1
echo 0x0525 >/sys/kernel/config/usb_gadget/g1/idVendor
echo 0xa4ac >/sys/kernel/config/usb_gadget/g1/idProduct
mkdir /sys/kernel/config/usb_gadget/g1/strings/0x409
mkdir /sys/kernel/config/usb_gadget/g1/functions/hid.usb0
echo 8 >/sys/kernel/config/usb_gadget/g1/functions/hid.usb0/report_length
echo -ne \x06\xa0\xff\x09\x01\xa1\x01\x09\x02\xa1\x00\x06\xa1\xff\x09\x03\x09\x04\x15\x80\x25\x7f\x35\x00\x45\xff\x75\x08\x95\x40\x81\x02\x09\x05\x09\x06\x15\x80\x25\x7f\x35\x00\x45\xff\x75\x08\x95\x40\x91\x02\xc0\xc0 >/sys/kernel/config/usb_gadget/g1/functions/hid.usb0/report_descecho 0xc0 >/sys/kernel/config/usb_gadget/g1/configs/c.1/bmAttributes
echo 500 >/sys/kernel/config/usb_gadget/g1/configs/c.1/MaxPower
mkdir /sys/kernel/config/usb_gadget/g1/configs/c.1/strings/0x409
ln -s /sys/kernel/config/usb_gadget/g1/functions/hid.usb0/ /sys/kernel/config/usb_gadget/g1/configs/c.1/
ls /sys/class/udc/ | xargs echo > /sys/kernel/config/usb_gadget/g1/UDC写指令前用了 echo "" > /sys/kernel/config/usb_gadget/g1/UDC 关闭ADB,还是说要其他方法重置gadget?
-
回复: 全志D1烧写中断,开机卡[180]Loading boot-pkg fail(error=2)
@moider 固件对了照 这个教程https://d1.docs.aw-ol.com/study/study_4compile/ 的按住fel按键烧写
-
回复: 全志D1烧写中断,开机卡[180]Loading boot-pkg fail(error=2)
解决了,问客服要的网盘里的固件才能启动,在https://d1.docs.aw-ol.com/d1_dev/下的固件用不了
-
回复: 全志D1烧写中断,开机卡[180]Loading boot-pkg fail(error=2)
现在PhoenixSuit能用了,烧写进度条满了之后板子重启卡住,烧写软件会再次尝试烧写也卡住 ,烧的是 D1-H哪吒HDMI测试固件20210804(开机HDMI就有小企鹅启动logo) .img
-
全志D1烧写中断,开机卡[180]Loading boot-pkg fail(error=2)
全志D1-H开发板刚到,烧写就出了问题,用的固件是用repo下载编译出来的,刚开始PhoenixSuit还能用,但烧写着板子重启就卡住了,然后就一直连接不上设备了,开发板再开机串口也是打印同样的内容。按FEL再按RST键也连接不上。在虚拟机ubuntu14用LiveSuit烧写能烧,但是进度条到100%会 Kill Timer,再开机串口的内容和之前一样,这该怎么解决啊!替代文字