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.

Enable camera interface



Hi,

Iam trying to get image from Android camera app.

Normally it opens but there was no image.

I follow instructions at

http://processors.wiki.ti.com/index.php/TI-Android-GingerBread-2.3.4-DevKit-2.1_PortingGuides

Now camera application has stopped unexpectedly

Here is logcat;


I/ActivityManager( 1098): Starting: Intent { act=android.intent.action.MAIN cat=
[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.camera/.Camera
} from pid 1574
I/ActivityManager( 1098): Start proc com.android.camera for activity com.android
.camera/.Camera: pid=2109 uid=10011 gids={1006, 1015}
V/CameraHolder( 2109): open camera 0
V/Camera ( 2109): connect
D/V4L2Camera( 997): 81: Open() ENTER
E/V4L2Camera( 997): Failed to open subdev
D/V4L2Camera( 997): 175: Open_media_device() ENTER
D/V4L2Camera( 997): pads for entity 1=
D/V4L2Camera( 997): (0 INPUT)
D/V4L2Camera( 997): (1 OUTPUT)
D/V4L2Camera( 997): [1:1]===>[5:0]
D/V4L2Camera( 997): INACTIVE
D/V4L2Camera( 997): pads for entity 2=
D/V4L2Camera( 997): (0 OUTPUT)
D/V4L2Camera( 997): [2:0]===>[1:0]
D/V4L2Camera( 997): INACTIVE
D/V4L2Camera( 997): pads for entity 3=
D/V4L2Camera( 997): (0 INPUT)
D/V4L2Camera( 997): (1 OUTPUT)
D/V4L2Camera( 997): [3:1]===>[4:0]
D/V4L2Camera( 997): INACTIVE
D/V4L2Camera( 997): [3:1]===>[5:0]
D/V4L2Camera( 997): INACTIVE
D/V4L2Camera( 997): pads for entity 4=
D/V4L2Camera( 997): (0 INPUT)
D/V4L2Camera( 997): pads for entity 5=
D/V4L2Camera( 997): (0 INPUT)
D/V4L2Camera( 997): (1 OUTPUT)
D/V4L2Camera( 997): (2 OUTPUT)
D/V4L2Camera( 997): [5:1]===>[6:0]
D/V4L2Camera( 997): INACTIVE
D/V4L2Camera( 997): [5:2]===>[7:0]
D/V4L2Camera( 997): INACTIVE
D/V4L2Camera( 997): [5:1]===>[10:0]
D/V4L2Camera( 997): INACTIVE
D/V4L2Camera( 997): [5:2]===>[13:0]
D/V4L2Camera( 997): ACTIVE
D/V4L2Camera( 997): [5:2]===>[14:0]
D/V4L2Camera( 997): ACTIVE
D/V4L2Camera( 997): [5:2]===>[15:0]
D/V4L2Camera( 997): ACTIVE
D/V4L2Camera( 997): pads for entity 6=
D/V4L2Camera( 997): (0 INPUT)
D/V4L2Camera( 997): pads for entity 7=
D/V4L2Camera( 997): (0 INPUT)
D/V4L2Camera( 997): (1 OUTPUT)
D/V4L2Camera( 997): [7:1]===>[9:0]
D/V4L2Camera( 997): INACTIVE
D/V4L2Camera( 997): [7:1]===>[10:0]
D/V4L2Camera( 997): INACTIVE
D/V4L2Camera( 997): pads for entity 8=
D/V4L2Camera( 997): (0 OUTPUT)
D/V4L2Camera( 997): [8:0]===>[7:0]
D/V4L2Camera( 997): INACTIVE
D/V4L2Camera( 997): pads for entity 9=
D/V4L2Camera( 997): (0 INPUT)
D/V4L2Camera( 997): pads for entity 10=
D/V4L2Camera( 997): (0 INPUT)
D/V4L2Camera( 997): (1 OUTPUT)
D/V4L2Camera( 997): [10:1]===>[12:0]
D/V4L2Camera( 997): INACTIVE
D/V4L2Camera( 997): pads for entity 11=
D/V4L2Camera( 997): (0 OUTPUT)
D/V4L2Camera( 997): [11:0]===>[10:0]
D/V4L2Camera( 997): INACTIVE
D/V4L2Camera( 997): pads for entity 12=
D/V4L2Camera( 997): (0 INPUT)
D/V4L2Camera( 997): pads for entity 13=
D/V4L2Camera( 997): (0 INPUT)
D/V4L2Camera( 997): pads for entity 14=
D/V4L2Camera( 997): (0 INPUT)
D/V4L2Camera( 997): pads for entity 15=
D/V4L2Camera( 997): (0 INPUT)
E/V4L2Camera( 997): Failed to enable link bewteen entities
D/CameraHardware( 997): 104: initDefaultParameters() ENTER
D/CameraHardware( 997): Set Parameter...!!
D/CameraHardware( 997): PreviewFormat yuv422sp
D/CameraHardware( 997): PictureFormat jpeg
D/CameraHardware( 997): preview width:320,height:240
D/CameraHardware( 997): picture width:320,height:240
D/CameraHardware( 997): FRAMERATE 15
D/CameraHardware( 997): Picture Size by CamHAL 320 x 240
D/CameraHardware( 997): Preview Resolution by CamHAL 320 x 240
D/CameraHardware( 997): 123: initDefaultParameters() EXIT
D/CameraHardware( 997): 196: setCallbacks() ENTER
D/CameraHardware( 997): 202: setCallbacks() EXIT
D/CameraHardware( 997): enableMsgType:13
I/StagefrightPlayer( 997): setDataSource('/system/media/audio/ui/camera_click.o
gg')
I/StagefrightPlayer( 997): setDataSource('/system/media/audio/ui/VideoRecord.og
g')
V/Camera ( 2109): getParameters
V/Camera ( 2109): getParameters
V/Camera ( 2109): setPreviewDisplay
D/Camera ( 2109): app passed NULL surface
V/Camera ( 2109): sendCommand
V/Camera ( 2109): getParameters
V/Camera ( 2109): setParameters
D/CameraHardware( 997): Set Parameter...!!
D/CameraHardware( 997): PreviewFormat yuv422sp
D/CameraHardware( 997): PictureFormat jpeg
D/CameraHardware( 997): preview width:640,height:480
D/CameraHardware( 997): picture width:640,height:480
D/CameraHardware( 997): FRAMERATE 15
D/CameraHardware( 997): Picture Size by CamHAL 640 x 480
D/CameraHardware( 997): Preview Resolution by CamHAL 640 x 480
V/Camera ( 2109): getParameters
V/Camera ( 2109): setParameters
D/CameraHardware( 997): Set Parameter...!!
D/CameraHardware( 997): PreviewFormat yuv422sp
D/CameraHardware( 997): PictureFormat jpeg
D/CameraHardware( 997): preview width:640,height:480
D/CameraHardware( 997): picture width:640,height:480
D/CameraHardware( 997): FRAMERATE 15
D/CameraHardware( 997): Picture Size by CamHAL 640 x 480
D/CameraHardware( 997): Preview Resolution by CamHAL 640 x 480
V/camera ( 2109): startPreview
V/Camera ( 2109): startPreview
D/CameraHardware( 997): enableMsgType:16
D/CameraHardware( 997): 308: startPreview() ENTER
D/V4L2Camera( 997): 81: Open() ENTER
E/V4L2Camera( 997): Failed to open subdev
D/V4L2Camera( 997): Inside else
D/V4L2Camera( 997): Inside else
D/V4L2Camera( 997): Inside else
D/V4L2Camera( 997): Inside else
D/V4L2Camera( 997): Inside else
D/V4L2Camera( 997): Inside else
D/V4L2Camera( 997): Inside else
D/V4L2Camera( 997): Inside else
D/V4L2Camera( 997): Inside else
D/V4L2Camera( 997): Inside else
D/V4L2Camera( 997): Inside else
D/V4L2Camera( 997): Inside else
D/V4L2Camera( 997): Inside else
D/V4L2Camera( 997): Inside else
D/V4L2Camera( 997): Inside else
V/Camera ( 2109): stopPreview
D/CameraHardware( 997): disableMsgType:16
D/CameraHardware( 997): 394: stopPreview() ENTER
D/CameraHardware( 997): 415: stopPreview() EXIT
V/Camera ( 2109): setPreviewCallbackFlags
V/Camera ( 2109): disconnect
D/CameraHardware( 997): disableMsgType:511
D/CameraHardware( 997): 394: stopPreview() ENTER
D/CameraHardware( 997): 415: stopPreview() EXIT
D/CameraHardware( 997): 170: ~CameraHardware() ENTER
D/V4L2Camera( 997): 464: Uninit() ENTER
E/V4L2Camera( 997): Uninit: Unmap failed
E/V4L2Camera( 997): Uninit: Unmap failed
E/V4L2Camera( 997): Uninit: Unmap failed
E/V4L2Camera( 997): Uninit: Unmap failed
D/V4L2Camera( 997): 485: Uninit() EXIT
D/V4L2Camera( 997): 516: StopStreaming() ENTER
D/V4L2Camera( 997): 529: StopStreaming() EXIT
D/V4L2Camera( 997): 421: Close() ENTER
D/V4L2Camera( 997): 428: Close() EXIT
D/CameraHardware( 997): 176: ~CameraHardware() EXIT
W/dalvikvm( 2109): threadid=9: thread exiting with uncaught exception (group=0x4
010e560)
E/AndroidRuntime( 2109): FATAL EXCEPTION: Thread-10
E/AndroidRuntime( 2109): java.lang.RuntimeException: startPreview failed
E/AndroidRuntime( 2109): at com.android.camera.Camera.startPreview(Camera
.java:1677)
E/AndroidRuntime( 2109): at com.android.camera.Camera.access$5300(Camera.
java:95)
E/AndroidRuntime( 2109): at com.android.camera.Camera$3.run(Camera.java:9
08)
E/AndroidRuntime( 2109): at java.lang.Thread.run(Thread.java:1019)
E/AndroidRuntime( 2109): Caused by: java.lang.RuntimeException: startPreview fai
led
E/AndroidRuntime( 2109): at android.hardware.Camera.startPreview(Native M
ethod)
E/AndroidRuntime( 2109): at com.android.camera.Camera.startPreview(Camera
.java:1674)
E/AndroidRuntime( 2109): ... 3 more
W/ActivityManager( 1098): Force finishing activity com.android.camera/.Camera
W/ActivityManager( 1098): Activity pause timeout for HistoryRecord{407b3890 com.
android.camera/.Camera}
D/dalvikvm( 1420): GC_CONCURRENT freed 349K, 52% free 2854K/5831K, external 716K
/1038K, paused 3ms+3ms
W/ActivityManager( 1098): Activity destroy timeout for HistoryRecord{407b3890 co
m.android.camera/.Camera}

Can anybody help?

  • Hi,

    1. It failed because, it is unable to open device

    "E/V4L2Camera(  997): Failed to open subdev"

    2. Could post log for below command after boot

    $ls -l /dev/v4*

    3. Which camera sensor are you using ?

     

    BR,

    satish

     

  • Satish thanks for quick reply once again.

    First I dont know why my android boot with safe mode.

    Than here is logs that you want

    # ls -l /dev/v4*
    ls -l /dev/v4*
    crw------- root root 81, 0 2000-01-01 00:09 v4l-subdev0
    crw------- root root 81, 2 2000-01-01 00:09 v4l-subdev1
    crwxrwxrwx root root 81, 4 2000-01-01 00:09 v4l-subdev2
    crw------- root root 81, 6 2000-01-01 00:09 v4l-subdev3
    crw------- root root 81, 9 2000-01-01 00:09 v4l-subdev4
    crw------- root root 81, 12 2000-01-01 00:09 v4l-subdev5
    crw------- root root 81, 13 2000-01-01 00:09 v4l-subdev6
    crw------- root root 81, 14 2000-01-01 00:09 v4l-subdev7
    
    
    My camera sensor is D-max
  • Hi,

    Can you help me to understand -

     - How is your D-Max sensor sensor interfaced to OMAP/AM37x?

     - Is it parallel sensor OR USB?

     - What is the framework used in your D-max camera driver?

     - Is it based on Media-controller OR plain simple V4L2 driver?

     - Probably share the boot log here

    Thanks,

    Vaibhav

  • My camera sensor is USB.

    And I got image when I connect it to PC.

    Idont have any driver file for it.I only follow instructions on link that I share.

    I used file that in kernel mt9v113.c

  • Ok. Then you are completely on wrong direction altogether. The whole v4l-subdev* story is built around media-controller framework which is not applicable in your use-case.

    In your use-case, when you interface USB camera, after enumeration, the new /dev/videoX device node will get created and you should be using this new device node for streaming.

    Can you please dump,

     # ls -l /dev/video*

     # Search for string "video4linux" in /sys/ directory. And dump all the entries inside this directory. I am not in front of board, so not able to give exact command here, sorry for that.

    Thanks,

    Vaibhav

  • Hi,

    1. Provide the inputs what vaibhav has asked. It is very much important to analyze the issue further.

    2. As you have mentioned that you are using USB camera, I would recommend to use attached files ( taken from previous android devkit release). It should work for you.

    BR,

    satish6747.camera-froyo.tar.gz

  • 1)

    I wrote dumpsys and dump state and copy the logs.I couldnt find video4linux string in that 388 pages.

    2)

    Shall I copy them to driver folder part?

  • Hi Batuhan,

    1. From the logs, it is seen that, capture device is detected.

    <6>Linux video capture dnterface: v2.00

    <6>usb 1-2.5: Product: USB 2.0 Image Capture Controller

    2.  Next step is to find out, device not entry for the same. Kindly do 'ls -l /dev/video*" , if entry has created or not. Reply back with output of this command.

    3. Also if possible, check sysfs entry for this device and find out major and minor number. If video node (as mentioned above) has not been created then we need to create that manually

    BR,

    satish

  • Hi Satish,

    Here is output

    ls -l /dev/video*
    crwxrwxrwx root root 81, 1 2000-01-01 00:04 video0
    crwxrwxrwx root root 81, 3 2000-01-01 00:04 video1
    crwxrwxrwx root root 81, 5 2000-01-01 00:04 video2
    crwxrwxrwx root root 81, 7 2000-01-01 00:04 video3
    crw------- root root 81, 8 2000-01-01 00:04 video4
    crw------- root root 81, 10 2000-01-01 00:04 video5
    crw------- root root 81, 11 2000-01-01 00:04 video6
    crwxrwxrwx root root 81, 15 2000-01-01 00:04 video7
    crw------- root root 81, 16 2000-01-01 00:04 video8
  • Hi Batuhan,

    1. Kindly check /sys/class/video4linux/videoxx entry

    kindly check all the entry to find out which one is belongs to camera that you have connected.

    $cd  /sys/class/video4linux/videox

    $cat name

    2. Once you indentify the same, use HAL that I have posted previously.

    Copy the file at <android-src>/hardware/ti/omap3/camera

    edit CameraHardware.cpp and change entry

    #define VIDEO_DEVICE "/dev/video0" to

    #define VIDEO_DEVICE "/dev/videox" - replace x with correct node that you will find using step#1.

    rebuilt HAL and try with newly generated libraries.

    BR,

    satish

     

  • OMAP3 ISP CCP2 input
    # cd /sys/class/video4linux/video1
    # cat name
    OMAP3 ISP CSI2a output
    # cd /sys/class/video4linux/video2
    # cat name
    OMAP3 ISP CCDC output
    # cd /sys/class/video4linux/video3
    # cat name
    OMAP3 ISP preview input
    # cd /sys/class/video4linux/video4
    # cat name
    OMAP3 ISP preview output
    # cd /sys/class/video4linux/video5
    # cat name
    OMAP3 ISP resizer input
    # cd /sys/class/video4linux/video6
    # cat name
    OMAP3 ISP resizer output
    # cd /sys/class/video4linux/video7
    # cat name
    omap_vout
    # cd /sys/class/video4linux/video8
    # cat name
    omap_vout
    
    
    I couldnt see my camera input here.When I plug in my camera to usb ;
    
    
    usb 1-2.5: new high speed USB device using ehci-omap and address 12
    usb 1-2.5: New USB device found, idVendor=05e1, idProduct=0501
    usb 1-2.5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    usb 1-2.5: Product: USB 2.0 Image Capture Controller
    usb 1-2.5: Manufacturer: Syntek Semiconductor
  • Hi,

    Full description of the camera and PC driver link: D-MAX, (STK-1135)

    Sorry about this late info.

    Regards, Onur

  • I tried logitech web cam and it broke down my other usb devices like keyboard.

    Here is logs that I got after I plugged the camera

    usb 1-2.2: new high speed USB device using ehci-omap and address 5
    usb 1-2.2: New USB device found, idVendor=046d, idProduct=081b
    usb 1-2.2: New USB device strings: Mfr=0, Product=0, SerialNumber=2
    usb 1-2.2: SerialNumber: 35EC25A0
    5:3:2: cannot set freq 24000 to ep 0x86
    ehci-omap ehci-omap.0: remove, state 1
    usb usb1: USB disconnect, address 1
    usb 1-2: USB disconnect, address 2
    5:3:3: cannot set freq 32000 to ep 0x86
    5:3:4: cannot set freq 48000 to ep 0x86
    usb 1-2.1: USB disconnect, address 3
    smsc95xx 1-2.1:1.0: usb0: unregister 'smsc95xx' usb-ehci-omap.0-2.1, smsc95xx USB 2.0 Ethernet
    usb 1-2.2: USB disconnect, address 5
    usb 1-2.4: USB disconnect, address 4
    ehci-omap ehci-omap.0: USB bus 1 deregistered
    ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    ehci-omap.0 supply hsusb0 not found, using dummy regulator
    ehci-omap.0 supply hsusb1 not found, using dummy regulator
    ehci-omap ehci-omap.0: OMAP-EHCI Host Controller
    ehci-omap ehci-omap.0: new USB bus registered, assigned bus number 1
    ehci-omap ehci-omap.0: irq 77, io mem 0x48064800
    ehci-omap ehci-omap.0: USB 2.0 started, EHCI 1.00
    usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    usb usb1: Product: OMAP-EHCI Host Controller
    usb usb1: Manufacturer: Linux 2.6.37-g06ebbba-dirty ehci_hcd
    usb usb1: SerialNumber: ehci-omap.0
    hub 1-0:1.0: USB hub found
    hub 1-0:1.0: 3 ports detected
  • Satish solved our problem.

    Additional to his posts here,we gave permission to device with

    chmod 777 /dev/videoX

    now camera is working like charm.

  • hi Batuhan,

    Please post the step by step procedure you followed to enable the USB camera

  • Hi Satish,

                      am trying to integrate ov2659 camera , to ICS  on DM37xx

                       my driver is listed under /sys/class/video4linux/v4l-subdev8

                       as   "ov2659 2-0030"

                      but not as videox  can i use it directly in CameraHardware.cpp as  /dev/v4l-subdev8

                     how to make it listed as videox??

    Regards,

    Dibin

     

  • Hi Team,

      my ov2659 sensor is listed as subdev8  but not as video0 , it is listed in /dev as media0 , is there necessory to list the sensor as video0 

    Regards,

    dibin

  • Hello world,

    im doing the same but my camera is an UVC Camera (046d:0825)

    cd  /sys/class/video4linux/video0

    cat name

    UVC Camera (046d:0825)

    I follow the instructions but when I open camera preview it still crashing

  • Hello!

    I'm working on a Beagleboard-xm and Android 4.0.3, I want to use an USB camera Logitech.

    How can I enable the camera?, Do I have to install the drivers for Logitech or it is not neccesary?, I can compile the kernel, but I don't know what to modify.

    Can you give me some information please?

    Thanks for your help.