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.

USB Camera in ICS, problems with image view

Other Parts Discussed in Thread: 4430

Hi everyone,

I'm using beaglebone with Android ICS and I want to use an USB camera (logitech c920) with this platform. I've seen many webs and threads in this forum talking about this topic and I saw how enable USB camera support in these links:

https://gitorious.org/rowboat/vendor-ti-am335xevm/commit/7198232cec46171ae8f6f35c796327c8abdbf4ff

http://gitorious.org/rowboat/hardware-ti-omap3/commit/386b90d2de47586eb0b892450daa6bbb1d6ce5b6

I've done it, and after it, I can use the camera, but the image isn't seen fine. I only can see the image correctly in the top of the screen. I have attached a photo with 3 images to see this error.

The logcat is:

W/AudioPolicyManagerBase(   69): getOutput() could not find output for stream 1, samplingRate 0, format 0, channels 3, flags 0
W/AudioPolicyManagerBase(   69): getOutput() could not find output for stream 1, samplingRate 0, format 0, channels 3, flags 0
W/AudioPolicyManagerBase(   69): getOutput() could not find output for stream 1, samplingRate 0, format 0, channels 3, flags 0
E/SoundPool(  195): Error creating AudioTrack
I/ActivityManager(  195): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.camera/.Camera} from pid 342
W/NetworkManagementSocketTagger(  195): setKernelCountSet(10044, 1) failed with errno -2
I/InputReader(  195): Reconfiguring input devices.  changes=0x00000004
I/InputReader(  195): Device reconfigured: id=1, name='ft5x06_ts', surface size is now 800x480, mode is 1
I/InputReader(  195): Device reconfigured: id=3, name='ti-tsc-adcc', surface size is now 800x480, mode is 1
I/ActivityManager(  195): Config changed: {1.0 0mcc0mnc en_US layoutdir=0 sw480dp w480dp h775dp lrg long port finger -keyb/v/h -nav/h s.10}
V/CameraHolder(  596): open camera 0
D/****CameraHAL(   69): cameraHal BACK 0
D/****CameraHAL(   69): cameraHal 0
I/CameraService(   69): Opening camera 0
I/****CameraHAL(   69): camera_device open
D/CameraHardware(   69): Set Parameter...!!
D/CameraHardware(   69): PreviewFormat yuv422sp
D/CameraHardware(   69): PictureFormat jpeg
D/CameraHardware(   69): preview width:320,height:240
D/CameraHardware(   69): picture width:320,height:240
D/CameraHardware(   69): FRAMERATE 15
D/CameraHardware(   69): Picture Size by CamHAL 320 x 240
D/CameraHardware(   69): Preview Resolution by CamHAL 320 x 240
D/CameraHardware(   69): enableMsgType:1037
I/AwesomePlayer(   69): setDataSource_l('/system/media/audio/ui/camera_click.ogg')
I/AwesomePlayer(   69): setDataSource_l('/system/media/audio/ui/VideoRecord.ogg')
D/CameraHardware(   69): Set Parameter...!!
D/CameraHardware(   69): PreviewFormat yuv422sp
D/CameraHardware(   69): PictureFormat jpeg
D/CameraHardware(   69): preview width:320,height:240
D/CameraHardware(   69): picture width:320,height:240
D/CameraHardware(   69): FRAMERATE 15
D/CameraHardware(   69): Picture Size by CamHAL 320 x 240
D/CameraHardware(   69): Preview Resolution by CamHAL 320 x 240
D/CameraHardware(   69): Set Parameter...!!
D/CameraHardware(   69): PreviewFormat yuv422sp
D/CameraHardware(   69): PictureFormat jpeg
D/CameraHardware(   69): preview width:320,height:240
D/CameraHardware(   69): picture width:320,height:240
D/CameraHardware(   69): FRAMERATE 15
D/CameraHardware(   69): Picture Size by CamHAL 320 x 240
D/CameraHardware(   69): Preview Resolution by CamHAL 320 x 240
D/Camera  (  596): app passed NULL surface
D/****CameraHAL(   69): cameraHal BACK 0
D/****CameraHAL(   69): cameraHal 0
D/CameraHardware(   69): Set Parameter...!!
D/CameraHardware(   69): PreviewFormat yuv422sp
D/CameraHardware(   69): PictureFormat jpeg
D/CameraHardware(   69): preview width:320,height:240
D/CameraHardware(   69): picture width:320,height:240
D/CameraHardware(   69): FRAMERATE 15
D/CameraHardware(   69): Picture Size by CamHAL 320 x 240
D/CameraHardware(   69): Preview Resolution by CamHAL 320 x 240
D/dalvikvm(  269): GC_CONCURRENT freed 417K, 70% free 7148K/23303K, paused 2ms+17ms
D/CameraHardware(   69): Set Parameter...!!
D/CameraHardware(   69): PreviewFormat yuv422sp
D/CameraHardware(   69): PictureFormat jpeg
D/CameraHardware(   69): preview width:640,height:480
D/CameraHardware(   69): picture width:640,height:480
D/CameraHardware(   69): FRAMERATE 15
D/CameraHardware(   69): Picture Size by CamHAL 640 x 480
D/CameraHardware(   69): Preview Resolution by CamHAL 640 x 480
D/CameraHardware(   69): Set Parameter...!!
D/CameraHardware(   69): PreviewFormat yuv422sp
D/CameraHardware(   69): PictureFormat jpeg
D/CameraHardware(   69): preview width:640,height:480
D/CameraHardware(   69): picture width:640,height:480
D/CameraHardware(   69): FRAMERATE 15
D/CameraHardware(   69): Picture Size by CamHAL 640 x 480
D/CameraHardware(   69): Preview Resolution by CamHAL 640 x 480
V/camera  (  596): Preview size is 640x480
D/CameraHardware(   69): Set Parameter...!!
D/CameraHardware(   69): PreviewFormat yuv422sp
D/CameraHardware(   69): PictureFormat jpeg
D/CameraHardware(   69): preview width:640,height:480
D/CameraHardware(   69): picture width:640,height:480
D/CameraHardware(   69): FRAMERATE 15
D/CameraHardware(   69): Picture Size by CamHAL 640 x 480
D/CameraHardware(   69): Preview Resolution by CamHAL 640 x 480
V/camera  (  596): startPreview
W/****CameraHAL(   69): ----Preview not Enabled----
W/****CameraHAL(   69): window is NULL
W/CameraHardware(   69): Window is Null
D/CameraHardware(   69): startPreview width:640,height:480
D/V4L2Camera(   69): CameraConfigure PreviewFormat: w=640 h=480
V/camera  (  596): surfaceChanged. w=401. h=534
W/****CameraHAL(   69): ----Preview Enabled----
D/****CameraHAL(   69): Exiting the function
I/ActivityManager(  195): Displayed com.android.camera/.Camera: +1s526ms
W/IInputConnectionWrapper(  342): showStatusIcon on inactive InputConnection
W/InputManagerService(  195): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@41314168 (uid=10028 pid=342)
D/sensors (  195): Control set delay 200000000 ns requetsed, using rate 6 [6.250 Hz]
D/sensors (  195): Control set delay 200000000 ns requetsed, using rate 6 [6.250 Hz]
D/LocationManager(  596): provider does not exist provider=network
D/LocationManager(  596): provider does not exist provider=gps
D/LocationManager(  596): startReceivingLocationUpdates
D/CameraStorage(  596): External storage state=mounted
I/Thumbnail(  596): Fail to load bitmap. java.io.FileNotFoundException: /data/data/com.android.camera/files/last_thumb: open failed: ENOENT (No such file or directory)
D/CameraHardware(   69): Set Parameter...!!
D/CameraHardware(   69): PreviewFormat yuv422sp
D/CameraHardware(   69): PictureFormat jpeg
D/CameraHardware(   69): preview width:640,height:480
D/CameraHardware(   69): picture width:640,height:480
D/CameraHardware(   69): FRAMERATE 15
D/CameraHardware(   69): Picture Size by CamHAL 640 x 480
D/CameraHardware(   69): Preview Resolution by CamHAL 640 x 480
W/NetworkManagementSocketTagger(  195): setKernelCountSet(10028, 0) failed with errno -2
D/dalvikvm(  195): GC_EXPLICIT freed 216K, 12% free 8750K/9863K, paused 4ms+28ms

Could somebody help me please?

Best Regards,

  • Hello, I'm working with the BeagleBoard-xm and Android ICS,I want to use an USB Camera for an aumented reality app,  I'm trying to do what is described in those links you mentioned, however I don't know where are the files BoardConfig.mk and Device.mk. I tried searching and I found them in this package wich contains arm-eabi binaries:


      Original source code package can be downloaded from:
        http://software-dl.ti.com/dsps/dsps_public_sw/sdo_tii/TI_Android_DevKit/TI_Android_ICS_4_0_3_DevKit_3_0_0/exports/TI-Android-ICS-4.0.3_AM37x_3.0.0.bin

    I modified the files and built it again:


      [Build basic Android ICS Filesystem]

        $ cd $HOME/rowboat-android/TI_Android_ICS_4_0_3_DevKit_3_0_0/exports/TI-Android-ICS-4.0.3_AM37x_3.0.0
        $ make TARGET_PRODUCT=omap3evm OMAPES=5.x -j<N>

    I don't know if, I'm doing it right, I will aprieciate your help a lot.

    Thanks.

  • Hi Johanna,


    Those files (BoardConfig.mk and device.mk) have to be in your source code downloaded. In my case, those files are in the following path: /<ANDROID SOURCE CODE>/device/ti/am335xevm

    As you have to know, I have had problems with the resolution because the Android camera driver, provided by Texas, only allows to capture with QVGA resolution and I don't know if they have solved this problem.


    Regards,

  • Hello,

    Thank you so much for your answer, the USB camera is working, but it works with one specific app. ¿is it possible to set the USB camera as default for all the apps on Android?.

    I need to excecute an app of augmented reality, and it didn't work it seems that the app is looking for the default camera.

    ¿Which app did you use?, or you set the Webcam as default.

    Regards,

  • Hi Johanna Gonz,

    I have compiled the android JB to the panda-board 4430. Since I don't have the CSI camera module too interface it to the panda-board 4430, I'm using the USB camera. But their is no preview & also not able to capture the images. In the kernel I have enabled the v4l2 drivers & the related tings by following/referring  the TI sites. the web cam ( logitec c160 ) is detected & a device node video0 is created under /dev. from application layer the camera application is crashing. Also by analyzing the log according to my understanding i am thinking that it is referring to the ON board camera interface(CSI) & other errors like cameraservice failed, no device properties file found etc . from application layer to camera hal layers errors are there I think so. Please help me, what changes do I need to do to make the usb camera work & capture the  images. Please help as I am in need of this for my project.

    8547.Logcat_21_June_14.txt

    Regards,

    Sainath

  • Hello Sainath,

    First of all it's important to know which operative system you are using, if you are using Android , to use de camera web you have to do two things:

    1. Modify the kernel:

    Check permission of your "dev/videoX"  (X is 0-9) in the Bealgleboard is 9. Add  permission using chmod 666, if you want to change permission permanently, you have to change "/init.rc" or "/ueventd.rc" file.

    2. The app for the camera has to  use JNI functions and has a method to get a Bitmap from de USB camera.

    if you need more help  add me to Skype, mi username is: johanna.gon

  • Hi Johanna,

    I have a USB uvc camera working but or some reason I can only get capture resolutions like 320x240. Have you succeed getting larger resolutions?

  • I have the same problem. I am testing external USB UVC camera modules with Android 4.1.2 on AM335x EVM compatible hardware (ChipSee board). The image resolution is limited to 320 x 240 (QVGA).

    With a low-resolution camera (Logitech C310), the image is displayed correctly, although only in 320 x 240 resolution. But with an 8MP camera module, which works flawlessly under Windows, the image is distorted.

    What can we do to solve these problems?

  • As Christian d'Heureuse noted, CameraHardware is hard coding the resolutions in it. That's why we cannot change the picture size. 

    I have made a simple addition to the list of hardcoded supported resolutions and could grab a 1920x1080 picture.

    However this should be dynamically loaded from V4L.