Re: Question about audio driver in WINCE5.0

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



There are a couple of separate issues, but I'll do my best to try to
cover them:

You probably want to start with the Ensoniq wavedev2 driver that
shipped in the "Windows CE 5.0 Networked Media Device Feature Pack" for
CE 5 at
http://www.microsoft.com/downloads/details.aspx?FamilyID=bf17d6b0-4716-494b-9018-7deee9b91832&DisplayLang=en

My recollection is that this driver is under
public\fp_nmd\common\oak\drivers\wavedev\wavedev2\ensoniq.

This version of the Ensoniq driver has S/PDIF support built into it
(the Ensoniq 1371 chip has a sort-of-undocumented S/PDIF mode which we
take advantage of).

This Feature Pack also includes a WMAPro-over-SPDIF DirectShow filter
to allow you to stream multichannel WMAPro (e.g. 5.1, 6.1, 7.1) content
over S/PDIF. Unfortunately, Pioneer markets the only reasonably priced
line of receivers that support WMAPro decoding (hopefully someone will
correct me if I'm wrong).

Let's divide up the remaining issues between directly supporting 6 DAC
channels and S/PDIF, which are really somewhat different issues and
which have their own tradeoffs.

- 6 DAC channels:
Outputting to 6 DAC channels presumes that you're going to do
decompression/decoding of multichannel content before it gets to the
wave driver, which means you're passing 6 channels of PCM audio to the
driver.

For WaveDev2 you'll need to modify the driver to accept a WAVEFORMATEX
structure which looks like a normal PCM format but for which the
nChannels field is 6. This will not be a trivial exercise, but it
should be pretty straightforward. As part of this, you'll have to
rewrite the output.cpp file to add a new output stream class that
accepts 6 streams, and modify the render functions that handle
sample-rate-conversion to support all 6 channels.

One problem with multichannel output is that if you're outputting over
RCA jacks you've got six cables going to your receiver, which no one
really wants. S/PDIF doesn't help you here (more on that in a sec); the
hope for the future is HDMI, which supports passing 6 (or more)
decompressed PCM channels.

One other issue with 6 DACs is the question of where you're going to
get those 6 channels from. There are a couple of multichannel
compressed formats out there- let's examine two of them:

WMAPro: The WMAPro decoder that shipped in CE5 always decodes the
channels and then downmixes down to stereo output. I think the NMD
feature pack added a Dolby-Prologic-style downmix algorithm so if you
take the stereo and send it to a Prologic amp it will sort-of decode to
6 channels; but at the driver level it's still just stereo PCM. We
thought about adding support for outputting to a real multichannel
audio driver, but the demand just didn't merit the development effort
at the time.

Dolby AC3: Dolby AC3 is probably the most common/popular multichannel
format. Microsoft doesn't currently ship a Dolby AC3 Directshow
decoder, although there are probably lots of third party companies that
produce such a thing and there may be open source versions (google
"ac3filter").

- S/PDIF
The situation for S/PDIF is very different from having 6 DAC channels.
S/PDIF was originally designed to support a maximum of 4 decompressed
PCM channels, which means there's no way to squeeze 6 decompressed
audio channels across it. The solution to this has been to pass the
compressed audio over S/PDIF, which apart from enabling use of a single
cable from your device to your receiver has the added benefit of
offloading the audio decompression processing into your receiver.

Transferring compressed audio over S/PDIF typically involves massaging
the compressed audio into a format that matches the S/PDIF frame format
(e.g. by padding the data with zero's as needed) and adding some header
information that lets the receiver figure out that you're sending a
compressed audio stream rather than PCM. Both WMAPro and Dolby AC3 have
a spec for this. Almost every receiver in the world supports AC3
decoding; few (but a growing number) also support WMAPro.

Info on WMAPro is here:
http://download.microsoft.com/download/5/b/5/5b5bec17-ea71-4653-9539-204a672f11cf/wmadrv.doc
As I mentioned earlier, the NMD feature pack includes a DShow filter to
do this processing for you.

Info on AC3 is here:
http://www.dolby.com/assets/pdf/tech_library/46_DDEncodingGuidelines.pdf
(Appendix B).

The WaveDev2 Ensoniq sample driver supports passing either 2-channel
PCM over S/PDIF or encoded WMAPro. It would be a trivial change to also
support encoded AC3 once it's been properly padded.

There is one other issue with passing compressed data over S/PDIF:
since the data isn't decompressed to PCM until it gets to your
receiver, there's no way for you to programatically control the volume
or mix it with other PCM audio data. The former isn't really a big
issue (the user can always control the volume on their receiver). The
latter doesn't have a really great solution.

In the sample Ensoniq driver, whenever we're playing compressed WMAPro
out the S/PDIF port we just throw away any PCM data that we're asked to
play.

I hope this helps.

-Andy

Yang.Zhaobo@xxxxxxxxx wrote:
Hi,all

Hardware:
CPU: Au1200(MIPSII) with AC97 Controller
Codec: AD1888 (AC97 2.3)
6 DAC channels for 5.1 surroud
S/PDIF output

develop tools: PB5.0

How can I implement the 6 channels and S/PDIF output in driver?
The driver samples in \Public\common\oak\drivers\wavdev just implement
2 channels stereo for
analog output.

MDD/PDD or UAM ,which should I select?

Thanks for your advise!

.



Relevant Pages