This message was deleted.
# helpdesk
s
This message was deleted.
g
PS: I'm using createLocalAudioTrack/createLocalVideoTrack (not sure if related or not)
p
hey boris, it should be enough to simply call
room.disconnect()
without all the other cleanup methods you’re calling before. the disconnect method does all the things you are doing there internally in the right order. Does that help?
g
Hi Lukas, thans for your help, but the result is the same. Here are livekit logs :
Copy code
livekit-client.esm.mjs?23b0:24394 room event connectionStateChanged {event: 'connectionStateChanged', args: Array(1)}
livekit-client.esm.mjs?23b0:20722 connecting to <ws://localhost:7880/rtc?access_token=...auto_subscribe=1&sdk=js&version=1.5.0&protocol=8&adaptive_stream=1&network=wifi>
livekit-client.esm.mjs?23b0:20794 ping config {timeout: 20, interval: 10}
livekit-client.esm.mjs?23b0:21132 clearing ping interval
livekit-client.esm.mjs?23b0:21125 start ping interval
livekit-client.esm.mjs?23b0:23372 connected to Livekit Server edition: 0, version: 1.3.1, protocol: 8, region: , nodeId: ND_SvB0B7aW, debugInfo: 
livekit-client.esm.mjs?23b0:24394 room event signalConnected {event: 'signalConnected', args: Array(0)}
livekit-client.esm.mjs?23b0:22677 received server offer {RTCSdpType: 'offer', signalingState: 'stable'}
livekit-client.esm.mjs?23b0:22121 setting munged local description
livekit-client.esm.mjs?23b0:20855 sending answer
livekit-client.esm.mjs?23b0:22601 primary PC state changed connecting
livekit-client.esm.mjs?23b0:22601 primary PC state changed connected
livekit-client.esm.mjs?23b0:19653 updating track subscription permissions {allParticipantsAllowed: true, participantTrackPermissions: Array(0)}
livekit-client.esm.mjs?23b0:24394 room event connectionStateChanged {event: 'connectionStateChanged', args: Array(1)}
livekit-client.esm.mjs?23b0:24394 room event connected {event: 'connected', args: Array(0)}
livekit-client.esm.mjs?23b0:22282 on data channel 1, _reliable
livekit-client.esm.mjs?23b0:22282 on data channel 3, _lossy
livekit-client.esm.mjs?23b0:22039 starting to negotiate
livekit-client.esm.mjs?23b0:22121 setting munged local description
livekit-client.esm.mjs?23b0:20846 sending offer RTCSessionDescription {type: 'offer', sdp: 'v=0\r\no=- 5562703927248534467 2 IN IP4 127.0.0.1\r\ns…le\r\na=sctp-port:5000\r\na=max-message-size:262144\r\n'}
livekit-client.esm.mjs?23b0:22646 received server answer {RTCSdpType: 'answer', signalingState: 'have-local-offer'}
livekit-client.esm.mjs?23b0:22628 secondary PC state changed connecting
livekit-client.esm.mjs?23b0:22628 secondary PC state changed connected
livekit-client.esm.mjs?23b0:22688 received trackPublishedResponse {cid: 'd6ddd03e-e2ef-4896-b50f-7afd565dcc4b', track: {…}}
livekit-client.esm.mjs?23b0:20315 publishing audio with encodings {encodings: Array(1), trackInfo: {…}}
livekit-client.esm.mjs?23b0:24394 room event localTrackPublished {event: 'localTrackPublished', args: Array(2)}
livekit-client.esm.mjs?23b0:22039 starting to negotiate
livekit-client.esm.mjs?23b0:22121 setting munged local description
livekit-client.esm.mjs?23b0:20846 sending offer RTCSessionDescription {type: 'offer', sdp: 'v=0\r\no=- 5562703927248534467 3 IN IP4 127.0.0.1\r\ns…6ddd03e-e2ef-4896-b50f-7afd565dcc4b\r\na=rtcp-mux\r\n'}
livekit-client.esm.mjs?23b0:22646 received server answer {RTCSdpType: 'answer', signalingState: 'have-local-offer'}
livekit-client.esm.mjs?23b0:17126 silence detected on local audio track
livekit-client.esm.mjs?23b0:18829 using video encoding {maxBitrate: 1700000, maxFramerate: 30}
livekit-client.esm.mjs?23b0:22688 received trackPublishedResponse {cid: 'c544df10-f912-452f-ba7a-7a80d7ded7a5', track: {…}}
livekit-client.esm.mjs?23b0:20315 publishing video with encodings {encodings: Array(3), trackInfo: {…}}
livekit-client.esm.mjs?23b0:22767 get capabilities {codecs: Array(8), headerExtensions: Array(11)}
livekit-client.esm.mjs?23b0:24394 room event localTrackPublished {event: 'localTrackPublished', args: Array(2)}
livekit-client.esm.mjs?23b0:22039 starting to negotiate
livekit-client.esm.mjs?23b0:22121 setting munged local description
livekit-client.esm.mjs?23b0:20846 sending offer RTCSessionDescription {type: 'offer', sdp: 'v=0\r\no=- 5562703927248534467 4 IN IP4 127.0.0.1\r\ns…id:h send\r\na=rid:f send\r\na=simulcast:send q;h;f\r\n'}
livekit-client.esm.mjs?23b0:22646 received server answer {RTCSdpType: 'answer', signalingState: 'have-local-offer'}
livekit-client.esm.mjs?23b0:24394 room event recordingStatusChanged {event: 'recordingStatusChanged', args: Array(1)}
livekit-client.esm.mjs?23b0:24394 room event connectionQualityChanged {event: 'connectionQualityChanged', args: Array(2)}
livekit-client.esm.mjs?23b0:23474 disconnect from room {identity: '{"browserId":"browser-ii40a72c-74d0-4dec-bafd-0979…e.localhost","requestId":"9thYFmG6ZMiireZ82cy2X"}'}
livekit-client.esm.mjs?23b0:21132 clearing ping interval
livekit-client.esm.mjs?23b0:20414 unpublishing track {track: LocalAudioTrack, method: 'unpublishTrack'}
livekit-client.esm.mjs?23b0:24394 room event localTrackUnpublished {event: 'localTrackUnpublished', args: Array(2)}
livekit-client.esm.mjs?23b0:20414 unpublishing track {track: LocalVideoTrack, method: 'unpublishTrack'}
livekit-client.esm.mjs?23b0:24394 room event localTrackUnpublished {event: 'localTrackUnpublished', args: Array(2)}
livekit-client.esm.mjs?23b0:24394 room event connectionStateChanged {event: 'connectionStateChanged', args: Array(1)}
livekit-client.esm.mjs?23b0:24394 room event disconnected {event: 'disconnected', args: Array(1)}

----- background/foreground

livekit-client.esm.mjs?23b0:16830 visibility changed, is in Background: false
livekit-client.esm.mjs?23b0:16833 track needs to be reaquired, restarting microphone
livekit-client.esm.mjs?23b0:16766 restarting track with constraints {echoCancellation: true, noiseSuppression: true, deviceId: 'default', autoGainControl: true}
livekit-client.esm.mjs?23b0:16830 visibility changed, is in Background: false
livekit-client.esm.mjs?23b0:16833 track needs to be reaquired, restarting camera
livekit-client.esm.mjs?23b0:16766 restarting track with constraints {width: 1280, height: 720, encoding: {…}, deviceId: '7a3f713abf7376b61e1d61909b7784f0e712a58ef701920a7fec65fcf932886f'}
livekit-client.esm.mjs?23b0:16794 re-acquired MediaStreamTrack
livekit-client.esm.mjs?23b0:17126 silence detected on local audio track
Hi @polite-kilobyte-67570, sorry to ping you but I'm still facing this issue... do you see anything wrong in these logs ? 😕
p
hi boris, nothing seems out of the ordinary with those logs. What I could imagine is that you’re creating local track instances that you never published? That way
localParticipant
wouldn’t know about them and the event listeners might not be cleared. It’d be great if you could create a minimal reproduction based on the sample in
client-sdk-js/example
repo to confirm.
g
👌 the two created tracks seems to be well published, but I will create the reproduction test and come back to you, thanks
🙏 1
Ok, I found the reason. It's because I was publishing the mediaStreamTrack (of the LocalVideoTrack) and not the LocalVideoTrack directly
p
ah, great to hear that you figured it out!
g
Thanks for the help! 👍
🙏 1
p
I’m glad you raised this issue, because it does indicate that cleanup of unpublished tracks isn’t exactly perfect right now. Will think about how to avoid this scenario alltogether!
👍 1