This message was deleted.
# helpdesk
s
This message was deleted.
e
There is no difference config of livekit-server itself between oss and cloud, I think the difference is caused by the network quality between your host server and cloud node, the cloud has a algorithm to allocate a node that has best connection quality and server load for the client
a
Thanks for a quick answer @early-gigabyte-44411. Is there any way to confirm this? The connection on hosted oss is great over Wi-Fi (tested 3 different networks), but degrades drastically after about 10 seconds on LTE never to return to higher bandwidth. It’s looks like being throttled down for some reason. I don’t understand where the throttle comes from – network, browser, device, turn server or host?
d
@agreeable-minister-78501 it likely has to do with how your server is configured. I would check firewall settings on the instance/hosting provider to ensure that the ports we require are opened.
a
@dry-elephant-14928 Thanks for feedback. We’ve opened port 7882, which was closed due to use of 50000-60000, but it didn’t help. I looked into the issue more thoroughly and noticed behaviour: 1. When connecting via LTE from iPhone the connection degrades always after 30 seconds (not about 10 as I mentioned before). 2. After that in console on iPhone appears:
Copy code
secondary PC state changed disconnected
Client starts to reconnect. After that connection is restored, but after another 30 seconds it happens again. During that time on iPhone I can see video from other call participants without any interruptions. I also tried using data channel to keep the connection and it works during the “disconnection” phase. We use LiveKit 1.3.3
e
The disconnected means network not stable for the rtc connection, but it will continue work until state transit to
failed
, so the video is not interrupt
By the way, the client should only reconnect when PC state transit to
failed
, is it right for iOS? @better-house-11852
👍 1
a
@early-gigabyte-44411 That might be true, it actually starts to reconnect after state transit is
failed
. Here is full log
e
@agreeable-minister-78501 I have post you a test server and token, you can check it with your client
❤️ 1
a
Hey @early-gigabyte-44411, @dry-elephant-14928, I’ve tested this issue on 4 different devices, 3 networks (1 wi-fi, and 2 cellular networks) and 3 servers (ours, rauber’s and LiveKit Cloud). The result is still the same: both on rauber’s and our open source server connection is being lost every 30 seconds on iOS with a cellular network. Mac & Android on a cellular network aren’t affected by this problem. Connecting with LiveKit Cloud on a cellular network works just fine. I was wondering, maybe LiveKit Cloud uses a different version of livekit-server? Is there any way to check it? Our host use 1.3.3
👀 1
d
That's interesting.. Cloud uses the same LiveKit SFU code. However, we do enable ICELite on Cloud. That's one difference
a
@dry-elephant-14928 Thanks for looking into this. Can ICELite be enabled on open source version? I couldn’t find much info about it. I might also add I’ve tested the connection on 3 different iPhones (14 pro, 12, X) with iOS 16 and 15 on 3 different SIM cards (including 2 mobile service providers). Is it possible the server somehow limits the bandwidth instead of a phone?
d
Yup, you can enable ICELite, it's here as long as you are able to connect. the quality of connection depends a lot on your hosting provider and how they are connected to various ISPs. LiveKit Cloud runs across a number of providers that we've vetted to have performant networking and interconnects to various ISPs.
a
Thanks, I must have missed it in the config. We’ll give it a try and let you know how it went
@dry-elephant-14928 We’ve just enabled ICELite, but it didn’t help 😕 I compared chrome://webrtc-internals settings for oss and cloud, and noticed that • Cloud uses port 3478 for UDP and 443 TCP. • Our host (and rauber`s) use 443 for UDP and 443 for TCP Do you think it might be the source of the problem?
d
hmm, that shouldn't be a major difference.. do you know how the connections have been terminated? can you enable debug on the client sdk and attach logs there?
a
Do you mean client JS sdk? If yes, it looks just like on the screenshot I’ve attached before

https://livekit-users.slack.com/files/U04E8HT0QKE/F04KF9DGMQW/image.png

I can post full log (as text) if needed in the morning (GMT+1 timezone). I’m not sure I understand the question about terminating the connections. Our sys admin was monitoring literally all data packets on the host while the issue occured, but he couldn’t find anything useful
d
do you have timestamps for these logs? from their alone it's not visible that they are becoming disconnected.
a
Yes, here is a screenshot (it’s easier to read than plaintext due to code highlight). I’ve just sent you a PM with our host url and test tokens – maybe it will be helpful to try it on your device
@dry-elephant-14928, @early-gigabyte-44411 After many hours of testing I’ve managed to identify the cause of this problem. Problem: Stream from iPhone users connected with mobile data is freezing and disconnecting every 30 seconds. Issue occurs on both Amazon EC2 with cloud-init built environment and custom host on another data center. Solution: Enable TURN server and set
enable_loopback_candidate
to
true
. Enabling ICELite was not necessary. Changing ports didn’t have any effect.
e
That's great! Can you check the users that solve the problem are connected through TURN server?
a
How can I check that? I’ve observed chrome webrtc internal logs and they show TURN urls for ICE candidates. Also the issue occurs again if I disable TURN in livekit.yaml config
e
You can check the ICE candidate grid of
webrtc-internals
tab, there will have the selected candidate pair information.
a
Yes, I can confirm the connection uses TURN udp
e
That means your client’s udp traffic for iPhone seems not stable, some ISP may block STUN/DTLS traffic, but that can’t explain your other device (android, pc) works well in same network🤔
@better-house-11852 Do you have similar experience for iPhone disconnected every 30 seconds?