Adaptation/GUID-E2641957-8163-5EF4-B282-FC3FD9CA75A6.dita
changeset 15 307f4279f433
equal deleted inserted replaced
14:578be2adaf3e 15:307f4279f433
       
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
       
     3 <!-- This component and the accompanying materials are made available under the terms of the License 
       
     4 "Eclipse Public License v1.0" which accompanies this distribution, 
       
     5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
       
     6 <!-- Initial Contributors:
       
     7     Nokia Corporation - initial contribution.
       
     8 Contributors: 
       
     9 -->
       
    10 <!DOCTYPE concept
       
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
       
    12 <concept id="GUID-E2641957-8163-5EF4-B282-FC3FD9CA75A6" xml:lang="en"><title>Sound
       
    13 Driver Technology</title><shortdesc>Describes the technology concepts that are used in the Sound Driver. </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    14 <section id="GUID-CBC17614-34B3-52A1-9C74-F7093A175398"><title>Audio hardware
       
    15 device</title> <p>An audio hardware device is an individual hardware codec
       
    16 device together with any associated controller hardware that allows the CPU
       
    17 to communicate with it. </p> <p>A basic audio hardware device typically provides
       
    18 two communication paths: an input path for the audio recording and an output
       
    19 path for audio playback. </p> <p>Most basic audio hardware devices support
       
    20 full duplex data transfer although some are only half-duplex or maybe just
       
    21 simplex. Each input or output path may be used to transfer mono data or stereo
       
    22 data. In the case of stereo this consists of two audio channels, the left
       
    23 and the right; mono data consists of just a single audio channel. </p> <p>A
       
    24 more complex audio hardware device could be an AC 97 codec or similar, plus
       
    25 its associated controller, which can support multiple input and output paths.
       
    26 Each input or output path may be used to transfer mono data, stereo data or
       
    27 'multichannel data'. For example, left, right, centre, left and right surround
       
    28 and Low-Frequency Effects (LFE). </p> </section>
       
    29 <section id="GUID-7C8FF32F-2E84-57B1-8962-9EDB4D51FEE6"><title>Unit</title> <p>Units
       
    30 are used to provide access to the various audio hardware devices. Each unit
       
    31 supports just one communication path this is either input or output. </p> <p>Clients
       
    32 of the audio hardware system can open a separate connection to each unit.
       
    33 The mapping between the units on a given phone and the audio hardware devices
       
    34 themselves is platform specific; this is determined by the implementer of
       
    35 the Sound Driver PDD for that platform. </p> <p>A basic full-duplex audio
       
    36 hardware device is presented as two units, one input/record unit and one output/playback
       
    37 unit. A more complex audio hardware device such as an AC 97 codec may be represented
       
    38 to the rest of the OS as a number of audio input and output units. </p> </section>
       
    39 <section id="GUID-74B14664-8D9D-57D2-B090-709136FEB5E3"><title>Audio channel</title> <p>An
       
    40 audio channel is a data stream between a client and an audio unit. There are
       
    41 one or more audio channels per driver channel. </p> </section>
       
    42 <section id="GUID-4D6A01FE-47E7-5A6F-9DFE-F612B880165B"><title>Driver channel</title> <p>A
       
    43 driver channel is a session between a client and an audio unit. A client may
       
    44 have driver channels open on more than one unit. </p> <p><note> The difference
       
    45 between a driver channel and an audio channel. A driver channel is a session
       
    46 between the client and an audio device which can consist of one or more audio
       
    47 channels. An audio channel refers to the audio stream, for example, left or
       
    48 right output.</note> </p> <fig id="GUID-C3B51755-EDB0-5518-83D1-886E9148D65A">
       
    49 <title>              The relationship between audio channels and device channels.
       
    50            </title>
       
    51 <image href="GUID-2D98DB88-BA48-5EF8-A5F9-0CB8688B0B63_d0e32099_href.png" placement="inline"/>
       
    52 </fig> </section>
       
    53 <section id="GUID-5C66667B-55C0-521D-86E3-67593DB381C9"><title>Mono to stereo
       
    54 conversion</title> <p>Many codecs that support stereo playback can only accept
       
    55 audio data that is delivered with the samples for each of the channels interleaved,
       
    56 for example, LRLRLR. For these audio hardware devices, in order to operate
       
    57 the channel in mono mode and to play audio data which contains only samples
       
    58 for a single channel it is necessary to perform mono-to-stereo conversion
       
    59 on the audio data before delivering it to the codec. So, for a section of
       
    60 mono audio data that contains three samples, lets call them S1, S2 and S3,
       
    61 each sample is duplicated, so we have S1,S1,S2,S2,S3,S3, with identical samples
       
    62 being delivered to each channel. </p> <p>Unfortunately, the only way for the
       
    63 PDD to implement this conversion is for it to allocate a conversion buffer
       
    64 and to copy each sample twice into this buffer. The PDD has to allocate a
       
    65 separate conversion buffer for each simultaneous transfer operation it supports,
       
    66 for example, for the template playback driver, a conversion buffer count equal
       
    67 to <xref href="GUID-EE69DF4F-3341-355A-837A-5DA1C8A20A67.dita"><apiname>KTemplateMaxTxDmaRequests</apiname></xref>. </p> <p>When performing conversion
       
    68 in this manner, the maximum transfer size that the PDD can accept from the
       
    69 LDD becomes half the size of each conversion buffer, and when configured in
       
    70 this mode, the value returned to the LDD in response to <xref href="GUID-61CC68CB-A01D-3CA0-93D9-F3717ABD6424.dita#GUID-61CC68CB-A01D-3CA0-93D9-F3717ABD6424/GUID-A47005E5-36B4-3795-A4C0-CB67B43802B5"><apiname>DSoundScPdd::MaxTransferLen</apiname></xref> must
       
    71 equal this value. </p> <p>Likewise, the record data may be delivered by the
       
    72 audio hardware device only in stereo format with the data samples for each
       
    73 channel interleaved. If the driver channel is configured in mono record mode,
       
    74 stereo to mono conversion has to be performed in the PDD to discard each alternate
       
    75 sample. </p> </section>
       
    76 </conbody></concept>