
                 C-Media 8338/8738 driver for QNX 6.2

     This driver is intended for 8338 and 8738 sound chips from  C-Media
Electronics Inc. The driver was written with the use of several sources:
ALSA 0.5.12a driver set - the main source (unfortunately this  branch is
no longer supported by ALSA developers), ALSA 0.9.0rc3 - the main source
of additional information about the driver, official driver from C-Media
for Linux version 5.68, CMI driver for FreeBSD version 1.16. This driver
is released under the GPL license (GNU General Public license)
     The driver for QNX RealTime Platform recognizes chips from  C-Media
on PCI ID, the manufacturer code of the C-Media is 0x13F6. The following
models are supported:

     - 0x0100 CM8338A CMI8338/C3DX PCI Audio Device
     - 0x0101 CM8338B CMI8338/C3DX PCI Audio Device
     - 0x0111 CM8738A CMI8738/C3DX PCI Audio Device
     - 0x0112 CM8738B CMI8738/C3DX PCI Audio Device

     The internal model of the  chip can be 33, 37, 39, 55. Depending on
these data the driver  can conduct  itself in  different ways. Models of
chips 39, 55 support multichannel upto 4 or 6 channels. The  information
on the retrieved model version of the chip is displayed as a part of the
device  name, for example: CMI8738 (37)  or  CMI8738 (39)-MC4. The  last
device name (with -MC suffix) shows that the chip supports  multichannel
feature.
     Irrespective of the type of chip, driver supports  two  independent
channels, which can be used as DAC1/DAC2, DAC1/ADC1. Thus chip  supports
duplex, which makes it  possible  to  play  samples  and  simultaneously
record from several sources, or to use both channels for the playback of
samples, btw: output of DAC2 will  go  to  the  rear  speakers. All  the
described models of chips have one  special  feature - the  frequency of
discreteness (sample rate) can only be fixed, namely  5512, 8000, 11025,
16000, 22050, 32000, 44100 and 48000 Hz. If application attempts  to use
nonstandard frequency, then the nearest standard value will be used.
    Chips with multichannel support use the first hardware  channel  for
playback  of  several  channels  simultaneously. They  can  be  4  or  6
depending on modification of the chip. Another feature is connected with
them - all characteristics of sound streams, such as sampling rate, bits
per one sample must be the same.
     The driver fully supports all capture  sources, such  as:  PCM, CD,
LINE, AUX, SYNTH, MIC. While using mic input  you  can  enable  Mic Gain
Boost option in Advanced setting menu. Also it  is  possible  to  change
amplification level (8 steps) in capture part of photon's mixer.
     Support for S/PDIF out was added. To use it  it  is  neccessary  to
setup your applications for using the third virtual  pcm  channel, which
offers the driver.
     Now the driver offers five virtual pcm channels for out and one for
in. Each of them has its own specific assignment:

     1 - The first DAC (DAC1) is used for playback.
     2 - The second DAC (DAC2) is used for playback.
     3 - The first DAC (DAC1) is used for playback and S/PDIF out is on.
         This channel is combined with the first  one, i.e. only one  of
         them can be used at the same time.
     4 - The first DAC (DAC1)  is  used  for  playback. This  channel is
         combined with the first one, but it can be  opened  many times.
         This channel uses the software mixer QSA for the output of some
         simultaneous sound streams from different applications into one
         physical channel (the first one).
     5 - The second DAC (DAC2) is  used  for  playback. This  channel is
         combined with the second one, but it can be  opened many times.
         This channel uses the software mixer QSA for the output of some
         simultaneous sound streams from different applications into one
         physical channel (the second one).
     6 - The second ADC (ADC2 is co-allocated with the DAC2) is used for
         the capturing. While using the  given  channel  the  rest ones,
         using DAC2, are blocked.

     Concerning additional options in the driver (access to them  can be
done by launching the photon mixer and selecting Advanced settings menu)
here is some information about the checked options:

     - 3D Surround - artificial expansion  of  stereo-base, having  only
       been checked on CMI8338A(33). This feature does not  work  for me
       absolutely, maybe I'm deaf :)(I have  card  with CMI8738(37) chip
       and CMI8738(55)).
     - Line-In As Rear - line-in input of soundboard begins  to  work as
       output for second hardware channel DAC2 (rear playback).
     - Analog Four Channel - rear ouput of the  soundcard  can  be heard
       only if the given option is set up. Otherwise the  hardware mixer
       will not route the sound to rear output.
     - Exchange DAC - Front  and  Rear  outputs  exchange  places. It is
       possible to listen the both channels by having only  one  pair of
       speakers or headphones.
     - S/PDIF  Monitor (to  analog  out) - the signal  from S/PDIF In is
       routed directly to DAC.
     - S/PDIF Loop (to digital out) - S/PDIF In input data is loop  back
       to the S/PDIF Out. (bypass mode).
     - S/PDIF 5V (0.5V or 5V) -  Select  0.5V  (coax)  or  5V  (optical)
       interface. On some cards this doesn't work and you need to change
       the configuration with hardware dip-switch.

     Some description of the switches was taken from  cmpci.txt document
(from ALSA source distribution) by Takashi Iwai.

(C) 2002 Mike Gorchak
