大家好,我现在使用DM368做高清摄像机遇到了很困惑的问题;
DM368通过TVP5146采集模拟标清信号,我这边是没有任何问题的;
但我们想做高清摄像机,DM368
EVM提供了TVP7002外接差分信号的高清方案,但我们想尽量减少功耗,不用TVP7002,我们使用了sony的PE1005S高清机芯,将数据线和同步信号直接接入DM368,由于机芯输出的信号标准是SMPTE 274M的,所以我设置采集方式为VPFE_BT1120时,是采集不到信号的;然后我设置成VPFE_YCBCR_SYNC_16模式来采集,由于机芯提供了外部的同步信号,所以我是可以从ISIF采集到YUV422的图像的,虽然由于信号里面有SAV和EAV信息导致图像有偏差,但我通过设置SPH可以把图像修正过来。
但随后问题出现了,我们要做H264编码,必须从IPIPE采集YUV420SP的图像,这时就采集不到图像了。
我深入调试了采集图像的过程,对VPFE的代码和手册也学习了下,但找不到原因。
我把我的思路跟大家分享下,看看能不能一起讨论下,能否解决我的问题?
直接从ISIF采集YUV422的图像,过程比较简单,如果图像信号符合BT656或BT1120标准,那么ISIF从信号中的EAV和SAV就可以自己产生行场同步信号,如果是逐行扫描,采集一帧数据的过程会有2个中断,其中半帧中断VINT1是ISIF内部产生的;如果是隔行扫描,采集一帧数据会产生2次VINT0中断;TI文档(DaVinciLinux_VPFECaptureDriverUsersGuide_SPRUGP6.pdf)的原话如下:
For this, VINT0 is configured to
occur at VD. This will generate the frame and field interrupts to align with the
frame and field start. VINT1 is configured to occur at midway in the frame.
For interlaced scan, frame interrupt
coincides with the top field (first field) interrupt and bottom field (second
field) interrupt happens at the middle of frame interrupts. For progressive
scan, only frame interrupts happens. VINT1 is configured to happens at midway
between frame interrupts for progressive scans.
我调试的记录如下,先看直接从ISIF采集YUV422的图像:
root@dm368-evm:/# ./v4l2_mmap_loopback -i 0
-p 1 -m 1
vpfe_isr field = 4
vpfe_isr field = 4
上面是通过tvp5146采集PAL制的D1图像,是隔行扫描的;
root@dm368-evm:/# ./v4l2_mmap_loopback -i 3
-p 1 -m 0
vpfe_vdint1_isr
vpfe_dev->fmt.fmt.pix.field = 1
vpfe_isr field = 1
上面是直接采集720 30P的数字机芯的图像,是逐行扫描的。
这2次调试,都能得到正常的YUV422的图像,也能验证上面的原理。
接下来我们看调试从IPIPE采集YUV420SP的过程;
root@dm368-evm:/#
./capture_prev_rsz_onthe_fly_yuv_pal -i
0 -p 1 -f 1
vpfe_imp_dma_isr
vpfe_dev->fmt.fmt.pix.field = 4
vpfe_isr field = 4
采集D1的图像成功,也可以看到有2个中断产生;
root@dm368-evm:/# ./capture_prev_rsz_onthe_fly_yuv -i 2 -p 1 -f 0
vpfe_isr field = 1
vpfe_isr field = 1
vpfe_isr field = 1
同样的程序,采集720P的数字信号,就遇到麻烦了,会有连续不断的vpfe_isr中断产生,程序采集不到图像,而且无法退出。
我在上面对capture_prev_rsz_onthe_fly_yuv程序做了些简化,去掉了display视频输出部分,直接把采集到的图像保存成文件;
下面是TI文档的原话,从IPIPE采集图像的时候,会有2个中断产生,但我采集数字机芯的时候,少了一个中断,导致采集不到图像。
Interrupt handling is concerned,
this is similar to the case when data is output from CCDC. Driver needs to decide
when to mark a frame buffer has completed capture and when to schedule next
frame for capture.
RSZ_INT_DMA (for DM365) or
(IPIPE_INT1_SDR) interrupt happens when the Resizer output image is written to
SDRAM. So this interrupt handling is used to free up current frame buffer and
schedule next frame buffer for capture. The buffer address is written to
Resizer register as part of this interrupt handling.
The assumption is that this
interrupt will occur before next frame data arrive at the Resizer.
vpfe_imp_dma_isr() is attached to
handle this interrupt.
The current frame is marked as
complete at VINT2 which is configured to occur at the end of the frame (height-1).
vpfe_isr() is attached to INT2 interrupt handling/
上面这段话,我没理解清楚,也不知道为什么采数字信号会少一个中断?
请有相关经验的朋友,一起讨论下,谢谢了!
Tuff Li:
建议适用TI IPNC框架来接机芯,请参考我的帖子
www.deyisupport.com/…/1115.aspx
James lin1:
请问问题解决了吗啊?