Hi all,
I wrote a simple play-through test application using input AUHAL and DefaultOutputUnit.
While experimenting with it I noticed that, just after startup, there are some strange sounds popping out, that last a few milliseconds.
This behavior happens only when at least 30 seconds have passed from the last run. Consequently, I related this to a sort of sleep (power saving?) mode of the device. In fact, it is easy to hear a small click (followed by total silence) after 30 seconds from the last sound. Also, it seems that the dirty samples come from the last play-through though I’m still not sure about it.
This behavior can be experienced with the CAPlayThrough sample code as well, so it is not related to my code. Just wait 30s between two successive runs.
Going a little bit further, I found that when starting the play through after those 30s, the DeviceProcessorOverload callback of the input device is called a few times. Furthermore, if instead of simply starting the inputAUHAL, I execute the sequence
inputAUHAL start - sleep 100ms - inputAUHAL stop - sleep 1s -inputAUHAL start
I get rid of the dirty samples. It is as if I give the device the time to wake up.
My question is: this seems to me a very unorthodox approach to solve this problem, there is something I am missing? Maybe a property to tell the device not to go to sleep or to wake up instantly?
My machine is a new MBP 13 retina. This happens with mic/headphone (iPhone set) and also with built-in audio I/O.
Thank you very much, Bruno ______________________ Mobile: 0039 347 16 49 210
|