全志A523 Camera篇(2)ov13850调试(2出错分析)

1.带宽不足 tdm0如下报错

[   94.429780][    C0] sunxi:vin:[ERR]: tdm0 rx0 buffer full!
[   94.479175][  T124] sunxi:vin:[WARN]: __sunxi_tdm_reset_v2_handle parser0 wait:82/2 ms to close!
[   94.489039][  T124] sunxi:vin:[INFO]: __sunxi_tdm_reset_v2_handle:workqueue tdm_rx0 reset!!!, isp frame count is 0
[   94.610526][    C0] sunxi:vin:[ERR]: tdm0 rx0 buffer full!
[   94.659919][  T124] sunxi:vin:[WARN]: __sunxi_tdm_reset_v2_handle parser0 wait:81/2 ms to close!
[   94.669895][  T124] sunxi:vin:[INFO]: __sunxi_tdm_reset_v2_handle:workqueue tdm_rx0 reset!!!, isp frame count is 0
[   94.791281][    C0] sunxi:vin:[ERR]: tdm0 rx0 buffer full!
[   94.840329][  T124] sunxi:vin:[WARN]: __sunxi_tdm_reset_v2_handle parser0 wait:78/2 ms to close!
[   94.850391][  T124] sunxi:vin:[INFO]: __sunxi_tdm_reset_v2_handle:workqueue tdm_rx0 reset!!!, isp frame count is 0
[   94.972035][    C0] sunxi:vin:[ERR]: tdm0 rx0 buffer full!
[   95.021401][  T124] sunxi:vin:[WARN]: __sunxi_tdm_reset_v2_handle parser0 wait:81/2 ms to close!
[   95.031282][  T124] sunxi:vin:[INFO]: __sunxi_tdm_reset_v2_handle:workqueue tdm_rx0 reset!!!, isp frame count is 0
[   95.152785][    C0] sunxi:vin:[ERR]: tdm0 rx0 buffer full!
[   95.201769][  T124] sunxi:vin:[WARN]: __sunxi_tdm_reset_v2_handle parser0 wait:78/2 ms to close!
[   95.211773][  T124] sunxi:vin:[INFO]: __sunxi_tdm_reset_v2_handle:workqueue tdm_rx0 reset!!!, isp frame count is 0
[   95.333640][    C0] sunxi:vin:[ERR]: tdm0 rx0 buffer full!

解决方法

diff --git a/drivers/vin/vin-tdm/vin_tdm.c b/drivers/vin/vin-tdm/vin_tdm.c
--- a/drivers/vin/vin-tdm/vin_tdm.c
+++ b/drivers/vin/vin-tdm/vin_tdm.c
@@ -647,13 +647,13 @@ static int sunxi_tdm_top_s_stream(struct tdm_rx_dev *rx, int enable)
 			csic_tdm_set_tx_t2_cycle(tdm->id, tdm->tx_cfg.t2_cycle = 0xfa0);
 		} else {
 			if (rx->ws.data_fifo_depth && rx->ws.head_fifo_depth) {
-				csic_tdm_set_tx_fifo_depth(tdm->id, rx->ws.head_fifo_depth, min(rx->ws.data_fifo_depth, (u16)192));
+				csic_tdm_set_tx_fifo_depth(tdm->id, rx->ws.head_fifo_depth, min(rx->ws.data_fifo_depth, (u16)64));
 			} else {
 #if IS_ENABLED(CONFIG_WDR)
 				csic_tdm_set_tx_fifo_depth(tdm->id, 32/4, 512/4);
 #else
 				if (rx->id == 0 || rx->id == 1) {
-					csic_tdm_set_tx_fifo_depth(tdm->id, 32/2, min(512/2, 192));
+					csic_tdm_set_tx_fifo_depth(tdm->id, 32/2, min(512/2, 64));
 				} else {
 					csic_tdm_set_tx_fifo_depth(tdm->id, 32/4, 512/4);
 					vin_warn("use ioctl VIDIOC_SET_TDM_DEPTH setting max_ch to make work stable!\n");
@@ -2532,4 +2532,4 @@ void sunxi_tdm_platform_unregister(void)
 {
 	platform_driver_unregister(&tdm_platform_driver);
 	vin_log(VIN_LOG_TDM, "tdm_exit end\n");
-}
\ No newline at end of file
+}


diff --git a/drivers/vin/vin-video/vin_core.c b/drivers/vin/vin-video/vin_core.c
--- a/drivers/vin/vin-video/vin_core.c
+++ b/drivers/vin/vin-video/vin_core.c
@@ -1329,7 +1329,7 @@ static irqreturn_t vin_isr(int irq, void *priv)
 		/*buffer address is overwrite before used*/
 		csic_dma_int_clear_status(vinc->vipp_sel, DMA_INT_ADDR_OVERFLOW);
 	}
-
+/*
 	if (status.pixel_miss) {
 		csic_dma_int_clear_status(vinc->vipp_sel, DMA_INT_PIXEL_MISS);
 		vin_warn("vinc%d input pixel in one line is less than expected!\n", vinc->id);
@@ -1340,6 +1340,7 @@ static irqreturn_t vin_isr(int irq, void *priv)
 		cap->frame_delay_cnt++;
 		vin_err("vinc%d input lines in one frame is less than execpted, frame lost!\n", vinc->id);
 	}
+*/
 #endif
 #ifndef BUF_AUTO_UPDATE
 	if (status.vsync_trig) {

diff --git a/drivers/vin/vin-video/vin_video.c b/drivers/vin/vin-video/vin_video.c
--- a/drivers/vin/vin-video/vin_video.c
+++ b/drivers/vin/vin-video/vin_video.c
@@ -5936,8 +5936,8 @@ static int vin_subdev_s_stream(struct v4l2_subdev *sd, int enable)
 		if ((vinc->dma_merge_mode == 1) && (vinc->vipp_sel % 4 == 0))
 			csic_dma_int_disable(vinc->vipp_sel, DMA_INT_ALL);
 
-		csic_dma_int_enable(vinc->vipp_sel, DMA_INT_ADDR_NO_READY | DMA_INT_ADDR_OVERFLOW |
-		DMA_INT_PIXEL_MISS | DMA_INT_LINE_MISS);
+		csic_dma_int_enable(vinc->vipp_sel, DMA_INT_ADDR_NO_READY | DMA_INT_ADDR_OVERFLOW);
+		//DMA_INT_PIXEL_MISS | DMA_INT_LINE_MISS);
 
 		switch (cap->frame.fmt.fourcc) {
 		case V4L2_PIX_FMT_LBC_2_0X:

 Android配置

一:修改Android.mk。

MERGE_SUPPORT 表示使能MERGE模式:

LIMIT_WIDTH表示大于这个值则开启MERGE。

LIMIT_HEIGHT表示大于这个值则开启MERGE。

diff --git a/hal_3/hal/Android.mk b/hal_3/hal/Android.mk
--- a/hal_3/hal/Android.mk
+++ b/hal_3/hal/Android.mk
@@ -109,6 +109,7 @@ VIDEO_NUM      := $(word $(NUM_IDX),$(SEARCH_ISP_TABLE))
 VIN_NUM     := $(word $(VIN_IDX),$(SEARCH_ISP_TABLE))
 endif
 ifeq ($(LIB_ISP_VERSION), isp_601)
+v4l2_cflags    += -DMERGE_SUPPORT
 v4l2_cflags    += -DISP_LIMIT_WIDTH=2112
 v4l2_cflags    += -DISP_LIMIT_HEIGHT=1568
 endif

 二:camera.cfg按照sensor分辨率进行配置。

以ov13850为例:

used_picture_size = 1
key_support_picture_size = 4224x3136,3264x2448,2112x1568,1920x1080,1600x1200,1280x720,1056x784,1024x768,640x480,352x288,320x240
key_default_picture_size = 4224x3136

以s5k3l2为例:

used_picture_size = 1
key_support_picture_size = 4208x3120,3264x2448,2592x1944,2104x1560,1920x1080,1600x1200,1280x720,1024x768,1052x780,640x480,352x288,320x240
key_default_picture_size = 4208x3120

1.为减少美颜等应用的算法带宽占用,需注意在配置分辨率配置的时候要添加一个最大分辨率4224x3136 相同比例,并且不超过屏幕尺寸的预览分辨率,如此时额外添加的分辨率为1056x784。以及大于屏幕尺寸的2112x1568。

2.由于此方案是通过TDM的方式支持,故无需配置插值,如果camera.cfg中有如下面一样的插值配置需要去掉,否则会影响GMS测试以及实际使用

used_interpolation_size = 1
key_support_src_interpolation_size = 3264x2440
key_support_dst_interpolation_size = 4208x3120

三:AWCamera2修改

在android14/vendor/aw/public/package/rro/AwCamera2Config/res/values/config.xml 中添加需要支持的尺寸。

配置方式和默认配置内容如下:

    <!-- 拍照尺寸支持,格式'<width>x<height>' 如1280x720 -->
    <string-array name="config_photo_supported_sizes">
        <item>1024x768</item>
        <item>1280x720</item>
        <item>1600x1200</item>
        <item>1920x1080</item>
        <item>2592x1944</item>
        <item>3264x2448</item>
        <item>4208x3120</item>
	<item>4224x3136</item>
    </string-array>

另外应用的版本需为v0.5.3以上版本支持

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值