Prime failed ('nope'); will stop (1/5925 frames) - ios

When started the audioqueue work well, it can playback audio, but when I manually change the progess of player, AudioQueuePrime will fail ,output Prime failed ('nope'); will stop (1/5925 frames), the errorcode returned is 1852797029, but next AudioQueueStart will succeed, and so the player will work, then just AudioQueuePrime failed sometimes. So why?

Related

Disable input/output AGC from RemoteIO and VPIO on iOS

CoreAudio is always a mystery due to lack of documentations. Recently I hit some stone again:
In my program, I invoke RemoteIO and VoiceProcessingIO (VPIO) back and forth, and also change AVAudiosession in between. I tried to turn off AGC on VPIO with the follwing code:
if (ASBD.componentSubType == kAudioUnitSubType_VoiceProcessingIO) {
UInt32 turnOff = 0;
status = AudioUnitSetProperty(_myAudioUnit,
kAUVoiceIOProperty_VoiceProcessingEnableAGC,
kAudioUnitScope_Global,
0,
&turnOff,
sizeof(turnOff));
NSAssert1(status == noErr, #"Error setting AGC status: %d", (int)status);
}
Well I'm still not sure if this code disables AGC on the microphone side or the speaker side on VPIO, but anyways, let's continue. Here's the sequence to reproduce the problem:
Create a RemoteIO output audio unit with PlayAndRecord audio session category, work with it and destroy the unit;
Switch audio session to Playback only category;
Switch audio session to PlayAndRecord again and create another VPIO, work with it and destroy it;
Switch audio session to Playback and then PlayAndRecord category;
After these steps, then whatever RemoteIO/VPIO created later will bear this amplified microphone signal (as if a huge AGC is always applied) and there's no way to go back until manually kill the app and start over.
Maybe it's my particular sequence that triggered this, wonder if anyone seen this before and maybe know a correct workaround?
Try setting the mode AVAudioSessionModeMeasurement, or AVAudioSession.Mode .measurement, when configuring your app's Audio Session.

Starting AudioKit results in AudioHAL_Client errors 50% of the time

I've been using AudioKit for over 8 months, but recently I've run into a weird issue.
When I start AudioKit, in (roughly) 50% of the cases the audio stops playing after a few seconds and I get a stream of lower-level AudioHAL_Client errors:
2019-03-14 17:17:15.567027+0100 TestApp[68164:1626512] [AudioHAL_Client] HALC_ProxyIOContext.cpp:1399:IOWorkLoop: HALC_ProxyIOContext::IOWorkLoop: failed to send the final message to the server, Error: 0x10000003
2019-03-14 17:17:16.104180+0100 TestApp[68164:1626365] [AudioHAL_Client] HALC_ShellPlugIn.cpp:817:HAL_HardwarePlugIn_ObjectHasProperty: HAL_HardwarePlugIn_ObjectHasProperty: no object
or:
2019-03-15 08:15:33.756244+0100 macOSDevelopment[47186:2925180] [AudioHAL_Client] HALC_ProxyIOContext.cpp:1399:IOWorkLoop: HALC_ProxyIOContext::IOWorkLoop: failed to send the final message to the server, Error: 0x10000003
2019-03-15 08:15:34.290366+0100 macOSDevelopment[47186:2925038] [AudioHAL_Client] HALC_ShellPlugIn.cpp:817:HAL_HardwarePlugIn_ObjectHasProperty: HAL_HardwarePlugIn_ObjectHasProperty: no object
2019-03-15 08:15:34.290431+0100 macOSDevelopment[47186:2925038] [AudioHAL_Client] HALC_ShellPlugIn.cpp:817:HAL_HardwarePlugIn_ObjectHasProperty: HAL_HardwarePlugIn_ObjectHasProperty: no object
It is not related to my specific app, because when I build the AudioKit macOS development app, the same happens. I've also tried it with a clean macOS project.
This is enough to trigger the bug:
AudioKit.output = AKMixer()
AudioKit.start()
Same happens when I connect an AKOscillator instead of AKMixer.
I've tried to debug this, but I cannot figure out what's going wrong.

Stop sound in AVAudioPlayer and shown AQDefaultDevice (173): skipping input stream Error Logs

I have used AVAudioPlayer and set the numberofloop to -1 because I want to play the audio in an infinite loop. At first it works well, but in the middle of playing sound track, I got the following error log continuously and my sound track was stopped.
2017-02-22 10:08:28.863041 TestBridgingHeader[1092:30476] [aqme] 255: AQDefaultDevice (173): skipping input stream 0 0 0x0
I am using two media players to get fade in fade out sound. I played these two media players using blocks:
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{});
Why does my sound track stop and why does it show AQDefaultDevice error logs?
This is a bug in Xcode 8.
You can resolve it with these steps:
Select Product --> Scheme--> Edit Scheme.
Select Arguments.
Add OS_ACTIVITY_MODE setup "disable" to Environment Variables.

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.

AVPlayerItem strange buffer observer

I'm using AVPlayer to play streamed network audio. I observer status of the streamed item as this post:
ios avplayer trigger streaming is out of buffer
Work seems well, but I encounter a strange problem. I meet the key "playbackLikelyToKeepUp" before the key "playbackBufferEmpty". I placed a log
NSLog(#"___path: %#", path)
in the first line of the function
observeValueForKeyPath.....
and the log I received is:
...
2012-10-29 17:24:35.412 NhacSo[236:907] ___path: rate
2012-10-29 17:24:35.413 NhacSo[236:907] ___path: playbackLikelyToKeepUp
2012-10-29 17:24:35.415 NhacSo[236:907] ___path: playbackBufferEmpty
2012-10-29 17:24:35.416 NhacSo[236:907] ___path: rate
...
Do you know why I receive "playbackLikelyToKeepUp" before "playbackBufferEmpty"? Thank you!!!
You receive playbackLikelyToKeepUp first because that property changes first. What I believe is confusing you is that it changes from YES to NO and not the other way around - that is, playback will no longer be able to keep up.

Resources