Jump to content

ATI AC 97 Sounds (SB400) effort


Andras Kenez
 Share

696 posts in this topic

Recommended Posts

Has anyone gotten a KP (kernel panic) with their hardware and the sound drivers in linux? We should make up a list of all the hardware configurations that work in linux with what build (live cd's) and then maybe we'll have to write custom versions for each version. It appears that even though these all share the same device ID, they are in fact wired differently.

 

Errrrrrrrr to KP's and their ability to not leave debugging information.

 

-ed

Link to comment
Share on other sites

OK I know my previous efforts haven't done very much in terms of solving the problem, but I think that the problem is getDMAEngineHardwarePointer returning an invlid value.

 

I've changed the method to the following and it seems that the kernel panics have stopped, but I get audio repeating itself a few times after it should have stopped, so its still not right...

 

IOByteCount CLASS::getDMAEngineHardwarePointer(IOAC97DMAEngineID engine)
{
IOByteCount position;

CHECK_DMA_ENGINE_ID(engine, 0);
ATIIXPDMADesc *dma = dma_channels[engine];

// Get physical address of sample buffer
UInt32 tmp;
IOPhysicalAddress buf_addr = dma->sampleMemory->getPhysicalSegment(0, &tmp);

// The DMA current pointer returns a physical memory address
position = regs->read(dma->currentPointerOffset);

// Subtract the sample buffer base address to get an offset
IOByteCount ret = position - buf_addr;

if (ret < 0)
	ret = 0;
if (ret > dma->ringBufferSize)
	ret = dma->ringBufferSize;

return ret;
}

 

As you can see at the end of the code I made it check that the return value is between 0 and dma->ringBufferSize and if not then to change it so it is. I'm not sure exactly what the bounds for the return value should be, I just guessed these from reading through the code (I remind you again this isn't my programming language...).

 

If you try the above code you should see what I mean by the audio repeating itself. I think therefore that the problem has to be in getDMAEngineHardwarePointer as I no longer get kernel panics/system lockups.

 

As always if I'm completely wrong I apologize.

Link to comment
Share on other sites

You may well be right, since I didn't do any error checking on that value (I just took it out because this seemed to be correct). Give it a good, long burn-in test and see if it works. I have a couple of other things to try as well, and I'll throw my original error-checking code in too, and if it all works out I'll release 1.0.4.

Link to comment
Share on other sites

I've had my laptop on for over a day now running 1.0.3 with no problems, both video and music, other than the video is a little jumpy (but I think that's a video driver issue). I had to use Tariq's build, since thedopefishlives's always gets a link/load error for me.

Link to comment
Share on other sites

I've had my laptop on for over a day now running 1.0.3 with no problems, both video and music, other than the video is a little jumpy (but I think that's a video driver issue). I had to use Tariq's build, since thedopefishlives's always gets a link/load error for me.

You have a better record with this driver than I do, man. Thanks for the encouragement. I'm going to try to replicate Tariq's build by doing exactly what he did. I think on one of my builds I ran a "clean all" that may be causing all the problems.

Link to comment
Share on other sites

I just updated to 10.4.7 (working great, thanks Jas/Dax)

and changed this in AppleAC97Audio.kext/Contents/Info.plist

 

<key>com.apple.iokit.IOAudioFamily</key>

<string>1.1d25</string>

 

working fine...

 

Dope I have also noticed that if I change any code in any other directory (like IOAC97Family) I always get link/load error... try the compile command I gave earlier.. it works fine with you package.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...