openvortex-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Openvortex-dev] Asp4FIFO.cpp


From: Manuel Jander
Subject: Re: [Openvortex-dev] Asp4FIFO.cpp
Date: Thu, 17 Apr 2003 21:57:01 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030327 Debian/1.3-4

Hi James,

Thank you very much for your help. I would really like to invite you to take a look at the current ALSA driver, because almost all of this functions have already been translated. There are some of them, specially for the AU8830/au8810 that have bugs, but its easier to
check a function than writing it from scratch.
To make more clear, i'm listing mp3 music using XMMS with the current ALSA driver right now,
on my AU8830 or sometimes on a AU8820.


The most problems of the current AU8830 ALSA part semes to be related
to mixerAddWTD/mixerDelWTD and srcAddWTD/srcDelWTD functions, because, if i start quake3 (which opens the sound device in fullduplex mode), i get mixer/src delWTD lifeboat overflows, that means there are troubles to remove the Mixer or SRC block output routes. This routes are internal routes of the Mixer and SRC blocks, they are apart of the
ADB routes.

I would say the things that arent working well/ need help are:

For basic functionality (most priority)
- AU8830 mixer/src AddWTD/DelWTD
- Add support for rear speaker routing (looks to be easy).

For extra goodness (less priority):
- AU8810 and AU8830 Hardware EQ
- WT audio engine routing (wavetable).
- A3D ... well this will be hard/impossible i guess. The windows drivers are very ugly to
reverse engineer.


Shamus wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all!

Here's a partial reconstruction of Asp4FIFO.cpp (which contains the
SetAdbCtrl__9CAsp4FIFOiiiiii function). It's fairly easy to see from
the parameters being passed into SetAdbCtrl(...) that the first
parameter is an index into the adbFifo (& HW registers) and that the
other 5 parameters are bit fields that get written into 0x16100 +
(baseAddr*4). Now as to what they actually *do*, that will take some
more investigation.

I did find out that the CAsp4DmaChannel (which calls the CAsp4FIFO
object's SetAdbCtrl function) is a base class to the CAsp4AbdDma and
CAsp4WtDma classes. I'll post my findings once I get those properly
translated.

Any more requests? Jeff? Manuel?
- -- Shamus


You are doing great work.


/*
void vortex_fifo_setadbctrl(vortex_t *vortex, int fifo, int b, int priority, int empty, int valid, int f)

i2 : fifo priority
i3 : fifo empty
i4 : fifo valid (start moving data)
*/

{
   DWORD baseAddrX4 = baseAddr * 4;
   DWORD esi = 0x16100 + baseAddrX4;
   DWORD ebx, edi;

   do
   {
       ebx = pHwIO->ReadDWORD(esi);
   }
   while (ebx & 0x01);

   if (i5 == 0)
   {
       if (ebx & 0x0010)
       {
           ebx &= 0xFFFFFFEF;

           if (64 % this04 == 0)
           {
               ebx |= 0x1C400000;
               pHwIO->Write(0x16100 + baseAddrX4, ebx);
               esi = (ebx >> 6) & 0x3F;
               DWORD ebp = ((ebx >> 6) & 0x3F) + 56;
               DWORD var08 = (esi == (ebx >> 12) & 0x3F ? 1 : 0);
               DWORD var10 = 0;
               DWORD var14 = 56 - (ebp % this04);
               DWORD var18 = (256 / (var14 - 4)) + 1;
               ebp = 256 - var18;
               DWORD var04 = 0;

               if (var14 > 0)
               {
                   DWORD var20 = baseAddr << 8;
                   DWORD addr = 0x14000 + (esi * 4) + var20;

                   do
                   {
                       if (var08)
                           var40 = var10;
                       else
                           // Sign extend 16 -> 32 bits
                           var10 = var40 =
(SDWORD)(SWORD)(pHwIO->ReadDWORD(addr) & 0x0000FFFF);

                       pHwIO->Write(0x14000 + (esi * 4) + var20,
(SDWORD)(var40 * ebp) >> 8);
                       addr += 4;
                       esi++;

                       if (esi > 63)
                       {
                           addr = 0x14000 + var20;
                           esi = 0;
                       }

                       if (esi == ((ebx >> 12) & 0x3F))
                           var08 = 1;

                       ebp -= var18;

                       if (ebp < 0)
                           ebp = 0;
                   }
                   while (++var04 < var14);
               }

               ebx = (((((ebx & 0xFFFC0FFF) | ((esi & 0x3F) << 12)) &
0x7FFFFFFF) | 0x08000000) & 0xEFFFFFFF) | 0x04400000;
               adbFifo[baseAddr] = 1;
           }
       }
       else
       {
           if (adbFifo[baseAddr] == 0)
               ClearAdbData(baseAddr, 64);
       }
   }
   else
   {
       if (!(ebx & 0x0010))
       {
           adbFifo[baseAddr] = 0;

           if ((64 % this04) == 0)
               ebx = (ebx & 0xFFFC0FFF) | ((ebx << 6) & 0x0003F000);
           else
           {
               ClearAbdData(baseAddr, this04);
               ebx = (this04 & 0x3F) << 12;
           }

           ebx = (ebx & 0xFFFFFFFD) | ((i2 & 0x0001) << 1);
           ebx = (ebx & 0xFFFFFFF3) | ((i3 & 0x0003) << 2);
           ebx = (ebx & 0xFFFFFFEF) | ((i5 & 0x0001) << 4);
           ebx |= 0x00040000;
           ebx = (ebx & 0xFFFFFFDF) | ((i4 & 0x0001) << 5);
           ebx = (ebx & 0xF7FFFFFF) | ((i6 & 0x0001) << 27);
           ebx = (ebx & 0xEFFFFFFF) | ((i6 & 0x0001) << 28);
       }
   }

   pHwIO->Write(0x16100 + baseAddrX4, ebx);
}







reply via email to

[Prev in Thread] Current Thread [Next in Thread]