Closed Bug 1468205 Opened 6 years ago Closed 7 months ago

Only one camera in permission prompt on Google Hangout: infrared

Categories

(Core :: WebRTC: Audio/Video, defect, P3)

defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: gerard-majax, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

STR:
 1. Ubuntu 18.04, ThinkPad T480s, Nightly
 2. Join a Hangout video call
 3. Permission promp only offers /dev/video0 that is the infrared camera

Expected:
 Two entries in permission prompt to use /dev/video1 that is the proper normal camera

Actual:
 One entry, infrared camera (/dev/video0)

Works well in Cheese when selecting second device.
Flags: needinfo?(padenot)
Flags: needinfo?(dminor)
Summary: Only one camera in permission prompt: infrared → Only one camera in permission prompt on Google Hangout: infrared
Somehow, it's okay on appear.in ?
Rank: 19
Priority: -- → P2
If it works on appear.in but not hangouts, it sounds like it is not a problem with device enumeration, but that hangouts is filtering out the second camera for some reason.
Flags: needinfo?(dminor)
(In reply to Dan Minor [:dminor] from comment #2)
> If it works on appear.in but not hangouts, it sounds like it is not a
> problem with device enumeration, but that hangouts is filtering out the
> second camera for some reason.

Yes, except that it's likely bad reasons given it's selecting the infrared one, which is the first enumerated ; or we send something wrong that makes them select the invalid one. They document Firefox support as in beta, but their support link is useless to report an issue. I don't have the contacts to ive the proper feedback, as well.
Blocks: meet
This reproduces for me on my Ubuntu 18.04 desktop with two usb webcams connected. Only one device is present in the permissions prompt. Oddly, it chooses the microphone from one camera and the video from the other. If I disconnect the camera being used for video and restart the call, it will happily use the camera it previously ignored.

I verified that both devices are being enumerated as expected and that both are available on appear.in.

Nils, do we have a contact at Google that can help debug this?
Flags: needinfo?(padenot) → needinfo?(drno)
I'm still experiencing this on other websites: the new Air Mozilla admin web page allows one to use WebRTC, and I get only the infrared camera in the list of available devices.
Flags: needinfo?(dminor)
I've double-checked that we are properly enumerating the cameras. Comparing the behaviour to appear.in, I see both devices on appear.in, but only the first choice on meet.google.com. I was unable to find an admin page on air.mozilla.org, presumably I don't have access.

It's possible we're doing something wrong at the GetUserMedia level, but that's not really my area of expertise. Maybe :jib can help out.

Are both devices showing up for you in Chrome?
Flags: needinfo?(dminor) → needinfo?(jib)
(In reply to Dan Minor [:dminor] from comment #6)
> I've double-checked that we are properly enumerating the cameras. Comparing
> the behaviour to appear.in, I see both devices on appear.in, but only the
> first choice on meet.google.com. I was unable to find an admin page on
> air.mozilla.org, presumably I don't have access.
> 
> It's possible we're doing something wrong at the GetUserMedia level, but
> that's not really my area of expertise. Maybe :jib can help out.
> 
> Are both devices showing up for you in Chrome?

Last time I was testing, only Firefox would not show the proper devices on Google Hangout.
Right now, on Air Mozilla streaming admin, it seems Chromium is also using the infrared camera. However, I have not been able to find a way to change the camera as we have in the permission prompt on Firefox, so I cannot tell if it's enumarating correctly.
It's possible Hangouts is using constraints to limit selection, maybe constraints like facingMode or deviceId.

Try turning on MOZ_LOG="MediaManager:4". This should log the constraints passed in to getUserMedia (they'll be displayed in an internal normalized format in the log). Please paste it here. Thanks.

It'll also log all camera(s) modes available and their fitness distance, which might narrow down further what is going on.
Flags: needinfo?(jib)
Attached file mediamanager.log
Check attachment 9012168 [details] :)
Flags: needinfo?(jib)
Hrm they must be taking the first device:

> [Child 31407: MediaManager]: D/MediaManager GetMediaDevices: appending device=Integrated IR Camera: Integrate
> [Child 31407: MediaManager]: D/MediaManager GetMediaDevices: appending device=Integrated Camera: Integrated C

Alex, maybe I can have a look or something if you have a minute at the office today.
Scratch that, we seem to be presenting the wrong devices ?
(In reply to Paul Adenot (:padenot) from comment #11)
> Hrm they must be taking the first device:
> 
> > [Child 31407: MediaManager]: D/MediaManager GetMediaDevices: appending device=Integrated IR Camera: Integrate
> > [Child 31407: MediaManager]: D/MediaManager GetMediaDevices: appending device=Integrated Camera: Integrated C
> 
> Alex, maybe I can have a look or something if you have a minute at the
> office today.

I only see one exposed in the permission prompt. I'm not in the office today, but should be tomorrow, I'll show you live.
Just to clarify comment 6 in case it sounded like I also have a thinkpad t480, I'm able to reproduce this issue (or something similar) with my linux desktop and two usb cameras. In appear.in, both cameras and microphones are available. In meet.google.com, I only see one choice for camera and one choice for microphone. The only choice available in meet is the same device as the default choice in appear.in. So I don't think this problem is specific to Alexandre's hardware.
It was pointed out to me on IRC that you can use the hangouts settings menu to select which camera to use. I could use that to switch between both of my usb cameras. Do you see only the infrared camera in the hangouts settings menu?
(In reply to Alexandre LISSY :gerard-majax from comment #10)
> Check attachment 9012168 [details] :)

The only constraints I see in logs are {width: 1280, height: 720}, but our logging is insufficient. I've filed bug 1494498.

It's possible Hangouts is enumerating devices and using a {deviceId: {exact: id}} constraint to explicitly to pick the first device in the enumerated list. This would match the symptom of one device in the list.

Something like this: https://jsfiddle.net/jib1/L893um4L/

Web sites are allowed to do that. I will try to confirm this once I've improved the logging.

If this is the case, we might want to consider reordering things to always list the preferred device first in enumerateDevices.
Flags: needinfo?(jib)
Attached file mediamanager.log
And this attachment is the same logging, on nightly from september 27th, but this time on the Air Mozilla admin for webcast, that exhibits the exact same behavior as Google Hangouts.
Flags: needinfo?(jib)
I've added extra logging in bug 1494498. A linux try build is here https://queue.taskcluster.net/v1/task/DIdyDrV-TBG1-SWxPKF8GQ/runs/0/artifacts/public/build/target.tar.bz2 or you can wait for Nightly in two days.

On my system, I see Hangouts using deviceId constraints to pick a specific camera from the list returned by enumerateDevices:

[Child 58279: MediaManager]: D/MediaManager Constraints: {
[Child 58279: MediaManager]: D/MediaManager   width: { min: -2147483647, max: 2147483647, ideal: 1280 }
[Child 58279: MediaManager]: D/MediaManager   height: { min: -2147483647, max: 2147483647, ideal: 720 }
[Child 58279: MediaManager]: D/MediaManager   frameRate: { min: -inf, max: inf }
[Child 58279: MediaManager]: D/MediaManager   mediaSource: { exact: [], ideal: [camera] }
[Child 58279: MediaManager]: D/MediaManager   facingMode: { exact: [], ideal: [] }
[Child 58279: MediaManager]: D/MediaManager   deviceId: { exact: [env5UgTqlPjgbvx9jUPKQ6JV7tEzurOmn7dNuPZtGAg=], ideal: [] }

Hangouts is allowed to force this choice, so you cannot alter it in Firefox's permission prompt.

Instead, you have to change your camera and mic under the ⚙️ icon in Hangouts itself.

Hangouts probably remembers my settings from last time, so it's hard to tell what it would do on a fresh system.

But from your report, it sounds like instead of using constraints, Hangouts blindly picks the first device in the list, regardless of fit.

Comment 11 suggests your IR Camera is first in the enumerated list. You can check it here: http://jsfiddle.net/jib1/LbtxeLvw/

I see two potential bugs here:

 1) Hangouts would be better off letting the fitness algorithm pick the best camera the first time, like appear.in does.

 2) Firefox could be smarter about ordering the list of devices, anticipating that some sites may blindly pick the first
    listed device regardless of fit. We could pre-sort it using the fitness algorithm against our system default (640x480).

I don't know how to access Air Mozilla admin for webcast, but I assume it's doing the same thing as Hangouts.
Flags: needinfo?(jib)

Hangouts is still broken.

Clearing old needinfo.

Flags: needinfo?(drno)
Severity: normal → S4
Priority: P2 → P3
Status: NEW → RESOLVED
Closed: 7 months ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: