0

I have an application that records video from USB cameras mounted on microscopes in remote places in Africa. It is working fine from Android 4 to 12. We have a handful of camera models and the problem is that our latest camera (already deployed dozens of them) fail on Android 9 and 10.

What is really strange is that if I open OTG Guru on those devices with that cameras, I am seeing an unknown device, with an unknown vendor and product ID, without any function inside (expecting video functions): OTG Guru with weird VID/PID

The same camera connected to the same tablet model but with Android 8.1 gives: OTG Guru with the proper data

I have seen reports that it was due to a targetSdk of 28+. So I updated my app to 27 with no difference. I also downloaded an older version of OTG Guru that had targetSdk 26 and got the same result.

Now, one might think that this camera is not usable on Android 9 or 10, but several apps in the Play Store are able to use it just fine like this USB Camera app or this OTG viewer

I tried to inspect the Manifest of those apps to see if my app was missing a permission but that doesn't look like it. And if that was the case, the other cameras wouldn't work. And all 3 others that I tested work just fine and are detected normally by OTG Guru...

I tried with several USB-C to USB-A adapters and a USB-C HUB. When the latter is not externally powered, the camera is not detected at all and if I give it power, it appears exactly as shown above.

I also disabled the Android USB debugging to see if it was interfering but it didn't.

4
  • If it works in one app but not in the other it is a problem of your code. I recommend to decompile some of the working apps to see what they do different. You can also create a question of stackoverflow.com posting relevant source code parts of your app and ask for help how to access USB camera on modern devices. Therefore voted to close the question here.
    – Robert
    Mar 27, 2022 at 10:55
  • @Robert I am showing that OTG Guru and all other OTG apps that simply list the USB devices reported by Android give a weird VID/PID result on a specific camera on Android 9 and 10. There is not a line of my code involved here. My code gives the same results as widely used OTG apps. I don't mind questioning my code but I'm basically listing devices and getting one that doesn't make sense, without any interface. So I'm looking for a clue as to what the difference might be. Mar 27, 2022 at 18:06
  • Have you tried if it is a power issue? Use an active USB hub between phone and camera. If the camera is low on power this could have strange effects on the USB protocol.
    – Robert
    Mar 27, 2022 at 18:32
  • @Robert Yes, I should have mentioned it. I tried with a trusted USB-C HUB with a good power supply. Without power, it doesn't see the device at all and with power, it sees the weird VID/PID. I also tried with 3 different USB-C to USB-A adapters and put USB amp-meter (it's barely taking power when not actively recording). I also suspected the USB debugging feature of Android to interfere but that didn't change anything. Good suggestions though Mar 28, 2022 at 9:14

0

You must log in to answer this question.

Browse other questions tagged .