openxc / android-webcam

Android library to access a USB webcam feed
BSD 3-Clause "New" or "Revised" License
322 stars 139 forks source link

Insufficient permissions, /dev/video4 owned by system user #18

Open btut opened 9 years ago

btut commented 9 years ago

Hi, I tried to compile your example and I am having problems getting it to run. When I can see the line "Insufficient permissions on /dev/video4 -- does the app have the CAMERA permission?". I am sure video4 is the right device since it appears only when the camera is attached via USB. I did not change anything else in the library or your example. Any idea on how to resolve this? Thank you!

btut commented 9 years ago

btw, I am using a Samsung Galaxy S5 with Android 5.0

airtel121 commented 8 years ago

Same issue have you found solution bcs Library already have camera permission in menifest in CameraActivity.

btut commented 8 years ago

Hi, no, unfortunately I have not found any solution. I can see that the kernel flags that are required are enabled, and video4 shows up with permissions 0660, but is owned not by media but by system. I do not know how to resolve this, any input by the developer would be great!

btut commented 8 years ago

@peplin have you ever experienced this? Any input would be highly appreciated. I checked for the kernel extensions and everything seems to be ok, I don't know where the issue might lie.

peplin commented 8 years ago

Hey, sorry, no I've never experienced any of this - I only ever used this library on one or two devices back on Android 4.x.

btut commented 8 years ago

Thanks for your reply. I downgraded to 4.4, didn't change anything unfortunately. Let's see if I can get this to work.

philjoseph commented 7 years ago

I had a similar issue where the /dev/video3 (that the one in my device) is owned by system. So I've run chown media /dev/video3 and had it now owned by media user as suggested in the README. Now the only problem is that I am still getting the same error

12-01 17:46:22.044 20837 20837 I WebcamManager: Service starting 12-01 17:46:22.053 20837 20837 W d.openxc.webcam: type=1400 audit(0.0:100): avc: denied { read } for name="video3" dev="tmpfs" ino=192720 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:video_device:s0 tclass=chr_file permissive=0 12-01 17:46:22.055 20837 20837 D NativeWebcam: Insufficient permissions on /dev/video3 -- does the app have the CAMERA permission? 12-01 17:46:22.055 20837 20837 I WebcamManager: Service binding in response to Intent { cmp=com.ford.openxc.webcam/.WebcamManager } 12-01 17:46:22.064 20837 20837 I WebcamPreview: Bound to WebcamManager 12-01 17:46:22.067 20837 20853 E NativeWebcamJNI: Unable to load frame, buffers not initialized