If I'm not totally mistaken, then you are required to handle byte-alignment if you can play 8bit data, WORD-alignment if you can play 16bit data etc. Do NEVER use option 3. This will be just as "bad" as wave cyclic with the additional complexity of wave pci. The real question if you can use wave pci or not is this: Does HW support 64bit addressing? Does HW support sample-split over page boundaries (6ch playback)? Can you handle the alignment issues. I'm guessing your HW does not support 64bit addressing (like most do), therefore go to wave cyclic. Please do honor SetNotificationFreq on WaveCyc. Portcls might want to change this from 10ms down to some other frequency. This posting is provided "AS IS" with no warranties, and confers no rights. -----Original Message----- From: Daniel E. Germann [mailto:deg@xxxxxxxx]=20 Sent: Friday, January 31, 2003 7:39 AM To: WDM Audio Developers List Subject: [wdmaudiodev] WavePci vs. WaveCyclic (was: Already got cool latency figures - how about everyone else) One of our clients wants us to look into the complexity of writing a WDM Audio driver for a PCI card that has a scatter/gather bus-master PCI DMA controller. Unfortunately, the DMA controller has a restriction that the buffer starting address must be DWORD-aligned. The end of the buffer can be in the middle of a DWORD, but the start of the buffer must be DWORD-aligned. I read in the Audio Device Performance white paper (http://www.microsoft.com/hwdev/tech/audio/highperf-drv.asp) that, "A WavePci device is able to perform DMA transfers to or from buffers that can be located at arbitrary memory addresses, and that begin and end with arbitrary byte alignments." I can understand why the spec would be written that way. But does that ever really happen? We've looked at many, many applications, and all of them use buffers that are DWORD-aligned. Granted, the addresses we were looking at came right from the app, so there was no WDM/KMixer involvement. It may be that WDM/KMixer does use non-aligned buffers. Is this a case of the specification being written to be "powerful and general", or is there a real-world reason for this requirement? Given that WavePci requires the hardware to handle arbitrary alignment, it looks like there are at least three options. (1) Redesign the hardware so it can handle buffers with arbitrary alignment. The hardware engineer tells me that will greatly increase the complexity of his DMA controller design (and take a lot of debugging time). (2) Use WaveCyclic instead of WavePci, which would result in a lot of needless memcpy()s, and incur the 10 ms WaveCyclic latency Dirk mentioned. (3) Set up WavePci to run with a driver-allocated DWORD aligned buffer and memcpy() to/from it, which would get rid of the 10 ms latency but still do the needless memcpy()s (not 100% sure this will work). What are other people doing? Does everyone else using WavePci have "smarter" DMA controllers? ;-) Best regards, -Dan > From: "Van Mieghem, Dirk" <dvm@xxxxxxxx> > Subject: [wdmaudiodev] Re: Already got cool latency figures - how abou > Date: Thu, 30 Jan 2003 19:18:26 +0100 > > Hi Tom, > > > I've been using smaller buffers with WaveCyclic with no unusual > > problems. Granted, they don't work reliably at very low latencies, but I > > thought that was my old, slow system. > > > > Can this have dire consequences I'm not aware of? > > It's been a while since I used WaveCyclic. My first driver used it because I > liked the straightforward approach of WaveCyclic compared to the comlicated > way WavePCI deals with buffers. IMO, scatter/gather techniques are too much > overhead while using very small buffers (low latency). I remember that the > WaveCyclic DMA buffer couldn't go below 10ms because PortCls copies the data > in and out of this buffer. PortCls is handling the Allocator Framing to the > application and the miniport can't change this. However, it's possible that > this behavior changed with a Service Pack update. > > Dirk ****************** WDMAUDIODEV addresses: Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx Subscribe: = mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=3Dsubscribe Unsubscribe: mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=3Dunsubscribe Moderator: mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx URL to WDMAUDIODEV page: http://www.wdmaudiodev.de/ ****************** WDMAUDIODEV addresses: Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx Subscribe: mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe Unsubscribe: mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe Moderator: mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx URL to WDMAUDIODEV page: http://www.wdmaudiodev.de/