• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: occasional crash in AudioQueueStop()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: occasional crash in AudioQueueStop()


  • Subject: Re: occasional crash in AudioQueueStop()
  • From: Christopher Liscio <email@hidden>
  • Date: Fri, 17 Oct 2008 12:38:55 -0400

I recently fixed a problem like this myself.

Do you have a listener for the AudioQueue's start/stop notification (it sounds like you do)? Furthermore, does it call into a cocoa object to notify it of the start/stop status?

If you've answered yes to both of these questions, you might want to investigate whether the cocoa object in question has 'disappeared' between the point where you get a pointer to it, and the point where you call the object.

The same could apply to a 'delegate' object or other method that you call from within the callback.

The solution, in my case, was to retain the object before I called it, and release it afterwards.

Seemingly innocuous code I fixed looked like this (paracoding):

id delegate = [queueObject delegate];
if ( [delegate respondsToSelector:@selector(queueDidStart:)] ) {
    [delegate queueDidStart:queueObject];
}

The fixed code now looks like this:

id delegate = [[queueObject delegate] retain];
if ( [delegate respondsToSelector:@selector(queueDidStart:)] ) {
    [delegate queueDidStart:queueObject];
}
[delegate release];

I struggled with this problem on and off for weeks (it kept disappearing with other 'fixes', but reappearing again days later), and it was a pain to debug.

Hope this helps,

Chris Liscio
http://SuperMegaUltraGroovy.com
Acoustic measurement software for Mac OS X -- http://www.FuzzMeasure.com

On Oct 17, 2008, at 11:54 AM, John Zorko wrote:


Hello, all ...

My app is behaving much better, thanks in no small part to the help of people on this list -- so thank you :-)

I still see an occasional crash, though ... and I don't know why. Here's the last few frames of the backtrace:

[Switching to thread 10755]
Program received signal: “EXC_BAD_ACCESS”.
(gdb) bt
#0 0x3486df8c in ClientAudioQueue::ServicePendingCallbacks ()
#1 0x3486e314 in AudioQueueStop ()
#2 0x0000e7ee in -[AudioStreamer stop] (self=0x87da00, _cmd=0x3018cc44) at /Users/jmzorko/devstuff/iphone/Magnatune/Classes/ AudioStreamer.m:381
#3 0x00008602 in -[AlbumController tableView:cellForRowAtIndexPath:] (self=0x124b90, _cmd=0x30130e24, tableView=0x1251e0, indexPath=0x131970) ...


The AudioStreamer -stop() method is simple:

- (void)stop
{
	stopping = true;

	if (connection)
	{
		[connection cancel];
		NSLog(@"connection cancelled");
		[connection release];
		connection = nil;

		if (started)
		{
			OSStatus err = AudioQueueStop(audioQueue, true);

			if (err) { NSLog(@"AudioQueueStop"); return; }
		}
		else
		{
			self.isPlaying = false;
			finished = true;
		}
	}
}

I am catching the _IsRunning notification, though I don't think the issue is anything with that code. The AudioStreamer is based on the AudioFileStreamExample project included with the developer tools. Is this call stack indicative of something particular, some common Core Audio n00b mistake?

Regards,

John

Falling You - exploring the beauty of voice and sound
http://www.fallingyou.com











_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: occasional crash in AudioQueueStop()
      • From: Brian Willoughby <email@hidden>
References: 
 >occasional crash in AudioQueueStop() (From: John Zorko <email@hidden>)

  • Prev by Date: NSSlider correct event handling in Audio Unit with Cocoa GUI
  • Next by Date: Re: occasional crash in AudioQueueStop()
  • Previous by thread: occasional crash in AudioQueueStop()
  • Next by thread: Re: occasional crash in AudioQueueStop()
  • Index(es):
    • Date
    • Thread