Re: ExtAudioFileRead Crash
Re: ExtAudioFileRead Crash
- Subject: Re: ExtAudioFileRead Crash
- From: Jean-Daniel Dupas <email@hidden>
- Date: Sun, 11 Oct 2009 19:32:08 +0200
Le 11 oct. 2009 à 16:31, Peter Castine a écrit :
Hello,
I have an app that is running on Leopard pretty happily but crashes
regularly on Snow Leopard immediately after starting audio, which
involves soundfile playback.
There was a thread end of August that looks similar to my problem
but was never resolved for lack of Crash Log etc. I'll provide a log
extract below.
If I may start with a general observation & question: the app
crashes in ExtAudioFileRead(). The API documents warn the function
isn't entirely thread-safe. My code (some of which is inherited from
other parties) is, as far as I have to date determined, only calling
ExtAudioFileRead() from only one thread. We can be mixing and
playing back multiple soundfiles, but the reads are serialized and
from a single thread.
However, from the crash log it looks like more than one thread is
calling ExtAudioFileRead(). Is this likely to be a result of Snow
Leopard's "Grand Central Dispatch" multi-core automated multi-
threading facility?
If this is the case, what are my options? I see (a) using the lower-
level Audio File Services and (b) delving into GCD documentation to
figure out how to prevent GCD from clobbering my app.
It look like that this is your app which spawn additional threads.
According to the log, WorkerThreadStartFunc is part of the bundle
'...coustic.myApp', so you should check where you call pthread_create
in your software.
Before starting either of these routes, it would be helpful to be
sure I'm barking up the right tree. If one of the options (or
another I haven't thought of) would be a clear path-of-least-
resistance, that would be great to know. If the answer is (b) above
then I'll take further questions to another list, but right now this
appears to be in the first instance a CoreAudio question.
Log extract below, ttboma the relevant parts. If someone would like
to look at the full 60kB, perhaps better by direct mail. I can also
provide code, but it's a big enough app and stripping down the code
is enough work that I'd like to know someone really wants to see it.
Thanks
-- Peter
----
Code Type: X86 (Native)
OS Version: Mac OS X 10.6.1 (10B504)
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000000be1724fc
Thread 21 Crashed:
0 ....audio.toolbox.AudioToolbox 0x9918e651
CrashIfClientProvidedBogusAudioBufferList + 73
1 ....audio.toolbox.AudioToolbox 0x991e19fa ExtAudioFileRead + 66
2 ...coustic.myApp 0x0000c0e0 ChunkReadCallback + 260
3 ...coustic.myApp 0x00017b0f WorkerThreadStartFunc
+ 63
4 libSystem.B.dylib 0x9838cf39 _pthread_start + 345
5 libSystem.B.dylib 0x9838cdbe thread_start + 34
Thread 42:
0 ....audio.toolbox.AudioToolbox 0x99193c44
Resampler2::ConvertAltivec_SmallIntegerRatio(float*, float*,
unsigned long, int) + 682
1 ....audio.toolbox.AudioToolbox 0x99193551 Resampler2::PushConvert
(float*, float*, float*, float*, unsigned long&, unsigned long&,
unsigned long, unsigned long) + 559
2 ....audio.toolbox.AudioToolbox 0x9919306f
Resampler2Wrapper::RenderOutput(CABufferList*, unsigned long,
unsigned long&) + 535
3 ....audio.toolbox.AudioToolbox 0x9918e7ab
BufferedAudioConverter::FillBuffer(unsigned long&, AudioBufferList&,
AudioStreamPacketDescription*) + 315
4 ....audio.toolbox.AudioToolbox 0x9918e913
AudioConverterChain::RenderOutput(CABufferList*, unsigned long,
unsigned long&, AudioStreamPacketDescription*) + 157
5 ....audio.toolbox.AudioToolbox 0x9918e7ab
BufferedAudioConverter::FillBuffer(unsigned long&, AudioBufferList&,
AudioStreamPacketDescription*) + 315
6 ....audio.toolbox.AudioToolbox 0x9918e520
AudioConverterFillComplexBuffer + 268
7 ....audio.toolbox.AudioToolbox 0x991ead84 ExtAudioFile::Read
(unsigned long&, AudioBufferList*) + 700
8 ....audio.toolbox.AudioToolbox 0x991e1a0d ExtAudioFileRead + 85
9 ...coustic.myApp 0x0000c0e0 ChunkReadCallback + 260
10 ...coustic.myApp 0x00017b0f WorkerThreadStartFunc
+ 63
11 libSystem.B.dylib 0x9838cf39 _pthread_start + 345
12 libSystem.B.dylib 0x9838cdbe thread_start + 34
Thread 60:
0 ....audio.toolbox.AudioToolbox 0x9918f2e4
NativeInt16ToFloat32_X86 + 268
1 ....audio.toolbox.AudioToolbox 0x9918f1c4
PCMConverter2::ConvertBufferList(unsigned long, CABufferList const*,
CABufferList*) + 96
2 ....audio.toolbox.AudioToolbox 0x9918ea39
CBRConverter::RenderOutput(CABufferList*, unsigned long, unsigned
long&, AudioStreamPacketDescription*) + 185
3 ....audio.toolbox.AudioToolbox 0x9918e7ab
BufferedAudioConverter::FillBuffer(unsigned long&, AudioBufferList&,
AudioStreamPacketDescription*) + 315
4 ....audio.toolbox.AudioToolbox 0x9918eb1e
BufferedAudioConverter::GetInputBytes(unsigned long, unsigned long&,
CABufferList const*&) + 160
5 ....audio.toolbox.AudioToolbox 0x99192f28
Resampler2Wrapper::RenderOutput(CABufferList*, unsigned long,
unsigned long&) + 208
6 ....audio.toolbox.AudioToolbox 0x9918e7ab
BufferedAudioConverter::FillBuffer(unsigned long&, AudioBufferList&,
AudioStreamPacketDescription*) + 315
7 ....audio.toolbox.AudioToolbox 0x9918e913
AudioConverterChain::RenderOutput(CABufferList*, unsigned long,
unsigned long&, AudioStreamPacketDescription*) + 157
8 ....audio.toolbox.AudioToolbox 0x9918e7ab
BufferedAudioConverter::FillBuffer(unsigned long&, AudioBufferList&,
AudioStreamPacketDescription*) + 315
9 ....audio.toolbox.AudioToolbox 0x9918e520
AudioConverterFillComplexBuffer + 268
10 ....audio.toolbox.AudioToolbox 0x991ead84 ExtAudioFile::Read
(unsigned long&, AudioBufferList*) + 700
11 ....audio.toolbox.AudioToolbox 0x991e1a0d ExtAudioFileRead + 85
12 ...coustic.myApp 0x0000c0e0 ChunkReadCallback + 260
13 ...coustic.myApp 0x00017b0f WorkerThreadStartFunc
+ 63
14 libSystem.B.dylib 0x9838cf39 _pthread_start + 345
15 libSystem.B.dylib 0x9838cdbe thread_start + 34
-- Jean-Daniel
_______________________________________________
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