打印
[嵌入式linux]

IMX6Q android OV3640摄像头调试

[复制链接]
3297|9
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
环境:
IMX6Q android OV3640摄像头

现象:
640*480全景拍照正常,1280*720录像功能正常,2048*1536分辨率拍照花屏,

修改过程:
ov3640.c驱动文件,寄存器设置修改过,拍照还是花屏
HAL层代码,对比过TQ和飞凌的代码,差别不大。

部分源码见附件









花屏.png (535 KB )

花屏

花屏

ov3640 driver.zip

1.67 MB

ov3640驱动

libcamera2 HAL层代码.zip

85.69 KB

3640HAL层代码

相关帖子

沙发
wuhainihaoma|  楼主 | 2016-8-11 17:32 | 只看该作者
接楼上,补充。可以交换IMX6Q android驱动资料,LVDS、TP、SD、USB、音频、网卡、串口、CAN、RS485、VGA、HDMI、WIFI+BT等驱动多已经调通了。可以交换其中一个驱动资料。谢谢!我的邮箱 543027657@qq.com

使用特权

评论回复
板凳
airwill| | 2016-8-12 07:46 | 只看该作者
低分辨率已经正常, 高分辨率却花屏, 我想这应该有两个可能因素
1. 配置问题, 设置错误, 可以再仔细检查一下
2. 数据带宽限制, 高分辨率下数据量明显提高, 如果来不及采样和接收, 那么必然错误或花屏. 看看你的数据贪吐能力, 有没有使用 DMA, 或者也可以实际测试一下这个能力

使用特权

评论回复
地板
wuhainihaoma|  楼主 | 2016-8-12 15:42 | 只看该作者

使用特权

评论回复
5
wuhainihaoma|  楼主 | 2016-8-15 11:34 | 只看该作者
接上:下面logcat是拍照时的打印信息:
--------- beginning of /dev/log/main
W/AudioTrack( 2761): AUDIO_OUTPUT_FLAG_FAST denied by client due to mismatching sample rate (48000 vs 44)
--------- beginning of /dev/log/system
I/ActivityManager( 2761): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER9
W/audio_hw_primary( 2369): card 0, port 0 device 0x2
W/audio_hw_primary( 2369): rate 44100, channel 2 period_size 0xc0
D/PermissionCache( 2366): checking android.permission.READ_FRAME_BUFFER for uid=1000 => granted (200 us)
D/dalvikvm( 2761): GC_CONCURRENT freed 346K, 8% free 5507K/5932K, paused 4ms+4ms, total 49ms
D/dalvikvm( 2761): WAIT_FOR_CONCURRENT_GC blocked 42ms
I/ActivityManager( 2761): Start proc com.android.camera2 for activity com.android.camera2/com.android.ca}
D/dalvikvm( 3402): GC_CONCURRENT freed 105K, 6% free 3137K/3324K, paused 4ms+2ms, total 27ms
D/dalvikvm( 3402): WAIT_FOR_CONCURRENT_GC blocked 18ms
D/dalvikvm( 3402): GC_CONCURRENT freed 82K, 5% free 3447K/3604K, paused 3ms+2ms, total 24ms
D/dalvikvm( 3402): WAIT_FOR_CONCURRENT_GC blocked 6ms
V/NFC     ( 3402): this device does not have NFC support
V/CAM_PhotoModule( 3402): On resume.
V/CAM_PhotoModule( 3402): Executing onResumeTasks.
V/CAM_PhotoModule( 3402): Open camera device.
V/CameraHolder( 3402): open camera 0
I/AwesomePlayer( 2369): setDataSource_l(URL suppressed)
I/AwesomePlayer( 2369): setDataSource_l(URL suppressed)
I/Camera2ClientBase( 2369): Camera 0: Opened
I/FslCameraHAL( 2369): camera_device open+++2: 0
I/FslCameraHAL( 2369): DeviceAdapter: Create ov5640 csi device
I/FslCameraHAL( 2369): SupportedPictureSizes: 640 x 480
I/FslCameraHAL( 2369): SupportedPictureSizes: 320 x 240
I/FslCameraHAL( 2369): SupportedPictureSizes: 720 x 480
I/FslCameraHAL( 2369): SupportedPictureSizes: 720 x 576
I/FslCameraHAL( 2369): SupportedPictureSizes: 1280 x 720
I/FslCameraHAL( 2369): SupportedPictureSizes: 1024 x 768
I/FslCameraHAL( 2369): SupportedPictureSizes: 2048 x 1536
I/FslCameraHAL( 2369): SupportedPreviewSizes: 1280 x 720
I/FslCameraHAL( 2369): SupportedPreviewSizes: 320 x 240
I/FslCameraHAL( 2369): SupportedPreviewSizes: 720 x 480
I/FslCameraHAL( 2369): SupportedPreviewSizes: 720 x 576
I/FslCameraHAL( 2369): SupportedPreviewSizes: 640 x 480
I/FslCameraHAL( 2369): FrameDuration is 33331760, 30000000000
I/FslCameraHAL( 2369): mMaxWidth:2048, mMaxHeight:1536
I/FslCameraHAL( 2369): ov5640Csi, mFocalLength:3.370000, mPhysicalWidth:3.628800, mPhysicalHeight 2.72160
E/FslCameraHAL( 2369): cpu num 4
W/Camera2-Parameters( 2369): buildFastInfo: Camera 0: activeArraySize is missing xmin/ymin!
I/Camera2-Parameters( 2369): Camera 0: Disabling ZSL mode
W/CAM_PhotoModule( 3402): startPreview: surfaceTexture is not ready.
V/CAM_PhotoModule( 3402): Preview size is 640x480
W/CAM_PhotoModule( 3402): startPreview: surfaceTexture is not ready.
I/FslCameraHAL( 2369): DEBUG(CreateDefaultRequest): making template (1)
E/        ( 2761): Could not open (write-only) SysFs attribute "/sys/class/input/input2/fifo" (No such f.
D/        ( 2761): AccelSensor enable 1 , handle 1 ,mEnabled 1
D/        ( 2761): MagSensor mEnabled 1, OrientaionSensor mEnabled 0
E/SensorService( 2761): Error activating sensor 1 (Operation not permitted)
I/FslCameraHAL( 2369): DEBUG(CreateDefaultRequest): making template (3)
D/dalvikvm( 3402): GC_CONCURRENT freed 195K, 7% free 3700K/3968K, paused 3ms+3ms, total 30ms
D/dalvikvm( 3402): GC_FOR_ALLOC freed 38K, 7% free 3712K/3968K, paused 15ms, total 15ms
I/dalvikvm-heap( 3402): Grow heap (frag case) to 15.695MB for 12582928-byte allocation
D/dalvikvm( 3402): GC_FOR_ALLOC freed <1K, 2% free 16000K/16260K, paused 17ms, total 17ms
D/dalvikvm( 3402): GC_CONCURRENT freed 6K, 2% free 16013K/16260K, paused 2ms+5ms, total 23ms
D/LocationManager( 3402): provider does not exist provider doesn't exist: network
D/LocationManager( 3402): startReceivingLocationUpdates
D/CameraStorage( 3402): External storage state=mounted
D/libEGL  ( 3402): loaded /system/lib/egl/libEGL_VIVANTE.so
D/libEGL  ( 3402): loaded /system/lib/egl/libGLESv1_CM_VIVANTE.so
D/libEGL  ( 3402): loaded /system/lib/egl/libGLESv2_VIVANTE.so
E/BufferQueue( 2366): [com.android.camera2/com.android.camera.CameraLauncher] dequeueBuffer: can't dequet
D/OpenGLRenderer( 3402): Enabling debug mode 0
V/CAM_UI  ( 3402): SurfaceTexture ready.
V/CAM_PhotoModule( 3402): Preview size is 640x480
V/CAM_PhotoModule( 3402): startPreview
I/FslCameraHAL( 2369): RequestManager allocateStream...
I/FslCameraHAL( 2369): allocateStream preview stream, w:640, h:480, fmt:0x22
I/FslCameraHAL( 2369): actual format 0x103
I/FslCameraHAL( 2369): RequestManager allocateStream end...
I/FslCameraHAL( 2369): RequestManager registerStreamBuffers stream id:0
I/FslCameraHAL( 2369): registerBuffers total 5 buffer
I/FslCameraHAL( 2369): RequestManager registerStreamBuffers end...
I/FslCameraHAL( 2369): RequestManager allocateStream...
I/FslCameraHAL( 2369): allocateStream jpeg stream, w:2048, h:1536, fmt:0x21
I/FslCameraHAL( 2369): actual format 0x103
I/FslCameraHAL( 2369): RequestManager allocateStream end...
I/ActivityManager( 2761): Displayed com.android.camera2/com.android.camera.CameraLauncher: +1s620ms
I/FslCameraHAL( 2369): RequestManager registerStreamBuffers stream id:3
I/FslCameraHAL( 2369): RequestManager registerStreamBuffers end...
I/FslCameraHAL( 2369): notify_request_queue_not_empty running
I/FslCameraHAL( 2369): dispatchRequest running
I/FslCameraHAL( 2369): handleRequest running
I/FslCameraHAL( 2369): PreviewStream configure running
I/FslCameraHAL( 2369): pixel format: 0x3231564e
I/FslCameraHAL( 2369): Width * Height 640 x 480 format 0x3231564e, fps: 30
D/dalvikvm( 3402): GC_FOR_ALLOC freed 116K, 2% free 16216K/16408K, paused 22ms, total 24ms
I/dalvikvm-heap( 3402): Grow heap (frag case) to 27.905MB for 12582928-byte allocation
D/dalvikvm( 3402): GC_FOR_ALLOC freed 1K, 1% free 28503K/28700K, paused 24ms, total 24ms
D/dalvikvm( 3402): GC_CONCURRENT freed 7K, 1% free 28496K/28700K, paused 4ms+8ms, total 37ms
I/FslCameraHAL( 2369): PreviewStream start running
I/FslCameraHAL( 2369): StreamAdapter start running
I/FslCameraHAL( 2369): stream thread received STREAM_START command
I/FslCameraHAL( 2369): Created device thread
W/audio_hw_primary( 2369): do_out_standby... 1092417328
V/CAM_PhotoModule( 3402): Preview size is 640x480
V/CAM_PhotoModule( 3402): onShutterButtonClick: mCameraState=1
D/LocationManager( 3402): No location received yet.
I/FslCameraHAL( 2369): DEBUG(CreateDefaultRequest): making template (2)
E/Camera2-Device( 2369): triggerPrecaptureMetering: Error triggering precapture metering (id 1)
I/FslCameraHAL( 2369): tryRestartStreams stop unused stream 0
I/FslCameraHAL( 2369): PreviewStream stop running
V/CAM_PhotoModule( 3402): mShutterLag = 66ms
V/CAM_PhotoModule( 3402): mShutterToRawCallbackTime = 2ms
W/audio_hw_primary( 2369): card 0, port 0 device 0x2
W/audio_hw_primary( 2369): rate 44100, channel 2 period_size 0xc0
I/FslCameraHAL( 2369): device thread exit...
I/FslCameraHAL( 2369): StreamAdapter stop running
I/FslCameraHAL( 2369): stream thread received STREAM_STOP command
I/FslCameraHAL( 2369): StreamAdapter stop end
I/FslCameraHAL( 2369): PreviewStream release running
I/FslCameraHAL( 2369): StreamAdapter release running
I/FslCameraHAL( 2369): stream thread exiting...
E/BufferQueue( 3402): [unnamed-3402-0] cancelBuffer: slot 1 is not owned by the client (state=3)
E/BufferQueue( 3402): [unnamed-3402-0] cancelBuffer: slot 2 is not owned by the client (state=2)
I/FslCameraHAL( 2369): CaptureStream::configure
E/FslCameraHAL( 2369): getGpsCoordinates: error reading jpeg Coordinates tag
E/FslCameraHAL( 2369): getGpsTimeStamp: error reading jpeg TimeStamp tag
E/FslCameraHAL( 2369): getGpsProcessingMethod: error reading jpeg ProcessingMethod tag
I/FslCameraHAL( 2369): pixel format: 0x3231564e
I/FslCameraHAL( 2369): Width * Height 2048 x 1536 format 0x3231564e, fps: 15
E/FslCameraHAL( 2369): width:2048 height:1536 is not supported.
I/FslCameraHAL( 2369): allocateBufferFromIon buffer num:2
I/FslCameraHAL( 2369): CaptureStream::start
I/FslCameraHAL( 2369): StreamAdapter start running
I/FslCameraHAL( 2369): stream thread received STREAM_START command
I/FslCameraHAL( 2369): Created device thread
I/FslCameraHAL( 2369): device thread exit...
E/FslCameraHAL( 2369): getGpsCoordinates: error reading jpeg Coordinates tag
E/FslCameraHAL( 2369): getGpsTimeStamp: error reading jpeg TimeStamp tag
E/FslCameraHAL( 2369): getGpsProcessingMethod: error reading jpeg ProcessingMethod tag
I/FslCameraHAL( 2369): pixel format: 0x3231564e
I/FslCameraHAL( 2369): insertExifThumbnailImage. ReplaceThumbnail(). ret=1
E/FslCameraHAL( 2369): handleRequest:No more requests available
I/FslCameraHAL( 2369): handleRequest exiting
I/FslCameraHAL( 2369): stopAllStreams running
I/FslCameraHAL( 2369): CaptureStream::stop
I/FslCameraHAL( 2369): StreamAdapter stop running
I/FslCameraHAL( 2369): stream thread received STREAM_STOP command
I/FslCameraHAL( 2369): StreamAdapter stop end
I/FslCameraHAL( 2369): CaptureStream::release
I/FslCameraHAL( 2369): StreamAdapter release running
I/FslCameraHAL( 2369): stream thread exiting...
I/FslCameraHAL( 2369): freeBufferToIon buffer num:2
I/FslCameraHAL( 2369): stopAllStreams end
I/FslCameraHAL( 2369): handleRequest end...
W/Camera2-CaptureSequencer( 2369): Mismatched capture timestamps: Metadata frame 119144440017, captured 6
V/CAM_PhotoModule( 3402): mPictureDisplayedToJpegCallbackTime = 1881ms
V/CAM_PhotoModule( 3402): stopPreview
V/CAM_PhotoModule( 3402): Preview size is 640x480
V/CAM_PhotoModule( 3402): startPreview
I/FslCameraHAL( 2369): notify_request_queue_not_empty running
I/FslCameraHAL( 2369): dispatchRequest running
I/FslCameraHAL( 2369): handleRequest running
I/FslCameraHAL( 2369): PreviewStream configure running
I/FslCameraHAL( 2369): pixel format: 0x3231564e
I/FslCameraHAL( 2369): Width * Height 640 x 480 format 0x3231564e, fps: 30
D/CameraStorage( 3402): External storage state=mounted
V/CAM_PhotoModule( 3402): mJpegCallbackFinishTime = 19ms
I/FslCameraHAL( 2369): PreviewStream start running
I/FslCameraHAL( 2369): StreamAdapter start running
I/FslCameraHAL( 2369): stream thread received STREAM_START command
I/FslCameraHAL( 2369): Created device thread

想把拍照改成640*480分辨率,但是没有效果,代码看的不是很懂,求指点,谢谢!

使用特权

评论回复
6
rankey| | 2016-9-22 13:12 | 只看该作者
楼主的问题解决了吗?
  另外,我们的方案里有3个摄像头,用第三方APP做直播,时间稍微长了,切换摄像头就卡在原来的画面。

使用特权

评论回复
7
wuhainihaoma|  楼主 | 2016-9-23 09:19 | 只看该作者
rankey 发表于 2016-9-22 13:12
楼主的问题解决了吗?
  另外,我们的方案里有3个摄像头,用第三方APP做直播,时间稍微长了,切换摄像头就 ...

没有解决呢,直接改用OV5640去了。5640是OK的

使用特权

评论回复
8
rankey| | 2016-9-23 13:25 | 只看该作者
wuhainihaoma 发表于 2016-9-23 09:19
没有解决呢,直接改用OV5640去了。5640是OK的

用了MIPI摄像头了?

比如这样:
  [    3.005410] camera ov5640_mipi is found.

使用特权

评论回复
9
zhagnmanyi| | 2018-1-14 16:20 | 只看该作者
各位大佬;我用的5640sensor,我们现在的问题是打印log文件显示能发现摄像头,但是系统起来了之后,打开相机显示连接不到相机,求各位大佬帮忙下,联系电话18688717281同步微信,小弟不胜感激!

使用特权

评论回复
10
zhagnmanyi| | 2018-1-14 16:47 | 只看该作者
wuhainihaoma 发表于 2016-9-23 09:19
没有解决呢,直接改用OV5640去了。5640是OK的

您好,有加您qq,请教下我用5640遇到的问题:我们现在的问题是打印log文件显示能发现摄像头,但是系统起来了之后,打开相机显示连接不到相机,在线等,请大佬指点!

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

3

主题

8

帖子

2

粉丝