Calling `assetWriter.startWriting()` blocks all Threads for 3 seconds in debug (LLDB hang?)

’m using the AVFoundation Swift APIs to record a Video (CMSampleBuffers) and Audio (CMSampleBuffers) to a file using AVAssetWriter.

Initializing the AVAssetWriter happens quite quickly, but calling assetWriter.startWriting() fully blocks the entire application AND ALL THREADS for 3 seconds. This only happens in Debug builds, not in Release.

Since it blocks all Threads and only happens in Debug, I’m lead to believe that this is an Xcode/Debugger/LLDB hang issue that I’m seeing.

Does anyone experience something similar?

Here’s how I set all of that up: startRecording(...)

And here’s the line that makes it hang for 3+ seconds: assetWriter.startWriting(...)

That's interesting and unexpected. Would you please file a FBA with a sample project that we can build and run to reproduce this, including any media files needed?

I have same problem. But it is just debugging ( when I press run on xcode ). Once disconnect device and re-open app, it will be fixed.

Calling `assetWriter.startWriting()` blocks all Threads for 3 seconds in debug (LLDB hang?)
 
 
Q