This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Errors in Froyo and Gingerbread using an USB Webcam

Other Parts Discussed in Thread: DM3730

Hi everyone,

I'm using DM3730 with Android in a DevKit from LogicPD. I want to use an USB webcam but I can't. I have a Logitech c910 and it is an UVC camera:

  http://logitech-en-amr.custhelp.com/app/answers/detail/a_id/6471/~/uvc-webcam-support-for-mac-os-10.4.9-and-later

I have followed many links and I can't find someone with same error. I just prove cam with froyo and gingerbread and I receive different errors. Obviously, I have built the kernel in both OS.

* (1) FROYO

It detects UVC cam and it creates /dev/video0: (shell)

usb 2-1.1: New USB device found, idVendor=046d, idProduct=0821
usb 2-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=1
usb 2-1.1: SerialNumber: BE66D3D0
PM: Adding info for usb:2-1.1
PM: Adding info for usb:2-1.1:1.0
PM: Adding info for No Bus:card1
PM: Adding info for No Bus:pcmC1D0c
PM: Adding info for No Bus:controlC1
PM: Adding info for usb:2-1.1:1.1
PM: Adding info for usb:2-1.1:1.2
uvcvideo: Found UVC 1.00 device <unnamed> (046d:0821)
PM: Adding info for No Bus:video0
PM: Adding info for No Bus:input3
input: UVC Camera (046d:0821) as /devices/platform/isp1763/usb2/2-1/2-1.1/2-1.1:1.2/input/input3
PM: Adding info for No Bus:event3
PM: Adding info for No Bus:ep_87
PM: Adding info for usb:2-1.1:1.3
PM: Adding info for No Bus:usbdev2.3
PM: Adding info for No Bus:ep_00

when I run camera app from Android I see in logcat this error:

01-01 07:21:05.742: DEBUG/dalvikvm(264): GC_EXTERNAL_ALLOC freed 9890 objects / 481936 bytes in 141ms
01-01 07:21:09.148: INFO/ActivityManager(190): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.camera/.Camera }
01-01 07:21:09.210: INFO/ActivityManager(190): Start proc com.android.camera for activity com.android.camera/.Camera: pid=438 uid=10004 gids={1006, 1015}
01-01 07:21:09.523: DEBUG/CameraHardware(58): Set Parameter...!!
01-01 07:21:09.523: DEBUG/CameraHardware(58): preview width:320,height:240
01-01 07:21:09.523: DEBUG/CameraHardware(58): Validating 1600, 320 and 1200, 240
01-01 07:21:09.523: DEBUG/CameraHardware(58): Validating 1024, 320 and 768, 240
01-01 07:21:09.531: DEBUG/CameraHardware(58): Validating 640, 320 and 480, 240
01-01 07:21:09.531: DEBUG/CameraHardware(58): Validating 352, 320 and 288, 240
01-01 07:21:09.531: DEBUG/CameraHardware(58): Validating 320, 320 and 240, 240
01-01 07:21:09.531: DEBUG/CameraHardware(58): picture width:320,height:240
01-01 07:21:09.531: DEBUG/CameraHardware(58): Validating 1600, 320 and 1200, 240
01-01 07:21:09.531: DEBUG/CameraHardware(58): Validating 1024, 320 and 768, 240
01-01 07:21:09.531: DEBUG/CameraHardware(58): Validating 640, 320 and 480, 240
01-01 07:21:09.531: DEBUG/CameraHardware(58): Validating 352, 320 and 288, 240
01-01 07:21:09.531: DEBUG/CameraHardware(58): Validating 320, 320 and 240, 240
01-01 07:21:09.531: DEBUG/CameraHardware(58): Preview Format:yuv422sp,Picture Format:jpeg
01-01 07:21:09.570: DEBUG/Camera(438): app passed NULL surface
01-01 07:21:09.585: DEBUG/CameraHardware(58): Set Parameter...!!
01-01 07:21:09.585: DEBUG/CameraHardware(58): preview width:320,height:240
01-01 07:21:09.585: DEBUG/CameraHardware(58): Validating 1600, 320 and 1200, 240
01-01 07:21:09.585: DEBUG/CameraHardware(58): Validating 1024, 320 and 768, 240
01-01 07:21:09.585: DEBUG/CameraHardware(58): Validating 640, 320 and 480, 240
01-01 07:21:09.585: DEBUG/CameraHardware(58): Validating 352, 320 and 288, 240
01-01 07:21:09.585: DEBUG/CameraHardware(58): Validating 320, 320 and 240, 240
01-01 07:21:09.585: DEBUG/CameraHardware(58): picture width:1600,height:1200
01-01 07:21:09.585: DEBUG/CameraHardware(58): Validating 1600, 1600 and 1200, 1200
01-01 07:21:09.585: DEBUG/CameraHardware(58): Preview Format:yuv422sp,Picture Format:jpeg
01-01 07:21:09.585: VERBOSE/camera(438): startPreview
01-01 07:21:09.585: DEBUG/CameraHardware(58): startPreview :opening device!!!!,width:320,height:240
01-01 07:21:09.640: ERROR/V4L2Camera(58): StartStreaming: Unable to start capture: Broken pipe
01-01 07:21:09.640: ERROR/CameraHardware(58): Camera StartStreaming fail: Broken pipe
01-01 07:21:09.648: WARN/dalvikvm(438): threadid=8: thread exiting with uncaught exception (group=0x4001d7c8)
01-01 07:21:09.648: ERROR/AndroidRuntime(438): FATAL EXCEPTION: Thread-9
01-01 07:21:09.648: ERROR/AndroidRuntime(438): java.lang.RuntimeException: startPreview failed
01-01 07:21:09.648: ERROR/AndroidRuntime(438):     at com.android.camera.Camera.startPreview(Camera.java:1677)
01-01 07:21:09.648: ERROR/AndroidRuntime(438):     at com.android.camera.Camera.access$61(Camera.java:1655)
01-01 07:21:09.648: ERROR/AndroidRuntime(438):     at com.android.camera.Camera$4.run(Camera.java:930)
01-01 07:21:09.648: ERROR/AndroidRuntime(438):     at java.lang.Thread.run(Thread.java:1096)
01-01 07:21:09.648: ERROR/AndroidRuntime(438): Caused by: java.lang.RuntimeException: startPreview failed
01-01 07:21:09.648: ERROR/AndroidRuntime(438):     at android.hardware.Camera.startPreview(Native Method)
01-01 07:21:09.648: ERROR/AndroidRuntime(438):     at com.android.camera.Camera.startPreview(Camera.java:1674)
01-01 07:21:09.648: ERROR/AndroidRuntime(438):     ... 3 more
01-01 07:21:09.671: WARN/ActivityManager(190):   Force finishing activity com.android.camera/.Camera
01-01 07:21:09.851: DEBUG/dalvikvm(190): GC_FOR_MALLOC freed 7822 objects / 638632 bytes in 64ms
01-01 07:21:10.179: WARN/ActivityManager(190): Activity pause timeout for HistoryRecord{442181c0 com.android.camera/.Camera}
01-01 07:21:13.765: INFO/Process(438): Sending signal. PID: 438 SIG: 9
01-01 07:21:13.781: INFO/ActivityManager(190): Process com.android.camera (pid 438) has died.
01-01 07:21:13.906: WARN/InputManagerService(190): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@440276b8
01-01 07:21:20.273: WARN/ActivityManager(190): Activity destroy timeout for HistoryRecord{442181c0 com.android.camera/.Camera}

and in the shell I have seen:

PM: Adding info for No Bus:ep_81
PIPE_ISOCHRONOUS ain't supported
uvcvideo: Failed to submit URB 0 (-32).

Could you explain me why I have this error? I was seen in other post (http://e2e.ti.com/support/dsp/sitara_arm174_microprocessors/f/416/t/157015.aspx) that I should see v4l in /dev but I haven't seen it yet.

* (2) GINGERBREAD

It detects UVC cam and it creates /dev/video0 too: (shell)


[    5.577484] platform mpu.0: omap_voltage_scale: Already at the requestedrate 600000000
<4>mmc0: host does not support reading read-only switch. assuming write-enable.

[    5.601440] mmc0: host does not support reading read-only switch. assuming write-enable.
<6>mmc0: new high speed SDHC card at address 0007

[    5.626647] mmc0: new high speed SDHC card at address 0007
<6>mmcblk0: mmc0:0007 SD4GB 3.70 GiB

[    5.636383] mmcblk0: mmc0:0007 SD4GB 3.70 GiB
<6> mmcblk0: p1 p2

[    5.646331]  mmcblk0: p1 p2
omap_hsmmc_235_set_power: power_on 1

[    5.653533] omap_hsmmc_235_set_power: power_on 1
omap_hsmmc_235_set_power: power_on 0

[    5.781982] omap_hsmmc_235_set_power: power_on 0
<6>usb 1-1.1: New USB device found, idVendor=046d, idProduct=0821

[    5.876068] usb 1-1.1: New USB device found, idVendor=046d, idProduct=0821
<6>usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=1

[    5.889739] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=1
<6>usb 1-1.1: SerialNumber: BE66D3D0

[    5.900817] usb 1-1.1: SerialNumber: BE66D3D0
<4>platform iva.0: omap_voltage_scale: Already at the requestedrate 520000000

[    5.913940] platform iva.0: omap_voltage_scale: Already at the requestedrate 520000000
<4>platform mpu.0: omap_voltage_scale: Already at the requestedrate 600000000

[    5.929351] platform mpu.0: omap_voltage_scale: Already at the requestedrate 600000000
<6>twl_rtc twl_rtc: setting system clock to 2000-01-01 07:33:43 UTC (946712023)

[    5.953460] twl_rtc twl_rtc: setting system clock to 2000-01-01 07:33:43 UTC (946712023)
<6>omap_vout omap_vout: Buffer Size = 3686400

[    5.966339] omap_vout omap_vout: Buffer Size = 3686400
<6>omap_vout omap_vout: : registered and initialized video device 0

[    5.990661] omap_vout omap_vout: : registered and initialized video device 0
<6>omap_vout omap_vout: Buffer Size = 3686400

[    6.002288] omap_vout omap_vout: Buffer Size = 3686400
<6>omap_vout omap_vout: : registered and initialized video device 1

[    6.014831] omap_vout omap_vout: : registered and initialized video device 1
<6>uvcvideo: Found UVC 1.00 device <unnamed> (046d:0821)

[    6.380706] uvcvideo: Found UVC 1.00 device <unnamed> (046d:0821)
<6>input: UVC Camera (046d:0821) as /devices/platform/isp1763/usb1/1-1/1-1.1/1-1.1:1.2/input/input3

[    6.410461] input: UVC Camera (046d:0821) as /devices/platform/isp1763/usb1/1-1/1-1.1/1-1.1:1.2/input/input3
<6>EXT3-fs: barriers not enabled

when I run camera app from Android I see in logcat this error:

I/ActivityManager(  234): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.camera/.Camera } from pid 319
I/ActivityManager(  234): Start proc com.android.camera for activity com.android.camera/.Camera: pid=530 uid=10009 gids={1006, 1015}
V/CameraHolder(  530): open camera 0
V/Camera  (  530): connect
D/CameraHardwareStub(   79): initHeapLocked: preview size=320x240
I/StagefrightPlayer(   79): setDataSource('/system/media/audio/ui/camera_click.ogg')
I/StagefrightPlayer(   79): setDataSource('/system/media/audio/ui/VideoRecord.ogg')
V/Camera  (  530): getParameters
V/Camera  (  530): getParameters
V/Camera  (  530): setPreviewDisplay
D/Camera  (  530): app passed NULL surface
V/Camera  (  530): sendCommand
V/Camera  (  530): getParameters
V/Camera  (  530): setParameters
D/CameraHardwareStub(   79): initHeapLocked: preview size=320x240
V/camera  (  530): startPreview
V/Camera  (  530): startPreview
D/dalvikvm(  234): GREF has increased to 401
V/Camera  (  530): setPreviewDisplay
I/ActivityManager(  234): Displayed com.android.camera/.Camera: +1s377ms
W/OrientationEventListener(  530): Cannot detect sensors. Not enabled
D/dalvikvm(  530): GC_CONCURRENT freed 467K, 51% free 2872K/5767K, external 901K/1038K, paused 2ms+2ms
E/SurfaceFlinger(  234): LayerBuffer::BufferSource::postBuffer() invalid buffer (offset=345600, size=153600, heap-size=462848
W/AudioPolicyManagerALSA(   79): AudioPolicyManagerALSA::getStrategyForStream() Stub Called...
W/AudioPolicyManagerALSA(   79):  redirecting AudioPolicyManagerALSA::getStrategy()
D/libEGL  (  530): loaded /system/lib/egl/libGLES_android.so
D/libEGL  (  530): loaded /system/lib/egl/libEGL_POWERVR_SGX530_125.so
D/libEGL  (  530): loaded /system/lib/egl/libGLESv1_CM_POWERVR_SGX530_125.so
D/libEGL  (  530): loaded /system/lib/egl/libGLESv2_POWERVR_SGX530_125.so
V/GLRootView(  530): onSurfaceChanged: 355x266, gl10: com.google.android.gles_jni.GLImpl@406ce180
V/GLRootView(  530): layout content pane 355x266
D/dalvikvm(  234): GC_CONCURRENT freed 811K, 43% free 4392K/7687K, external 1775K/2975K, paused 2ms+10ms
E/SurfaceFlinger(  234): LayerBuffer::BufferSource::postBuffer() invalid buffer (offset=345600, size=153600, heap-size=462848
E/SurfaceFlinger(  234): LayerBuffer::BufferSource::postBuffer() invalid buffer (offset=345600, size=153600, heap-size=462848
E/SurfaceFlinger(  234): LayerBuffer::BufferSource::postBuffer() invalid buffer (offset=345600, size=153600, heap-size=462848
E/SurfaceFlinger(  234): LayerBuffer::BufferSource::postBuffer() invalid buffer (offset=345600, size=153600, heap-size=462848
E/SurfaceFlinger(  234): LayerBuffer::BufferSource::postBuffer() invalid buffer (offset=345600, size=153600, heap-size=462848
E/SurfaceFlinger(  234): LayerBuffer::BufferSource::postBuffer() invalid buffer (offset=345600, size=153600, heap-size=462848
V/camera  (  530): stopPreview
V/Camera  (  530): stopPreview
V/Camera  (  530): stopPreview
V/Camera  (  530): setPreviewCallbackFlags
V/Camera  (  530): disconnect
W/OrientationEventListener(  530): Cannot detect sensors. Invalid disable
E/dhcpcd  (   84): timed out

In this case, the app haven't broken and the error from SurfaceFlinger always appear.

I am seeing that many people use Logitech Webcam Pro 9000 and it runs well with froyo and gingerbread. But, I think that c910 don't have many differences with Pro 9000 and it could be used with Android...

Any suggestion are appreciate.