question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Voice Focus Leak : WebRTC audio stream not released

See original GitHub issue

What happened and what did you expect to happen?

After intializing Voice Focus, the webRTC audio stream is never released.

I’m creating a VoiceFocusTransformDevice through the VoiceFocusDeviceTransformer and using the default voicefocus-inline-processor. When Stopping the device through the stop() method and ending the meeting, we can still see active webRTC audio streams through chrome debugger (chrome://webrtc-internals).

I noticed that when stopping the worklet-inline-node we send a ‘stop’ message through the port, yet we dont stop the worker that seems to stay alive. In the meetingV2 demo app, you dont get the issue because you seem to redirect to another page straight after ending the meeting.

Have you reviewed our existing documentation?

Reproduction steps

Supposing you have a started audioVideo meeting :

  • Create a voice focus transformer with VoiceFocusDeviceTransformer.create. It will create in turn a VoiceFocus and its associated worker. How do you I destroy it even without creating a device ?

  • Create a voice focus device with .createTransformDevice(innerDevice) and startAudioInput on deviceController of the meetingSession’s audioVideo

  • Call stop on the device, when stopping the audioVideo and destroying the deviceController

You still have running webRTC audio streams.

Amazon Chime SDK for JavaScript version

3.2.0

What browsers are you seeing the problem on?

Mac OS Chrome

Browser version

Version 102.0.5005.61 (Official Build) (x86_64)

Meeting and Attendee ID Information.

No response

Browser console logs

Remaining webRTC audio streams : 9019aecf0c353bfa14b6b1660a7e97eb

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
richhxcommented, Jun 23, 2022

Hey @chdeps, thanks for raising this issue. After giving it a look, the worker is definitely not being released. I’ve submitted a PR at https://github.com/aws/amazon-chime-sdk-js/pull/2320 to fix this issue.

However, I believe the worker leak is unrelated to the WebRTC stream leak. This can be tested out through the following steps in the demo application (on the release branch).

  1. Deploy the demo application on the release branch (or main, though the additional options wasn’t working for me when I tried)
  2. Open chrome://webrtc-internals/ in a tab.
  3. Open the demo site in a new tab
  4. Enter stuff into “Meeting Title” and “Your Name”
  5. Make sure “Web Audio” is unselected
  6. Click “Continue”
  7. Click “Join” (notice that there’s no “Enable Voice Focus” option since Web Audio is disabled)
  8. Hold the “Shift” key and click the “Leave meeting” green icon in the top-right. The “Shift” key is important here because it will not redirect the page, thereby allowing us to debug the contents of the page.
  9. Notice that it says “Gone” on the page.
  10. Visit the chrome://webrtc-internals/ tab that was previously opened.
  11. Notice that even though the “Connection state” is “closed”, ICE connection state is still “connected”, Signaling state is “stable”, and WebRTC audio streams and audio sources are still running

Logs from my testing: https://pastebin.com/1WaxaC8m

Screenshot from my testing: Screen Shot 2022-06-22 at 11 55 53 PM

Based on this testing, my guess is it’s somewhere in the controller and not the Voice Focus library, since the Voice Focus code isn’t even executed in this test path and the issue is still reproduced.

@michhyun1 or @devalevenkatesh are you able to look into this further?

0reactions
chdepscommented, Nov 15, 2022

@nainkunal933 Thanks for investigating! I’ll follow up on Chromium issue 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

604523 - WebRTC uses wrong audio device to output audio
Hello! I have a client (for a webRTC based audio communication platform) who experiences the same behavior. Only with webRTC connections, ...
Read more >
How to Disable WebRTC and Prevent Leaks - FastestVPN
Need to learn how to disable WebRTC and prevent leaks? This guide will show you all! Learn how to block or disable WebRTC...
Read more >
Flutter webrtc audio not working on android - Stack Overflow
I was doing some testing and video seems to be working with webrtc, but there is no audio. I see the video of...
Read more >
What is a WebRTC Leak & How to Test On Any Browser
WebRTC is an open-source project that browsers use to facilitate real-time communication with video and audio streaming over the web. Almost every browser...
Read more >
How to Fix WebRTC Leaks (All Browsers) - RestorePrivacy
A WebRTC leak is when your external (public) IP address is exposed via your browser's WebRTC functionality. This leak can de-anonymize you via...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found