getDisplayMedia: [Windows Chrome] System Audio track goes mute when USB Headset is connected/disconnected

422 views
Skip to first unread message

Vinayak V Kulkarni

unread,
Apr 13, 2023, 5:29:22 AM4/13/23
to discuss-webrtc
Hi Team,
I am trying to use "Audio capture support" on getDisplayMedia by passing both audio and video constraints.
Sharing the "Tab Audio" when sharing only the particular "Chrome Tab" like this works fine.
Screen Shot for Chromium - Tab Share.PNG
But when sharing the "Entire Screen" and "Share system audio" (like below screenshot)
Screen Shot for Chromium - Share  Entire Screen.PNG
 - I observe that the shared system audio becomes mute when a USB Headset device is connected/disconnected. I monitored for onmute, onunmute and onended events and the enabled/muted/readyState flags on the track but they don't indicate any issue.

This issue doesn't happen with Tab Audio. The issue is also seen Slack Web Application on Chrome.

Attaching the video captured using https://addpipe.com/get-display-media-demo/ 
I have raised a chromium bug as well - https://bugs.chromium.org/p/chromium/issues/detail?id=1432877, if any else has encountered this issue, please star this issue. 
Any info if there is a workaround or a fix for this would be appreciated. 
Thanks
Video for Chromium.mp4

guest271314

unread,
Apr 15, 2023, 6:07:20 PM4/15/23
to discuss-webrtc
I don't think sharing around is supported for sharing Entire Screen. 

On Linux Chromium authors refuse to support capturing system audio - even though following said refusal to support capturing monitor devices on Linux the systemAudio constraint was added to Screen Capture specification, which is misleading in the case of Chrome or Chromium on Linux. See https://github.com/edisionnano/Screenshare-with-audio-on-Discord-with-Linux#enter-chromium for details and workarounds.

Henrik Andreasson

unread,
Apr 17, 2023, 1:59:54 AM4/17/23
to discuss...@googlegroups.com
The issue has been discussed and resolved in https://bugs.chromium.org/p/chromium/issues/detail?id=1432877

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/1c025dd0-c3c8-463a-abf8-61d7f92d6d8bn%40googlegroups.com.

raj codonnier

unread,
Jul 20, 2023, 3:36:45 AM7/20/23
to discuss-webrtc

local stream microphone not working while share screen + system audio shared in HTML JS

Screenshot 2023-07-19 182435

Here is code HTML + JS 

function startScreenShare() { if (screenSharing) { stopScreenSharing() } navigator.mediaDevices.getDisplayMedia( { video: { mediaSource: "screen" }, audio: true } ).then((stream) => { setScreenSharingStream(stream); screenStream = stream; let videoTrack = screenStream.getAudioTracks()[0]; videoTrack.onended = () => { stopScreenSharing() } if (peer) { let sender = currentPeer.peerConnection.getSenders().find(function (s) { return s.track.kind == videoTrack.kind; }) sender.replaceTrack(videoTrack) screenSharing = true } console.log(screenStream) }) }



We have tried to share screen audio. When sharing the screen, microphone and screen-sharing audio do not work together. Mic does not work when system audio is on. System audio does not working if end mic is on. please explain me what is the about issue.

Henrik Andreasson

unread,
Jul 20, 2023, 4:19:12 AM7/20/23
to discuss...@googlegroups.com
Please file an issue at https://bugs.chromium.org/p/chromium/issues/list and attach a working (complete) JS code snippet where the issue can be reproduced.


Reply all
Reply to author
Forward
0 new messages