DM368外接YUV数字机芯的问题

LIDEHUA1975 2012-09-07 03:58:31
大家好,我现在使用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/
上面这段话,我没理解清楚,也不知道为什么采数字信号会少一个中断?
请有相关经验的朋友,一起讨论下,谢谢了!
...全文
705 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
铭雪 2014-11-04
  • 打赏
  • 举报
回复
各位大侠,弱弱的问一句,dm368视频信号接机芯,那么dm368这端,怎么取流,视频设备的驱动该如何修改?
chinazjn 2013-08-30
  • 打赏
  • 举报
回复
YUV422 to YUV420 可以通过resizer模块处理,然后送入编码
winner104 2013-08-14
  • 打赏
  • 举报
回复
机芯输出是raw data,不是YUV
s110500423 2012-11-02
  • 打赏
  • 举报
回复
兄台,怎样了?我最近也是做机芯的输入EH6300,图像全黑,没有数据过来,发现中断也是没有,不知道兄台如何解决?可否赐教!!
morris88 2012-09-08
  • 打赏
  • 举报
回复
有没公司用这个芯片做成功的?硬件上有无问题?

4,436

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 内核源代码研究区
社区管理员
  • 内核源代码研究区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧