Jump to content

Help for patch IOAudioFamily speaker popping.


nyolc8
 Share

3 posts in this topic

Recommended Posts

Hi! My problem is that if I set my smbios to a macmini or imac, my speakers popping because the sound goes to a power saving state. (many of us know this problem, it's present even on real macs)

 

Today I searched and found this in the IOAudioDevice.cpp source:


// This needs to be overridden by driver if it wants to know about power manager changes.
// If overridden, be sure to still call super::setAggressiveness() so we can call our parent.
IOReturn IOAudioDevice::setAggressiveness(unsigned long type, unsigned long newLevel)
{
return super::setAggressiveness(type, newLevel);
}

// This was modified for <rdar://problem/3942297>
void IOAudioDevice::setIdleAudioSleepTime(unsigned long long sleepDelay)
{
assert(reserved);

audioDebugIOLog(3, "+ IOAudioDevice[%p]::setIdleAudioSleepTime: sleepDelay = %lx%lx\n", this, (long unsigned int)(sleepDelay >> 32), (long unsigned int)sleepDelay);

if ( reserved->idleTimer ) {
	reserved->idleTimer->cancelTimeout();
}

if (reserved->idleSleepDelayTime != sleepDelay) { 	// <rdar://problem/6601320>
	reserved->idleSleepDelayTime = sleepDelay;
}

if ( kNoIdleAudioPowerDown != sleepDelay ) {
	scheduleIdleAudioSleep();
}
audioDebugIOLog(3, "- IOAudioDevice[%p]::setIdleAudioSleepTime: sleepDelay = %lx%lx\n", this, (long unsigned int)(sleepDelay >> 32), (long unsigned int)sleepDelay);
}


// Set up a timer to power down the hardware if we haven't used it in a while.
// <rdar://8121989> Restructured for single point of entry and single point of exit so that
// the indentifier post processing tool can properly insert scope when post processing a log file
// obtained via fwkpfv.
void IOAudioDevice::scheduleIdleAudioSleep(void)
{
AbsoluteTime fireTime;
UInt64	 nanos;
bool	 exit = false;
assert(reserved);
audioDebugIOLog(3, "+ IOAudioDevice[%p]::scheduleIdleAudioSleep: idleSleepDelayTime = %lx%lx\n", this, (long unsigned int)(reserved->idleSleepDelayTime >> 32), (long unsigned int)reserved->idleSleepDelayTime);
if ( 0 == reserved->idleSleepDelayTime )
{
// For backwards compatibility, or drivers that don't care, tell them about idle right away.
initiatePowerStateChange ();
}
else
{
if ( !reserved->idleTimer && ( kNoIdleAudioPowerDown != reserved->idleSleepDelayTime ) )
{
reserved->idleTimer = IOTimerEventSource::timerEventSource ( this, idleAudioSleepHandlerTimer );
if ( !reserved->idleTimer )
{
exit = true;
}
else
{
workLoop->addEventSource ( reserved->idleTimer );
}
}

if ( !exit && ( kNoIdleAudioPowerDown != reserved->idleSleepDelayTime ) )
{
// If the driver wants to know about idle sleep after a specific amount of time, then set the timer to tell them at that time.
// If idleSleepDelayTime == 0xffffffff then don't ever tell the driver about going idle
clock_get_uptime ( &fireTime );
absolutetime_to_nanoseconds ( fireTime, &nanos );
nanos += reserved->idleSleepDelayTime;
nanoseconds_to_absolutetime ( nanos, &fireTime );
reserved->idleTimer->wakeAtTime ( fireTime ); // will call idleAudioSleepHandlerTimer
}
}
audioDebugIOLog(3, "- IOAudioDevice[%p]::scheduleIdleAudioSleep: idleSleepDelayTime = %lx%lx\n", this, (long unsigned int)(reserved->idleSleepDelayTime >> 32), (long unsigned int)reserved->idleSleepDelayTime);
return;
}
void IOAudioDevice::idleAudioSleepHandlerTimer(OSObject *owner, IOTimerEventSource *sender)
{
IOAudioDevice * audioDevice;
audioDevice = OSDynamicCast(IOAudioDevice, owner);
assert(audioDevice);
audioDebugIOLog(3, "+ IOAudioDevice[%p]idleAudioSleepHandlerTimer: pendingPowerState = %d, idleSleepDelayTime = %lx%lx\n", audioDevice, audioDevice->pendingPowerState, (long unsigned int)(audioDevice->reserved->idleSleepDelayTime >> 32), (long unsigned int)audioDevice->reserved->idleSleepDelayTime);
if (audioDevice->reserved->idleSleepDelayTime != kNoIdleAudioPowerDown &&
audioDevice->getPendingPowerState () == kIOAudioDeviceIdle) {
// If we're still idle, tell the device to go idle now that the requested amount of time has elapsed.
audioDevice->initiatePowerStateChange();
}
audioDebugIOLog(3, "- IOAudioDevice[%p]idleAudioSleepHandlerTimer: pendingPowerState = %d, idleSleepDelayTime = %lx%lx\n", audioDevice, audioDevice->pendingPowerState, (long unsigned int)(audioDevice->reserved->idleSleepDelayTime >> 32), (long unsigned int)audioDevice->reserved->idleSleepDelayTime);
return;
}

 

So my question is: is it possible to somehow modify this in the IOAudioFamily binary file?

  • Like 1
Link to comment
Share on other sites

  • 3 months later...

Hello. As I have similar problem I want to join to it as together we have more chances to solve it.

I want to tell you about another thing which helps but not always. For me it didn't help.

Here we go.

You should find you internal speaker or line output so as to find bite of sound volume. It helped for ALC883 P5K.(00 was chandged to 01). That we are looking for blindly.(Of course volumes are different for others codecs)

Tell about what I tried to do

01b71c40 01b71d10 01b71e2b 01b71f01 - HP Out at Ext Left, Conn = 1/8, Color = Black
01571c30 01571d01 01571e13 01571f90 - Speaker at Int ATAPI, Conn = ATAPI, Color = Unknown
01271c10 01271d01 01271ea0 01271f90 - Mic at Int ATAPI, Conn = ATAPI, Color = Unknown
01a71c50 01a71d31 01a71e81 01a71f01 - Line In at Ext Left, Conn = 1/8, Color = Blue
01971c20 01971d90 01971e81 01971f01 - Mic at Ext Left, Conn = 1/8, Color = Pink
01e71c60 01e71d11 01e71e4b 01e71f01 - SPDIF Out at Ext Left, Conn = Optical, Color = Black
01171cf0 01171d00 01171e00 01171f40 
01371cf0 01371d00 01371e00 01371f40 
01471cf0 01471d00 01471e00 01471f40 
01671cf0 01671d00 01671e00 01671f40 
01771cf0 01771d00 01771e00 01771f40 
01871cf0 01871d00 01871e00 01871f40 
01d71cf0 01d71d00 01d71e00 01d71f40 
02171cf0 02171d00 02171e00 02171f40

----------------------

1)First attempt 01->00  

2) Second attempt 90->99

Both without success

------------------------------

Did  you have similar problem at ML?

For me, My sound was perfect at ML, I have no pup at all. But at the Mavericks even changing of mac model doesn't help me.  :(

PinConfigurator.zip

Link to comment
Share on other sites

  • 7 months later...
 Share

×
×
  • Create New...