Jump to content

ATI AC 97 Sounds (SB400) effort


Andras Kenez
 Share

696 posts in this topic

Recommended Posts

Have you a webpage/paypal setup? I'd like to donate to continue the effort. I'm busy working on the 0x5653 driver myself, which seems to be 1/4 of the people with sb4xx's, but I'd like to help the effort along somehow.

Link to comment
Share on other sites

I'm setting up a server this week, and i'll gladly host the project page. I have the domains expresslychicken.com and ferranconsulting.net , but if anyone has a different one they want to use we can point it at my server

Link to comment
Share on other sites

this cohort accidently got a job for the summer that's taking up a lot of time.

 

 

i've got some ideas for what to fix, but I'd like to make sure you already haven't fixed them.

 

 

as regards to a paypall, i don't need to get paid for this so don't worry about that.

 

a domain would be cool. we'd have to discuss it in more detail later

 

-ed

Link to comment
Share on other sites

I was thinking a Sourceforge account, as I'll probably be setting one of those up for my work on the EMU10K1 project when we finally get this. Uhh, as far as things I've fixed, things like checking dma->flags & kEngineRunning instead of dma->flags == kEngineRunning, little stuff like that. I can upload the newly revamped file with the same old problem if you like.

Link to comment
Share on other sites

Well, I've been doing a lot of "little bugfixes" over the past day, and - well, I fixed the kernel panic/lockup, but I'm no closer to solving the hardware pointer problem than I was. :( I'm quite irked about it, but I'm at a loss for now. Maybe Ed or scousi can come up with a solution.

 

 

Have you guys managed to get thr H/W pointer incrementing at all?

 

That's where I got hung up. Sorry about the spaghetti code - but I don't have any SDLC to deal with.

 

I just couldn't get the DMA started up on the chip. Who knows, maybe the linux driver doesn't work either. I never tried it myself.

Link to comment
Share on other sites

The Linux driver works better than good. I am going to try to go back and totally redesign the driver from the top down, patterning it after the Linux driver code (which I *know* works). If I can get a grasp of how the Apple sound driver setup process works, I think I just might be able to pull it off.

Link to comment
Share on other sites

This driver does not work. As a matter of fact, in its current state, it will probably lock up your system - and if it does anything like what mine did, it will take you forever to get it to boot normally again. I am not going to upload any builds until I have a driver that at least outputs sound.

Link to comment
Share on other sites

for now, we shall define works as: compiles, loads in system without crashing)

 

what it will not do, is give you any semblance of sound.

 

The best i've gotten for sound right now is a pop that happens the first time mac os x generates a sound.

 

I may have an idea on advancing the hardware pointer, but I'd like to test it on my code right now and see what that does, then i'll upload.

 

I think I'll do that tonight, as I don't see anything else coming up to distract me.

Link to comment
Share on other sites

can you post your .h file also?

 

I was wondering.

 

[this is my log output]

Jun 19 16:25:22 ed-lennons-computer kernel[0]: AppleAC97AudioATIIXP: acquireACLink

Jun 19 16:25:22 ed-lennons-computer kernel[0]: AppleAC97AudioATIIXP: acquireACLink

Jun 19 16:25:22 ed-lennons-computer kernel[0]: AppleAC97AudioATIIXP: acquireACLink

Jun 19 16:25:22 ed-lennons-computer kernel[0]: IOAC97AudioCodec[iD 0]::setAnalogOutputVolume(1, 1, 0) offset 0x4 word 0x0100

Jun 19 16:25:22 ed-lennons-computer kernel[0]: AppleAC97AudioATIIXP: acquireACLink

Jun 19 16:25:22 ed-lennons-computer kernel[0]: AppleAC97AudioATIIXP: acquireACLink

Jun 19 16:25:22 ed-lennons-computer kernel[0]: AppleAC97AudioATIIXP: acquireACLink

Jun 19 16:25:22 ed-lennons-computer kernel[0]: IOAC97AudioCodec[iD 0]::setAnalogOutputVolume(0, 1, 0) offset 0x2 word 0x0100

Jun 19 16:25:22 ed-lennons-computer kernel[0]: AppleAC97AudioATIIXP: acquireACLink

Jun 19 16:25:22 ed-lennons-computer kernel[0]: AppleAC97AudioATIIXP: acquireACLink

Jun 19 16:25:22 ed-lennons-computer kernel[0]: AppleAC97AudioATIIXP: acquireACLink

Jun 19 16:25:22 ed-lennons-computer kernel[0]: IOAC97AudioCodec[iD 0]::setAnalogOutputVolume(1, 2, 0) offset 0x4 word 0x0000

Jun 19 16:25:22 ed-lennons-computer kernel[0]: AppleAC97AudioATIIXP: acquireACLink

Jun 19 16:25:22 ed-lennons-computer kernel[0]: AppleAC97AudioATIIXP: acquireACLink

Jun 19 16:25:22 ed-lennons-computer kernel[0]: AppleAC97AudioATIIXP: acquireACLink

Jun 19 16:25:22 ed-lennons-computer kernel[0]: IOAC97AudioCodec[iD 0]::setAnalogOutputVolume(0, 2, 0) offset 0x2 word 0x0000

Jun 19 16:25:23 ed-lennons-computer kernel[0]: AppleAC97AudioEnginePCMOut::performAudioEngineStart

Jun 19 16:25:23 ed-lennons-computer kernel[0]: AppleAC97AudioATIIXP::startDMAEngine[1]

Jun 19 16:25:23 ed-lennons-computer kernel[0]: AppleAC97AudioATIIXP::startDMAEngine[1] IS STARTED

Jun 19 16:25:23 ed-lennons-computer kernel[0]: PCMOUt id = 10

Jun 19 16:25:23 ed-lennons-computer kernel[0]: curptr is: 0

Jun 19 16:25:23 ed-lennons-computer kernel[0]: curptr is: 0

Jun 19 16:25:23 ed-lennons-computer kernel[0]: curptr is: 0

Jun 19 16:25:23 ed-lennons-computer kernel[0]: curptr is: 0

Jun 19 16:25:23 ed-lennons-computer kernel[0]: curptr is: 0

Jun 19 16:25:23 ed-lennons-computer kernel[0]: curptr is: 0

Jun 19 16:25:23 ed-lennons-computer kernel[0]: curptr is: 0

Jun 19 16:25:23 ed-lennons-computer kernel[0]: curptr is: 0

Jun 19 16:25:23 ed-lennons-computer kernel[0]: curptr is: 0

Jun 19 16:25:23 ed-lennons-computer kernel[0]: curptr is: 0

Jun 19 16:25:23 ed-lennons-computer kernel[0]: HW Position = 0x0 engine ID = 0x1,REG=0x44

Jun 19 16:25:23 ed-lennons-computer kernel[0]: [sF: 0]

Jun 19 16:25:23 ed-lennons-computer kernel[0]: AppleAC97AudioATIIXP::startDMAEngine[1]

Jun 19 16:25:23 ed-lennons-computer kernel[0]: AppleAC97AudioATIIXP::startDMAEngine[1] IS ALREADY RUNNING

Jun 19 16:25:23 ed-lennons-computer kernel[0]: curptr is: 0

Jun 19 16:25:23 ed-lennons-computer kernel[0]: curptr is: 0

Jun 19 16:25:23 ed-lennons-computer kernel[0]: curptr is: 0

Jun 19 16:25:23 ed-lennons-computer kernel[0]: curptr is: 0

Jun 19 16:25:23 ed-lennons-computer kernel[0]: curptr is: 0

[/end log output]

 

Anyways. I was wondering.....if you notice at the top, the codec ID is 0, but then the Engine ID is 1

 

Because right now, when I detect the codec It properly gets the address for codec 0 but not codec 1 which is a zero, that's one bug i know of in my code.

 

but the thing is, is it entirely possible that the reason we're not able to get the hardware to advance is that we've got the wrong engine attatched to the codec?

 

I'm wondering if those two numbers are supposed to match, because if they are, there is definitely something wrong in my code that definitely needs to be fixed.

 

-ed

Link to comment
Share on other sites

go back a little in the thread (somewhere near page 6), there is a zip file that has the whole project in it, then you download it. then you have to make sure the paths for all the files are correct (you need to correct the paths for the ATIIXP files (or you can match the directories whichever you find easier). The paths are kinda burried in the settings of the project, but this will give you an opportunity to familiarize yourself with the settings of x-code. Then you need to go to the latest source post you can find (dopefishlives probably today sometime this evening) and then paste that source code into the ATIIXP codebase. Compile, and copy the kext from your build directory to the System/Library/Extensions directory, chmod and chown for proper permissions, restart and see what happens. If you crash OSX, go into the command prompt off the boot and delete the kext and the kextcache. So that's pretty much everything in a nutshell.

 

 

Also, familiarize yourself with the LINUX code that has been posted at the beginning and other parts throughout the thread. Read the whole thread to see what we've done and what ideas we have tried and are currently stuck on. Familiarize yourself with the rest of the AC97 framework we're building off of, and then you can compare our code with the other code and see if we missed something or did something in some really goofy way. If you notice something blatantly wrong, fix it and post the fix to this thread. Also check out the IOKit documentation (its linked to all over this forum) and look up the audio stuff to get an idea of what needs to be done.

 

That's about all. Any other questions, don't hesitate to post them.

Link to comment
Share on other sites

*heavy sigh*

So I finished the restructuring of the driver, essentially writing it from scratch (although borrowing very heavily from the previous version, especially with regard to power management). And I still have made NO PROGRESS on the DMA hardware pointer! :hysterical: I don't know what this problem could be, because I followed the Linux driver as closely as I could. I'll upload the code later, when I'm less exhausted and frustrated.

Link to comment
Share on other sites

Ed, scousi, I've found the problem but have been unable to fix it so far. The problem is that the chipset is timing out when trying to read the Vendor ID from codec #1, which I presume is to be attached to DMA #1, which is PCM in. I'm attaching a modified IOAC97CodecDevice.cpp which has some additional debug strings in it for you to see exactly what I mean. Go into your codecRead function and have it print a debug string if it times out (don't use DebugLog, use regular IOLog instead). I'm working on a solution to this problem right now.

IOAC97CodecDevice.cpp.txt

Link to comment
Share on other sites

I was noticing that vendor ID read problem also, the thing was that there was no indication anywhere else where to get that vendor ID, so I thought it was just something else not to worry about, I guess I was wrong.

 

So what register do we need to read the vendor ID from?

Link to comment
Share on other sites

It's a codec register, something the codec usually handles. I don't honestly know if that is the problem that's causing all this, but I've been experimenting with tons of stuff, making it look more like the Linux driver, and nothing's worked yet. I have noticed that Codec 1 does not ever seem to be "ready" according to the driver, so perhaps there is an issue with codec detection and attachment.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...