UVC for Android?

6,186 views
Skip to first unread message

lucrus

unread,
Mar 15, 2012, 5:21:38 AM3/15/12
to Android Linux Kernel Development
Hello *,

I'm new to this group and to Android kernel development in general, so
please be patient with me for my newbie questions.

My customer would like to use a external USB webcam (UVC) connected to
a tablet that has a USB Host port. Are there any plans to include the
UVC driver in the Linux kernel for Android in the future? The app
would need to be easily installable by end users, so the "compile it
yourself" solution is a non-starter.

Also coding a static UVC library (GPL license) using the
android.hardware.usb API seems a bit hard way to go... unless there's
someone here, already UVC-skilled, interested in doing such paid job...

lucrus

unread,
Mar 17, 2012, 8:15:53 AM3/17/12
to Android Linux Kernel Development
I just feel the need to clarify some points, based on private messages
received so far:

1. I'm not going to write a UVC driver for Android myself. For one,
I'm not skilled enough for that job and then I think we don't need to
write an UVC driver, we already have one in the Linux kernel. Either
we plan to include officially that in the Android Linux kernel, or we
plan to port that code as a Dalvik static library (if we ever decide
to do anything about that).

2. I know the current UVC Linux driver is GPL and many people
contributed it in years. For my project (actually my customer's
project) it's ok to have a GPL static library and then to make Android
apps under GPL license. If someone is interested in coding such
library, he would be paid to port/write GPL code.

hedwin

unread,
Mar 18, 2012, 5:28:10 AM3/18/12
to android...@googlegroups.com
UVC is already part of the standard kernel but you need to configure the kernel to use it of course.
To capture the output you need to use video 4 linux (v4l2).

Hedwin


lucrus

unread,
Mar 18, 2012, 10:05:17 AM3/18/12
to android...@googlegroups.com


On Sunday, March 18, 2012 10:28:10 AM UTC+1, Hedwin wrote:
UVC is already part of the standard kernel but you need to configure the kernel to use it of course.

Assuming you refer to "make menuconfig" and similar, the problem is just that: I'm looking for a way to use a UVC webcam from an app without requiring users to root their devices, recompile the kernel, install it, install v4l and then install my app. I can reach that point sometime in the future in two ways:
1. have the UVC driver included by default into the Android default kernel, and v4l included by default at least in some Android distributions
2. have the UVC driver and v4l ported to a static Dalvik library I link to my app

Now I have little clue about which of those two options is feasible, if any, so I ask your opinions about that.

s.rawat

unread,
Mar 23, 2012, 1:00:17 PM3/23/12
to android...@googlegroups.com
HI, 
We have been doing this work and were successfull as well with lots of delay ~1-2 secs.The tablet kernel needs to have the uvc-usb and v4l2 module enabled in that.The main challenge is that even if you are able to build the lernel at your own by enabling the uvc support from the make menu-config , no tablet distributor will allow you to do it and hence no commercial solution for it.
Ofcourse you have to root your device but many of us knows that rooting voids the warranty.All i can hint here is that rooting the device cleverly(hacking the system/su code and calling it from the JNI) and having inserted the uvc usb and v4l2 driver the frames can be grabbed upto to the Android UI Framework .You just need to create the images out of the raw data coming out of video node being created and display it on the UI continuously.Lot of raw hacks and dirty tricks to get this done.
Also the device must be hot pluggable for any USB UVC device.There are lot of device which you can readily use - Acer Iconia Tab A501 is one of them.
The biggest hurdle you can face is to get the creation of node- /dev/video0 being formed as soon you plug in the uvc camera.remember this.This is the thumb rule for identifying the tablets which you can work upon.

Rgds,
softy
"..pain is temporary.....quitting lasts forever......"



--
Reply all
Reply to author
Forward
0 new messages