flat assembler
Message board for the users of flat assembler.

Index > MenuetOS > PCI AC97 sounddriver for Intel motherboard ICH4

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
dvorakvik



Joined: 06 Feb 2004
Posts: 19
Location: Praha - Czech Republic - Europe
dvorakvik 30 Sep 2004, 18:52
If someone has PCI AC97 soundriver for testing, please can you make this driver available for others?

Viktor
Post 30 Sep 2004, 18:52
View user's profile Send private message Reply with quote
Ivan Poddubny



Joined: 21 Sep 2003
Posts: 32
Location: Yaroslavl, Russia
Ivan Poddubny 03 Oct 2004, 11:15
I have Smile AC97 player for MenuetOS RE.
But i haven't yet tested it with ICH4...
Post 03 Oct 2004, 11:15
View user's profile Send private message Visit poster's website Reply with quote
drh3xx



Joined: 11 Sep 2004
Posts: 34
drh3xx 03 Oct 2004, 11:38
Any chance of posting it and the source?
Post 03 Oct 2004, 11:38
View user's profile Send private message Reply with quote
ASHLEY4



Joined: 28 Apr 2004
Posts: 376
Location: UK
ASHLEY4 03 Oct 2004, 15:42
Here is a test driver for AC97, i made for a OS i am working on, it work with some AC97 chips, but not others, They are not all the same, but can be made to work once i have basic code working.
In the zip is a exe to put the program on a floppy, it then can be booted to test the driver, it also come with a SB-Pro driver and a command line cdplayer this will auto detect your cd/dvd drive and the cdplayer can be used to test if driver works (must have a cable from cd/dvd drive to sound card in pc to work)
The code is assembled with fasm and can easy be converted for menuet, but i have not included code as this stops people from giving feedback, i will put code up when i have a working driver.

PS: please note this does not put a driver on your pc, it just test if it would work on your setup and like menuetos is gone when reboot with out the floppy in the A: drive.

\\\\||////
(@@)
ASHLEY4.


Last edited by ASHLEY4 on 19 Dec 2004, 02:40; edited 2 times in total
Post 03 Oct 2004, 15:42
View user's profile Send private message Reply with quote
daneel



Joined: 19 May 2004
Posts: 56
daneel 03 Oct 2004, 17:14
So .. newer SB than SB16 will work ?
Post 03 Oct 2004, 17:14
View user's profile Send private message Reply with quote
drh3xx



Joined: 11 Sep 2004
Posts: 34
drh3xx 03 Oct 2004, 17:26
Trust me to have a system that wont work with this driver Sad

Motherboard's an ASUS P4S800D I think the AC97 is provided by SiS although I'm not certain (My N/S bridges are both use SiS chipsets but my LAN & SND are not detected by the utility on the SiS website. I Know my LAN is part of the 900 chipset) I think ASUS have done some jimmy-rigging for some reason.
Post 03 Oct 2004, 17:26
View user's profile Send private message Reply with quote
mike.dld



Joined: 03 Oct 2003
Posts: 235
Location: Belarus, Minsk
mike.dld 03 Oct 2004, 17:30
Ivan: you're right - your player works in RE (and only in RE#8 now). Why? Because official kernel allows us to use ports 0000-3FFF but your player uses ports C000 and higher so i can't test it until RE#8 is released.
Post 03 Oct 2004, 17:30
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
ASHLEY4



Joined: 28 Apr 2004
Posts: 376
Location: UK
ASHLEY4 03 Oct 2004, 18:11
drhxx, the code may still work with your card, it just looks for a set vender id and chip id if your is not on the list , it will not work, but may if your vender id is check for.
Go here and get the vendor id and device id for your sound card or onboard sound.
http://www.pcidatabase.com/
and send it to me i will put in the code to search for it and then you can try it.

\\\\||////
(@@)
ASHLEY4.


Last edited by ASHLEY4 on 03 Oct 2004, 20:45; edited 1 time in total
Post 03 Oct 2004, 18:11
View user's profile Send private message Reply with quote
Ivan Poddubny



Joined: 21 Sep 2003
Posts: 32
Location: Yaroslavl, Russia
Ivan Poddubny 03 Oct 2004, 18:27
I've just made a simple html page.
AC97 & MeOS RE#8 pre1 are there:
http://www.corbina.net/~poddubny
Post 03 Oct 2004, 18:27
View user's profile Send private message Visit poster's website Reply with quote
drh3xx



Joined: 11 Sep 2004
Posts: 34
drh3xx 03 Oct 2004, 18:42
Cheers ASHLEY4, the id's you wanted are:

VendorID 0x1039 (SiS)
DeviceID 0x7012
Post 03 Oct 2004, 18:42
View user's profile Send private message Reply with quote
ASHLEY4



Joined: 28 Apr 2004
Posts: 376
Location: UK
ASHLEY4 03 Oct 2004, 21:33
drh3xx, i have up dated code with your id etc. it may work, if not let me now and i will get data sheet for your vendor and see where the differnt. is.
if you get " AC97 test driver byASHLEY4. " and then the cdplayer commands, then its detced it, but if no sound from speakers, then it needs sweeking.

ps: make shore you have a cd driver to soundcard cable, some new pc do not have them.

\\\\||////
(@@)
ASHLEY4.
Post 03 Oct 2004, 21:33
View user's profile Send private message Reply with quote
drh3xx



Joined: 11 Sep 2004
Posts: 34
drh3xx 03 Oct 2004, 22:24
I custom build all my PCs Smile
Hell I'd have tried to built my own router if I could afford all the kit.
I thought you'd have known me a bit better than that ASHLEY4.

As for your code, it shows the menu but still no sound Sad

You still gonna hit that wednesday target you set yourself?
I'll be away until then but I'll drop by your site as soon as I get back.
Post 03 Oct 2004, 22:24
View user's profile Send private message Reply with quote
ASHLEY4



Joined: 28 Apr 2004
Posts: 376
Location: UK
ASHLEY4 04 Oct 2004, 11:09
The cd cable bit was not meant for programmers like you drh3xx, it was for the more general user who is not in to programmer.
Thats Y i did not put a type in your vendor id here etc, in the code, i would get lots of what is a vendor id ?.

As for Wednesday target do not expect too much.

\\\\||////
(@@)
ASHLEY4.
Post 04 Oct 2004, 11:09
View user's profile Send private message Reply with quote
profkid13



Joined: 21 Aug 2003
Posts: 111
profkid13 15 Oct 2004, 18:03
i tested your app with my via ac'97 audio controller and it sdidnt worked, i get this error in the debug board :

Quote:
Error: Could not find Intel ICH based AC97 audio device!
Maybe your codec is disabled in BIOS?
Exiting NOW!


is this because my card isnt recognized or isnt it gonna work at all?
What do i have to change/or what info do you need to get it working?[/quote]
Post 15 Oct 2004, 18:03
View user's profile Send private message Reply with quote
mike.dld



Joined: 03 Oct 2003
Posts: 235
Location: Belarus, Minsk
mike.dld 15 Oct 2004, 20:15
Ivan has no any VIA-dedicated documents, so VIA-chipsets aren't supported now. If you have some - send it to him.
Post 15 Oct 2004, 20:15
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
ASHLEY4



Joined: 28 Apr 2004
Posts: 376
Location: UK
ASHLEY4 16 Oct 2004, 12:29
I am working with the ac97 sound,making drivers for my OS, here is a link to a pdf with info for the
via vt82c686a with ac97 may be the one on your board ? http://www.o3one.org/hwdocs/amd_chipset/via_686a.pdf
From page 106, but to get it to work, you need to use a differant method then intel ac97.
its more like the Sb pro.

\\\\\\||//////
(@@)
ASHLEY4.
Post 16 Oct 2004, 12:29
View user's profile Send private message Reply with quote
profkid13



Joined: 21 Aug 2003
Posts: 111
profkid13 16 Oct 2004, 14:00
Quote:
I am working with the ac97 sound,making drivers for my OS, here is a link to a pdf with info for the
via vt82c686a with ac97 may be the one on your board ? http://www.o3one.org/hwdocs/amd_chipset/via_686a.pdf
From page 106, but to get it to work, you need to use a differant method then intel ac97.
its more like the Sb pro.

\\\\\\||//////
(@@)
ASHLEY4.


*Looks under table..
Yups, that's the one on my board Razz

I never made drivers before, is there a sort of step by step guid to this ?
I have lots of free time on my hands to learn it Wink
Post 16 Oct 2004, 14:00
View user's profile Send private message Reply with quote
ASHLEY4



Joined: 28 Apr 2004
Posts: 376
Location: UK
ASHLEY4 16 Oct 2004, 16:56
Basic tut for make sound driver, all gather round.
Step 1. First you write a function to read PCI , we will start with dos .
Code:
;===============================================================; 8/16/32bit PCI reader;; Entry: EAX=PCI Bus/Device/fn/register number;           BIT30 set if 32 bit access requested;           BIT29 set if 16 bit access requested;           otherwise defaults to 8bit read;; Exit:  DL,DX,EDX register data depending on requested read size;; Note: this routine is meant to be called via pciRegRead8, pciRegread16,;  or pciRegRead32, listed below.;; Note2: don't attempt to read 32bits of data from a non dword aligned reg;    number.  Likewise, don't do 16bit reads from non word aligned reg #;BIT30 EQU 40000000hBIT31 EQU 80000000hPCI_INDEX_PORT  EQU     0CF8hPCI_DATA_PORT   EQU     0CFChPCI32           EQU     BIT31           ; bitflag to signal 32bit accessPCI16           EQU     BIT30           ; bitflag for 16bit accessVIA_VID       equ     1106h           ; VIAPCI vendor IDVIA_DID      equ      3058h           ; VIA device IDpciRegRead:        push    ebx   push    cx        mov     ebx, eax                        ; save eax, dh        mov     cl, dh        and     eax, NOT PCI32+PCI16            ; clear out data size request        or      eax, BIT31                      ; make a PCI access request        and     al, NOT 3                       ; force index to be dword        mov     dx, PCI_INDEX_PORT        out     dx, eax                         ; write PCI selector        mov     dx, PCI_DATA_PORT        mov     al, bl        and     al, 3                           ; figure out which port to        add     dl, al                          ; read to   in      eax, dx                         ; do 32bit read        test    ebx, PCI32        jz      @f        mov     edx, eax                        ; return 32bits of data@@:   mov     dx, ax                          ; return 16bits of data        test    ebx, PCI32+PCI16        jnz     @f        mov     dh, cl                          ; restore dh for 8 bit read@@:        mov     eax, ebx                        ; restore eax        and     eax, NOT PCI32+PCI16            ; clear out data size request     pop     cx    pop     ebx   retpciRegRead8:        and     eax, NOT PCI16+PCI32            ; set up 8 bit read size        jmp     pciRegRead                   ; call generic PCI accesspciRegRead16:        and     eax, NOT PCI16+PCI32            ; set up 16 bit read size        or      eax, PCI16                   ; call generic PCI access        jmp     pciRegReadpciRegRead32:        and     eax, NOT PCI16+PCI32                ; set up 32 bit read size        or      eax, PCI32                   ; call generic PCI access        jmp     pciRegRead    


Step 2. we fill in the vendor id and device id to see it is on the pc, to do that we need a function to scan through pci space to look for vendor+device id like this.
Code:
;===============================================================; PCIFindDevice: scan through PCI space looking for a device+vendor ID;; Entry: EAX=Device+vendor ID;;  Exit: EAX=PCI address if device found;        CY clear if found, set if not found. EAX invalid if CY set.;; [old stackless] Destroys: ebx, edx, esi, edi, cl;pciFindDevice:     push    cx    push    edx   push    esi   push    edi        mov     esi, eax                ; save off vend+device ID        mov     edi, (80000000h - 100h) ; start with bus 0, dev 0 func 0nextPCIdevice:        add     edi, 100h        cmp     edi, 80fff800h             ; scanned all devices?        stc        jz      PCIscanExit             ; not found        mov     eax, edi                ; read PCI registers        call    pciRegRead32        cmp     edx, esi                ; found device?        jnz     nextPCIDevice        clcPCIScanExit:       pushf mov     eax, edi                ; return found PCI address    and     eax, NOT BIT31          ; return only bus/dev/fn #    popf        pop     edi   pop     esi   pop     edx   pop     cx    retEnd    

Step 3. we need to put it together and call the above functions.
Code:
        mov     eax, (VIA_DID shl 16) + VIA_VID        call    pciFindDevice        jnc     @f; couldn't find the audio device! push    cs    pop     ds        lea     dx, noVIAMsg        mov     ah, 9        int     21h        jmp     exitnoVIAMsg db "Error: Unable to find VIA based audio device!",CR,LF,"$"@@:    


Step 4. put the above code in to a com file (adding org 100h, etc) and boot it from dos or bootprog you can get it here: http://alexfru.chat.ru/epm.html
Print one message for found and an other for not found.
Step 5. well i think that enough for now, tune in for the next instalment of basic sounddriver making.

good links: http://www.pcidatabase.com/#notice

PCI code by (jeff leyda)

\\\\||////
(@@)
ASHLEY4.
Post 16 Oct 2004, 16:56
View user's profile Send private message Reply with quote
Cryptus



Joined: 19 Oct 2004
Posts: 8
Location: Germany
Cryptus 19 Oct 2004, 01:54
Hi Ashley4,

I just tried your AC97CdPlay.zip, as I am desperately looking for a DOS driver for my Toshiba Notebook, Chipset Intel 830M, which has an AC97 Audio Controller, Device ID 0x2485.
Linux does identify it ('cat /proc/asound/card1/ac97') as Cirrus Logic CS4299 rev D.

Your Program (as tested under M$-DOS and FreeDOS) says:
"AC97 test driver, by ASHLEY4.", then I get the cdplayer commands.
Open does work. Hitting P turns on my CDROM LED, but no sound ... Crying or Very sad
(btw. there is not way to quit the program besides reboot...)

any hope for me??

Frank
Post 19 Oct 2004, 01:54
View user's profile Send private message Reply with quote
ASHLEY4



Joined: 28 Apr 2004
Posts: 376
Location: UK
ASHLEY4 19 Oct 2004, 13:34
Here are some note, first if you get "AC97 test driver, by ASHLEY4." this means that it has detect your vendor ID and device ID, this does not mean it will work, what i did was put all the vendor + device ID in that i new had a ac97 chip.
I did not have the above chip to test it on, the problem is this, the ac97 codec are 99% compatable with each other, but the address and way to enable them is totally different, so you still need to write a drivers for most vendor Crying or Very sad .
The test program comes with a bootloader which is put on the boot sector of the floppy, if you put the floppy that it put its self on. in the floppy drive and rebooted, it would boot to the program, so no need for dos, so as it made to run without dos there s no int 20h etc, i can make one for dos if people wanted it.

Also if the light is on then the cd is playing, when you press to test do you here a pop as the speakers are turned on ?.

Basiclly each vendors ac97 needs two to three days work and a pc with the chip on to get it to work.

\\\\||////
(@@)
ASHLEY4.
Post 19 Oct 2004, 13:34
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.