I think I found the issue.
I took the hint, and created a new opMode using the code you provided above. I then extended it slightly to use 3 cameras on 3 VisionPortals and discovered that…it works. 2 of the 3 viewports are blue screens but this should be expected given that the logitech 270’s are running at 640x480, through a single hub, with default image compression (from the doc: Under the legacy YUY2 format , one webcam or the other (on a shared hub) may stop streaming above roughly 640x360 resolution. This is below the default resolution of 640x480.)
I modified the code a bit further to stopStreaming() on each portal immediately after it starts streaming and wait for CAMERA_DEVICE_READY before building the next portal. I also added some gamepad controls to “switch” between portals by calling stopStreaming() on the “current” portal and "resumeStreaming() on the “new” portal. Again, everything works fine, one camera at a time.
This was tested both with a powered and unpowered USB hub confirming (I think) the suspicion that the issue in this case, was not about USB power.
So then I started adding in the additional embellishments that were present in the test bed described above. A single line reproduced the issue:
.enableLiveView(true)
When this line was added to the VisionPortal builder, the portal would hang in the OPENING_CAMERA_DEVICE state. If the passed in parameter is false, everything works as expected.
So we’ll modify our code so enableLiveView() is only called when we want it set to false and I think the kids are back in business.
I would appreciate knowing if:
A) you can reproduce this (try adding .enableLiveView(true) to your VisionPortal builder)
B) If you can reproduce this, is it a bug or expected behavior?
Thanks!