Issue with VLCKit Playback Delay When Local Network Permission Is Enabled

We are developing an iOS application that uses the MobileVLCKit framework (version 3.7.3) for RTSP video streaming. We have encountered a critical performance issue that directly affects user experience.

Problem Description When the app is granted the Local Network permission (the switch in Apps → OurApp → Local Network), the VLC media player takes 10–15 seconds to start playback after calling play(). If the user manually disables this permission, playback starts immediately (within 1 second).

The issue is 100% reproducible on real devices and does not appear on the simulator.

What we have tried

Adjusting VLC options (network-caching, rtsp-tcp, clock-synchro, etc.) — no effect. Using different RTSP streams (both local and public) — same delay. Checking network logs: the delay occurs before any actual RTSP handshake (DESCRIBE/SETUP), suggesting the system is waiting for something network-related. Why this is critical We cannot instruct our users to turn off Local Network access, because the app also needs this permission for legitimate features (e.g., discovering cameras on the local network). Disabling it permanently is not a viable solution.

Request We kindly ask for your guidance:

Is there a recommended way to configure the app or the VLC instance to avoid this delay while keeping Local Network permission enabled? Could this be a bug in the permission-handling layer that causes unnecessary timeouts? Are there any entitlements, plist keys, or runtime flags we should use to optimise network access in this scenario? We are happy to provide detailed logs, a sample project, or any other information that could help identify and resolve this issue.

Environment

iOS: 16.0+ Device: Physical (all) VLCKit: 3.7.3 (integrated via CocoaPods) Xcode: 26.5 Thank you for your time. We look forward to your response.

Answered by DTS Engineer in 896651022

Yeah, it's coming from internet

OK, so local network privacy should be irrelevant to this stream, which gels with the explanation in your original post.

Coming back to your main issue, debugging that is going to be tricky. DTS does not, in general, support open source software. From our perspective, VLCKit is like any other library that you wrote. If that code is having problems on an Apple platform, it’s up to you to debug the code to the point where a specific Apple API is misbehaving, at which point I can step in with clarifications and advice.

My best guess is that this is related to the way that the code interacts with the source interface. iOS devices have many different interfaces, and choosing the right interface can be challenging. For TCP this usually doesn’t matter — you let the system choose the interface for you — but for UDP it’s trickier, and lots of existing BSD Sockets code jump through a lot of hoops to try to do the right thing. I suspect that this library has code that tries to set up the stream over each interface in turn, falling back to the next interface when it fails. If LNP is enabled this code fails fast, but with LNP enabled it ends up waiting for some timeout.

However, that’s just a guess. I don’t know this codebase at all, so I can’t offer more than that. To debug this further you’ll either have to dig into this library yourself or discuss it with the experts via its support channel.

But if you manage to get to a point where one of our APIs is misbehaving, or you need advice on how to use it correctly, reply back here and I’ll respond to that.


Finally, there’s a bunch of BSD Sockets tips and tricks in TN3151 Choosing the right networking API. However, those are mostly focused on TCP, not UDP. Most of the UDP problems I see are related to broadcasts and multicasts, and I talk about those in Extra-ordinary Networking > Broadcasts and Multicasts, Hints and Tips. Sadly, I don’t think that’ll help you much, because your stream is most definitely unicast. However, Extra-ordinary Networking does have a bunch of links to other posts that provide background on how networking actually works in practice on our platfroms.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Just to confirm, this RTSP video stream is coming from the wider Internet, right? That is, you’re not playing a stream that’s hosted on the local network?


Oh, and btw, this is a worry:

integrated via CocoaPods

given this:

https://blog.cocoapods.org/CocoaPods-Specs-Repo/

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Yeah, it's coming from internet

OK, so local network privacy should be irrelevant to this stream, which gels with the explanation in your original post.

Coming back to your main issue, debugging that is going to be tricky. DTS does not, in general, support open source software. From our perspective, VLCKit is like any other library that you wrote. If that code is having problems on an Apple platform, it’s up to you to debug the code to the point where a specific Apple API is misbehaving, at which point I can step in with clarifications and advice.

My best guess is that this is related to the way that the code interacts with the source interface. iOS devices have many different interfaces, and choosing the right interface can be challenging. For TCP this usually doesn’t matter — you let the system choose the interface for you — but for UDP it’s trickier, and lots of existing BSD Sockets code jump through a lot of hoops to try to do the right thing. I suspect that this library has code that tries to set up the stream over each interface in turn, falling back to the next interface when it fails. If LNP is enabled this code fails fast, but with LNP enabled it ends up waiting for some timeout.

However, that’s just a guess. I don’t know this codebase at all, so I can’t offer more than that. To debug this further you’ll either have to dig into this library yourself or discuss it with the experts via its support channel.

But if you manage to get to a point where one of our APIs is misbehaving, or you need advice on how to use it correctly, reply back here and I’ll respond to that.


Finally, there’s a bunch of BSD Sockets tips and tricks in TN3151 Choosing the right networking API. However, those are mostly focused on TCP, not UDP. Most of the UDP problems I see are related to broadcasts and multicasts, and I talk about those in Extra-ordinary Networking > Broadcasts and Multicasts, Hints and Tips. Sadly, I don’t think that’ll help you much, because your stream is most definitely unicast. However, Extra-ordinary Networking does have a bunch of links to other posts that provide background on how networking actually works in practice on our platfroms.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Issue with VLCKit Playback Delay When Local Network Permission Is Enabled
 
 
Q