I work on a video conferencing application, which makes use of AVAudioEngine and the videoChat AVAudioSession.Mode
This past Friday, an internal user reported an "audio cutting in and out" issue with their new iPhone 14 Pro, and I was able to reproduce the issue later that day on my iPhone 14 Pro Max. No other iOS devices running iOS 16 are exhibiting this issue.
I have narrowed down the root cause to the videoChat AVAudioSession.Mode after changing line 53 of the ViewController.swift file in Apple's "Using Voice Processing" sample project (https://developer.apple.com/documentation/avfaudio/audio_engine/audio_units/using_voice_processing) from:
try session.setCategory(.playAndRecord, options: .defaultToSpeaker)
to
try session.setCategory(.playAndRecord, mode: .videoChat, options: .defaultToSpeaker)
This only causes issues on my iPhone 14 Pro Max device, not on my iPhone 13 Pro Max, so it seems specific to the new iPhones only.
I am also seeing the following logged to the console using either device, which appears to be specific to iOS 16, but am not sure if it is related to the videoChat issue or not:
2022-09-19 08:23:20.087578-0700 AVEchoTouch[2388:1474002] [as] ATAudioSessionPropertyManager.mm:71 Invalid input size for property 1684431725
2022-09-19 08:23:20.087605-0700 AVEchoTouch[2388:1474002] [as] ATAudioSessionPropertyManager.mm:225 Invalid input size for property 1684431725
I am assuming 1684431725 is 'dfcm' but I am not sure what Audio Session Property that might be.
Post
Replies
Boosts
Views
Activity
We have a method that extracts 1-second video image thumbnails using an AVAssetImageGenerator.
After updating our devices to iOS/iPadOS 17, both the generateCGImagesAsynchronously(forTimes:completionHandler:) and async images(for:) methods take considerably longer than previous versions of iOS/iPadOS to asynchronously return images.
Running the code below on various devices with a 10 minute test video returned the following results:
iOS / iPadOS 16.7
iPhone 13 Pro Max - 601 images extracted in 7.31719 seconds.
iPad Pro (11-inch) (3rd generation) - 601 images extracted in 7.34210 seconds.
iOS / iPadOS 17.0.2
iPhone 15 Pro Max - 601 images extracted in 22.80841 seconds.
iPad mini (6th generation) - 601 images extracted in 26.94888 seconds.
iOS 17.1 Beta
iPhone Xs Max - 601 images extracted in 38.74796 seconds.
(The iPhone Xs Max was returning only slighter better times when running iOS 17.0.2)
Has anyone else experienced this issue when running on iOS 17?
Task {
let path = Bundle.main.path(forResource: "10min_60fps", ofType: "mp4")!
let url = URL(filePath: path)
let asset = AVAsset(url: url)
let numFrames = Int(ceil(asset.duration.seconds))
let times = (0..<numFrames).map { CMTime(value: CMTimeValue($0 * 1000), timescale: 1000) } // 1 fps
let generator = AVAssetImageGenerator(asset: asset)
generator.requestedTimeToleranceBefore = .zero
generator.requestedTimeToleranceAfter = .zero
generator.appliesPreferredTrackTransform = true
generator.maximumSize = CGSize(width: 160 * 4, height: 90 * 4)
var images = generator.images(for: times)
var count = 0
let start = Date()
while await images.next() != nil {
count += 1
}
let duration = Date().timeIntervalSince(start)
let seconds = String(format: "%.5f", duration)
print("\(count) images extracted in \(seconds) seconds.")
}