Author Topic: How to use a web cam  (Read 4821 times)

Jaychadw

  • Guest
How to use a web cam
« on: July 29, 2013, 05:29:55 pm »
I am trying to use a usb webcam.  I am using the android image 'cubiebox_tvbox_rel2.2' from www.cubieboard.org/downloads

I am attempting to add opencv4android to my project and so I uploaded and installed the samples to the cubieboard, plugged in a webcam. A very basic one, no extras so should be no issues with power.

I want to know how to make it work, plus other usb devices like an arduino because I can't figure out gpio on android.

I've heard mention of a kernel but I have no idea how to access or edit this even if I found it.

xtofury

  • Guest
Re: How to use a web cam
« Reply #1 on: August 31, 2013, 04:20:16 am »
I'm looking into that right now, though I thought I bricked my cubie because the usb connectivity got nerfed but still worked in FEL mode thank god (otherwise I'd be stuck using SD).
I'll post whatever I figure out if I remember visiting this thread when I get mine working.

xtofury

  • Guest
Re: How to use a web cam
« Reply #2 on: August 31, 2013, 05:20:10 am »
https://www.olimex.com/wiki/UVC_support

There's usb support.
You'll have to download the source from github, and figure out how to setup the dependencies, and configure the kernel with the UVC support added by adding:

select in  Device Drivers -> Multimedia support -> Video For Linux ->
   Video capture adapters ->  V4L USB devices -> USB Video Class (UVC)

make it = yes, if you load it as a module it won't work right away without some commands to get it loaded from a terminal (adb shell).

From the way it works with a 14 megapixel microsoft cam I tried, the usb is choppy, I might use a crappier camera with it.

Jaychadw

  • Guest
Re: How to use a web cam
« Reply #3 on: August 31, 2013, 05:52:29 am »
Ah right excellent thank you.

I just have one question.

How on earth do you build / compile / configure kernals.

I have never EVER worked with them at all.  Would windows web cams that do not state compatibitity with android work on these?

xtofury

  • Guest
Re: How to use a web cam
« Reply #4 on: August 31, 2013, 08:02:23 am »
Not as daunting of a task as it might seem, follow this vid:
http://www.youtube.com/watch?v=sub3b9DUp3I

The dependencies are a little confusing, for "make cubieboard_defconfig" (if this fails "echo $ARCH", if you get a blank line try "export ARCH=arm" and "export CROSS_COMPILE=arm-linux-gnueabihf-"), copy the generated .config afterwards to become the new cubieboard_defconfig (if you can't find it try "locate cubieboard_defconfig) and "make menuconfig", one must ensure that libncurses5-dev and libncurses5 dependencies are installed.  After done with make menuconfig, one needs to run "make mrproper" to tidy things up for the main build (as this is kernel stuff only).  For make on the entire sdk, one must ensure that libncurses5-dev:i386 is there, otherwise they fail.

Just sudo apt-get install these dependencies when you run "make -j3" (for dualcore) or "make -j4"

If you get java issues no problems, just download the java jdk here:
http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html#jdk-6u45-oth-JPR

be sure to point JAVA_HOME to the folder by:
export JAVA_HOME=~/jdk1.6.0_45
AND:
export PATH=$PATH:$JAVAHOME:~/bin

Here's some instructions for JDK, don't use the version they suggest get the 6u45 one from the previous link:
http://akbarahmed.com/2012/06/22/install-java-jdk-6-0-update-26-on-ubuntu-12-04-lts/

All of the kernel drivers can be found in /kernel/allwinner/common
that is where I run the make cubieboard_defconfig and make menuconfig stuff.

It involves a rather lengthy download from git as well, and you should check out the instructions at sunxi to get more of an idea, eventually it'll just click in, it's easy once you get through your first build.  Follow up builds do not generally take as long as the first.

If you are feeling lazy I'll put up my latest image, but really it's a good idea to learn this as it is necessary to dig into the GPIO and connect other things...I'm just surprised it didn't come ALREADY installed....

xtofury

  • Guest
Re: How to use a web cam
« Reply #5 on: September 02, 2013, 03:48:38 am »
http://www.fileswap.com/dl/ZPPtpzQFmN/
webcam works, arduino works, i2c should work, touchscreen works, and if you have rotation app or gyro then that nasty landscape mode lock should be gone.

xtofury

  • Guest
Re: How to use a web cam
« Reply #6 on: September 03, 2013, 09:27:56 pm »
I can get apps (some of them) working from google play, but I cannot get this to work:
http://developer.android.com/training/camera/videobasics.html

After I deal with all of the warnings and other things, I am left with this, which nobody seems to know over irc, and comes up with no answers over google (the chineese results translate into nothing useful):
"cubieboard not have framework config class"

Jaychadw

  • Guest
Re: How to use a web cam
« Reply #7 on: March 27, 2014, 09:15:59 am »
Hi

Sorry its taken me so long to get back on.

I just downloading this image.  Will this go straight onto the NAND?