How to go about debugging transient "statics" using AudioUnit's RemoteIO
How to go about debugging transient "statics" using AudioUnit's RemoteIO
- Subject: How to go about debugging transient "statics" using AudioUnit's RemoteIO
- From: Jean-François Brouillet <email@hidden>
- Date: Sun, 15 Jan 2012 10:06:22 +0000
All,
I'm pretty new to AudioUnit and I have reached the stage where I can generate a pretty simple sine wave with or without FM modulation or PM modulation by another sine wave.
I'm using a unit test (SenTest) to debug as I go, and I have noticed something I do not seem to be able to develop an understanding of.
When I run my test, every other time, the whole test suite runs fine, with exactly the kind of sounds I am expecting to hear:
FM:
- test1: a carrier at 440 modulated at 8Hz with a 20Hz "swing" around 440
- test2: a carrier at 440 modulated at 200Hz with a 40Hz "swing" around 440
- test3: a carrier at 440 modulated at 400Hz with a 80Hz "swing" around 440
PM:
- test4: a carrier at 440 modulated at 8Hz with a 0.2 "phase swing" (ie 0 to 2pi * 0.2)
- test5: a carrier at 440 modulated at 200Hz with a 0.4 "phase swing" (ie 0 to 2pi * 0.4)
- test6: a carrier at 440 modulated at 400Hz with a 0.8 "phase swing" (ie 0 to 2pi * 0.8)
Each test is played for 4 seconds.
The problem is that half time I run the above tests from start to finish I hear the above with "high pitched 'static noise'".
Also, very often, nearly all the time, but not always I see that one ore more CPU cores getting maxed out
(SenTest run on the Simulator, hence the Mac's CPU is producing the sounds).
Also, some times, but rarely, I just get a few loud statics for a few milliseconds and then just silence for the rest of that test.
Also, if the first test runs OK, it is very likely that all subsequent tests will be ok.
Conversely, as soon as a test starts sounding weird, it is almost certain that the following tests will sound funny too.
I have tried to insert NSLog into the play callback, but then I'm swamped with miles upon miles of output and the sound is NOT heard anymore.
I have instrumented the RemoteIO play callback to record latency, rate of calls, buffer sample size, time I take to fill it, and nothing jumps at me.
I was expecting my sample generation to be too slow, but it looks like I complete the buffer filling in about 80 samples per ms where the sampling rate 44100 requires me to fill at least 44.1 such samples per ms ... so the problem must be somewhere else ...
Any idea how to go about debugging this?
Many Thanks
--
JFB
_______________________________________________
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