[wdmaudiodev] Problem on setting wavecyclc

  • From: "PB" <peterbla@xxxxxxxxxxx>
  • To: <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Mon, 20 Jun 2005 00:18:49 +0800

I am writing an window audio driver by Microsoft 
Window Driver Development Kit(DDK) for window XP. 
I have followed the archecture of the driver sample
code provided under the folder SB16 which are using
WaveCyclic Interface and Slave Channel method to build
the sound card audio driver. 

However, since our chip on the sound card have not 
provide us the default channel, we use the Master Channel
method to create DMA channel and using allocate buffer API
similar as Slave method provided in the sample code.
------------------------------------------------------------
e.g.
       ntStatus = 
            Port->NewMasterDmaChannel 
            (  
               &MyDmaChannel,      // OutDmaChannel
               NULL,             // OuterUnknown (opt)
               NULL,             // ResourceList (opt)
               MAXLEN_DMA_BUFFER,    //Maximum Length            
               TRUE,             // Dma32BitAddresses
               FALSE,            // Dma64BitAddresses
               Width32Bits,      // DmaWidth
               Compatible
             );               // DmaPort
        if (NT_SUCCESS(ntStatus))
        {
            ULONG  lDMABufferLength = MAXLEN_DMA_BUFFER;
            
            do {
              ntStatus = MyDmaChannel->AllocateBuffer(lDMABufferLength,NULL);
              lDMABufferLength >>= 1;
              _DbgPrintF(DEBUGLVL_TERSE, ("lDMABufferLength = 0x%x", 
lDMABufferLength));
              
            } while (!NT_SUCCESS(ntStatus) && (lDMABufferLength > (PAGE_SIZE / 
2)));
        }

        if (NT_SUCCESS(ntStatus))
        {
           ....
           
AdapterCommon->WriteMCControlRegister((ULONG)PLAYBACK_DMA_CURRENT_BASE_ADDR, 
                                                 
(ULONG)MyDmaChannel->PhysicalAddress().QuadPart);
           ....
------------------------------------------------------------

However no matter how we tried, we cannot get the audio sound out.
We have seen in the debugger that all the register of our chip is now 
controllable and the
address of the allocate addressed is sured can written to our audio chip.
We have seen the sequence in the window such as:
--------------------
[ValidateFormat]
[SetNotificationFreq]
[ServiceWaveISR]
[SetState]
--------------------

can be runned under the testing on debugger. 
I have seen from the MSDN help menu that for master channel, user need to
use the API "copyto", "copyfrom" to copy data from and to the audio buffer.
It seems that it is not necessary in the slave channel method. Is it really
necessary in the master channel method?
And how can I know the address of where the data come from when Window Media 
wave file? I have no method to fill in the parameter of the "copyto",
"copyfrom" API to use them.
Or anyone can post the reference code for masterchannel  of Driver?

Thans you very much


Best Regards,
Peter

Other related posts: