Problem with USB 3.0 camera and XU4. LineageOS 14.1-20180311

Moderators: mdrjr, odroid

Problem with USB 3.0 camera and XU4. LineageOS 14.1-20180311

Unread postby kafan1986 » Fri May 18, 2018 4:54 pm

I am using a USB 3.0 camera which gives me a supports multiple resolution. 1280x480 or 2560x960

If I try to preview camera at 1280x480 it works fine and displays fine but if I use 2560x960 resolution, the preview picture is all distorted and noisy with horizontal lines (refer attached image). I am using the USB 3.0 port with my camera and it works at this higher resolution fine, with my other devices like my mac book.

USB 3.0 bandwidth should be enough for such resolution. Any inputs regarding how to solve such issue?
Attachments
Webp.net-compress-image (3).jpg
Webp.net-compress-image (3).jpg (181.54 KiB) Viewed 667 times
kafan1986
 
Posts: 19
Joined: Tue Feb 27, 2018 8:05 am
languages_spoken: english

Re: Problem with USB 3.0 camera and XU4. LineageOS 14.1-2018

Unread postby voodik » Fri May 18, 2018 6:51 pm

Hi,
for first can you check is your camera working on linux ?
Buy me a beer Here ;)
BTC: 3Lx83Vh9HL7UbsD9oDBcMR9pQMRSPEfRmg
User avatar
voodik
 
Posts: 1390
Joined: Sat Dec 07, 2013 2:36 am
languages_spoken: english,russian

Re: Problem with USB 3.0 camera and XU4. LineageOS 14.1-2018

Unread postby kafan1986 » Fri May 18, 2018 7:00 pm

voodik wrote:Hi,
for first can you check is your camera working on linux ?


This camera is rated to work out of the box with android, mac, linux and windows. I have tested it with both mac and windows but currently don't have access to a linux system. I will test it as soon as possible but I don't think there should be any problem with linux, given I have tested this on mac programmatically, using ffmpeg/opencv/python.

Also, FYI that this is a stereo camera.
kafan1986
 
Posts: 19
Joined: Tue Feb 27, 2018 8:05 am
languages_spoken: english

Re: Problem with USB 3.0 camera and XU4. LineageOS 14.1-2018

Unread postby voodik » Fri May 18, 2018 7:16 pm

kafan1986 wrote:
voodik wrote:Hi,
for first can you check is your camera working on linux ?


This camera is rated to work out of the box with android, mac, linux and windows. I have tested it with both mac and windows but currently don't have access to a linux system. I will test it as soon as possible but I don't think there should be any problem with linux, given I have tested this on mac programmatically, using ffmpeg/opencv/python.

Also, FYI that this is a stereo camera.

I am talking about Linux on Odroid, please install linux on some microsd card and test it on your XU4.
Buy me a beer Here ;)
BTC: 3Lx83Vh9HL7UbsD9oDBcMR9pQMRSPEfRmg
User avatar
voodik
 
Posts: 1390
Joined: Sat Dec 07, 2013 2:36 am
languages_spoken: english,russian

Re: Problem with USB 3.0 camera and XU4. LineageOS 14.1-2018

Unread postby kafan1986 » Fri May 18, 2018 7:21 pm

voodik wrote:
kafan1986 wrote:
voodik wrote:Hi,
for first can you check is your camera working on linux ?


This camera is rated to work out of the box with android, mac, linux and windows. I have tested it with both mac and windows but currently don't have access to a linux system. I will test it as soon as possible but I don't think there should be any problem with linux, given I have tested this on mac programmatically, using ffmpeg/opencv/python.

Also, FYI that this is a stereo camera.

I am talking about Linux on Odroid, please install linux on some microsd card and test it on your XU4.


Creating one now. Any preference with ubuntu version 16 or 18?
kafan1986
 
Posts: 19
Joined: Tue Feb 27, 2018 8:05 am
languages_spoken: english

Re: Problem with USB 3.0 camera and XU4. LineageOS 14.1-2018

Unread postby kafan1986 » Fri May 18, 2018 9:16 pm

voodik wrote:
kafan1986 wrote:
voodik wrote:Hi,
for first can you check is your camera working on linux ?


This camera is rated to work out of the box with android, mac, linux and windows. I have tested it with both mac and windows but currently don't have access to a linux system. I will test it as soon as possible but I don't think there should be any problem with linux, given I have tested this on mac programmatically, using ffmpeg/opencv/python.

Also, FYI that this is a stereo camera.

I am talking about Linux on Odroid, please install linux on some microsd card and test it on your XU4.



*UPDATE*: I tested the camera with mplayer instead of cheese. It is showing much less lag, probably less than 1 sec. Frame drop is present but I think I am getting around 4 fps (2414 frames successfully processed, 15144 frames dropped). Also, camera keeps continue working till I shutdown the app. At lower resolution of 1280x480 negligible frames are dropped and I am nearly max supported FPS from camera.

Code: Select all
root@odroid:~# v4l2-ctl -d /dev/video0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
   Index       : 0
   Type        : Video Capture
   Pixel Format: 'YUYV'
   Name        : YUYV 4:2:2
      Size: Discrete 2560x960
         Interval: Discrete 0.033s (30.000 fps)
         Interval: Discrete 0.050s (20.000 fps)
      Size: Discrete 1280x480
         Interval: Discrete 0.033s (30.000 fps)
         Interval: Discrete 0.050s (20.000 fps)

root@odroid:~# lsusb -t
/:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
    |__ Port 1: Dev 2, If 0, Class=Vendor Specific Class, Driver=r8152, 5000M
/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/2p, 5000M
        |__ Port 1: Dev 4, If 0, Class=Video, Driver=uvcvideo, 5000M
        |__ Port 1: Dev 4, If 1, Class=Video, Driver=uvcvideo, 5000M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/2p, 480M
        |__ Port 2: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=exynos-ohci/3p, 12M
    |__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 1: Dev 2, If 1, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 1: Dev 2, If 2, Class=Human Interface Device, Driver=usbhid, 12M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=exynos-ehci/3p, 480M


@voodik Tested this in ubuntu 18.04 version using Cheese. The image is displayed properly without any artifacts for few minutes even in highest resolution (2560x980), although there is considerable lag, there is frames drops and my estimate is camera is not giving me more than 1 FPS at this resolution. The camera image freezes after sometime. And all this while from the beginning itself this message is printed on terminal.

Code: Select all
MESA-LOADER: failed to retrieve device information
libGL error: unable to load driver: exynos_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: exynos

(cheese:2012): Gtk-WARNING **: 12:07:53.768: Theme parsing error: cheese.css:7:35: The style property GtkScrollbar:min-slider-length is deprecated and shouldn't $

(cheese:2012): cheese-WARNING **: 12:07:58.316: A lot of buffers are being dropped.: gstbasesink.c(2902): gst_base_sink_is_too_late (): /GstCameraBin:camerabin/G$
There may be a timestamping problem, or this computer is too slow.
kafan1986
 
Posts: 19
Joined: Tue Feb 27, 2018 8:05 am
languages_spoken: english

Re: Problem with USB 3.0 camera and XU4. LineageOS 14.1-2018

Unread postby odroid » Fri May 18, 2018 11:37 pm

Can you try "guvcview" on Ubuntu 18.04?
User avatar
odroid
Site Admin
 
Posts: 28707
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Problem with USB 3.0 camera and XU4. LineageOS 14.1-2018

Unread postby kafan1986 » Sat May 19, 2018 12:29 am

odroid wrote:Can you try "guvcview" on Ubuntu 18.04?


guvcview is even better. It is giving me 8+ fps at 2560x980 resolution with minimum lag and at 1280x480 resolution achieves 30 fps. Although the camera seems to suffer from select timeout after few minutes. Is there something that needs to be done in android to make it similar performing without the "select timeout"? Also, would it make any difference by using Lineage v15 (Oreo)?
kafan1986
 
Posts: 19
Joined: Tue Feb 27, 2018 8:05 am
languages_spoken: english

Re: Problem with USB 3.0 camera and XU4. LineageOS 14.1-2018

Unread postby odroid » Sat May 19, 2018 4:01 am

I have no idea how UVC camera works in the Android framework.
I hope Voodik can help you.
User avatar
odroid
Site Admin
 
Posts: 28707
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Problem with USB 3.0 camera and XU4. LineageOS 14.1-2018

Unread postby kafan1986 » Sat May 19, 2018 10:43 am

odroid wrote:I have no idea how UVC camera works in the Android framework.
I hope Voodik can help you.


@voodik: Is there any other information that you need for debugging this problem? I do need this camera to work at this higher resolution. Kindly make this work, please.
kafan1986
 
Posts: 19
Joined: Tue Feb 27, 2018 8:05 am
languages_spoken: english

Re: Problem with USB 3.0 camera and XU4. LineageOS 14.1-2018

Unread postby voodik » Sat May 19, 2018 9:21 pm

Please dump logcat dmesg logs after reproducing issue.
Then upload e.g. to pastebin.com and post links here.
Buy me a beer Here ;)
BTC: 3Lx83Vh9HL7UbsD9oDBcMR9pQMRSPEfRmg
User avatar
voodik
 
Posts: 1390
Joined: Sat Dec 07, 2013 2:36 am
languages_spoken: english,russian

Re: Problem with USB 3.0 camera and XU4. LineageOS 14.1-2018

Unread postby kafan1986 » Sat May 19, 2018 11:41 pm

voodik wrote:Please dump logcat dmesg logs after reproducing issue.
Then upload e.g. to pastebin.com and post links here.


*UPDATE 2: Tested android code by setting camera FPS to 20 and at the same higher resolution of 2560x980. Artifacts are still present on the screen. Same error message in dmesg logs (link below). Someone please help. Seems like the driver works perfectly at 20 fps in linux(ubuntu 18.04), whereas not so in android.

https://pastebin.com/24RYGtqJ

*UPDATE 1: came across another insight using guvcview on ubuntu. There are 2 fps mode that camera supports - 20fps and 30fps. With 30fps mode and highest resolution 2560x980, the guvcview is giving me around 8 fps as earlier posted, but with 20 fps mode, I am actually getting 20 fps.

*ORIGINAL:
@voodik: Please refer the dmesg log below

https://pastebin.com/7Kmrb0xK
kafan1986
 
Posts: 19
Joined: Tue Feb 27, 2018 8:05 am
languages_spoken: english

Re: Problem with USB 3.0 camera and XU4. LineageOS 14.1-2018

Unread postby voodik » Tue May 22, 2018 4:03 am

Can you check ubuntu dmesg for errors/warnings ?
Buy me a beer Here ;)
BTC: 3Lx83Vh9HL7UbsD9oDBcMR9pQMRSPEfRmg
User avatar
voodik
 
Posts: 1390
Joined: Sat Dec 07, 2013 2:36 am
languages_spoken: english,russian

Re: Problem with USB 3.0 camera and XU4. LineageOS 14.1-2018

Unread postby kafan1986 » Tue May 22, 2018 11:30 am

voodik wrote:Can you check ubuntu dmesg for errors/warnings ?


dmesg log from boot till running camera for 20 seconds at 2560x960, 30 fps, ubuntu 18.04 using guvcview, giving around 7-8 fps. Encounters "select timeout" after few minutes usually.

https://pastebin.com/N3uadX8x


dmesg log when running camera for over 60 minutes at 2560x960, 20 fps, ubuntu 18.04 using guvcview, giving 20 fps. Kept on running till I tested (well over 60 minutes and counting) without any timeout. I am OK, if we achieve this camera resolution and framerate on XU4 android. dmesg logs shows sparsely spread errors..

https://pastebin.com/SX0ZFQqq
kafan1986
 
Posts: 19
Joined: Tue Feb 27, 2018 8:05 am
languages_spoken: english

Re: Problem with USB 3.0 camera and XU4. LineageOS 14.1-2018

Unread postby voodik » Tue May 22, 2018 8:45 pm

I will try to port some commits of UVC driver from latest kernel branch and let you know.
Buy me a beer Here ;)
BTC: 3Lx83Vh9HL7UbsD9oDBcMR9pQMRSPEfRmg
User avatar
voodik
 
Posts: 1390
Joined: Sat Dec 07, 2013 2:36 am
languages_spoken: english,russian

Re: Problem with USB 3.0 camera and XU4. LineageOS 14.1-2018

Unread postby kafan1986 » Tue May 22, 2018 9:53 pm

voodik wrote:I will try to port some commits of UVC driver from latest kernel branch and let you know.


Thanks. Would test them and let you know once you post the link.
kafan1986
 
Posts: 19
Joined: Tue Feb 27, 2018 8:05 am
languages_spoken: english


Return to Android

Who is online

Users browsing this forum: No registered users and 3 guests