Arksine / Easycam

Easycap viewer for android
BSD 3-Clause "New" or "Revised" License
40 stars 14 forks source link

Error Connecting Device #10

Open kushanshah11 opened 8 years ago

kushanshah11 commented 8 years ago

Hi,

I am using EasyCap to convert RCA to usb to stream video from Surveillance system.

I have selected UTV007 as device type and NTSC as color coding standard.

Every time i am getting "Error connecting device" and Black screen.

Help will be appreciated !!

Thanks.

Arksine commented 8 years ago

Are you using a kernel that has the usbtv module compiled/loaded? Assuming you have a rooted device with busybox installed, you can determine if the module is loaded with the lsmod command. Run it from adb or from a terminal emulator on your device. If usbtv isn't listed then you don't have the driver.

In that situation I suggest looking for kernels for your device that have the usbtv driver pre-installed. Alternatively you could get the source for your kernel, add the usbtv source to it, then configure the kernel to build the module (either built in if you want to flash the entire kernel or as a module if you want to push it to your device with adb and load it with modprobe). If you haven't done any of this before then there are tutorials on google, but its not trivial for beginners.

If you do infact already have the usbtv module loaded make sure SELinux is in permissive mode. There is an app called "SELinuxModeChanger" that will set this for you.

sw-tt-niravbhavsar commented 8 years ago

Hello Arksine,

I can see output using https://play.google.com/store/apps/details?id=com.easycap.viewer from my Surveillance System.

But using this project getting "Error Connecting Device".

What should be workaround ?

Your support really help me to move ahead with my app as i am stuck at initial level.

Looking forward for your support!!

Thanks, Nirav

Arksine commented 8 years ago

The developers for easycapviewer wrote their own Android user space driver for easycap devices. My app relies on existing kernel space easycap drivers using the V4L2 subsystem. The downside to using kernel space drivers is:

1) The driver must either be compiled with the kernel, or compiled as a module. As far as I know there are no stock kernels that include this driver, regardless of device. You must flash a custom kernel with support, or compile the drivers from source, push them to your device, and load them with modprobe. I did all of my testing on a custom rom for a Nexus 7 2012 that had the drivers compiled with the kernel.

2) SEAndroid (or SELinux as its commonly referred to) prevents user space apps from accessing v4l2 devices. A work around for rooted devices is to enter the following commands from adb:

adb root adb shell setenforce 0

One (or both) of the above issues is what is causing your device connection error. I have had requests for creating user space drivers, and while I haven't ruled it out its not something I will do anytime soon. I simply can't spare the time to do it right now, and both my Nexus 7 and Easycap are installed in my car so I can't test without taking them out. Anyone that wants that functionality can download the app you linked.

kushanshah11 commented 8 years ago

HI, can you please share how to integrate V4L2 subsystem with existing module or how can i flash custom kernel with support, or compile the drivers from source ?

so it will will work like easycap Viewer app without device root.

Help will be appreciated !!

Thanks.

Arksine commented 8 years ago

Compiling a kernel is far too complex of a process for me to explain it. There are tutorials on how to compile an Android kernel, most of which are several hours long. You can use google to find them. Compiling a kernel is not beginner friendly, it will take a lot of effort on your part to learn how to do it. You may want to begin by learning how to compile a linux kernel.

The XDA forums are good place to see if a kernel exists for your device that has the drivers built in. The steps toward flashing a kernel are device specific. You will likely need to unlock your bootloader, root your device, and flash recovery before you can flash a custom kernel.

While Easycam itself doesn't require root, getting it to work almost certainly does. Easycap Viewer should not require root. If you have a UTV007 device then I recommend using that app if you don't want to root your device or learn how to build and flash a kernel.

kushanshah11 commented 8 years ago

Hi,

in NativeEasyCapture java File (startDevice,getNextFrame,isDeviceAttached,stopDevice,detectDevice) can't find JNI function.

I m using Android Studio 2.1.1 and NDK 10e Version.

can you please tell what's d issue?

Thanks.

Arksine commented 8 years ago

Those are just lint errors because I don't use Android Studio's built in NDK support.

Edit: I have added an annotation to suppress those warnings.

VSneg commented 2 years ago

Hi i try to use this app with MS2100E. I know that this device doesn't support but maybe can you help me with this problem?