Loading...
首页问答  

Hi3516DV300接入BT656无法出图象的问题

大晖狼
大晖狼  发布于 2020-11-13 10:35:48 453

我用3516接入一个BT656的模组,用了海思的sample_vio样例代码进行改造,怎么都调不出图像来,不知道哪里出问题了,有搞过的兄弟没?帮忙看看呢,下面是我的VI、VPSS和VO的信息,多谢了!

[VI] Version: [Hi3516CV500_MPP_V2.0.2.0 B030 Release], Build Time[Sep 10 2019, 19:48:32]

———————————————-MODULE PARAM —————————————————————————————————————-
DetectErrFrame DropErrFrame VbSource
0 0 Common

———————————————-VI MODE ——————————————————————————————-
Pipe0Mode Pipe1Mode Pipe2Mode Pipe3Mode
offline offline offline offline
———————————————-VPSS MODE —————————————————————————————-
Pipe0Mode Pipe1Mode Pipe2Mode Pipe3Mode
offline offline offline offline

———————————————-VI DEV ATTR1——————————————————————————————————————
DevID DevEn BindPipe Width Height IntfM WkM ComMsk0 ComMsk1 ScanM
1 Y Y 720 576 BT656 1Mux ff0000 0 P

———————————————-VI DEV ATTR2——————————————————————————————————————
DevID AD0 AD1 AD2 AD3 Seq DataType DataRev BasW BasH HReph VReph WDRMode CacheLine DataRate
1 -1 -1 -1 -1 UYVY YUV N 720 576 NONE NONE None 576 X1

———————————————-VI BIND ATTR——————————————————————————————————————
DevID PipeNum PipeId
1 1 2

———————————————-VI DEV TIMING ATTR———————————————————————————————————
DevID DevTimingEn DevFrmRate DevWidth DevHeight

———————————————-VI PIPE ATTR1—————————————————————————————————————-
PipeID BypassMode YuvSkip IspBypass Width Height PixFmt BitWidth NrEn SharpenEn CompressMode
2 BypassNone N Y 720 576 SP422 8 Y N None

———————————————-VI PIPE ATTR2—————————————————————————————————————-
DiscProPic SrcFRate DstFRate FrameSource RepeatMode VCNum IntType EarlyLine VbPoolId
N -1 -1 DEV NONE 0 START 0 -1

———————————————-VI PIPE PRE CROP ATTR———————————————————————————————————-
PipeID CropEn CoorX CoorY Width Height

———————————————-VI PIPE POST CROP ATTR———————————————————————————————————-
PipeID CropEn CoorX CoorY Width Height

———————————————-VI PIPE NR ATTR————————————————————————————————————-
PipeID BitWidth CompressMode PixFmt RefSrc Intf Version OptMode
2 8 None SP422 CH0 NR_X VER_2 MANUAL

———————————————-VI PIPE NRX_V2 PARAM——————————————————————————————————
PipeID ISO SFS1 SFS2 SFS4 SFN0 SFN1 SFN3 STH1 STH3
2 0 0 0 0 0 1 4 0 0

———————————————-VI PIPE USER PIC ATTR—————————————————————————————————-
PipeID Enable ChnID Mode BgColor PicID Width Height Stride PixFmt PoolID PhyAddr

———————————————-VI PIPE DUMP ATTR———————————————————————————————————-
PipeID Enable Depth DumpType

———————————————-VI PIPE BNR DUMP ATTR—————————————————————————————————-
PipeID Enable Depth

———————————————-VI CHN ATTR1——————————————————————————————————————
PipeID ChnID Width Height Mirror Flip SrcFRate DstFRate PixFmt VideoFmt DynamicRange
2 0 720 576 N N -1 -1 SP420 LINEAR SDR8

———————————————-VI CHN ATTR2——————————————————————————————————————
CompressMode Depth Align VbPoolId
None 6 0 -1

———————————————-VI EXTCHN ATTR1————————————————————————————————————-
PipeID ChnID Source SrcChn Width Height SrcFRate DstFRate PixFmt DynamicRange CompressMode Depth

———————————————-VI EXTCHN ATTR2————————————————————————————————————-
Align VbPoolId

———————————————-VI CHN LOW DELAY ATTR—————————————————————————————————-
PipeID ChnID Enable LineCnt Effect
2 0 N 0 N

———————————————-VI CHN CROP INFO————————————————————————————————————
PipeID ChnID CropEn CoorType CoorX CoorY Width Height TrimX TrimY TrimWid TrimHgt
2 0 N RIT 0 0 0 0 0 0 0 0

———————————————-VI CHN ROTATION INFO——————————————————————————————————
PipeID ChnID Rotation
2 0 0

———————————————-VI CHN LDC INFO————————————————————————————————————-
PipeID ChnID Enable Aspect XRatio YRatio XYRatio XOffset YOffset DistortionRatio
2 0 N N 0 0 0 0 0 0

———————————————-VI CHN ROTATIO_EX INFO—————————————————————————————————
PipeID ChnID Enable ViewType Angle XOffset YOffset Width Height
2 0 N ALL 0 0 0 0 0

———————————————-VI CHN SPREAD INFO———————————————————————————————————
PipeID ChnID Enable OutW OutH Coef
2 0 N 0 0 0

———————————————-VI EXTCHN FISHEYE ATTR—————————————————————————————————
PipeID ChnID Enable MntMode RgnNum BgEnable BgColor LMF HOffset VOffset TCoef FStrength

———————————————-VI EXTCHN FISHEYE REGION ATTR—————————————————————————————-
PipeID ChnID RgnIndex ViewMode InRadius OutRadius Pan Tilt HorZoom VerZoom OutX OutY OutW OutH

———————————————-VI DIS CONFIG INFO1——————————————————————————————————-
PipeID ChnID Mode Motion PdtType BufNum CropRatio FrmRate GyroRange GyroBitWidth CamSteady Scale

———————————————-VI DIS ATTR INFO————————————————————————————————————
PipeID ChnID DisChn Enable GdcBypass MovSub Roef Timelag ViewAngle bStillCrop HorLimit VerLimit Strength

———————————————-VI SNAP ATTR INFO———————————————————————————————————-
PipeID Type bLoadCCM FrameCnt rptTimes bZSL FrmDepth RollbaskMs Interval

———————————————-VI SNAP STATUS INFO——————————————————————————————————-
Status bDoublePipe VideoPipe SnapPipe VcNum ProDelayInt

———————————————-VI CHN OUTPUT RESOLUTION————————————————————————————————
PipeID ChnID Enable Mirror Flip Width Height PixFmt VideoFmt DynamicRange CompressMode FrameRate
2 0 Y N N 0 0 SP420 LINEAR SDR8 None 0

———————————————-VI PIPE STATUS—————————————————————————————————————
PipeID Enable IntCnt FrameRate LostFrame VbFail Width Height
2 Y 1 0 0 0 720 576

———————————————-VI CHN STATUS—————————————————————————————————————-
PipeID ChnID Enable FrameRate LostFrame VbFail Width Height
2 0 Y 0 0 0 0 0

———————————————-VI PIPE Statistic———————————————————————————————————-
PipeID RecvPic LostCnt BufCnt CurSoftTm MaxSoftTm CurTaskTm MaxTaskTm LowBandWidth BeBufNum
2 0 0 0 0 0 0 0 0 0

———————————————-VI HW STATISTIC————————————————————————————————————-
ProcIdx HWCostTm MaxHWCostTm CycleCnt MaxCycleCnt
0 0 0 0 0

———————————————-VI PROC OFFLINE IRQ STATISTIC—————————————————————————————
ProcIdx SubmitCnt IntCnt ListCnt TmOutCnt BusErrCnt DcmpErrCnt StartErrCnt NodeIdErrCnt
0 0 0 0 0 0 0 0 0

———————————————-VI PROC ONLINE IRQ STATISTIC—————————————————————————————-
ProcIdx IntCnt FrmStartCnt FrmErrCnt FrmFlowCnt BusErrCnt DcmpErrCnt CfgLossCnt FirstIntPts
0 0 0 0 0 0 0 0 0

———————————————-VI PROC COST TIME STATISTIC—————————————————————————————-
ProcIdx IntCntPerSec MaxIntCntPerSec CurIntCostTm MaxIntCostTm TotalIntCostTm IntTmPerSec MaxIntTmPerSec
0 0 0 0 0 0 0 0

———————————————-VI DEV DETECT INFO———————————————————————————————————
DevID ValidWidth ValidHeight TotalWidth
1 0 0 0

———————————————-VI BAS DETECT INFO———————————————————————————————————
DevID ValidWidth ValidHeight TotalWidth

———————————————-VI ISP DETECT INFO———————————————————————————————————
ISPID ValidWidth ValidHeight TotalWidth
2 0 0 0

[VPSS] Version: [Hi3516CV500_MPP_V2.0.2.0 B030 Release], Build Time[Sep 10 2019, 19:48:32]

———————————————-MODULE PARAM—————————————————————————————
u32VpssVbSource bOneBufferforLowDelay u32VpssSplitNodeNum bHdrSupport bNrQuickStart
0 0 3 0 0

———————————————-VPSS GRP ATTR————————————————————————————-
GrpID MaxW MaxH PixFmt DRange SrcFRate DstFRate bUserCtrl NrEn NrType RefCmp MotionMode
0 720 576 YVU-SP420 SDR8 -1 -1 Y Y VIDEO Y normal

———————————————-VPSS CHN ATTR————————————————————————————-
GrpID PhyChnID Enable Mode Width Height SrcFRate DstFRate Depth Align MirrorEn FlipEn bBufferShare ProcMode
0 0 Y USER 720 576 30 30 6 0 N N N VIDEO

———————————————-VPSS EXT-CHN ATTR—————————————————————————
GrpID ExtChnID Enable SrcChn Width Height SrcFRate DstFRate Depth Align ProcMode

———————————————-VPSS GRP CROP INFO——————————————————————————-
GrpID CropEn CoorType CoorX CoorY Width Height OriW OriH TrimX TrimY TrimWid TrimHgt
0 N RAT 0 0 0 0

———————————————-VPSS CHN CROP INFO——————————————————————————-
GrpID ChnID CropEn CoorType CoorX CoorY Width Height TrimX TrimY TrimWid TrimHgt
0 0 N RAT 0 0 0 0

———————————————-VPSS GRP PIC QUEUE——————————————————————————
GrpID FreeLen0 BusyLen0 Delay Backup
0 9 0 0 0

———————————————-VPSS GRP PIC INFO—————————————————————————-
GrpID Width Height Pixfmt Videofmt DRange Compress
0 0 0 UNKNOW LINEAR SDR8 N

———————————————-VPSS GRP WORK STATUS—————————————————————————-
GrpID RecvPic0 ViLost0 VdecLost0 NewDo OldDo NewUnDo OldUnDo StartFl bStart CostTm MaxCostTm
0 0 0 0 0 0 0 0 0 Y 0 0

———————————————-VPSS CHN OUTPUT RESOLUTION——————————————————————
GrpID ChnID Enable Width Height Pixfmt Videofmt DRange Compress SendOk FrameRate
0 0 Y 720 576 UNKNOW LINEAR SDR8 N 0 0

———————————————-VPSS 3DNR X PARAM———————————————————————————
———————————————-VPSS GPR0 3DNR PARAM——————————————————-
GrpID Intf Version OptMode ISO Ref
0 NR_X VER_2 MANUAL 110 1
NRyEn_1 NRyEn_2 NRyEn_3 NRyEn_4
1 1 1 1
SFS2_1 SFS2_2 SFS2_3 SFS2_4
32 32 32 32
SFS4_1 SFS4_2 SFS4_3 SFS4_4
32 32 32 32
TFS0_1 TFS1_1 TFS0_2 TFS1_2
7 7 7 7
MATH0_1 MATH1_1 MATH0_2 MATH1_2
40 100 60 0

———————————————-VPSS CHN LBA ATTR————————————————————————————-
GrpID ChnID Aspect videoX videoY videoW videoH BgColor

———————————————-VPSS CHN ROTATE ATTR—————————————————————————-
GrpID ChnID Rotate

———————————————-VPSS CHN LDC ATTR——————————————————————————-
GrpID ChnID Enable Aspect XRatio YRatio XYRatio XOffset YOffset DistortionRatio

———————————————-VPSS CHN ROTATIO_EX ATTR———————————————————————
GrpID ChnID Enable ViewType Angle XOffset YOffset Width Height

———————————————-VPSS CHN SPREAD ATTR—————————————————————————-
GrpID ChnID Enable OutW OutH Coef

———————————————-VPSS EXTCHN FISHEYE ATTR———————————————————————-
GrpID ChnID Enable MntMode RgnNum BgEnable BgColor LMF HOffset VOffset TCoef FStrength

———————————————-VPSS EXTCHN FISHEYE REGION ATTR———————————————————-
GrpID ChnID RgnIndex ViewMode InRadius OutRadius Pan Tilt HorZoom VerZoom OutX OutY OutW OutH

———————————————-VPSS CHN LOWDELAY ATTR————————————————————————-
GrpID ChnID Enable LineCnt OneBufEnable OneBufAddr

———————————————-FRAME INTERRUPT ATTR—————————————————————————-
GrpID IntType EarlyLine
0 - 0

———————————————-VPSS GRP PIC PTS————————————————————————————-
GrpID FirstPicPTS CurPicPTS
0 0 0

———————————————-DRV WORK STATUS————————————————————————————
StartSuc0 StartSuc1 LinkInt StartErr0 NodeIdErr0 StartErr1 NodeIdErr1 BusErr
0 0 0 0 0 0 0 0

———————————————-DRV NODE QUEUE————————————————————————————-
FreeNum WaitNum Busy00 Busy01 Sel0 Busy10 Busy11 Sel1 Proc
17 0 0 0 0 0 0 0 0

———————————————-INT WORK STATUS————————————————————————————
CntPerSec MaxCntPerSec CostTm MostCostTm CostTmPerSec MCostTmPerSec
0 0 0 0 0 0

[VO] Version: [Hi3516CV500_MPP_V2.0.2.0 B030 Release], Build Time[Sep 10 2019, 19:48:33]

——-DEVICE CONFIG—————————————————————————————————-
DevId DevEn Mux1 Mux2 Mux3 IntfSync BgClr DevFrt
0 Y MIPI USER 0xff 60

——-DEVICE CLOCK INFO—————————————————————————————————-
DevId DevEn ClkSource FbDiv Frac RefDiv PostDiv1 PostDiv2 LCDMCLK VoDevDiv VoPreDiv ClkReverse
0 Y PLL 380 4158065 4 7 7 1 1 N

——-MODULE PARAM——————————————-
transparentTransmit ExitDev WbcBgBlackEn DevClkExtEn SaveBufMode
N Y N N N

——-VIDEO LAYER STATUS 1————————————————————————————————————————————
LayerId VideoEn ClustMode PixFmt ImgW ImgH DispX DispY DispW DispH DispFrt DoubFrm DstDyRg Decompress
0 Y N SP420 1024 600 0 0 1024 600 60 N SDR8 N

——-VIDEO LAYER STATUS 2(continue)———————————————————————————————————————
LayerId VideoEn Toleration Priority EnChNum Matrix Luma Cont Hue Satu
0 Y 10000000 0 1 4 50 50 50 50

——-VIDEO LAYER STATUS 3(continue)———————————————————————————————————————
LayerId DevId SetBeg SetEnd PartitionMode bSDVgsBypass u32BufLen
0 0 N N Single N 3

——-VIDEO LAYER STATUS 4(continue)———————————————————————————————————————
LayerId AspectRatioMode X Y Width Height BgColor

——-VIDEO LAYER STATUS 5(continue)———————————————————————————————————————
LayerId BoundaryWidth Color0 Color1

——-VIDEO LAYER STATUS 6(continue)———————————————————————————————————————
LayerId CropEn X Y Width Height
0 N

——-CHN BASIC INFO ———————————————————————————————-
LayerId ChnId ChnEn Prio DeFlk ChnX ChnY ChnW ChnH DispX DispY bSnap Field RotAngle
0 0 Y 0 N 0 0 1024 600 -1 -1 N both 0

——-CHN PLAY INFO 1——————————————————————————————————————————————————————————-
LayerId ChnId Batch Show Pause Step Revrs Refsh Thrshd ChnFrt ChnGap
0 0 N Y N N N N 3 60 16666

——-CHN PLAY INFO 2(continue)—————————————————————————————————————————————————————-
LayerId ChnId DisplayPts PrePts CurrPts ScalePts SetPts RecvCurPts
0 0 0 0 0 0 -1 0

——-BySingle CHN STATUS 1————————————————————————————————————————————————————————
LayerId ChnId Job Task QueryLCnt SendLCnt QCnt SCnt ChRpt DRpt ShouD Dsped b2Scl ChnAddr DispAddr
0 0 0 0 0 0 0 0 0 92589 -1 -1 N 0x0 0xa2812000

——-BySingle CHN STATUS 2(continue)———————————————————————————————————————————————————
LayerId ChnId bBorder BorderWidth Color ChnFreeNum ChnBusyNum DispFreeNum DispBusyNum
0 0 N 0 0 10 0 13 0

——-BySingle CHN STATUS 3(continue)————————————————————————————
LayerId ChnId AspectRatioMode X Y Width Height BgColor CompressMode
0 0 NONE 0 0 0 0 0x0

——-CHN OTHER INFO———————————————————————————————
LayerId ChnId bZoom ZmTyp ZoomX ZoomY ZoomW ZoomH SrcW SrcH
0 0 N 0 0 0 0 0 0 0

——-GRAPHIC LAYER CSC PARAM——————————————-
LAYERID Matrix Luma Cont Hue Satu
0 9 50 50 50 50

——-DEV Int Status——————————————————————————————
DevId IntRate IntTime MaxIntT TimePrM IntGapT MaxGapT
0 59 51 122 3091 16677 16686

我来回答
回答可得5积分
7个回答
发布于 2020-12-10 11:01:27
最佳答案

搞定,可以结题了。
最终主要解决了三个问题:
1、sensor模组的中断一直没上来,后来通过示波器打表,发现模组硬件有问题
2、楼上寄存器按照手册,在ko和代码中进行了对应设置
3、海思sample代码有问题,在配置VPSS的时候,没有设置好第二条VPSS group和VPSS CH,需要整改代码

1
发布于 2020-11-16 09:58:09

自己顶一下,我分析了一下VI,发现有两个数据不太对:
1、VI PIPE NRX_V2 PARAM中的ISO总是为0
2、VI CHN CROP INFO中的TrimWid和TrimHgt总是为0
但是不知道这两个参数该怎么设置。

0
发布于 2020-11-20 11:06:53

继续顶一下,图像暂时还是没有调出来,大概率感觉是中断没上来,也就是硬件输入这块应该有点不对。

另外,这两天又看了下,发现系统初始化sys_config.c中有BT.656相关寄存器的配置。

static int g_cmos_yuv_flag = 0; / vi: 0—RAW, 1—BT1120/DC, 2—BT656 /
这里应该要改成2

然后才会调用到下面这个函数对BT.656的寄存器配置,比我之前用pinout表生成.reg,然后烧到uboot中更方便。
void vi_bt656_mode_mux(void)
{
SYS_WRITEL(reg_iocfg_base+0x0040 ,0x471);
SYS_WRITEL(reg_iocfg_base+0x0044 ,0x471);
SYS_WRITEL(reg_iocfg_base+0x0048 ,0x471);
SYS_WRITEL(reg_iocfg_base+0x004C ,0x471);
SYS_WRITEL(reg_iocfg_base+0x0050 ,0x471);
SYS_WRITEL(reg_iocfg_base+0x0054 ,0x471);
SYS_WRITEL(reg_iocfg_base+0x0058 ,0x471);
SYS_WRITEL(reg_iocfg_base+0x005C ,0x471);
SYS_WRITEL(reg_iocfg_base+0x0068 ,0x461);
SYS_WRITEL(reg_gpio_base+0x4400 ,0xff);
SYS_WRITEL(reg_gpio_base+0x43fc ,0xff);
}

0
发布于 2020-12-07 20:45:38

继续顶。
sys_config是在load3516dv300中加载的,并且相关参数通过加载带进去的:

# sys config
insmod sys_config.ko chip=$CHIP_TYPE sensors=sns0=$SNS_TYPE0,sns1=$SNS_TYPE1, g_cmos_yuv_flag=$YUV_TYPE0

所以不需要在sysconfig.c中更改g_cmos_yuv_flag,只需要修改load3516dv300脚本中的YUV_TYPE0取值即可。

另外,发现ko加载之后,寄存器的值还是会被刷新,所以其实设置是无效的。
看了一下代码,比如MIPI_RX的寄存器PHY_MODE_LINK,实在mipi rx的驱动代码中更改的,在文件mipi_rx_hal.c中,修改mipi_rx_drv_set_phy_en_link()函数,在其中设置需要的寄存器取值,查看了一下,发现设置成功了。
但是目前只搞定了PHY_MODE_LINK、PHY_EN_LINK和8个VI的寄存器,还有一些VICAP什么的寄存器还没找到设置的驱动代码,翻了一下海思的寄存器手册,我清理的寄存器清单如下,姑且认为搞定VI采集BT656需要这些,不知道是否齐全:
寄存器含义 寄存器名称
VI_DATA0 iocfg_reg34
VI_DATA1 iocfg_reg35
VI_DATA2 iocfg_reg36
VI_DATA3 iocfg_reg37
VI_DATA4 iocfg_reg38
VI_DATA5 iocfg_reg39
VI_DATA6 iocfg_reg40
VI_DATA7 iocfg_reg41
VI_CLK iocfg_reg44
MIPI Rx PHY_MODE_LINK
MIPI Rx PHY_EN_LINK
VICAP CMUX_SEL
VICAP CMUX_ID_CFG
VICAP ISP_MODE
VICAP VICAP_INT_MASK
VICAP PT_INTF_MOD
VICAP PT_BT656_CFG
VICAP PT_INT_MASK

0
发布于 2021-09-13 18:53:37

感谢楼主的分享

0
发布于 2021-09-13 18:57:15

不知道楼主还会不会上论坛,想问下dev pipe chn的结构体是如何填充的

0
发布于 2021-09-17 11:36:42

0
+ 添加网盘链接/附件
或将文件直接拖到这里
悬赏:
EBC
文件格式必须为doc,docx,xls,xlsx,pdf,ppt,pptx,txt,zip,rar,tar,7z,gz
网盘
* 网盘链接:
* 提取码:
悬赏:
EBC
易百纳技术社区
确定要删除此文章、专栏、评论吗?
确定
取消
易百纳技术社区