use uvc as primary camera
#1
I'm using Android 6.1 image with pine64 board. I have UVC webcam and don't have the pine64 camera.

I installed open camera app from play store and the app could use the webcam as the secondary camera.

But other apps like hangout, skype, etc., don't detect this camera. It appears that they look for the primary camera and then report that the camera is missing.

Is there a way to setup the UVC webcam as the primary camera so that the android apps use it?
#2
i did a mod off of xda website a couple years back using a nexus 7 and a uvc webcam.  it did pretty much what you wanted , i think. question is if this will work on the pine64. take a look at it,
https://forum.xda-developers.com/showthr...452&page=3
pine64 does otg but only with one usb port, i think it is the top one, furtherest from board.
#3
Often the microusb port is also an OTG port;  NOT ON THE PINE.  The microusb connector is only a power plug !

Both of the usb ports are usb2.0 and can be used for things like drives, keyboards, and even cameras;  however, only the bottom  top port can be used OTG (the usb port closest furthest from the board).

( I edited the previous post to avoid confusion )

And yet, there is confusion about this.  The upper usb port (furthest from the board) is the FEL port; sometimes confused with the OTG hardware port.  (in a previous post even tllim was confused about this, and I'm still fuzzy on it too)

Of course a normal OTG port will have an ID pin.  The ports on the pine are type A four pin (+5, D+, D-, ground) and do NOT have the id pin (like a five pin microusb OTG port).  Consequently, whether you can REALLY use either port as a real OTG port is sketchy at best.  

The schematics show no difference in the ports electrically;  only that ONE of the ports is wired to the OTG hardware/   so........  the top port.

This was the Pine choice to provide two usb2.0 ports for most user's flexibility rather than providing one REAL OTG port with ID pin which might have been used for booting from the usb!

Note:  and having said all of that...  if the FEL port is REALLY the OTG hardware port, that needs to be documented -- and in that case the top port (furthest from the board) is the REAL OTG port.
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
#4
(03-20-2017, 04:14 AM)MarkHaysHarris777 Wrote: Both of the usb ports are usb2.0 and can be used for things like drives, keyboards, and even cameras;  however, only the bottom port can be used OTG (the usb port closest to the board).

Are you sure about that Marcus? It is documented as being the top port.


Attached Files Thumbnail(s)
   
#5
traditionally, it has been the cabling. A cable as host device, b as peripheral. maybe that is how pine64 works it. if so then the camera will need b cabling. as a side note, i think there are apps that can determine if a device, in this case pine64, are OTG compatible, or if so, if they are host ready.
#6
(03-20-2017, 05:49 AM)pfeerick Wrote:
(03-20-2017, 04:14 AM)MarkHaysHarris777 Wrote: Both of the usb ports are usb2.0 and can be used for things like drives, keyboards, and even cameras;  however, only the bottom port can be used OTG (the usb port closest to the board).

Are you sure about that Marcus? It is documented as being the top port.

Thank you!   What is the source of the thumb nail ?   Also, then that means that the FEL port (top) is the same as the OTG hardware port  too (top) ?  I've looked through the SoC user manual, but apparently I missed it;  can you provide a page number?


Note:  I did confirm through reliable sources on-line (irc) that the FEL port (top usb port) is the OTG hardware port (furthest from the board vertically).

If the board is booted without the SD card in place the machine goes into FEL mode , and the pine board (using FEL port) will be visible to the PC as a device-- the pc will be able to write to the pine memory , and read the pine memory (although, not immediately useful, it is a cool academic exercise);  however,  when booted in gnu+linux there isn't a usb OTG controller available , so with linux only two (2) usb2.0 host ports are available;  no OTG port is available.
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
#7
Thanks for all your replies.

In my case the camera is already recognized by pine64.

I was able to use the camera successfully with an app called "open camera app" from playstore.
Only apps like skype/hangout report that the camera is not found.

Do i still need to use OTG cable?
Will executing the following 3 lines make the apps use UVC webcam as the main camera? (taken from the link given by @dkryder)

su
chown system.camera /dev/video0
chmod 660 /dev/video0

Do i also need to replace the camera.tegra3.so mentioned in in @dkryder  's reply?
#8
(03-20-2017, 04:04 PM)mathiraj Wrote: Thanks for all your replies.
<snip>
su
chown system.camera /dev/video0
chmod 660 /dev/video0

cabling will not buy you anything, because the pine board has no ID pin that can be used to determine OTG or not.  And, if we're talking linux, at least, there is no OTG controller anyways.

If the pine recognizes the camera, there will be a device for it...  the trick will be to point the app at the relevant device  ( for instance  /dev/video0 )  and then make sure that the user is in the right group for the device, and|or that the permissions are correct.
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
#9
(03-20-2017, 05:57 AM)MarkHaysHarris777 Wrote: Thank you!   What is the source of the thumb nail ?   Also, then that means that the FEL port (top) is the same as the OTG hardware port  too (top) ?  I've looked through the SoC user manual, but apparently I missed it;  can you provide a page number?

The linux-sunxi Pine64 wiki link in my signature.

The A64 datasheet talks about the USB peripherals under 2.9 External Peripherals -> USB Controller. USB OTG is also covered in the A64 User Manual at 7.5.2 USB OTG.

On AllWinner SoCs, you put the device into FEL mode (usually via a switch or jumper) , and you then boot using the USB OTG port. There is no "fel port"... FEL mode is the mode the CPU goes into to boot via the USB OTG port. 
#10
the thing with android apps is some of them are hardwired to look for a specific camera location and if there is no camera there the app reports no camera found, what that little mod does is find a camera at an alternate location and report it as being were most apps are looking. that is how it gets past the no camera found problem. that mod was for a nexus 7 running android, it has nothing to do with linux. not sure how linux even got into the discussion. mathiraj, you need to follow the directions provided in that mod and make note of anything that happens and let us know how it goes. should work if the pine64 is really a nexus 7 in drag.


Possibly Related Threads…
Thread Author Replies Views Last Post
  Android USB camera support - Android 7.0 mikey0000 24 42,243 08-27-2018, 08:39 PM
Last Post: lee
  Camera Support Thru Android devildog125 17 22,542 12-04-2016, 09:42 AM
Last Post: kenjiru
  UVC Camera support mikey0000 6 9,074 09-09-2016, 01:49 PM
Last Post: mikey0000
  Camera streaming to TV over long distance CanadianIceTech 6 11,552 08-03-2016, 02:15 AM
Last Post: RangeR
Music RTC and Camera modules g_t_j 2 4,630 05-26-2016, 02:42 PM
Last Post: g_t_j
  Audio from Headphone Jack and Camera Issue cybernak 1 3,696 05-23-2016, 11:02 AM
Last Post: tllim
Question Android + Camera Peripheral T_ech 4 7,507 01-29-2016, 10:01 PM
Last Post: modsbyus

Forum Jump:


Users browsing this thread: 3 Guest(s)