Jump to content

ATI AC 97 Sounds (SB400) effort


  • This topic is locked This topic is locked
695 replies to this topic

#41
quickslvr1287

quickslvr1287

    InsanelyMac Protégé

  • Members
  • Pip
  • 36 posts
  • Location:somewhere
hey guys I'm not as smart as you guys as far as the coding and debugging for the driver goes, but if you can think of any way I could help you out, let me know. It doesnt feel right to just sit here and wait for you guys to finish and then just reap the rewards for doing nothing :)

#42
Geek

Geek

    InsanelyMac Protégé

  • Members
  • Pip
  • 13 posts
I am very excited to see what comes of this again the last thing not working is my ati ac97 sound....best of luck to you brave fellows :)

#43
Peter Gammelgaard

Peter Gammelgaard

    InsanelyMac Protégé

  • Members
  • PipPip
  • 60 posts
Any news in this projekt?

Is the homepage up soon, or!?

I'm just curious.. :thumbsdown_anim:

#44
scousi

scousi

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 308 posts

Any news in this projekt?

Is the homepage up soon, or!?

I'm just curious.. :)


I've been working on it lately. I found my backup of the source code.

The problem I'm having so far is getting the device to fire interrupts and mapping the DMA buffers to the device.

#45
scousi

scousi

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 308 posts

I've been working on it lately. I found my backup of the source code.

The problem I'm having so far is getting the device to fire interrupts and mapping the DMA buffers to the device.



Here's the source code if anyone want to take a look. It doesn't work however.

Attached Files



#46
EdFlyer

EdFlyer

    Computer Lackey

  • Members
  • PipPipPip
  • 159 posts
well, i've been working off scousi's and mine source code and checking against the linux code. I've run into an interesting problem where there's an infinite loop occuring, but its not occuring in the code that we developed, but in the code that came from Apple. So, hopefully is a matter of figuring out where the loop is originally called from, and then tracing the steps that cause that.

The good news is that the river is loading more or less and that we can control volume, but anytime it attmpets to play a sound it hits the inifite loop, so that's the current status for the curious.

#47
digicide

digicide

    InsanelyMac Protégé

  • Members
  • PipPip
  • 53 posts
thanks! I love updates-- I think I check this thread about once an hour. it sounds like you're close. once I get garageband installed, i'm naming my mac drive 'scousi' and my windows drive 'edflyer' so they'll be right there on the desktop all the time and i'll never forget the blood sweat and tears sacrificed for my hackintosh....

#48
kaveman

kaveman

    InsanelyMac Protégé

  • Members
  • Pip
  • 5 posts
hey digicide.... you know you can actually subscribe to the topic to get an email whenever there is a new post doncha? :(

#49
scousi

scousi

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 308 posts

well, i've been working off scousi's and mine source code and checking against the linux code. I've run into an interesting problem where there's an infinite loop occuring, but its not occuring in the code that we developed, but in the code that came from Apple. So, hopefully is a matter of figuring out where the loop is originally called from, and then tracing the steps that cause that.

The good news is that the river is loading more or less and that we can control volume, but anytime it attmpets to play a sound it hits the inifite loop, so that's the current status for the curious.


Can you send me what you are talking about? (PM). I've cleaned up my code a liitle by actually using the Linux functions. (Sorry about the mess but this is a hack, no QA on my back). I don't have the master volume working either. The driver isn't actually crashing. Another weirdness is that DebugLog only logs when it's called from code within AppleAC97AudioATIIXP.cpp module.

THe DMA mappings just don't seem to happen. We must find a way to kick-start the whole thing. I'm also a little suspicious about the source since it didn't compile without any tweaks.

I have enclosed an update to the code.

The problem I'm having is this:

Mar 29 21:26:02 MACPortable kernel[0]: AppleAC97AudioATIIXP::startDMAEngine[1]
Mar 29 21:26:02 MACPortable kernel[0]: AppleAC97AudioATIIXP::startDMAEngine[1] IS ALREADY RUNNING
Mar 29 21:26:02 MACPortable kernel[0]: HW Position = 0x102d50b4 engine ID = 0x1,REG=0xc
Mar 29 21:26:02 MACPortable kernel[0]: LINKPTR = 0x106a1001
Mar 29 21:26:02 MACPortable kernel[0]: START = 0x102d5000
Mar 29 21:26:02 MACPortable kernel[0]: NEXT = 0x21b6800c
Mar 29 21:26:02 MACPortable kernel[0]: CUR = 0x102d50b4
Mar 29 21:26:02 MACPortable kernel[0]: SZ = 0x8000400
Mar 29 21:26:02 MACPortable kernel[0]: HW Position = 0x102d50b4 engine ID = 0x1,REG=0xc
Mar 29 21:26:02 MACPortable kernel[0]: LINKPTR = 0x106a1001
Mar 29 21:26:02 MACPortable kernel[0]: START = 0x102d5000
Mar 29 21:26:02 MACPortable kernel[0]: NEXT = 0x21b6800c
Mar 29 21:26:02 MACPortable kernel[0]: CUR = 0x102d50b4
Mar 29 21:26:02 MACPortable kernel[0]: SZ = 0x8000400
Mar 29 21:26:02 MACPortable kernel[0]: AppleAC97AudioATIIXP::startDMAEngine[1]
Mar 29 21:26:02 MACPortable kernel[0]: AppleAC97AudioATIIXP::startDMAEngine[1] IS ALREADY RUNNING
Mar 29 21:26:02 MACPortable kernel[0]: HW Position = 0x102d50b4 engine ID = 0x1,REG=0xc
Mar 29 21:26:02 MACPortable kernel[0]: LINKPTR = 0x106a1001
Mar 29 21:26:02 MACPortable kernel[0]: START = 0x102d5000
Mar 29 21:26:02 MACPortable kernel[0]: NEXT = 0x21b6800c
Mar 29 21:26:02 MACPortable kernel[0]: CUR = 0x102d50b4
Mar 29 21:26:02 MACPortable kernel[0]: SZ = 0x8000400
Mar 29 21:26:02 MACPortable kernel[0]: HW Position = 0x102d50b4 engine ID = 0x1,REG=0xc
Mar 29 21:26:02 MACPortable kernel[0]: LINKPTR = 0x106a1001
Mar 29 21:26:02 MACPortable kernel[0]: START = 0x102d5000
Mar 29 21:26:02 MACPortable kernel[0]: NEXT = 0x21b6800c
Mar 29 21:26:02 MACPortable kernel[0]: CUR = 0x102d50b4
Mar 29 21:26:02 MACPortable kernel[0]: SZ = 0x8000400
Mar 29 21:26:03 MACPortable kernel[0]: AppleAC97AudioATIIXP::startDMAEngine[1]
Mar 29 21:26:03 MACPortable kernel[0]: AppleAC97AudioATIIXP::startDMAEngine[1] IS ALREADY RUNNING
Mar 29 21:26:03 MACPortable kernel[0]: HW Position = 0x102d50b4 engine ID = 0x1,REG=0xc
Mar 29 21:26:03 MACPortable kernel[0]: LINKPTR = 0x106a1001
Mar 29 21:26:03 MACPortable kernel[0]: START = 0x102d5000
Mar 29 21:26:03 MACPortable kernel[0]: NEXT = 0x21b6800c
Mar 29 21:26:03 MACPortable kernel[0]: CUR = 0x102d50b4
Mar 29 21:26:03 MACPortable kernel[0]: SZ = 0x8000400
Mar 29 21:26:03 MACPortable kernel[0]: HW Position = 0x102d50b4 engine ID = 0x1,REG=0xc
Mar 29 21:26:03 MACPortable kernel[0]: LINKPTR = 0x106a1001
Mar 29 21:26:03 MACPortable kernel[0]: START = 0x102d5000
Mar 29 21:26:03 MACPortable kernel[0]: NEXT = 0x21b6800c
Mar 29 21:26:03 MACPortable kernel[0]: CUR = 0x102d50b4
Mar 29 21:26:03 MACPortable kernel[0]: SZ = 0x8000400
Mar 29 21:26:03 MACPortable kernel[0]: AppleAC97AudioATIIXP::startDMAEngine[1]
Mar 29 21:26:03 MACPortable kernel[0]: AppleAC97AudioATIIXP::startDMAEngine[1] IS ALREADY RUNNING
Mar 29 21:26:03 MACPortable kernel[0]: HW Position = 0x102d50b4 engine ID = 0x1,REG=0xc
Mar 29 21:26:03 MACPortable kernel[0]: LINKPTR = 0x106a1001
Mar 29 21:26:03 MACPortable kernel[0]: START = 0x102d5000
Mar 29 21:26:03 MACPortable kernel[0]: NEXT = 0x21b6800c
Mar 29 21:26:03 MACPortable kernel[0]: CUR = 0x102d50b4
Mar 29 21:26:03 MACPortable kernel[0]: SZ = 0x8000400
Mar 29 21:26:03 MACPortable kernel[0]: HW Position = 0x102d50b4 engine ID = 0x1,REG=0xc
Mar 29 21:26:03 MACPortable kernel[0]: LINKPTR = 0x106a1001
Mar 29 21:26:03 MACPortable kernel[0]: START = 0x102d5000
Mar 29 21:26:03 MACPortable kernel[0]: NEXT = 0x21b6800c
Mar 29 21:26:03 MACPortable kernel[0]: CUR = 0x102d50b4
Mar 29 21:26:03 MACPortable kernel[0]: SZ = 0x8000400
Mar 29 21:26:03 MACPortable kernel[0]: AppleAC97AudioATIIXP::startDMAEngine[1]
Mar 29 21:26:03 MACPortable kernel[0]: AppleAC97AudioATIIXP::startDMAEngine[1] IS ALREADY RUNNING
Mar 29 21:26:03 MACPortable kernel[0]: HW Position = 0x102d50b4 engine ID = 0x1,REG=0xc
Mar 29 21:26:03 MACPortable kernel[0]: LINKPTR = 0x106a1001
Mar 29 21:26:03 MACPortable kernel[0]: START = 0x102d5000
Mar 29 21:26:03 MACPortable kernel[0]: NEXT = 0x21b6800c
Mar 29 21:26:03 MACPortable kernel[0]: CUR = 0x102d50b4
Mar 29 21:26:03 MACPortable kernel[0]: SZ = 0x8000400
Mar 29 21:26:03 MACPortable kernel[0]: HW Position = 0x102d50b4 engine ID = 0x1,REG=0xc
Mar 29 21:26:03 MACPortable kernel[0]: LINKPTR = 0x106a1001
Mar 29 21:26:03 MACPortable kernel[0]: START = 0x102d5000
Mar 29 21:26:03 MACPortable kernel[0]: NEXT = 0x21b6800c
Mar 29 21:26:03 MACPortable kernel[0]: CUR = 0x102d50b4
Mar 29 21:26:03 MACPortable kernel[0]: SZ = 0x8000400

Attached Files



#50
EdFlyer

EdFlyer

    Computer Lackey

  • Members
  • PipPipPip
  • 159 posts
that engine running problem is the one i've run into, once I get back on my laptop tomorrow, I'll upload the .cpp file that's relevent. Yeah, We need to figure out how to have the dma shutdown properly after the codecs are initialized, so that when the OS calls it, it isn't already running, because it shuoldn't. Hopefully we can get this solved. Too bad the other driver projects aren't getting this amount of collaboration.

that's all for now
-ed

#51
Elv13

Elv13

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 318 posts
hi, if this can help, that my dmesg on gentoo
ati ixp 150

*by the way, if someone have an idea about the problem with the rest of the chipsset and the hdd, it will be helpful

Attached Files



#52
EdFlyer

EdFlyer

    Computer Lackey

  • Members
  • PipPipPip
  • 159 posts
For those also attempting to code this driver:

here's what I've got so far.....swap this file with the one from scousi's download, compile, and then copy the kext file into your /System/Library/Extensions folder

you will see that the driver loads, detects and communicates with teh hardware, but has some dma trouble and thinks that the dam is constantly running. the good news is that mac os x sees it and you are even able to control the volume, but no sound yet., so that's what we're at.


ps. dont forget to change the file extension back to .cpp

Attached Files



#53
limbohz

limbohz

    InsanelyMac Protégé

  • Members
  • PipPip
  • 60 posts
just want to chime in and thank you guys for all of your effort :offtopic: congratulations! you guys are almost there!

good job and thanks again!

#54
EdFlyer

EdFlyer

    Computer Lackey

  • Members
  • PipPipPip
  • 159 posts
some code fixes for everyone to play with

I updated the readCodec method, and various little tweaks to the code, that didn't help my situation, but didn't break it either.

as before, download scousi's latest upload and copy this file over the cpp included with it.

Attached Files



#55
dimbulb

dimbulb

    InsanelyMac Protégé

  • Members
  • Pip
  • 19 posts
Ed--

Is there any debugging information you'd like after I give this module a try?

#56
EdFlyer

EdFlyer

    Computer Lackey

  • Members
  • PipPipPip
  • 159 posts
nothing in particular, i was just hoping that if more eyes looked at the code we could figure out what is going wrong with the dma engine.


scousi's error is this
Mar 29 21:26:03 MACPortable kernel[0]: HW Position = 0x102d50b4 engine ID = 0x1,REG=0xc

mine is the same but i dont have a hardware position address
Mar 29 21:26:03 MACPortable kernel[0]: HW Position = 0x0 engine ID = 0x1,REG=0xc

#57
EdFlyer

EdFlyer

    Computer Lackey

  • Members
  • PipPipPip
  • 159 posts
I found another bug in the code

It seams that it tries to load the via sound driver first, fails, then tries to load the ATIIXP driver. This may be related to the problem with the engine, as it may attempting to use the engine of the VIA driver and crapping out because of it. What's interesting is that it gets as far as it does.

[edit]
I changed the plist in XCode to the default code, so the VIA driver no longer loads,
had to delete the Extensions.mkext and Extensions.kextcache files though.

Alright that's all for now folks
[/edit]

That or there's another error in the code that I'm not seeing

Scousi, may I ask why the device id for the VIA was set to 0x43771002 when it is supposed to be something else?
43771002 appears to be the PCI-ISA bridge.

The investigation continues......

#58
scousi

scousi

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 308 posts

I found another bug in the code

It seams that it tries to load the via sound driver first, fails, then tries to load the ATIIXP driver. This may be related to the problem with the engine, as it may attempting to use the engine of the VIA driver and crapping out because of it. What's interesting is that it gets as far as it does.

[edit]
I changed the plist in XCode to the default code, so the VIA driver no longer loads,
had to delete the Extensions.mkext and Extensions.kextcache files though.

Alright that's all for now folks
[/edit]

That or there's another error in the code that I'm not seeing

Scousi, may I ask why the device id for the VIA was set to 0x43771002 when it is supposed to be something else?
43771002 appears to be the PCI-ISA bridge.

The investigation continues......


That's because at first I used the VIA code as the baseline and put 4370 there. When I wanted to to remove it, I was too lazy to look up the original so I put an arbitrary 4377 there. I gues we should put the original back in.

PS - My VIA never loads as I load the driver manually while I'm debugging.

The problem I have is that the function atiixp_out_enable_transfer from atiixp.c wasn't implemented. When I run this enabler, it screws up the initialization. So I'm trying to figure out the correct place of where to run this in the sequence of things.

I've checked the status of the codec by reading all the proper H/W addresses and it's in the proper state. The buffer descriptor is now initialized OK (there was a few bugs in that code since I was inserting in the "next" pointer of the linked list the virtual address rather than the h/w address). The volume controls are actually changing the volume registers inside the chip also.

The reason the DMA engine is looping I think, is that since the h/W pointer is never advancing, the driver tries to restart the engine all the time. I guess we could try to stub the h/w pointer return and fake an increasing value to see the effect.

It's a long process mainly because of the reboots required + the IOLog buffer seems to skip some messages. If I had firewire on my laptop, I could remotely step through the driver code.

I think that we are fairly close.

#59
EdFlyer

EdFlyer

    Computer Lackey

  • Members
  • PipPipPip
  • 159 posts
scousi, I also think we are fairly close, are u working off the code I did, or ur code base? or a combination of both?

#60
dhruv

dhruv

    InsanelyMac Protégé

  • Members
  • Pip
  • 15 posts
Just a quick question to the devs. I've been told by dimbulb that the internal 56k modem in HP/Compaq laptops is a part of the sound system (Windows XP calls the modem "AC97 Data Fax SoftModem with SmartCP"). Thus, can one assume that this sound driver may allow OSX to recognise the internal modem component, or will it purely be for sound only?

Thanks for the hard work!





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy