New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 627793 link

Starred by 4 users

Issue metadata

Status: Started
Owner:
Last visit > 30 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Blocking:
issue 616098



Sign in to add a comment

MediaDeviceInfo object of kind videoinput is missing groupId

Project Member Reported by oseg@chromium.org, Jul 13 2016

Issue description

Version: 51.0.2704.106 (64-bit)
OS: Ubuntu 14.04 LTS

What steps will reproduce the problem?
(1) With a webcam connected visit https://guidou.github.io/enumdemo4.html which lists the MediaDeviceInfo objects from an `enumerateDevices` call.

What is the expected output?
I expect the webcamera entry to have a `groupId` that is a non-empty string.

What do you see instead?
An empty string.


If the camera has a built-in microphone, I also expect the `groupId`s of the camera's videoinput and audioinput MediaDeviceInfo objects to match.

 
Labels: Needs-Feedback
Status: Assigned (was: Untriaged)
oseg@ could you include a link of the spec where this is mandated?

Comment 2 by oseg@google.com, Aug 9 2016

jansson@ Here you go: https://w3c.github.io/mediacapture-main/#idl-def-mediadeviceinfo

It appears that the `groupId` should have the same format as the currently supported `deviceId`; though it doesn't get as thorough an explanation as the latter.

Comment 3 by guidou@chromium.org, Aug 10 2016

Cc: maxmorin@chromium.org
Labels: -OS-Linux -Needs-Feedback OS-All
Project Member

Comment 5 by bugdroid1@chromium.org, Sep 2 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f07d1047986130ef0277a87b5b0b6175c4362c98

commit f07d1047986130ef0277a87b5b0b6175c4362c98
Author: maxmorin <maxmorin@chromium.org>
Date: Fri Sep 02 00:17:27 2016

Add groupid for media devices. Group audio devices.

At present, the renderer tries to use matched_output_device
to assign groupids to audio devices. matched_output_device isn't set
before devices are sent to the renderer, and we wouldn't be able to
handle all the cases with it anyways.

BUG=636300, 627793

Review-Url: https://codereview.chromium.org/2273653002
Cr-Commit-Position: refs/heads/master@{#416140}

[modify] https://crrev.com/f07d1047986130ef0277a87b5b0b6175c4362c98/content/browser/renderer_host/media/audio_input_device_manager.cc
[modify] https://crrev.com/f07d1047986130ef0277a87b5b0b6175c4362c98/content/browser/renderer_host/media/media_stream_manager.cc
[modify] https://crrev.com/f07d1047986130ef0277a87b5b0b6175c4362c98/content/common/media/media_stream_messages.h
[modify] https://crrev.com/f07d1047986130ef0277a87b5b0b6175c4362c98/content/public/common/media_stream_request.h
[modify] https://crrev.com/f07d1047986130ef0277a87b5b0b6175c4362c98/content/renderer/media/mock_media_stream_dispatcher.cc
[modify] https://crrev.com/f07d1047986130ef0277a87b5b0b6175c4362c98/content/renderer/media/user_media_client_impl.cc
[modify] https://crrev.com/f07d1047986130ef0277a87b5b0b6175c4362c98/media/audio/audio_manager.h
[modify] https://crrev.com/f07d1047986130ef0277a87b5b0b6175c4362c98/media/audio/audio_manager_base.cc
[modify] https://crrev.com/f07d1047986130ef0277a87b5b0b6175c4362c98/media/audio/audio_manager_base.h
[modify] https://crrev.com/f07d1047986130ef0277a87b5b0b6175c4362c98/media/audio/audio_manager_unittest.cc
[modify] https://crrev.com/f07d1047986130ef0277a87b5b0b6175c4362c98/media/audio/mock_audio_manager.cc
[modify] https://crrev.com/f07d1047986130ef0277a87b5b0b6175c4362c98/media/audio/mock_audio_manager.h

Project Member

Comment 6 by bugdroid1@chromium.org, Sep 2 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0c747762e50c0452f7809fa48249a1a776ff43d2

commit 0c747762e50c0452f7809fa48249a1a776ff43d2
Author: maxmorin <maxmorin@chromium.org>
Date: Fri Sep 02 09:09:46 2016

Revert of Add groupid for media devices. Group audio devices. (patchset #5 id:80001 of https://codereview.chromium.org/2273653002/ )

Reason for revert:
Breaks webrtc FYI bots on mac https://build.chromium.org/p/chromium.webrtc/builders/Mac%20Tester/builds/59143. I'll have to figure out what's up with that ¯\_(ツ)_/¯

Original issue's description:
> Add groupid for media devices. Group audio devices.
>
> At present, the renderer tries to use matched_output_device
> to assign groupids to audio devices. matched_output_device isn't set
> before devices are sent to the renderer, and we wouldn't be able to
> handle all the cases with it anyways.
>
> BUG=636300, 627793
>
> Committed: https://crrev.com/f07d1047986130ef0277a87b5b0b6175c4362c98
> Cr-Commit-Position: refs/heads/master@{#416140}

TBR=guidou@chromium.org,tommi@chromium.org,nasko@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=636300, 627793

Review-Url: https://codereview.chromium.org/2296393004
Cr-Commit-Position: refs/heads/master@{#416217}

[modify] https://crrev.com/0c747762e50c0452f7809fa48249a1a776ff43d2/content/browser/renderer_host/media/audio_input_device_manager.cc
[modify] https://crrev.com/0c747762e50c0452f7809fa48249a1a776ff43d2/content/browser/renderer_host/media/media_stream_manager.cc
[modify] https://crrev.com/0c747762e50c0452f7809fa48249a1a776ff43d2/content/common/media/media_stream_messages.h
[modify] https://crrev.com/0c747762e50c0452f7809fa48249a1a776ff43d2/content/public/common/media_stream_request.h
[modify] https://crrev.com/0c747762e50c0452f7809fa48249a1a776ff43d2/content/renderer/media/mock_media_stream_dispatcher.cc
[modify] https://crrev.com/0c747762e50c0452f7809fa48249a1a776ff43d2/content/renderer/media/user_media_client_impl.cc
[modify] https://crrev.com/0c747762e50c0452f7809fa48249a1a776ff43d2/media/audio/audio_manager.h
[modify] https://crrev.com/0c747762e50c0452f7809fa48249a1a776ff43d2/media/audio/audio_manager_base.cc
[modify] https://crrev.com/0c747762e50c0452f7809fa48249a1a776ff43d2/media/audio/audio_manager_base.h
[modify] https://crrev.com/0c747762e50c0452f7809fa48249a1a776ff43d2/media/audio/audio_manager_unittest.cc
[modify] https://crrev.com/0c747762e50c0452f7809fa48249a1a776ff43d2/media/audio/mock_audio_manager.cc
[modify] https://crrev.com/0c747762e50c0452f7809fa48249a1a776ff43d2/media/audio/mock_audio_manager.h

Project Member

Comment 7 by bugdroid1@chromium.org, Sep 6 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a4ec5769ae36fdd14e49207f30e0aa8dcdc2ac34

commit a4ec5769ae36fdd14e49207f30e0aa8dcdc2ac34
Author: maxmorin <maxmorin@chromium.org>
Date: Tue Sep 06 17:57:09 2016

Reland of Add groupid for media devices. Group audio devices. (patchset #1 id:1 of https://codereview.chromium.org/2296393004/ )

Reason for revert:
I'm fixing the threading issue now.

Original issue's description:
> Revert of Add groupid for media devices. Group audio devices. (patchset #5 id:80001 of https://codereview.chromium.org/2273653002/ )
>
> Reason for revert:
> Breaks webrtc FYI bots on mac https://build.chromium.org/p/chromium.webrtc/builders/Mac%20Tester/builds/59143. I'll have to figure out what's up with that ¯\_(ツ)_/¯
>
> Original issue's description:
> > Add groupid for media devices. Group audio devices.
> >
> > At present, the renderer tries to use matched_output_device
> > to assign groupids to audio devices. matched_output_device isn't set
> > before devices are sent to the renderer, and we wouldn't be able to
> > handle all the cases with it anyways.
> >
> > BUG=636300, 627793
> >
> > Committed: https://crrev.com/f07d1047986130ef0277a87b5b0b6175c4362c98
> > Cr-Commit-Position: refs/heads/master@{#416140}
>
> TBR=guidou@chromium.org,tommi@chromium.org,nasko@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=636300, 627793
>
> Committed: https://crrev.com/0c747762e50c0452f7809fa48249a1a776ff43d2
> Cr-Commit-Position: refs/heads/master@{#416217}

TBR=guidou@chromium.org,tommi@chromium.org,nasko@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=636300, 627793

Review-Url: https://codereview.chromium.org/2313663002
Cr-Commit-Position: refs/heads/master@{#416663}

[modify] https://crrev.com/a4ec5769ae36fdd14e49207f30e0aa8dcdc2ac34/content/browser/renderer_host/media/audio_input_device_manager.cc
[modify] https://crrev.com/a4ec5769ae36fdd14e49207f30e0aa8dcdc2ac34/content/browser/renderer_host/media/audio_output_device_enumerator.cc
[modify] https://crrev.com/a4ec5769ae36fdd14e49207f30e0aa8dcdc2ac34/content/browser/renderer_host/media/audio_output_device_enumerator.h
[modify] https://crrev.com/a4ec5769ae36fdd14e49207f30e0aa8dcdc2ac34/content/browser/renderer_host/media/audio_renderer_host.cc
[modify] https://crrev.com/a4ec5769ae36fdd14e49207f30e0aa8dcdc2ac34/content/browser/renderer_host/media/media_stream_manager.cc
[modify] https://crrev.com/a4ec5769ae36fdd14e49207f30e0aa8dcdc2ac34/content/common/media/media_stream_messages.h
[modify] https://crrev.com/a4ec5769ae36fdd14e49207f30e0aa8dcdc2ac34/content/public/common/media_stream_request.h
[modify] https://crrev.com/a4ec5769ae36fdd14e49207f30e0aa8dcdc2ac34/content/renderer/media/mock_media_stream_dispatcher.cc
[modify] https://crrev.com/a4ec5769ae36fdd14e49207f30e0aa8dcdc2ac34/content/renderer/media/user_media_client_impl.cc
[modify] https://crrev.com/a4ec5769ae36fdd14e49207f30e0aa8dcdc2ac34/media/audio/audio_manager.h
[modify] https://crrev.com/a4ec5769ae36fdd14e49207f30e0aa8dcdc2ac34/media/audio/audio_manager_base.cc
[modify] https://crrev.com/a4ec5769ae36fdd14e49207f30e0aa8dcdc2ac34/media/audio/audio_manager_base.h
[modify] https://crrev.com/a4ec5769ae36fdd14e49207f30e0aa8dcdc2ac34/media/audio/audio_manager_unittest.cc
[modify] https://crrev.com/a4ec5769ae36fdd14e49207f30e0aa8dcdc2ac34/media/audio/mock_audio_manager.cc
[modify] https://crrev.com/a4ec5769ae36fdd14e49207f30e0aa8dcdc2ac34/media/audio/mock_audio_manager.h

Components: -Blink>Webrtc>GetUserMedia Blink>GetUserMedia
guidou@chromium.org,
Is this one available or you plan to work on it?

groupId is important for synchronizing depth and color video streams coming from the same physical device (share the groupId) as in the example here:

https://www.w3.org/TR/mediacapture-depth/#examples
(Playback of depth and color streams from same device group)
 
Blocking: 616098
Cc: guidou@chromium.org
Status: Started (was: Assigned)
I'm starting analysis on how to add groupId for composite camera devices. Thouse could include rgb, depth and fisheye cameras and all should share the groupId.
Owner: aleksand...@intel.com
aleksandar: assigning to you then. Feel free to assign back to me when you finish your analysis.
Cc: mcasas@chromium.org
Did an initial analysis and starting with implementation.

In the first pass, I plan to add a group id link between multiple cameras on the same physical device.
For this, it seems that we can use caps.bus_info on Linux and DevicePath on Windows to identify which video capture devices should have the same groupId:
(do not review, pasting the patch here to document the previous sentence)
https://chromium-review.googlesource.com/c/572900/3


After this, need to find the way to get device path for audio, so that we could link audio to video capture device. maxmorin@chromium.org, do you already know how to get this information - the information from audio input devices enabling a match audio to video device properties; bus_info (Video4Linux) and DevicePath(Windows)? Thanks.


PulesAudio devices seems to have a PA_PROP_DEVICE_BUS_PATH property looking like "pci-0000:00:1b.0". The V4L bus_info seems to be formatted as "PCI:0000:05:06.0". Maybe it's enough to strip special characters, lowercase what's left and use the result as group id? I wrote a CL for using the bus path for Pulse a long time ago (see related bug 636300), but it was reverted for some reason and I never relanded it. Note that, as AudioManager currently works, it derives the group ids by using GetAssociatedOutputDeviceID. To harmonize with video group ids,  GetGroupIDOutput/GetGroupIDInput (at https://cs.chromium.org/chromium/src/media/audio/audio_manager_base.h?l=178) could be made virtual. I'm not familiar with the Windows APIs.
Project Member

Comment 15 by bugdroid1@chromium.org, Jan 27 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/848ce57fc3f3f3b6b099db6f1df81b423a17d945

commit 848ce57fc3f3f3b6b099db6f1df81b423a17d945
Author: Guido Urdaneta <guidou@chromium.org>
Date: Sat Jan 27 01:39:40 2018

Use heuristic to group ID for video-input devices in enumerateDevices

This CL adds a heuristic to find associations between video-input and
audio-input devices.

The heuristic considers an association to exist if the label for the
video device (minus the VID:PID suffix, if it exists) appears as a
substring of the audio label.

If zero or more than one association is found then the video device ID
is used as its group ID. This also fixes the problem of having all
video devices with empty group IDs.

We expect this heuristic to have a relatively high false-negative rate
and a low false-positive rate.

Bug: 627793
Change-Id: Iebc9228ca6a8acd5f0e740f3120ef851fecc1cb1
Reviewed-on: https://chromium-review.googlesource.com/883534
Reviewed-by: Henrik Boström <hbos@chromium.org>
Reviewed-by: Harald Alvestrand <hta@chromium.org>
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532119}
[modify] https://crrev.com/848ce57fc3f3f3b6b099db6f1df81b423a17d945/chrome/browser/media/webrtc/webrtc_getmediadevices_browsertest.cc
[modify] https://crrev.com/848ce57fc3f3f3b6b099db6f1df81b423a17d945/content/browser/renderer_host/media/media_devices_manager.cc
[modify] https://crrev.com/848ce57fc3f3f3b6b099db6f1df81b423a17d945/content/browser/renderer_host/media/media_devices_manager.h
[modify] https://crrev.com/848ce57fc3f3f3b6b099db6f1df81b423a17d945/content/browser/renderer_host/media/media_devices_manager_unittest.cc

Project Member

Comment 16 by bugdroid1@chromium.org, Apr 9 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3a1630fdcef4bf840d02425fc02518ea3563334e

commit 3a1630fdcef4bf840d02425fc02518ea3563334e
Author: Guido Urdaneta <guidou@chromium.org>
Date: Mon Apr 09 13:20:03 2018

Improve group ID heuristic for video devices

Thanks to recent changes in audio device enumerations, it is possible
that USB audio devices report their vid/pid in enumeration results similarly
to video input devices.

This CL extends the heuristic to guess associations between video and
audio devices by looking at coincidences in the VID/PID, if available.
Also, this CL excludes the default and communications device entries
from the heuristics since they could be incorrectly detected as
duplicates.

Bug: 627793
Change-Id: I870a033c1dff358025c5da7332ac90004f1d7f5a
Reviewed-on: https://chromium-review.googlesource.com/992292
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Reviewed-by: Harald Alvestrand <hta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549165}
[modify] https://crrev.com/3a1630fdcef4bf840d02425fc02518ea3563334e/content/browser/renderer_host/media/media_devices_manager.cc
[modify] https://crrev.com/3a1630fdcef4bf840d02425fc02518ea3563334e/content/browser/renderer_host/media/media_devices_manager_unittest.cc

Sign in to add a comment