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.

TI Sitara Starter Kit USB Camera

Hello,

I noticed that the TI Sitara am335x SK supports USB camera interface

http://processors.wiki.ti.com/index.php/AM335X_EVM-SK_Android_Devkit_Guide#Camera_Support

Can please clarify on this subject? 

I plugged in a USB Camera and clicked on the Camera application. I get and error message Unfortunately the Camera has stopped. 

Is there any configuration that is needed?

Thanks

  • Hi,

    Which is the image you tested?

    Can you test USB camera on AM335x SK using the prebuilt images available at http://software-dl.ti.com/sitara_android/esd/TI_Android_DevKit/TI_Android_JB_4_2_2_DevKit_4_1_1/exports/TI_Android_JB_4.2.2_DevKit_4.1.1_am335xevm_sk.tar.gz

    Regards,

    Arun

  • I tested the USB camera with both ICS and JB distributions on the TI Sitara SK. None of them worked. Do you know if I need to do any configurations?

    I used a logitech Webcam, which I connected to the J5 usb connector of the TI Sitara SK board.

    I connected the camera after Android was loaded and also for before android was loaded

    Thanks

  • Hi,

    Can you test with the USB connected before powering up the board?

    Where you able to see the camera preview at least?

    Regards,

    Arun

  • @Arun,

    I tested with the USB camera plugging, then power up the board.

    I clicked on the camera app. The app opens but then closes without anything and goes back to the screen that show all the rest of the icons for the other apps.

    I guess you have this working on a TI Sitara SK board. If so what is the USB camera you are using.

    BTW I test on JB

    Thanks

    Mahendra

  • Hi Mahendra,

    Can you attach the logcat output. I shall compare it with the one when I tested with the AM335x SK.

    Regards,

    Arun

  • Hi,

    I tested the CREATIVE USB camera with the image , and the preview is coming up at 320x240.

    Can you attach the LOGITECH camera to ubuntu PC and find its supported resolutions with the Cheese application(Preferences->Resolution).

    In android HAL at hardware/ti/omap3/camera/CameraHardware.cpp, we have enabled the resolutions 320x240, 352x288 and 176x144 for USB camera.

    You can edit this list if the logitech camera support none of these resolutions.

    #ifdef _USE_USB_CAMERA_
    const char CameraHardware::supportedPictureSizes [] = "320x240,352x288,176x144";
    const char CameraHardware::supportedPreviewSizes [] = "320x240,352x288,176x144";

    Please find the attached logcat with creative USB camera attached.

    1881.camera_logcat.txt
    --------- beginning of /dev/log/system
    I/ActivityManager(  343): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.gallery3d/com.android.camera.CameraLauncher} from pid 732
    --------- beginning of /dev/log/main
    W/audio_hw_primary(   76): out_write() limiting sleep time 139682 to 39909
    W/audio_hw_primary(   76): out_write() limiting sleep time 119727 to 39909
    W/audio_hw_primary(   76): out_write() limiting sleep time 99773 to 39909
    W/audio_hw_primary(   76): out_write() limiting sleep time 79818 to 39909
    W/audio_hw_primary(   76): out_write() limiting sleep time 59863 to 39909
    V/CameraHolder(  848): open camera 0
    D/****CameraHAL(   76): cameraHal BACK 0
    D/****CameraHAL(   76): cameraHal 0
    I/AwesomePlayer(   76): setDataSource_l(URL suppressed)
    E/WVMExtractor(   76): Failed to open libwvm.so
    D/dalvikvm(  848): GC_CONCURRENT freed 1321K, 28% free 4774K/6628K, paused 2ms+16ms, total 168ms
    D/dalvikvm(  848): WAIT_FOR_CONCURRENT_GC blocked 51ms
    I/AwesomePlayer(   76): setDataSource_l(URL suppressed)
    E/WVMExtractor(   76): Failed to open libwvm.so
    I/CameraClient(   76): Opening camera 0
    I/****CameraHAL(   76): camera_device open
    D/CameraHardware(   76): Set Parameter...!! 
    D/CameraHardware(   76): PreviewFormat yuv422sp
    D/CameraHardware(   76): PictureFormat jpeg
    D/CameraHardware(   76): preview width:320,height:240
    D/CameraHardware(   76): picture width:320,height:240
    D/CameraHardware(   76): FRAMERATE 15
    D/CameraHardware(   76): Picture Size by CamHAL 320 x 240
    D/CameraHardware(   76): Preview Resolution by CamHAL 320 x 240
    D/CameraHardware(   76): enableMsgType:3085
    D/CameraHardware(   76): Set Parameter...!! 
    D/CameraHardware(   76): PreviewFormat yuv422sp
    D/CameraHardware(   76): PictureFormat jpeg
    D/CameraHardware(   76): preview width:320,height:240
    D/CameraHardware(   76): picture width:320,height:240
    D/CameraHardware(   76): FRAMERATE 15
    D/CameraHardware(   76): Picture Size by CamHAL 320 x 240
    D/CameraHardware(   76): Preview Resolution by CamHAL 320 x 240
    D/CameraHardware(   76): Set Parameter...!! 
    D/CameraHardware(   76): PreviewFormat yuv422sp
    D/CameraHardware(   76): PictureFormat jpeg
    D/CameraHardware(   76): preview width:320,height:240
    D/CameraHardware(   76): picture width:320,height:240
    D/CameraHardware(   76): FRAMERATE 15
    D/CameraHardware(   76): Picture Size by CamHAL 320 x 240
    D/CameraHardware(   76): Preview Resolution by CamHAL 320 x 240
    V/StateManager(  848): startState class com.android.gallery3d.app.PhotoPage
    D/CameraHardware(   76): Set Parameter...!! 
    D/CameraHardware(   76): PreviewFormat yuv422sp
    D/CameraHardware(   76): PictureFormat jpeg
    D/CameraHardware(   76): preview width:320,height:240
    D/CameraHardware(   76): picture width:320,height:240
    D/CameraHardware(   76): FRAMERATE 15
    D/CameraHardware(   76): Picture Size by CamHAL 320 x 240
    D/CameraHardware(   76): Preview Resolution by CamHAL 320 x 240
    V/CAM_PhotoModule(  848): Preview size is 320x240
    D/CameraHardware(   76): Set Parameter...!! 
    D/CameraHardware(   76): PreviewFormat yuv422sp
    D/CameraHardware(   76): PictureFormat jpeg
    D/CameraHardware(   76): preview width:320,height:240
    D/CameraHardware(   76): picture width:320,height:240
    D/CameraHardware(   76): FRAMERATE 20
    D/CameraHardware(   76): Picture Size by CamHAL 320 x 240
    D/CameraHardware(   76): Preview Resolution by CamHAL 320 x 240
    D/****CameraHAL(   76): cameraHal BACK 0
    D/****CameraHAL(   76): cameraHal 0
    D/****CameraHAL(   76): cameraHal BACK 0
    D/****CameraHAL(   76): cameraHal 0
    V/CAM_PhotoModule(  848): Preview size is 320x240
    D/        (  343): int sensors_poll_context_t::setDelay(int, int64_t)[179],index:0x0
    D/        (  343): int sensors_poll_context_t::setDelay(int, int64_t)[179],index:0x0
    D/CameraHardware(   76): Set Parameter...!! 
    D/CameraHardware(   76): PreviewFormat yuv422sp
    D/CameraHardware(   76): PictureFormat jpeg
    D/CameraHardware(   76): preview width:320,height:240
    D/CameraHardware(   76): picture width:320,height:240
    D/CameraHardware(   76): FRAMERATE 20
    D/CameraHardware(   76): Picture Size by CamHAL 320 x 240
    D/CameraHardware(   76): Preview Resolution by CamHAL 320 x 240
    I/CAM_ScreenNail(  848): aspect ratio clamping disabled
    I/CAM_ScreenNail(  848): aspect ratio clamping enabled, surfaceTexture scale: 1.0, 1.0
    W/****CameraHAL(   76): ----Preview not Enabled----
    V/CAM_PhotoModule(  848): startPreview
    W/****CameraHAL(   76): ----Preview not Enabled----
    D/****CameraHAL(   76): Exiting the function
    D/CameraHardware(   76): startPreview width:320,height:240
    D/dalvikvm(  848): GC_FOR_ALLOC freed 895K, 38% free 4149K/6628K, paused 29ms, total 30ms
    D/        (  343): int sensors_poll_context_t::setDelay(int, int64_t)[179],index:0x0
    W/SensorService(  343): sensor 00000000 already enabled in connection 0x400035a8 (ignoring)
    D/        (  343): int sensors_poll_context_t::setDelay(int, int64_t)[179],index:0x0
    D/CameraStorage(  848): External storage state=mounted
    D/V4L2Camera(   76): CameraConfigure PreviewFormat: w=320 h=240
    I/CAM_ScreenNail(  848): preview layout size: 480/272
    I/CAM_ScreenNail(  848): aspect ratio clamping enabled, surfaceTexture scale: 1.0, 0.75555557
    I/GalleryEGLConfigChooser(  848): Config chosen: R8 G8 B8 A8 D24 S8 ID1 CAVEAT12344 
    I/GLRootView(  848): onSurfaceChanged: 480x272, gl10: com.google.android.gles_jni.GLImpl@40effb10
    I/GLRootView(  848): layout content pane 480x272 (compensation 0)
    D/PhotoView(  848): compensation = 0, CameraRelativeFrame = Rect(0, 0 - 0, 0), mCameraRect = Rect(0, 0 - 0, 0)
    I/ActivityManager(  343): Displayed com.android.gallery3d/com.android.camera.CameraLauncher: +1s209ms
    D/dalvikvm(  848): GC_CONCURRENT freed 54K, 33% free 4487K/6628K, paused 5ms+18ms, total 214ms
    D/dalvikvm(  848): WAIT_FOR_CONCURRENT_GC blocked 201ms
    D/dalvikvm(  848): GC_CONCURRENT freed 332K, 31% free 4624K/6628K, paused 21ms+53ms, total 288ms
    D/dalvikvm(  848): WAIT_FOR_CONCURRENT_GC blocked 268ms
    D/dalvikvm(  848): GC_CONCURRENT freed 300K, 28% free 4793K/6628K, paused 14ms+4ms, total 100ms
    D/dalvikvm(  848): WAIT_FOR_CONCURRENT_GC blocked 86ms
    D/dalvikvm(  848): GC_CONCURRENT freed 275K, 25% free 4986K/6628K, paused 10ms+4ms, total 49ms
    D/dalvikvm(  848): WAIT_FOR_CONCURRENT_GC blocked 40ms
    I/Choreographer(  848): Skipped 41 frames!  The application may be doing too much work on its main thread.
    D/dalvikvm(  848): GC_CONCURRENT freed 306K, 23% free 5118K/6628K, paused 73ms+49ms, total 492ms
    D/dalvikvm(  848): GC_CONCURRENT freed 10K, 15% free 5654K/6628K, paused 8ms+52ms, total 204ms
    I/ActivityManager(  343): Process com.android.settings (pid 588) has died.
    

    Regards,

    Arun

  • @Arun,

    Thank you for the feedback. Attached is the log cat file.

    5554.camera.log

    I also noticed that the /dev folder in the device doesn't have the video device defined.

    This issue could be a simple configuration issue

    The camera resolution is 352x288. Attach is a picture I took from the camera via Cheese

    Also is attach is the TI - Sitara Build Info

    Note; The TI-Sitara-SK is recognizing the camera. Attach is a terminal log of connecting and disconnecting the usb camera

    7536.usb-camera-connect-disconnect.txt
    [ 5520.087585] usb 1-1: USB disconnect, device number 5
    [ 5523.985626] usb 1-1: new full-speed USB device number 6 using musb-hdrc
    [ 5524.126800] usb 1-1: New USB device found, idVendor=046d, idProduct=092e
    [ 5524.133789] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [ 5524.141235] usb 1-1: Product: Camera
    [ 5524.144958] usb 1-1: Manufacturer:         
    [ 5528.601776] request_suspend_state: wakeup (3->0) at 4793996160391 (2000-01-01 01:32:06.893240008 UTC)
    

  • Mahendra,

    Yes, the logs indicate that the /dev/video node is not getting created. I suspect this could be a setup issue. Can you also test with Am335xEVM?

    I tested with Logitech USB camera on AM335x SK(Android 4.2.2). The preview and capture works fine.

    Attached is the image.

    USB connect/disconnect logs

    <6>[  658.163085] usb 1-1: new high-speed USB device number 3 using musb-hdrc
    <6>[  658.525451] usb 1-1: New USB device found, idVendor=046d, idProduct=0825
    <6>[  658.532470] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=2
    <6>[  658.539916] usb 1-1: SerialNumber: 83BE09C0
    <6>[  658.546051] uvcvideo: Found UVC 1.00 device <unnamed> (046d:0825)
    <6>[  658.649475] input: UVC Camera (046d:0825) as /devices/platform/omap/musb-ti81xx/mus
    b-hdrc.1/usb1/1-1/1-1:1.0/input/input4
    <3>[  659.664306] 3:3:1: cannot set freq 16000 to ep 0x86
    <3>[  660.663116] 3:3:2: cannot set freq 24000 to ep 0x86
    <3>[  661.663146] 3:3:3: cannot set freq 32000 to ep 0x86
    <3>[  662.663146] 3:3:4: cannot set freq 48000 to ep 0x86
    root@android:/ # ls /d
    d/           data/        default.prop dev/         
    root@android:/ # ls /dev/video1                                                
    /dev/video1

    Regards,

    Arun

  • I also notice that after connect/disconnect of USB camera, the video node changes from /dev/video0 to /dev/video1.

    But in Camera HAL, the video node is specified as /dev/video0

    hardware/ti/omap3/camera/CameraHardware.cpp

    #define VIDEO_DEVICE_0      "/dev/video0"

    root@android:/ # cat ueventd.am335xevm.rc                                      
    /dev/video0         0666  root       root

    So can you make sure the USB camera is being detected at /dev/video0?

    Regards,

    Arun

  • @Arun,

    I think this is a minor setup problem.

    Attach is the text file of the output from your suggestion.

    7673.ti-USB-Camera.txt
    /d
    /d
    root@android:/ # ls - /dev/v*
    /dev/vcs
    /dev/vcs1
    /dev/vcsa
    /dev/vcsa1
    root@android:/ # cat ueventd.am335xevm.rc
    /dev/video0         0666  root       root
    
    # for Bluetooth
    /dev/hci_tty              0666   bluetooth bluetooth
    
    /dev/ttyUSB0	0660	radio	radio
    /dev/ttyUSB1	0660	radio	radio
    /dev/ttyUSB2	0660	radio	radio
    root@android:/ # [  841.355102] usb 1-1: USB disconnect, device number 2
    [  846.663726] usb 1-1: new full-speed USB device number 3 using musb-hdrc
    [  846.804870] usb 1-1: New USB device found, idVendor=046d, idProduct=092e
    [  846.811889] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [  846.819335] usb 1-1: Product: Camera
    [  846.823059] usb 1-1: Manufacturer:         
    
    root@android:/ # [  857.490264] usb 1-1: USB disconnect, device number 3
    
    root@android:/ # [  861.593719] usb 1-1: new full-speed USB device number 4 using musb-hdrc
    [  861.734863] usb 1-1: New USB device found, idVendor=046d, idProduct=092e
    [  861.741851] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [  861.749328] usb 1-1: Product: Camera
    [  861.753051] usb 1-1: Manufacturer:         
    
    1|root@android:/ # 1|root@android:/ # ls -al ueventd.am335xevn.rc                                
    -rw-r--r-- root     root          203 2013-06-26 12:51 ueventd.am335xevm.rc
    root@android:/ # root@android:/ # ls -al ueventd.am335xevm.rc  
    
                                     
    root@android:/ # [  957.002349] usb 1-1: USB disconnect, device number 4
    [  961.563720] usb 1-1: new full-speed USB device number 5 using musb-hdrc
    [  961.704864] usb 1-1: New USB device found, idVendor=046d, idProduct=092e
    [  961.711883] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [  961.719329] usb 1-1: Product: Camera
    [  961.723052] usb 1-1: Manufacturer:         
    [  964.443450] request_suspend_state: wakeup (3->0) at 964409723561 (2013-10-23 14:10:48.550104253 UTC)
    

    Two things to note

    1. When the USB camera connected a /dev/video0 is not created? Not exactly sure the reason.
    2. In your USB connect/disconnect log I noticed the following
      1. uvcvideo: UVC 1.00 device ....
      2. input: UVC camera    /devices/platform/omap/musb-.....

      I don't see these in my log.

    Note: I don't have access to a Am335xEVM

    Thank you for your help in advance.

    Mahendra
  • Mahendra,

    I spot another difference. The USB camera you are testing is detected as "full speed" (USB 1.1) and the ones I have tested is "high speed"(USB 2.0). Can you try with a high speed USB camera if possible? The bandwidth of USB 1.1 full speed will be limited to 12Mbps. Still we have to see why the USB camera is not detected as UVC interface.

    Regards,

    Arun

  • @Arun,

    I just went and got USB 2.0 Camera, and now I see the Camera Working.

    Also I might suggest that the wiki be updated to pointed out USB 2.0 camera. Also I think uvc compliant might be needed.

    Thank you for your continued support.

  • Hi Mahendra,

     

    I am working  on 5MP USB Camera and try to integrate to my AM18XX USB 2.0 and  the driver and device it seems found and created the node under /dev/video0.

    When I am trying to capture the image  nothing has come. Please find the error

     Hard ware detection:-

    usb 1-1: new high speed USB device using musb_hdrc and address 4
    uvcvideo: Found UVC 1.00 device 5M Web Camera (04f2:b355)
    input: 5M Web Camera as /devices/platform/musb_hdrc/usb1/1-1/1-1:1.0/input/input3 

    ./webcam.

    uvcvideo: Failed to submit URB 0 (-90).

    Start Capture: Message too long

    VIDIOC_STREAMON: Message too long

     

    Thanks,

    Lofna

  • @Lofna,

    What is your OS? I got this working on Android JB version.

  • Hi Mahendra,

    I am working on Linux 2.6.37 OS.

    Thanks,

    Lofna

  • Hi Mahendra,

    I am waiting for your inputs. Could you update on my query please.

    Thanks,

    Lofna

  • Hi Mahendra,

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

  • It was a problem with the camera device. After changing the device I could get larger images.

  • Hi Arun,

    I am using USB camera and connected to my target using android. Under kernel we have configured the uvc driver and while booted the system it has created the interface under /dev/video0.

    i tried to access android usb cam apk and tried, it says packages are not proper. please suggest any usb cam working apk for my target am335x.

    Thanks,
  • Android is not supported on this forum. Please post on e2e.ti.com/.../509