Re: Audio problems of wav_close in wince 5.0
- From: andyraf@xxxxxxxxxxxxx
- Date: Mon, 17 Sep 2007 09:12:54 -0700
On Sep 16, 11:56 pm, huod...@xxxxxxxxx wrote:
On Sep 16, 1:30 am, andy...@xxxxxxxxxxxxx wrote:
On Sep 13, 6:48 am, huod...@xxxxxxxxx wrote:
HI,all
Hardware:
CPU:AU1200(MIPS||) with AC97 Controller
Codec:AD1985(AC97 2.3)
6 DAC channels for 5.1 surroud
Develop tools : PB5.0
My audio driver has some problems that i can't deal with!
I am developping 6 channels audio driver to surpport dvd
playing in wince 5.0!
The problem comes out when i want to turn off the dvd in the
application, where
i use the standard api function wave_out_close(). But there are the
times when i can't
successfully turn the audio off. I check the driver code,and find that
when this problem
happpens,it dose not get into the driver pdd function
wav_common_close().
So, the next time i play the DVD,there is no sound coming out!
Can anybody tell me why the wave_out_close() api function dose
not get into the
driver mdd function wav_common_close()?
Thanks a lot!
I'm not specifically sure why it wouldn't get into the close routine,
but you should check the return value from waveOutClose at the
application level. If you get WAVEERR_STILLPLAYING it means that the
system thinks there are still audio buffers lodged in your driver.
Before trying to close the wave device, it's usually a good idea to
call waveOutPause/waveOutReset, wait for all buffers to be returned to
the application, and then call waveOutClose.
Also, if you're using the MDD/PDD driver architecture, how are you
hooking into the kernel mixer, or do you have it shut off? (In
general, I've never heard of anyone using MDD/PDD for multichannel
audio, and the kernel mixer doesn't really support it, so you might
have some problems to solve). Also, is there a chance that some other
application has the wave device open at the same time?
-Andy- Hide quoted text -
- Show quoted text -
Thank you for your valualbe advice to me !
You are right that i get WAVEERR_STILLPLAYING message when it
fails. So,i am very confused about it!
I have called waveOutReset everytime before calling waveOutClose,but
there are also some times when i can't have it successfully closed!
Is there any other reason for that?
I use the MDD/PDD driver architecture to support multichannel
audio in this way. By changing the WaveFormat constuct ,which can
only
surpport the Two-channel Audio ,to WaveFormatExtensible,i make the
audio driver supportable for Six-Channel Audio output.
In this way , although I can play Six-Channel DVD Audio, the order
of the Six-Channel output is not right .For example ,the channel
which
oughts to play out Front Left plays out Center! I have checked the
manual of DB1200 and AD1985 ,The register are all set as what
they should be. Till now I can't find out the resolvent for it!
Maybe it's because of the MDD/PDD driver architecture !
And i also find out that the kernel mixer doesn't support
multichannel audio.In the MDD/PDD Audio driver architecture ,the
software mixer
dosen't be used! And in my opinion the wav-data is sent from the
application to the DMA of audio driver by the way of pointer.In fact
i'm not
quite sure about that.
I have thought about re-writing the Audio driver using the UAM.
But,i don't have the sample codes of UAM ,So it seems quite difficult
for me
to work on it.Do you have the sample codes of UAM? I 'll feel rather
grateful if you can share me one copy .Or can you tell me the way to
get it.
Thanks a lot!- Hide quoted text -
- Show quoted text -
I can think of a couple of things to try:
1. How is your application waveOutReset? Is there a chance that while
one thread is calling waveOutReset to force the buffers to be
returned, some other thread is refilling the buffers with more data
and sending them back down to the driver?
2. How is your driver handling WODM_RESET? Is it returning all the
buffers to the application?
3. Can you modify your code to verify that all the buffers have been
returned to your application after waveOutReset and before calling
waveOutClose? I don't recall exactly how waveOutReset works on CE5,
but part of the buffer return code may be handled in a separate
thread, so you may need to block until all the buffers you had
previously sent the driver are marked unqueued. I don't recall seeing
this problem elsewhere though.
If you were to rewrite your driver, you wouldn't want to use the UAM
driver; you would use the wavedev2 driver. Appropriate blog entries
are here:
http://blogs.msdn.com/medmedia/archive/2007/01/03/windows-ce-audio-driver-samples.aspx
http://blogs.msdn.com/medmedia/archive/2007/01/16/multichannel-audio-in-windows-ce.aspx
You can find the wavedev2 sample code as part of the NMD feature pack
for CE5.0 under public\fp_nmd\common\oak\drivers\wavedev
\wavedev2\ensoniq. I believe the download is here
http://www.microsoft.com/downloads/details.aspx?FamilyID=BF17D6B0-4716-494B-9018-7DEEE9B91832&displaylang=en
.
- References:
- Audio problems of wav_close in wince 5.0
- From: huodian
- Re: Audio problems of wav_close in wince 5.0
- From: andyraf
- Re: Audio problems of wav_close in wince 5.0
- From: huodian
- Audio problems of wav_close in wince 5.0
- Prev by Date: CellCore in windows CE6, no voice?
- Next by Date: Re: keyboard and mouse get hang immediately after moving the mouse
- Previous by thread: Re: Audio problems of wav_close in wince 5.0
- Next by thread: Re: Use IESIMPLE in OS design (full screen)
- Index(es):
Relevant Pages
|
Loading