I know there is another bug report about distorted audio under Leopard and a workaround exists that involves unloading and re-loading the driver but that hack does not seem to work under Snow Leopard.
So I had a look at the original FreeBSD hdac code (on which voodooHDA is based). Part of the resume process in the FreeBSD code is to re-start the audio channels - something the voodooHDA driver does not do. Someone has ported the necessary code into voodooHDA but it is never called. So I tried it by making the call in the resume() function in voodooHDAdevice.cpp (shown below). Unfortunately this causes the machine to hang on resume. Since I am not set-up for remote debugging and walking through the code did not highlight anything - does someone with a debugger want to see if this really is the problem?
bool VoodooHDADevice::resume()
{
.......... snip .........
// VoodooHDAEngine *engine;
for (int i = 0; i < mNumChannels; i++) {
if (!(mChannels.flags & HDAC_CHN_SUSPEND)) {
errorMsg("warning: found non-suspended channel during resume action\n");
continue;
}
mChannels.flags &= ~HDAC_CHN_SUSPEND;
channelStart(&mChannels, false);
// engine = lookupEngine(i);
// if (engine) {
// engine->resumeAudioEngine();
// engine->takeTimeStamp(false);
// }
}
UNLOCK();
logMsg("Resume done.\n");
return true;
}