AVAudioRecorder freezes when paused too many times before a stop - freeze

I have noticed that AVAudioRecorder (iOS) hangs when I pause and resume 8 or more times during the recording. On the simulator it hangs indefinitely, and on the device I get this errors:
AudioQueueStop posting message to kill mediaserverd
Does anyone know how to prevent this, or is there a workaround? My problem is that I try to load the file into AVAudioPlayer afterward and the resulting loaded file has no duration (and doesn't play). The strange thing is that I am able to save the file and later play it just fine. I'm not certain yet at what point the file is playable, but was hoping if there is a solution to the issue with the recorder, I won't need a workaround.

I've got the same same problem and I thought i had found a workaround, it seems to work for small recordings, but it still freezes for longer ones:
[NSThread detachNewThreadSelector:#selector(stop) toTarget:myrecorder withObject:nil]
maybe it can work for you if you're lucky, have you filed a bug report? i'll file one now

Related

A new guard page for the stack cannot be created ,EXCEPTION_CODE_STR: c00000fd

I am working vb project in which I am using a media player which is showing videos in a loop. Everything is working fine but after maybe 10 to 12 hours (time is not specific) showing me this dialog box saying close the program or Debug the program (below is the screenshot) but my app is still running.
I created a crash dump file and when I tried to figure out the reason then I found that below is the reason for this error. I used WinDbg to debug the crash dump file.
By seeing this I found that maybe this is a memory leak issue but I am not able to figure out from the code that where is the actually exception is occurring. As my app is not throwing any error during the running app but it throws after 10 or 12 hours.
I am new in VB I would appreciate any help.
Thanks.
According to this post a possible reason could be a memory leak in your code.

AudioPlayMode.BackgroundLoop stops after about 3 hours

This is my first post here. I need some help with my Visual Basic .NET project.
I'm making a program that runs in the background and continously plays an audio file. The project has a 10 second wav file embedded as a resource.
I was able to make it work just fine using this method:
AudioPlayMode.BackgroundLoop()
BackgroundLoop is supposed to play the audio file in the background continuously. It works fine but after about 3 hours, I noticed that it just stops. The program stays open but the audio stops looping. Is this normal? How can I prevent this from happening?
Edit to add workaround:
I couldn't find the reason why it was stopping the playback every 3 hours but I found a workaround.
Basically, I just added a Timer control and just kept stopping and restarting the playback every 2 hours.
My.Computer.Audio.Stop()
My.Computer.Audio.Play(My.Resources.Files.AudioFileName, AudioPlayMode.BackgroundLoop)
It's working fine for now. I'll keep observing the behavior for a few hours and will report back.

What causes a complication to go blank in watchOS?

I've been debugging a complication of mine for several weeks now, and I am completely unable to figure out what runtime behavior (crash? hang? out of budget?) causes it to go completely blank.
I've left the exact same complication running overnight in the simulator as on my real watch, and my real watch (Series 2) will go blank yet the simulator catches no crashes or other failures that I can tell.
Does anyone know what going blank means for a complication on watchOS?
Sometimes it’s just watchOS, I think. When was the last time you power cycled the Watch? Also, have you looked at the Watch log files for your app? In devices from Xcode, you can view all the logs. See if there are any crash logs for your app on the Watch.

XCode crashes on start up

Yes, this happens to people. Yes, I've looked at all the solutions.
This is different.
XCode starts and there is no error message, it just freezes. This is the screen I get:
That's it. No errors. I can't interact with it, I can't close it. The only thing I can do is use Show All Windows. There are five and yes I don't need them all (never did! don't know why I have them) but I can't close any of them. To get rid of it I need to do a hard reset.
I've tried deleting the library file in Finder as this was one of the solutions.
Nope.
Anyone any ideas?
I think it's XCode 6 (the latest) but I can't tell because I can't access the menu.
I ended up scouring Stackoverflow for ways to clear the startup process.
You hold cmd+shift when you start XCode - ONLY from the task bar, this does NOT work if you go into the Applications folder - and it will load blank.
Then you can load your project.

When calling to NSOpenPanel's runModal, my application will not properly terminate

I'm writing a simple Cocoa Application, no core data or multiple document support. Running on a Mac Pro, OS X 10.6.6, Xcode 3.2.3.
I have reduced my application to the following code in my AppDelegate class:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
NSOpenPanel *openPanel = [NSOpenPanel openPanel];
[openPanel runModal];
return;
}
From within the debugger, I will run my application. As expected a somewhat not-to-useful OpenPanel will appear. I will click Cancel and it will disappear. All this is as expected. When I click [Command + Q] to Quit the application, the UI will go away but the debugger will indicate that the application is still running (as does the console output).
Based upon all the information I'm reading, I should not have to do anything else in order for this to run right. I've downloaded several examples on the Open Panel's usage but most use the deprecated methods of opening modal giving additional information as parameters. FWIW, I tried those methods and am still seeing the same result.
One last item, when the Open dialog appears, just for an instant I see a message box asking me something to the extent if I want my application to receive incoming connections. The dialog quickly disappears. I don't know if that is part of my problem or not. [Update - this deals with my Firewall being turned on.]
Yes, I'm fairly new at Objective C but not at programming in general. Any words of wisdom is greatly appreciated!
2011.02.07 - Update:
I have walked the debugger line by line without incident. There is no indication of any program failure in the console window.
I say that the debugger is still active after [Command + Q] because the Stop Process toolbar button is still enabled as is the Break button. Further the console indicates that after I tell the application to terminate (either via the menu or key command) that it is still running. The following is the Complete console output from start of run to after I Quit the application.
Program loaded.
run
[Switching to process 62370]
Running...
The Activity Monitor (system tool) will show my application terminating (no longer shows up as a process) but the Debugger will still not transition to "edit" mode - if I tell Xcode to run the debugger again, it will ask me if it's OK to Stop the current debugging session. If I was in Windows I would start looking for background threads keeping the process alive but as far as I know, NSOpenPanel should not be doing something like that.
I have further simplified the program to nothing more than creating a brand new Cocoa application and inserting the code snippet above - no other additions to the template project or updates in any way.
And lastly, when the application is run under the Leaks Performance Tool, everything runs fine when the panel is created but never used. When created and actually used though, at the end of the run I will get the following message in the tool "insufficient task_for_pid privileges (leakagent64)". Googling this hurts. If I read it right, the debugger does not have sufficient permissions to fully kill the target process ??? Now that sounds stupid but ... It does not make sense!
Another update - I just downloaded and ran FunHouse, one of the SDK sample applications that also uses NSOpenPanel. Well don't I feel special. It exhibits the same exact behavior. So from this I conclude either Apple has a bug in their code, my machine is special and messed up, and finally, it is Not my code that is at fault. That being the best part. Tomorrow, I will use a friends Mac and see if the same behavior is exhibited on his box.
This is just too weird.
I rebooted my box, took it to work and found it worked like a charm! I will assume this is fixed and has nothing to do with any other connected devices at home as compared to at work.
If it re-exhibits at home, then it is a network/device issue. Thanks all for your inputs and suggestions! Very much appreciated.
What, specifically, does the debugger say? It's possible that your program crashed, so the debugger is showing you information about the crash.
What if you omit any attempt to run an Open panel?