Re: [android-kernel] Android UVC Camera Issue

Visto 1.934 veces
Saltar al primer mensaje no leído

Peter Teoh

no leída,
23 ene 2013, 15:56:1323/1/13
a android...@googlegroups.com
Due to security control, I don't think it is possible to directly access the camera via the /dev devices.  U have to write an app and let Dalvik gives u the access to the camera via manifest.


http://stackoverflow.com/questions/3783124/how-do-i-access-the-camera-on-android-phones

On Thu, Jan 17, 2013 at 1:14 PM, abhishek jain <intelc...@gmail.com> wrote:
Hello,

I have been struggling with an issue related to v4l enabling in Android Kernel. Please suggest me appropriate place to post my question i found this email for contacting on linux-media website. I am trying to connect external UVC camera with android device. 

What i have done so far , I enabled v4l configuration in kernel and i do see in log UVC driver get loaded after enabling  as well as video_device_register return 0 and picked up video node 0. But what is the problem is when i application trying to access /dev/video0 it always shows device busy can not open. 

I have tried all permutation combination by assigning 0666 permission in init.rc , init.<board>.rc or uevetd.<board>.rc .

But no luck please guide me how can i do it ?  I am trying with Logitech C270 webcam and it does support v4l. 

Thank you 

--
unsubscribe: android-kerne...@googlegroups.com
website: http://groups.google.com/group/android-kernel



--
Regards,
Peter Teoh

abhishek jain

no leída,
6 feb 2013, 0:00:066/2/13
a android...@googlegroups.com
Hi Peter,

I know on phone with singed image it is not possible but once you have rooted phone with patch in kernel (configuration ) to enable v4l driver you should see video0 node as a character device and after giving permission 0666 in board specific rc application should be able to access directly. 


I have done all this but not sure why i am getting EBUSY error on open function when trying to open /dev/video0 ( this error number is 16 : device or resource busy). I don't know who else is using /dev/video0 or what is the cause of it. 

Thanks
Himanshu Jain

Andras Nemeth

no leída,
31 mar 2014, 14:32:2031/3/14
a android...@googlegroups.com
Hi,

I have been looking into this problem myself, although I haven't had much time yet. I didn't find the root cause of the problem (i.e. who exactly opens the device before my attempt), but I have a workaround (at least until I can dig deeper and eliminate the real cause).

I don't know if you want to access the device from java, or native code, but the same approach should works for both cases:

Java: Construct a file observer instance for "/dev", with CREATE mask. When onEvent is called check, if for what you have been notified for is a video device and open it, if so. Open should succeed (based on the tests I have done so far).
Native: since FileObserver is based in inotify, the same thing should work using the native inotify API.

Important: your application must run prior to attaching the camera.

Let me know this approach has worked for you, or if you have found a more elegant solution, I'd be very interested.

Andras
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos