wb4916 发表于 2015-7-11 00:02:06

请问cubieboard2怎样点亮USB摄像头?

USB摄像头已经在WIN7 64位的系统上面确认是好的!(AMCAP.EXE可以点亮,驱动通过驱动人生安装的)
http://item.jd.com/1557859532.html
现代(HYUNDAI)HYC-W800 免驱 网络高清摄像头 外置麦克风 蓝色
国际品牌,5G高清镀膜镜头,外置高保真麦克风,内置4盏LED夜视灯,超强防盗防滑底座设计!




系统:android4.2.2
2)在百度云下载源码压缩包:
http://pan.baidu.com/s/1kTFXnPP




http://blog.csdn.net/lynchyo/article/details/38400481
cubieboard2使用ov7670模块

按照这个帖子,点亮了OV7670。




root@android:/dev # ll video*
crwxrwxrwx system   system    81,   1 1970-01-02 08:49 video0
crwxrwxrwx system   system    81,   0 1970-01-02 08:05 video1
root@android:/dev #

http://www.waveshare.net/shop/DVK522.htm
DVK522的扩展板主页上说明:USB CAMERA会被配置成为/dev/video0的
CSI CAMERA(OV7670)        VIDEO1
USB CAMERA        VIDEO0




插入USB摄像头,在穿口中敲入:dmesg,可以看见这个。

<6>: cpu(0) try to kill cpu(1)
<6>: cpu1 is killed!
<6>usb 4-1: new high-speed USB device number 3 using sw-ehci
<6>uvcvideo: Found UVC 1.00 device USB2.0 Camera (1871:2000)
<6>input: USB2.0 Camera as /devices/platform/sw-ehci.2/usb4/4-1/4-1:1.0/input/input9
<7>cpu up:1
<7>CPU1: Booted secondary processor
<6>init: waitpid returned pid 4600, status = 00000000
<3>init: untracked pid 4600 exited
<5>CPU1: shutdown
<6>: cpu(0) try to kill cpu(1)




查看logcat可以得到:
root@android:/dev # logcat -c
root@android:/dev # logcat
--------- beginning of /dev/log/system
W/SocketClient( 1311): write error (Broken pipe)
--------- beginning of /dev/log/main
V/alsa_pcm( 1317): pcm_open_req, playback card: 0, device: 0, req_rate: 44100
V/alsa_pcm( 1317): size rate is 9
V/alsa_pcm( 1317): pcm_open_req try channels: 2, rate: 44100
V/alsa_pcm( 1317): pcm_open_req OK config->rate: 44100
I/ActivityManager( 2047): START u0 {act=android.intent.action.MAIN cat= flg=0x10200000 cmp=com.android.gallery3d/com.android.camera.CameraLauncher} from pid 2551
D/PermissionCache( 1314): checking android.permission.READ_FRAME_BUFFER for uid=1000 => granted (319 us)
E/SurfaceFlinger( 1314): ro.sf.lcd_density must be defined as a build property
I/ActivityManager( 2047): Start proc com.android.gallery3d for activity com.android.gallery3d/com.android.camera.CameraLauncher: pid=3370 uid=10016 gids={50016, 1006, 3003, 1015, 1028}
I/qtaguid ( 2047): Failed write_ctrl(s 1 10016) res=-1 errno=1
W/NetworkManagementSocketTagger( 2047): setKernelCountSet(10016, 1) failed with errno -1
E/Trace   ( 3370): error opening trace file: No such file or directory (2)
D/dalvikvm( 2047): GC_CONCURRENT freed 1686K, 27% free 6949K/9508K, paused 2ms+7ms, total 111ms
D/HALCameraFactory( 1317): There is 1 attached cameras and 1 removable cameras
D/HALCameraFactory( 1317): There is 1 attached cameras and 1 removable cameras
D/HALCameraFactory( 1317): There is 1 attached cameras and 1 removable cameras
I/CameraHolder( 3370): getNumberOfCameras = 2
V/CameraHolder( 3370): open camera 1
I/AwesomePlayer( 1317): setDataSource_l(URL suppressed)
I/AwesomePlayer( 1317): setDataSource_l(URL suppressed)
V/StateManager( 3370): startState class com.android.gallery3d.app.PhotoPage
I/CameraClient( 1317): Opening camera 1
D/HALCameraFactory( 1317): Calling process is: com.android.gallery3d
D/CameraHardware( 1317): ........................... to do initDefaultParameters
V/NFC   ( 3370): this device does not have NFC support
W/OrientationEventListener( 3370): Cannot detect sensors. Not enabled
W/dalvikvm( 3370): threadid=13: thread exiting with uncaught exception (group=0x41a13930)
W/OrientationEventListener( 3370): Cannot detect sensors. Not enabled
E/AndroidRuntime( 3370): FATAL EXCEPTION: Thread-107
E/AndroidRuntime( 3370): java.lang.RuntimeException: Unexpected Jpeg encoding quality levels 0
E/AndroidRuntime( 3370):         at android.media.CameraProfile.getImageEncodingQualityLevels(CameraProfile.java:99)
E/AndroidRuntime( 3370):         at android.media.CameraProfile.getJpegEncodingQualityParameter(CameraProfile.java:84)
E/AndroidRuntime( 3370):         at com.android.camera.PhotoModule.updateCameraParametersPreference(PhotoModule.java:2236)
E/AndroidRuntime( 3370):         at com.android.camera.PhotoModule.setCameraParameters(PhotoModule.java:2318)
E/AndroidRuntime( 3370):         at com.android.camera.PhotoModule.access$1300(PhotoModule.java:87)
E/AndroidRuntime( 3370):         at com.android.camera.PhotoModule$CameraStartUpThread.run(PhotoModule.java:327)
W/ActivityManager( 2047):   Force finishing activity com.android.gallery3d/com.android.camera.CameraLauncher
D/CameraStorage( 3370): External storage state=mounted
W/OrientationEventListener( 3370): Cannot detect sensors. Invalid disable
W/OrientationEventListener( 3370): Cannot detect sensors. Invalid disable
E/SurfaceFlinger( 1314): ro.sf.lcd_density must be defined as a build property
W/ActivityManager( 2047): Activity pause timeout for ActivityRecord{42130908 u0 com.android.gallery3d/com.android.camera.CameraLauncher}
E/SurfaceFlinger( 1314): ro.sf.lcd_density must be defined as a build property
W/BufferQueue( 1314): freeAllBuffersLocked called but mQueue is not empty
I/qtaguid ( 2047): Failed write_ctrl(s 0 10016) res=-1 errno=1
W/NetworkManagementSocketTagger( 2047): setKernelCountSet(10016, 0) failed with errno -1
I/ActivityManager( 2047): No longer want com.google.android.inputmethod.latin.dictionarypack (pid 2619): empty #17
I/Process ( 3370): Sending signal. PID: 3370 SIG: 9
W/CameraService( 1317): Disconnecting camera client 0x419518f8 since the binder for it died (this pid 1317)
I/WindowState( 2047): WIN DEATH: Window{41f7b568 u0 com.android.gallery3d/com.android.camera.CameraLauncher}
I/ActivityManager( 2047): Process com.android.gallery3d (pid 3370) has died.
W/InputMethodManagerService( 2047): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4222b5c0 attribute=null, token = android.os.BinderProxy@42267da0
D/V4L2CameraDevice( 1317): sunxi_alloc_close ok
D/CallbackNotifier( 1317): savePictureThread exit
I/CameraClient( 1317): Destroying camera 1
W/AudioFlinger( 1317): session id 8 not found for pid 1317
W/AudioFlinger( 1317): session id 9 not found for pid 1317




W/SocketClient( 1311): write error (Broken pipe)
D/dalvikvm( 2975): GC_CONCURRENT freed 1923K, 41% free 4146K/6936K, paused 3ms+1ms, total 29ms
W/SocketClient( 1311): write error (Broken pipe)

W/ThrottleService( 2047): unable to find stats for iface rmnet0

W/SocketClient( 1311): write error (Broken pipe)
W/SocketClient( 1311): write error (Broken pipe)
D/dalvikvm( 2975): GC_CONCURRENT freed 1923K, 41% free 4145K/6936K, paused 3ms+1ms, total 22ms
W/SocketClient( 1311): write error (Broken pipe)
D/dalvikvm( 2047): GC_CONCURRENT freed 1765K, 28% free 7131K/9776K, paused 3ms+5ms, total 61ms
W/SocketClient( 1311): write error (Broken pipe)
W/SocketClient( 1311): write error (Broken pipe)





wb4916 发表于 2015-7-11 08:42:56

BAIDU网盘的系统有改动的文件:
logcat的文件:




正常打开 /dev/video1 的logcat语句:
root@android:/dev #
root@android:/dev # ll video*
crwxrwxrwx system   system    81,   1 1970-01-01 08:00 video0
crwxrwxrwx system   system    81,   0 1970-01-01 08:00 video1
root@android:/dev # ll a20*
crw------- root   root   242,   0 1970-01-01 08:00 a20_ov7670
root@android:/dev #
root@android:/dev #
root@android:/dev # logcat -c
root@android:/dev # logcat
--------- beginning of /dev/log/system
W/SocketClient( 1313): write error (Broken pipe)
I/ActivityManager( 2417): START u0 {act=android.intent.action.MAIN cat= flg=0x10200000 cmp=com.android.gallery3d/com.android.camera.CameraLauncher} from pid 3686
--------- beginning of /dev/log/main
V/alsa_pcm( 1319): pcm_open_req, playback card: 0, device: 0, req_rate: 44100
V/alsa_pcm( 1319): size rate is 9
V/alsa_pcm( 1319): pcm_open_req try channels: 2, rate: 44100
V/alsa_pcm( 1319): pcm_open_req OK config->rate: 44100
D/PermissionCache( 1316): checking android.permission.READ_FRAME_BUFFER for uid=1000 => granted (429 us)
E/SurfaceFlinger( 1316): ro.sf.lcd_density must be defined as a build property
I/qtaguid ( 2417): Failed write_ctrl(s 1 10016) res=-1 errno=1
W/NetworkManagementSocketTagger( 2417): setKernelCountSet(10016, 1) failed with errno -1
D/HALCameraFactory( 1319): There is 1 attached cameras and 1 removable cameras
D/HALCameraFactory( 1319): There is 1 attached cameras and 1 removable cameras
V/CameraHolder( 3788): open camera 0
I/AwesomePlayer( 1319): setDataSource_l(URL suppressed)
I/AwesomePlayer( 1319): setDataSource_l(URL suppressed)
****wyb drivers/media/video/sunxi_csi/device/ov7670.c:917/sensor_ioctl()! cmd=0x0002, CSI_SUBDEV_CMD_GET_INFO=0x0001, CSI_SUBDEV_CMD_SET_INFO=0x0002
I/CameraClient( 1319): Opening camera 0
V/StateManager( 3788): startState class com.android.gallery3d.ap****wyb drivers/media/video/sunxi_csi/device/ov7670.c:962/sensor_ioctl()! info->ccm_info->mclk=27000000, info->ccm_info->vref=0, info->ccm_info->href=1, info->ccm_info->clock=1, info->ccm_info->iocfg=0
p.PhotoPage
****wyb drivers/media/video/sunxi_csi/device/ov7670.c:670/ov7670_power()! on=7 CSI_SUBDEV_STBY_ON=6, CSI_SUBDEV_STBY_OFF=7 CSI_SUBDEV_PWR_ON=8, CSI_SUBDEV_PWR_OFF=9
V/NFC   ( 3788): this device does not have NFC support
****wyb drivers/media/video/sunxi_csi/device/ov7670.c:630/csi_gpio_write()! gpio->gpio=181, level=1
****wyb drivers/media/video/sunxi_csi/device/ov7670.c:630/csi_gpio_write()! gpio->gpio=181, level=0
W/OrientationEventListener( 3788): Cannot detect sensors. Not enabled
W/OrientationEventListener( 3788): Cannot detect sensors. Not enabled
D/CameraStorage( 3788): External storage state=mounted
V/GLRootView( 3788): width 800, height 480
V/GLRootView( 3788): width 800, height 480
****wyb drivers/media/video/sunxi_csi/device/ov7670.c:630/csi_gpio_write()! gpio->gpio=181, level=1
E/SurfaceFlinger( 1316): ro.sf.lcd_density must be defined as a build property
D/libEGL( 3788): loaded /system/lib/egl/libEGL_mali.so
D/libEGL( 3788): loaded /system/lib/egl/libGLESv1_CM_mali.so
D/libEGL( 3788): loaded /system/lib/egl/libGLESv2_mali.so
W/BufferQueue( 1316): freeAllBuffersLocked called but mQueue is not empty
D/OpenGLRenderer( 3788): Enabling debug mode 0
I/CAM_ScreenNail( 3788): preview layout size: 800/480
I/CAM_ScreenNail( 3788): aspect ratio clamping disabled
E/SurfaceFlinger( 1316): ro.sf.lcd_density must be defined as a build property
I/GalleryEGLConfigChooser( 3788): Config chosen: R8 G8 B8 A8 D24****wyb drivers/media/video/sunxi_csi/device/ov7670.c:892/ov7670_init()! ov7670_init
S8 ID9 CAVEAT12344
****wyb drivers/media/video/sunxi_csi/device/ov7670.c:845/ov7670_detect()! 2015-6-26 18:31
W/BufferQueue( 1316): freeAllBuf****wyb drivers/media/video/sunxi_csi/device/ov7670.c:555/ov7670_read()! reg=0x1c device addr=0x21
fersLocked called but mQueue is not empty
I/GLRootView( 3788): onSurfaceCh****wyb drivers/media/video/sunxi_csi/device/ov7670.c:555/ov7670_read()! reg=0x1d device addr=0x21
anged: 800x480, gl10: com.google.android.gles_jni.GLImpl@4255b2f8
I/GLRootView( 3788): layout content pane 800x480 (compensation 0)
D/PhotoView( 3788): compensation = 0, CameraRelativeFrame = Rect(0, 0 - 0, 0), mCameraRect = Rect(0, 0 - 0, 0)
****wyb drivers/media/video/sunxi_csi/device/ov7670.c:555/ov7670_read()! reg=0x0a device addr=0x21
D/dalvikvm( 3788): GC_CONCURRENT freed 814K, 26% free 5280K/7076****wyb drivers/media/video/sunxi_csi/device/ov7670.c:555/ov7670_read()! reg=0x0b device addr=0x21
K, paused 8ms+2ms, total 54ms
D/dalvikvm( 3788): WAIT_FOR_CONCURRENT_GC blocked 26ms
****wyb drivers/media/video/sunxi_csi/device/ov7670.c:594/ov7670_write()! reg=0x12, value=0x80
****wyb drivers/media/video/sunxi_csi/device/ov7670.c:594/ov7670_write()! reg=0x11, value=0x01
****wyb drivers/media/video/sunxi_csi/device/ov7670.c:594/ov7670_write()! reg=0x3a, value=0x04
****wyb drivers/media/video/sunxi_csi/device/ov7670.c:594/ov7670_write()! reg=0x12, value=0x00
I/ActivityManager( 2417): Displayed com.android.gallery3d/com.android.camera.CameraLauncher: +1s****wyb drivers/media/video/sunxi_csi/device/ov7670.c:594/ov7670_write()! reg=0x17, value=0x13
128ms
****wyb drivers/media/video/sunxi_csi/device/ov7670.c:594/ov7670_write()! reg=0x18, value=0x01
****wyb drivers/media/video/sunxi_csi/device/ov7670.c:594/ov7670_write()! reg=0x32, value=0xb6
****wyb drivers/media/video/sunxi_csi/device/ov7670.c:594/ov7670_write()! reg=0x19, value=0x02
****wyb drivers/media/video/sunxi_csi/device/ov7670.c:594/ov7670_write()! reg=0x1a, value=0x7a
****wyb drivers/media/video/sunxi_csi/device/ov7670.c:594/ov7670_write()! reg=0x03, value=0x0a
V/GLRootView( 3788): width 800, height 480
V/GLRootView( 3788): width 800, height 480
****wyb drivers/media/video/sunxi_csi/device/ov7670.c:594/ov7670_write()! reg=0x0c, value=0x00
****wyb drivers/media/video/sunxi_csi/device/ov7670.c:594/ov7670_write()! reg=0x3e, value=0x00
****wyb drivers/media/video/sunxi_csi/device/ov7670.c:594/ov7670_write()! reg=0x70, value=0x3a
****wyb drivers/media/video/sunxi_csi/device/ov7670.c:594/ov7670_write()! reg=0x71, value=0x35
****wyb drivers/media/video/sunxi_csi/device/ov7670.c:594/ov7670_write()! reg=0x72, value=0x11
****wyb drivers/media/video/sunxi_csi/device/ov7670.c:594/ov7670_write()! reg=0x73, value=0xf0
****wyb drivers/media/video/sunxi_csi/device/ov7670.c:594/ov7670_write()! reg=0xa2, value=0x02
****wyb drivers/media/video/sunxi_csi/device/ov7670.c:594/ov7670_write()! reg=0x15, value=0x00
D/dalvikvm( 3788): GC_FOR_ALLOC freed 34K, 23% free 6160K/7904K,****wyb drivers/media/video/sunxi_csi/device/ov7670.c:594/ov7670_write()! reg=0x7a, value=0x20
paused 19ms, total 21ms

……(更多请参见附件!!!!)
^C


wb4916 发表于 2015-7-11 08:51:58

奇怪的是,查看属性文件,没有看到关于 摄像头的部分呀!

130|root@android:/dev # getprop                                                
:
:
:
:
:
:
:
:
:
:
:
:
:
: []
: []
:
: []
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
: [-d/dev/ttyUSB2]
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
: []
:
:
:
: [-1]
:
: [-1]
:
:
:
:
:
:
:
:
: []
:
:
:
:
:
:
:
:
:
:
:
:
:
: []
: []
: []
root@android:/dev #

wb4916 发表于 2015-7-11 13:12:13

5寸RGB格式的LCD显示,

修改了:

增加了:/dev/video0
拔掉USB摄像头,确认没有设备节点:/dev/video0。插上就有了!

Z:\wyb\lcd5inch_cubieboard2_video1_csi1_i2c1_ov7670\video0_usbcam_cubieboard2_baidu\android\device\softwinner\sugar-cubieboard2\camera.cfg

;-------------------------------------------------------------------------------
; CAMERA_FACING_BACK
; gc0308 ov7670 ov5640 USBCamera(UVC)
;-------------------------------------------------------------------------------
camera_id = 1


;-------------------------------------------------------------------------------
; 1 for CAMERA_FACING_FRONT
; 0 for CAMERA_FACING_BACK
;-------------------------------------------------------------------------------
camera_facing = 1


;-------------------------------------------------------------------------------
; camera orientation (0, 90, 180, 270)
;-------------------------------------------------------------------------------
camera_orientation = 0


;-------------------------------------------------------------------------------
; driver device name
;-------------------------------------------------------------------------------
camera_device = /dev/video0


;-------------------------------------------------------------------------------
; device id
; for two camera devices with one CSI
;-------------------------------------------------------------------------------
device_id = 0

used_preview_size = 1
key_support_preview_size = 640x480
key_default_preview_size = 640x480

used_picture_size = 1
key_support_picture_size = 640x480
key_default_picture_size = 640x480
……(更多在附件中)




logcat中可以看见问题:
root@android:/dev # logcat -c
root@android:/dev # logcat
--------- beginning of /dev/log/system
I/ActivityManager( 2635): START u0 {act=android.intent.action.MAIN cat= flg=0x10200000 cmp=com.android.gallery3d/com.android.camera.CameraLauncher} from pid 4073
--------- beginning of /dev/log/main
V/alsa_pcm( 1320): pcm_open_req, playback card: 0, device: 0, req_rate: 44100
V/alsa_pcm( 1320): size rate is 9
V/alsa_pcm( 1320): pcm_open_req try channels: 2, rate: 44100
V/alsa_pcm( 1320): pcm_open_req OK config->rate: 44100
D/dalvikvm( 2635): GC_FOR_ALLOC freed 1311K, 36% free 7092K/11064K, paused 57ms, total 57ms
I/dalvikvm-heap( 2635): Grow heap (frag case) to 7.688MB for 124216-byte allocation
D/dalvikvm( 2635): GC_FOR_ALLOC freed <1K, 36% free 7213K/11188K, paused 49ms, total 49ms
E/SurfaceFlinger( 1317): ro.sf.lcd_density must be defined as a build property
I/ActivityManager( 2635): Start proc com.android.gallery3d for activity com.android.gallery3d/com.android.camera.CameraLauncher: pid=9038 uid=10016 gids={50016, 1006, 3003, 1015, 1028}
I/qtaguid ( 2635): Failed write_ctrl(s 1 10016) res=-1 errno=1
W/NetworkManagementSocketTagger( 2635): setKernelCountSet(10016, 1) failed with errno -1
E/Trace   ( 9038): error opening trace file: No such file or directory (2)
D/HALCameraFactory( 1320): There is 2 attached cameras and 0 removable cameras
D/HALCameraFactory( 1320): There is 2 attached cameras and 0 removable cameras
D/HALCameraFactory( 1320): There is 2 attached cameras and 0 removable cameras
I/CameraHolder( 9038): getNumberOfCameras = 2
V/CameraHolder( 9038): open camera 1
I/AwesomePlayer( 1320): setDataSource_l(URL suppressed)
V/StateManager( 9038): startState class com.android.gallery3d.app.PhotoPage
I/AwesomePlayer( 1320): setDataSource_l(URL suppressed)
V/NFC   ( 9038): this device does not have NFC support
I/CameraClient( 1320): Opening camera 1
E/V4L2CameraDevice( 1320): setAutoFocusCtrl failed, Invalid argument
D/HALCameraFactory( 1320): Calling process is: com.android.gallery3d
D/CameraHardware( 1320): ........................... to do initDefaultParameters
W/dalvikvm( 9038): threadid=13: thread exiting with uncaught exception (group=0x40d84930)
W/OrientationEventListener( 9038): Cannot detect sensors. Not enabled
E/AndroidRuntime( 9038): FATAL EXCEPTION: Thread-140





页: [1]
查看完整版本: 请问cubieboard2怎样点亮USB摄像头?