Post

Replies

Boosts

Views

Activity

Reply to iOS 16 Autorotation strange issue
@UIKit Engineers We desperately need your help here. We have to use lot of workarounds(which are not good) to cover up this iOS 16 bug. As of now I tried to introduce a delay of 0.5 seconds to invoke autorotation which works on iPhone 13 pro at the very least. However this introduces an extra latency in app startup and at the same time is not guaranteed to work on every iOS device (particularly the slow ones like iPhone X or older). Please help us. func autoRotateNotification() { DispatchQueue.main.asyncAfter(deadline: .now() + 0.5, execute: { /* * HELP::: This code does something only when debug directly from XCode, * not when directly launching the app on device!!!! */ self.disableAutoRotation = false if #available(iOS 16.0, *) { UIView.performWithoutAnimation { self.setNeedsUpdateOfSupportedInterfaceOrientations() } } else { // Fallback on earlier versions UIViewController.attemptRotationToDeviceOrientation() } }) }
Topic: UI Frameworks SubTopic: UIKit Tags:
Sep ’22
Reply to iOS 16 Autorotation strange issue
Dear UIKit Engineers, I have reproduced the issue with very basic code that disables autorotation on startup and then after 0.2 seconds fires a notification to autorotate. Just create a new project and in ViewController, replace this code. It's shocking that this bug is there in iOS 16. Run this code through XCode debugger while holding iPhone in Portrait mode. and everything runs fine. But if the app is launched directly on iPhone 13 Pro by touching the app icon (and while holding iPhone in portrait mode), it doesn't autorotates to portrait mode (or to be specific, function viewWillTransition() is not called upon autorotation which creates all issues) ! Please do provide workaround as I desperately need it. I have filed FB11516363 for the same issue. import UIKit class ViewController: UIViewController { public var windowOrientation: UIInterfaceOrientation { return view.window?.windowScene?.interfaceOrientation ?? .unknown } private var disableAutoRotation = true override var supportedInterfaceOrientations: UIInterfaceOrientationMask { var orientations:UIInterfaceOrientationMask = .landscapeRight if !self.disableAutoRotation { orientations = .all } return orientations } override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. self.view.backgroundColor = UIColor.systemGreen DispatchQueue.main.asyncAfter(deadline: .now() + 0.2, execute: { self.autoRotateNotification() }) } override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { super.viewWillTransition(to: size, with: coordinator) let orientation = windowOrientation coordinator.animate(alongsideTransition: {_ in }, completion: { [unowned self] (UIViewControllerTransitionCoordinatorContext) -> Void in let orient = self.windowOrientation if orient.isLandscape { self.view.backgroundColor = UIColor.systemGreen } else { self.view.backgroundColor = UIColor.systemOrange } }) } func autoRotateNotification() { DispatchQueue.main.asyncAfter(deadline: .now(), execute: { /* * HELP::: This code does something only when debug directly from XCode, * not when directly launching the app on device!!!! */ self.disableAutoRotation = false if #available(iOS 16.0, *) { UIView.performWithoutAnimation { self.setNeedsUpdateOfSupportedInterfaceOrientations() } } else { // Fallback on earlier versions UIViewController.attemptRotationToDeviceOrientation() } }) } }
Topic: UI Frameworks SubTopic: UIKit Tags:
Sep ’22
Reply to AVAudioEngine exception - required condition is false format.sampleRate == hwFormat.sampleRate
As suggested by @Polyphonic, I observed avaudioengineconfigurationchangenotification . But some of the users are seeing the same crash but now it happens on the following line: let format = engine.inputNode.inputFormat(forBus: 0) Here is the backtrace: Fatal Exception: com.apple.coreaudio.avfaudio 0 CoreFoundation 0x99288 __exceptionPreprocess 1 libobjc.A.dylib 0x16744 objc_exception_throw 2 CoreFoundation 0x170488 -[NSException initWithCoder:] 3 AVFAudio 0x9f64 AVAE_RaiseException(NSString*, ...) 4 AVFAudio 0xc99e0 AVAudioIONodeImpl::SetOutputFormat(unsigned long, AVAudioFormat*) 5 AVFAudio 0x91b0 -[AVAudioNode setOutputFormat:forBus:] 6 AVFAudio 0x20e4 AVAudioEngineImpl::UpdateInputNode(bool) 7 AVFAudio 0xe12b0 -[AVAudioEngine inputNode]
Topic: Media Technologies SubTopic: Audio Tags:
Aug ’22
Reply to Apple Watch (waiting for first unlock) in Xcode
Getting the same error on Apple Watch SE and iPhone 14 Pro.
Replies
Boosts
Views
Activity
Jan ’23
Reply to iPadPro M2 ProRes unavailable
Dear @AVFoundation Engineers, Any inputs on this? Still waiting to hear.
Topic: Media Technologies SubTopic: Audio Tags:
Replies
Boosts
Views
Activity
Jan ’23
Reply to AVAssetWriter audio settings failure with compression settings
This again turns out to be another bug in iOS 16.0 where sample buffers received via AVCaptureAudioDataOutput continue to have stale/incorrect formatDescription when external mic is inserted.
Topic: Media Technologies SubTopic: Audio Tags:
Replies
Boosts
Views
Activity
Nov ’22
Reply to iOS 16.1(b5) - AVMultiCamSession emitting silent audio frames
The main culprit of the bug is nailed. Configuring microphone using -[AVAudioSession preferredDataSource] causes the conflict and silent audio frames are produced by captureOutput. Need to file a bug, but these days so many bugs are discovered that I have spent more time on hunting bugs in iOS and filing bugs than any productive work!
Topic: Media Technologies SubTopic: Audio Tags:
Replies
Boosts
Views
Activity
Oct ’22
Reply to iOS 16.1(b5) - AVMultiCamSession emitting silent audio frames
Correction, the setting that avoids the issue is captureSession.usesApplicationAudioSession = true &captureSession.automaticallyConfiguresApplicationAudioSession = false, OR alternatively, captureSession.usesApplicationAudioSession = false. The first one works but prevents dual audio streams from two mics while the other one is less flexible.
Topic: Media Technologies SubTopic: Audio Tags:
Replies
Boosts
Views
Activity
Oct ’22
Reply to 2x Telephoto (enabled by quad-pixel sensor) - Developer Documentation?
You just need to zoom wide angle camera by 2x, nothing else!
Topic: Media Technologies SubTopic: Audio Tags:
Replies
Boosts
Views
Activity
Oct ’22
Reply to iOS 16 Autorotation strange issue
@UIKit Engineers We desperately need your help here. We have to use lot of workarounds(which are not good) to cover up this iOS 16 bug. As of now I tried to introduce a delay of 0.5 seconds to invoke autorotation which works on iPhone 13 pro at the very least. However this introduces an extra latency in app startup and at the same time is not guaranteed to work on every iOS device (particularly the slow ones like iPhone X or older). Please help us. func autoRotateNotification() { DispatchQueue.main.asyncAfter(deadline: .now() + 0.5, execute: { /* * HELP::: This code does something only when debug directly from XCode, * not when directly launching the app on device!!!! */ self.disableAutoRotation = false if #available(iOS 16.0, *) { UIView.performWithoutAnimation { self.setNeedsUpdateOfSupportedInterfaceOrientations() } } else { // Fallback on earlier versions UIViewController.attemptRotationToDeviceOrientation() } }) }
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to iOS 16 Autorotation strange issue
Dear UIKit Engineers, I have reproduced the issue with very basic code that disables autorotation on startup and then after 0.2 seconds fires a notification to autorotate. Just create a new project and in ViewController, replace this code. It's shocking that this bug is there in iOS 16. Run this code through XCode debugger while holding iPhone in Portrait mode. and everything runs fine. But if the app is launched directly on iPhone 13 Pro by touching the app icon (and while holding iPhone in portrait mode), it doesn't autorotates to portrait mode (or to be specific, function viewWillTransition() is not called upon autorotation which creates all issues) ! Please do provide workaround as I desperately need it. I have filed FB11516363 for the same issue. import UIKit class ViewController: UIViewController { public var windowOrientation: UIInterfaceOrientation { return view.window?.windowScene?.interfaceOrientation ?? .unknown } private var disableAutoRotation = true override var supportedInterfaceOrientations: UIInterfaceOrientationMask { var orientations:UIInterfaceOrientationMask = .landscapeRight if !self.disableAutoRotation { orientations = .all } return orientations } override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. self.view.backgroundColor = UIColor.systemGreen DispatchQueue.main.asyncAfter(deadline: .now() + 0.2, execute: { self.autoRotateNotification() }) } override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { super.viewWillTransition(to: size, with: coordinator) let orientation = windowOrientation coordinator.animate(alongsideTransition: {_ in }, completion: { [unowned self] (UIViewControllerTransitionCoordinatorContext) -> Void in let orient = self.windowOrientation if orient.isLandscape { self.view.backgroundColor = UIColor.systemGreen } else { self.view.backgroundColor = UIColor.systemOrange } }) } func autoRotateNotification() { DispatchQueue.main.asyncAfter(deadline: .now(), execute: { /* * HELP::: This code does something only when debug directly from XCode, * not when directly launching the app on device!!!! */ self.disableAutoRotation = false if #available(iOS 16.0, *) { UIView.performWithoutAnimation { self.setNeedsUpdateOfSupportedInterfaceOrientations() } } else { // Fallback on earlier versions UIViewController.attemptRotationToDeviceOrientation() } }) } }
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to AVAudioEngine exception - required condition is false format.sampleRate == hwFormat.sampleRate
As suggested by @Polyphonic, I observed avaudioengineconfigurationchangenotification . But some of the users are seeing the same crash but now it happens on the following line: let format = engine.inputNode.inputFormat(forBus: 0) Here is the backtrace: Fatal Exception: com.apple.coreaudio.avfaudio 0 CoreFoundation 0x99288 __exceptionPreprocess 1 libobjc.A.dylib 0x16744 objc_exception_throw 2 CoreFoundation 0x170488 -[NSException initWithCoder:] 3 AVFAudio 0x9f64 AVAE_RaiseException(NSString*, ...) 4 AVFAudio 0xc99e0 AVAudioIONodeImpl::SetOutputFormat(unsigned long, AVAudioFormat*) 5 AVFAudio 0x91b0 -[AVAudioNode setOutputFormat:forBus:] 6 AVFAudio 0x20e4 AVAudioEngineImpl::UpdateInputNode(bool) 7 AVFAudio 0xe12b0 -[AVAudioEngine inputNode]
Topic: Media Technologies SubTopic: Audio Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to AVFoundation crash in getting power levels from Audio channel
@AVFoundationEngineers Any update on this? Is this a known issue?
Topic: Media Technologies SubTopic: Audio Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to KVO crash in AVAudioSession
Here is the full crash report. I think earlier it failed to upload the full report as the file was in rtf format (possibly). CrashReport.txt
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to KVO crash in AVAudioSession
@eskimo, here is crash report Crash Report
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to AVPlayer display on external screen transform
The problem has been fixed. I forgot to set player.usesExternalPlaybackWhileExternalScreenIsActive to false.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’22
Reply to AVPlayerViewController Airplay in the presence of external UIScene
Dear UIKit/AVFoundation Engineers, Please look into this question, still looking for an answer.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’22
Reply to RemoteIO to AVAudioEngine port
I was able to fix this by connecting inputNode and outputNode of AVAudioEngine instead of playerNode and mixerNode. I had misconception about playerNode which was cleared from WWDC 2014 video.
Topic: Media Technologies SubTopic: Audio Tags:
Replies
Boosts
Views
Activity
Apr ’22