USB Camera preview failing on Android 7.1.2

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB Camera preview failing on Android 7.1.2

1,634 Views
trevormeyer
Contributor I

We have a product using the MX6Q that runs Android and uses a USB camera.  The camera worked fine in Android 6.0 and 7.1.1, but in Android 7.1.2, the preview stream is corrupted.  Specifically, using the Camera App, the camera preview appears as purple static most of the time, or occasionally contains small blocks of the actual preview stream from the camera, combined with various random-looking artifacts.  When we capture an image the image is captured correctly, so only the preview stream has a problem.  There is no obvious difference in the logcat output between the working version in 7.1.1 and the failing version in 7.1.2 (ie. no errors printed in 7.1.2 indicating a problem).  Any idea what might be wrong?

Labels (4)
0 Kudos
9 Replies

1,261 Views
trevormeyer
Contributor I

Weidong,

You said that the NXP team tested the USB camera on a Sabre-SD board running 7.1.2 and it worked.  I assume that was an MX6-based Sabre? With that in mind, I removed all changes we made to any related components (video, gpu, ipu, USB and camera) and tested again but it still does not work.  So it seems there is some strange difference between our system and the Sabre-SD.  Would the NXP team have some suggestions as to where to look or what might have changed to break our build?  Here are some possibly relevant pieces of information for them:

1) It worked in 6.0 and 7.1.1.

2) The same build works fine using a CSI-based camera.  Only the USB camera fails.

3) We didn't make any additional changes to our 7.1.2 build that were not in the 7.1.1 build, except as noted in 4) below.

4) In 7.1.2, we had to switch our CSI camera HAL to use MMAPStream as it had strange preview problems when using the USPStream.  I saw this same change was made to the NXP CSI-based camera HALs.  Could this be related somehow?  The UVC Camera HAL for MX6 uses the DMAStream which is derived from USPStream.

5) To distinguish between our two USB cameras, we had to give them unique names: ci_hdrc.1-1.X, where X is the USB port number for the camera (2 or 3 in this case).  Could this mess something up in the 7.1.2 HAL somehow?

6) Similarly to 5), our USB cameras are FRONT and BACK rather than EXTERNAL.

7) We had to make some IPU and LCD related DTS changes for our display panel.  Could these be messing up the preview streaming in some way?

Thanks,

Trevor

0 Kudos

1,261 Views
trevormeyer
Contributor I

Hello Weidong,

I was unable to run gmem_info, I get this error: /system/bin/sh: /system/bin/gmem_info: not executable: 64-bit ELF file

0 Kudos

1,261 Views
trevormeyer
Contributor I

I send the various files directly to you, let me know when you get them or if you do not get them.  

0 Kudos

1,261 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello Trevor,

   I didn't find information on GPU driver in your log, could you confirm if you have added gpu driver in your kernel configuration?

   Then run "gmem_info" on command line, checking if information on GPU can be displayed.

Have a nice day!

Best regards,

weidong

0 Kudos

1,261 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi, Trevor Meyer

send files to me, please!  weidong.sun@nxp.com

Thanks!

regards,

Weidong

0 Kudos

1,261 Views
trevormeyer
Contributor I

Hopefully I will have the information for you later today.  When I last left the build the camera was not working at all due to some experimental changes, so I am trying to get it back to a working state now.

A couple things I did not mention before: I can reproduce the same problem with a Logitech USB camera I bought at Target.  It is a HD Webcam C270; it worked in Android 6.0 and Android 7.1.1 but not Android 7.1.2.  We also have an MX6-based product that uses the same Android 7.1.2 build but has a CSI Camera module instead of the USB camera, and that works fine in 7.1.2.

0 Kudos

1,261 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello Trevor,

    I.MX expert team helped us to test USB camera on android 7.1.2,  there is no problem!

Best Regards,

Weidong

0 Kudos

1,261 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi, Trevor

   Would you like to provide these information for me?

1. Take a record of  "camera preview" by phone, and paste it here. I want to see the quality of image preview.

2. booting log of linux kernel.

3. android log via logcat.

Have a nice day!

Best Regards,

NXP TIC weidong sun

0 Kudos

1,261 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Any update?

0 Kudos