Fatal Exception: NSInternalInconsistencyException -[AVAssetWriter startWriting] Cannot call method when status is 4 - ios

I am working on video record. I use GPUImage. The error occured on iOS 10.2.0.
According the method call stacks, i found it occured randomly when call -[GPUImageMovieWriter startRecording].
I searched everywhere, but all the questions are about when status is 3 not 4.

Of the AVAssetWriter statuses, you're running into writing. This means that you are calling [GPUImageMovieWriter startRecording] multiple times. This is easily fixed by checking the status of GPUImageMovieWriter and skipping the startRecording call if the status is writing.

Related

computeFunction must not be nil error reported

The error that ComputeFunction must not be nill was reported after a metal shading function has been called repeatedly for about 248 times.
/Library/Caches/com.apple.xbs/Sources/Metal/Metal-56.6/Framework/MTLComputePipeline.mm:230: failed assertion `computeFunction must not be nil.'
Abort trap: 6
The first 247 calls worked correctly, but the program failed at the 248th call.
What causes this and how can it be avoided?
Thanks in advance.
only the command buffer and encoder are transient and can be created on every call (inside the draw() function). libraries/functions are not transient so you should avoid creating them repeatedly.

AudioQueueStart return -66681

When I use <AudioToolbox/AudioServices.h> to implement a recording function, sometimes there will be unsuccessful recording. The reason is AudioQueueStart returned value -66681. The document says:
The audio queue has encountered a problem and cannot start
I found documents but I have no idea about that.

Is there a way for a RACSignal to keep receiving `next`s after an error?

I'm trying to listen for both location updates and errors (through CLLocationManagerDelegate), and support the ability to track errors but filter them out of the final signal and keep it alive.
When I subscribe to the location signal (via ReactiveCocoaPlayground's -[LocationManager currentLocationSignal]), any errors received will end the signal.
I've tried -catch: and -catchTo: but those just catch one error and then end the signal.
I've tried returning a brand new instance of that signal inside -catch:, but then the error on THAT signal is uncaught (which causes a crash in a RAC() binding later on).
I've tried a recursive approach to that catch as well, which caused a stack overflow (maybe I just made a mistake though).
Is there a way to receive nexts after errors occur?
I believe you're looking for -[RACSignal retry]:
/// Resubscribes to the receiving signal if an error occurs.
- (RACSignal *)retry;

Suppress RestKit Error Message

Using RestKit 0.20.x I am firing off a series of API calls on a particular view. If the user sends the app to the background I am cancelling ALL API calls using the following statement in the app delegate
- (void)applicationDidEnterBackground:(UIApplication *)application{
[self.weatherManager.restKitManager.operationQueue cancelAllOperations];
}
When the app returns from the background a UIAlert is visible with the following message:
The operation could not be completed. (org.restkit.RestKit.ErrorDomain error 2).
I don't want the user to have to see or dismiss this message upon return but am having trouble figuring out where/how to suppress this message.
Initially I was avoiding the use of cancelAllObjectRequestOperationsWithMethod: matchingPathPattern: because I had found a post on Google Groups from Blake Watters suggesting the use of the cancelAllOperations method on the operation queue which did not require a pathPattern
However If I use
[self.weatherManager.restKitManager cancelAllObjectRequestOperationsWithMethod:RKRequestMethodAny matchingPathPattern:#"/"];
by specifying a path pattern of just a "/" this seems to do the trick.

iOS - AudioOutputUnitStop results in app freeze and warning

sometimes the execution of
AudioOutputUnitStop(inputUnit)
results in the app to be freezed for about 10/15 seconds and the following console message:
WARNING: [0x3b58918c] AURemoteIO.cpp:1225: Stop: AURemoteIO::Stop: error 0x10004003 calling TerminateOwnIOThread
Such code is handled by the Novocaine library and in particular it occurs in the [Novocaine pause] method which I invoke to stop the execution of the playback of an audio file (https://github.com/alexbw/novocaine/blob/master/Novocaine/Novocaine.m).
Any hint is really appreciated!
Thanks,
DAN

Resources