Finding Thread related problems
Finding Thread related problems
- Subject: Finding Thread related problems
- From: Bill Stewart <email@hidden>
- Date: Sat, 1 Mar 2003 17:56:09 -0800
One thing that can help to debug these problems when they have to do
with threading issues is the use of latency type traces...
In /Developer/Examples/CoreAudio there's an app called MillionMonkees -
that has code in there from Darwin called latency.c (its slightly
modified to do two things):
(1) ONLY take a latency trace for a period of time that MM knows there
is a scheduling problem - that kind of logic is very useful so you
don't get mega bytes of traces to look through
In this case for instance, you should be able to tell from your I/O
thread if you don't have enough data and will generate a click
The MM code also shows how to share a buffer between threads without
needing to take locks...
(2) It writes the latency trace to a block of memory - which you can
then dump out to a file later (outside of the I/O thread for instance)
Bill
On Thursday, February 27, 2003, at 10:11 PM, Christof Faller wrote:
A very simple suggestion:
But with really small buffer size (like 128 or 256), they are some
gliches
even if the client audio graph does not consume too much cpu (like
25-30 %)
I use frame-based coding algorithms, which also use quite small frames
(blocks of samples at once). However, I use CoreAudio with a larger
buffer (e.g. 512 or 1024) and then call my codec just as many times as
necessary such that I have enough samples to provide to CoreAudio in
each callback call.
Since in the general case, my code frame size and the buffer size are
not "multiples" of each other, I need to save the samples which are
left over, for the next callback call.
Chris
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.