Need help
# ask-ai
c
Need help
t
Thanks for reaching out, Ashish. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'd love to help you out! Could you please share a bit more about what you're experiencing? For instance, are you having trouble with a technical issue, or do you need some guidance on a particular feature or setup? I'm here to support you every step of the way.
c
I’m use usedatachannel and I’m sending card carousel from backend to front end using data channel. But I’m facing some data loss as soon as we deploy on gcp or aws. What might be the issue
t
I understand that data loss in LiveKit's data channels can be frustrating, and I’m here to help clarify what’s going on. Typically, this issue is more about network conditions and how lossy data channels are designed, rather than the cloud platform you’re using, whether it’s GCP or AWS. Let’s walk through some important points together: • Lossy Data Channels: These channels prioritize low-latency transmission and don’t guarantee every packet will arrive or be in order. So, some data loss can happen, especially when the network is under stress. • Network Conditions: If there’s high packet loss or latency, your system might switch protocols (like from UDP to TCP), which can cause brief interruptions. • Buffer Limits: When data is sent faster than it can be handled, the buffer might overflow, leading to dropped packets. It’s important to note that while GCP or AWS themselves aren’t the root cause of data loss, certain network settings on these platforms—like routing, latency between regions, or firewall rules—can sometimes make things a bit trickier. LiveKit offers features like
use_external_ip
to help manage cloud-specific networking challenges and keep things running smoothly. Here are some practical steps you might find helpful to reduce data loss: • Check and optimize your cloud instance’s network setup, such as making sure UDP traffic isn’t blocked. • Keep an eye on network health to spot any high latency or packet loss early on. • Adjust your application’s flow control to avoid overwhelming the buffer. If you’d like, I’m happy to assist you further with specific configurations or troubleshooting. Just let me know—I’m here to support you! Sources: src/room/RTCEngine.ts | livekit-android-sdk/src/main/java/io/livekit/android/room/RTCEngine.kt | Data packets | LiveKit Docs | pkg/rtc/transport.go | Connecting to LiveKit | LiveKit Docs
c
What’s the max size data channel can handle without giving error
t
Thanks for reaching out! I’d love to help you understand the maximum data size that a LiveKit data channel can handle, which actually depends on the delivery mode you’re using: • Reliable Mode: Each data packet can be up to 15KiB in size. This takes into account the 16KiB protocol limit, with 1KiB set aside for headers. • Lossy Mode: It’s best to keep the packet size at a maximum of 1300 bytes to prevent any issues with packet fragmentation and loss. This size matches well with the network’s Maximum Transmit Unit (MTU) of 1400 bytes. If you go beyond these limits, you might run into errors or less reliable delivery, so it’s good to keep these in mind. Please feel free to ask if you’d like me to explain anything further or if there’s anything else I can assist you with! Sources: Data packets | LiveKit Docs
c
It’s 1384 bytes and still wasn’t transmitted
t
Hi there! I wanted to share a little insight about why a 1384-byte packet might have trouble transmitting over a LiveKit data channel in lossy mode. It’s because it’s a bit larger than the recommended maximum size of 1300 bytes. This guideline helps keep packets within the network's Maximum Transmit Unit (MTU) of 1400 bytes, which helps avoid fragmentation and keeps things running smoothly. In lossy mode, packets are sent just once without any retries. So, if a larger packet like 1384 bytes gets broken up and any piece is lost along the way, the whole packet doesn’t make it through. This can make delivery a bit less reliable, especially if the network is under stress. To help things work better, I’d suggest trying to keep your packet size at 1300 bytes or less. If you have any questions or need a hand with this, please don’t hesitate to reach out—I’m here to help! Sources: Data packets | LiveKit Docs
c
One more thing. When the livekit agents are deployed. Sometimes the .say messages appear late and if we have a data channel it appears earlier than .say Even though chronologically . Say appear first then data channel. Why is this happening in deployed only
One more thing. When the livekit agents are deployed. Sometimes the .say messages appear late and if we have a data channel it appears earlier than .say Even though chronologically . Say appear first then data channel. Why is this happening in deployed only
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!