1.1 wince sound model
The standard audio processing model for Windows CE.
1) the sound application is classified by coredll module when using the wave interface function: if it is a simple PCM data, it directly enters the ADM module, software mixer or even mixer is saved, and the driver is called to play the audio directly. If the data in the compression mode is used, the ACM module is used for decompression (for example, GSM/g7xx, etc ...) Enter the ADM module again. In addition, if the driver supports hardware mixer, the application layer directly drops ACM and ADM and directly enters the driver for software or hardware sound mixing and playing.
2) ACM and software mixer are optional units. You can add or delete parameters through the registry or CE Kernel configuration.
1.2 sound-driven model of WinCE
L layered model
This is a standard hierarchical MDD-PDD stream interface model. All application-layer waveapis use the waveapi Manager (waveapi. dll) to map to the wav_iocontrol function through deviceiocontrol for processing.
The MDD layer is a standard implementation of Microsoft. It is connected through the ddsi (Device Driver service-provider interface) and the PDD layer implementation. MDD notifies the PDD layer through messages (pdd_waveproc processing)
Interface functions at the MDD layer
· Wav_close
· Wav_deinit
· Wav_init
· Wav_iocontrol
· Wav_open
· Wav_powerdown
· Wav_powerup
· Wav_read
· Wav_seek
· Wav_write
Ddsi interface functions
· Pdd_audiodeinitialize
· Pdd_audiogetinterrupttype
· Pdd_audioinitialize
· Pdd_audiomessage
· Pdd_audiopowerhandler
· Pdd_waveproc
However, the layered model also has certain limitations.
· Only one device is supported
· Multiple Streams are not supported
· Poor loop support
· Poor support for multiple stream data
L monolithic model
For a single-chip model, WinCE wants to transition to this solution. Driver porting in this model
It is quite simple. At the same time, this model also provides customer service to support the limitations of multiple streams through the kernel mixer. At the driver level, it supports mixing of multiple input and output streams.
L basic operation of layered models
The layered model supports simultaneous sound recording and recording operations. The MDD layer manages one interrupt handler and multiple
DMA buffers. Generally, dual DMA buffer is used for both sound recording and recording.
For example, when a sound is played, the application transmits some data through the waveapi. The MDD layer sends the wpdm_start message to the PDD through the pdd_waveproc function, the PDD layer copies the data to the DMA buffer, and starts the hardware sound releasing. When the DMA completes the data transfer of a buffer, a hardware interruption occurs. The PDD layer sets an audio_state_out_playing flag. If MDD finds that more data needs to be transferred, it will use the wpdm_continue. Message to make the PDD layer continue to be responsible for filling the DMA buffer; otherwise, it will send a wpdm_endofdata. Message to stop the DMA at the PDD layer.