Closed Bug 1493990 Opened 6 years ago Closed 4 years ago

SetSinkId: Enable setSinkId through MSG

Categories

(Core :: Audio/Video: MediaStreamGraph, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: achronop, Assigned: achronop)

References

Details

Attachments

(4 files)

We need to support setSinkId when the audio output occurs through the MSG. This happens when the source object of the HTMLMediaElement is a MediaStream object coming from WebAudio or a gUM request. All these cases are handled through MSG. Currently, MSG does not support to change the output device.
Blocks: 934425
Priority: -- → P3
Blocks: 1498512
Depends on: 1617915
Depends on: 1621243

Tried this just now on meet.google.com with the pref media.setsinkid.enabled set to true on MacOS 10.15.3 (19D76) with Firefox Nightly 76.0a1 (2020-03-29) (64-bit)

It does not work for WebRTC during the call but does work for the 'Test' audio bit (likely a local file)

What's the status?

Assignee: nobody → achronop

Thanks for the response (on multiple bugs) Alex! Looking forward to some testing for this bug when ready.

Depends on: 1630986
Depends on: 1637235

The name of the two new tracks is CrossGraphTransmitter and CrossGraphReceiver. They are used together to transfer the audio data of the transmitter to the receiver which belongs to different MTG. In addition to that a CrossGraphManager class has been created that creates the connection between the transmitter and the receiver and can redirect to the correct track some operations like the volume change etc.

A new method has been added in AudioStreamTrack to allow the change of the output device. Also, the methods that add/remove the AudioOutput or Volume have been enhanced to use the CrossGraphManager, when available, in order to set the AudioOutput or volume to the correct MediaTrack.

Depends on D77807

The SetSinkId method of HTMLMediaElement has been enhanced to handle the sink change when the element is sourced with a MediaObject through the srcObject attribute. It makes use in the corresponding method of AudioStreamTrack taking into account the AudioOutput and Volume that has to be removed and re-added to the right track.

Depends on D77808

The GetSinkDevice method is used for the output device enumeration and verification. The result of the enumeration is an object that includes the low-level device id even if the device is the preferred one. In that case, the device id is replaced with null in order to use it directly with the rest of the logic.

Depends on D77809

Pushed by achronopoulos@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8d4faaf6604c Create two new MediaTrack able to transfer the audio data between different threads. r=padenot. https://hg.mozilla.org/integration/autoland/rev/49c83d2045f1 Enhance AudioStreamTrack to set output device and handle the connection between different graphs. r=padenot https://hg.mozilla.org/integration/autoland/rev/9ad8f66fbc7c Enable sink change in the srcObject of HTMLMediaElement. r=padenot https://hg.mozilla.org/integration/autoland/rev/00372b81041d Return a null device id when the device is the default one. r=jib.
Regressions: 1651049
Regressions: 1661710
Depends on: 1786306
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: