Voice Focus Leak : WebRTC audio stream not released
See original GitHub issueWhat 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 aVoiceFocus
and its associated worker. How do you I destroy it even without creating a device ? -
Create a voice focus device with
.createTransformDevice(innerDevice)
andstartAudioInput
on deviceController of themeetingSession
’saudioVideo
-
Call
stop
on the device, when stopping theaudioVideo
and destroying thedeviceController
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 :
Issue Analytics
- State:
- Created a year ago
- Comments:10 (7 by maintainers)
Top GitHub Comments
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).
Logs from my testing: https://pastebin.com/1WaxaC8m
Screenshot from my testing:
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?
@nainkunal933 Thanks for investigating! I’ll follow up on Chromium issue 😃