Re: [Q]: Message
From: Sajid (sajidbmsATyahooDOTcom)
Date: 09/03/04
- Next message: Yu: "Re: ActiveSync by IRDA in WinCE .NET ?"
- Previous message: neo: "Re: sources files"
- In reply to: Andrew Raffman: "RE: [Q]: Message"
- Next in thread: Sajid: "Re: [Q]: Message"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 3 Sep 2004 11:49:01 +0530
hi Andrew,
Atfirst, I really thank you for the valuable information you rendered
in this respect, as this type of information is tough to get.
Here, i would like to make my audio driver design a bit clear:
I have adopted two DMA buffers of 2K each [this design works well on other
OS].
I have set the software mixer registry for 4 buffers with 4K each.
[HKEY_LOCAL_MACHINE\Audio\SoftwareMixer]
"SampleRate"=dword:AC44
"Buffers"=dword:4
"BufferSize"=dword:1000
"EnableLowPassFilter"=dword:1
"Priority 256"=dword:dc
I would include the code for the normal causes as mentioned by you.
Moreover, I have the working audio driver code with the software mixer
disabled.
So, I do not see much problem in DMA case, rather i see something fishy in
software
buffer handling code, as I have re-designed the software buffer management
code in my audio driver from earlier single buffer to a linked list of
WAVEHDR
structure instances.
I am glad to say that your information has given me a better understanding
of the
middle layer now. Thank you.
regards
sajid
"Andrew Raffman" <andyraf@microsoft.com> wrote in message
news:zEyL$ESkEHA.3628@cpmsftngxa10.phx.gbl...
> The software mixer allocates a set of internal buffers, mixes into them as
> needed, and sends them down to the audio driver for playback. The mixer
> uses a semaphore to keep track of the number of free buffers. As buffers
> are sent down to the audio driver, the semaphore is decremented, and as
the
> audio driver returns the buffers the semaphore is incremented. Each time
> the mixer needs to send more data to the driver, it waits on the semaphore
> for up to 1 second for a buffer to become available (in other words, for
> the semaphore count to be non-zero).
>
> The message you received ("SwMixer: WaitForBuffer failed. Audio driver
> missed interrupt?") means that the wait on the semaphore for an available
> buffer timed out, indicating that all the buffers are lodged in the audio
> device driver and have not been returned in a timely manner to the mixer.
>
> This typically means that one of the following problems has occurred. (I'm
> assuming your underlying hardware has a DMA channel to move audio data to
a
> CODEC, and generates an interrupt when each DMA operation is compete,
which
> then wakes up an IST thread to move more data to the DMA buffer):
>
> - The audio DMA operation did not complete and did not generate an
> interrupt.
> - The DMA interrupt was improperly masked
> - The interrupt occurred, but some unexpected DMA condition caused the IST
> to ignore the interrupt (e.g. some DMA error bits were set), causing
> everything to stop. For example, on the SA1100 we've seen cases where the
> DCSR_ERROR bit is set for no apparent reason, and the only workaround is
> to recognize this condition and restart the DMA operation.
> - The IST became hung due to a deadlock, infinite loop, or starvation due
> to some other high priority thread.
> - After copying the (SW mixer) buffer to the DMA buffer, the IST never
> returned the buffer to the wave subsystem.
>
> You should be able to instrument your wave driver to determine which of
> these conditions has taken place.
>
> An outside possibility is that the mixer driver has used either too few
> buffers, or each buffer is too small; and the audio driver is using
> extremely large DMA buffers. Under these conditions, it might take too
long
> for the audio driver to return a buffer to the SW mixer. This seems
> unlikely, as it would require each audio DMA buffer to hold more than 1
> second worth of data. However, this type of situation is often the cause
of
> unexplained dropouts in audio output (e.g. "I heard some dropouts, so I
> increased my DMA buffer size and the dropouts got worse rather than
> better"). In general, it's important to size the driver's DMA buffers and
> the SW mixer's buffers so that at any time the SW mixer has at least one
> buffer available to mix into.
>
> The audio driver can control the number and size of the buffers which the
> sw mixer allocates by correctly handling the WODM_GETEXTDEVCAPS message
and
> filling in the associated WAVEOUTEXTCAPS structure. This structure is also
> used to tell the SW mixer how many streams the driver can mix (for drivers
> that support doing their own mixing), and also to tell the SW mixer the
> preferred sample rate of the audio driver.
>
>
- Next message: Yu: "Re: ActiveSync by IRDA in WinCE .NET ?"
- Previous message: neo: "Re: sources files"
- In reply to: Andrew Raffman: "RE: [Q]: Message"
- Next in thread: Sajid: "Re: [Q]: Message"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|