Annotation of margi2/audio.h, revision 1.2

1.1       cvs         1: /* 
                      2:     audio.h
                      3: 
                      4:     Copyright (C) Christian Wolff for convergence integrated media.
                      5: 
                      6:     This program is free software; you can redistribute it and/or modify
                      7:     it under the terms of the GNU General Public License as published by
                      8:     the Free Software Foundation; either version 2 of the License, or
                      9:     (at your option) any later version.
                     10: 
                     11:     This program is distributed in the hope that it will be useful,
                     12:     but WITHOUT ANY WARRANTY; without even the implied warranty of
                     13:     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                     14:     GNU General Public License for more details.
                     15: 
                     16:     You should have received a copy of the GNU General Public License
                     17:     along with this program; if not, write to the Free Software
                     18:     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
                     19: */
                     20: 
                     21: 
                     22: #ifndef CVDV_AUDIO_H
                     23: #define CVDV_AUDIO_H
                     24: 
                     25:   //
                     26:  //  Audio Decoder
                     27: //
                     28: #define __NO_VERSION__
                     29: #include <pcmcia/config.h>
                     30: #include <pcmcia/k_compat.h>
                     31: 
                     32: #include "cardbase.h"
                     33: 
1.2     ! mocm       34: #define MAUDIO_PAUSE 0
        !            35: #define MAUDIO_PLAY 1
        !            36: #define MAUDIO_FAST 2
        !            37: #define MAUDIO_SLOW 3
1.1       cvs        38: 
                     39: // mode=0 pause
                     40: // mode=1 normal speed play
                     41: // mode=2 fast play, 16/15
                     42: // mode=3 slow play, 16/17
                     43: void AudioSetPlayMode(struct cvdv_cards *card, int mode);
                     44: 
                     45: void AudioStartDecode(struct cvdv_cards *card);
                     46: 
                     47: // Stop Decode flushes the Audio ES channel buffer
                     48: void AudioStopDecode(struct cvdv_cards *card);
                     49: 
                     50: void AudioStartFormat(struct cvdv_cards *card);
                     51: 
                     52: void AudioStopFormat(struct cvdv_cards *card);
                     53: 
                     54: //         Audio source:    S/PDIF out:
                     55: // mode 0: MPEG             IEC958
                     56: // mode 1: AC3              IEC958
                     57: // mode 2: MPEG             MPEG
                     58: // mode 3: AC3              AC3
                     59: // mode 4: PCM              IEC958 (max. 48kHz)
                     60: // mode 5: PCM 96->48kHz    IEC958 (48kHz)
                     61: // mode 6: CD Bypass        S/PDIF Bypass
                     62: // mode 7: PCM FIFO         PCM FIFO
                     63: void AudioSetMode(struct cvdv_cards *card, int mode);
                     64: 
                     65: 
                     66: // volume: 0..255
                     67: void AudioSetVolume(struct cvdv_cards *card, int volume);
                     68: 
                     69: // mute=1: mute audio
                     70: void AudioMute(struct cvdv_cards *card, int mute);
                     71: 
                     72: // mode=0: stereo
                     73: // mode=1: surround
                     74: void AudioAC3Mode(struct cvdv_cards *card, int mode);
                     75: 
                     76: // mode=0: custom analog
                     77: // mode=1: custom digital
                     78: // mode=2: line-out (default)
                     79: // mode=3: RF mode
                     80: void AudioAC3Compression(struct cvdv_cards *card, int mode);
                     81: 
                     82: // mode=0: AC3
                     83: // mode=1: ES1
                     84: void AudioAC3Formatter(struct cvdv_cards *card, int mode);
                     85: 
                     86: // mode=0: Stereo
                     87: // mode=1: Right channel only
                     88: // mode=2: Left channel only
                     89: // mode=3: Mono Mix
                     90: void AudioDualMono(struct cvdv_cards *card, int mode);
                     91: 
                     92: // swap=0: L->L, R->R
                     93: // swap=1: L->R, R->L
                     94: void AudioSwap(struct cvdv_cards *card, int swap);
                     95: 
                     96: // select=0: use clock from ACLK_441 pin -> ACLK=44.1kHz*N
                     97: // select=1: use clock from ACLK_48 pin  -> ACLK=48.0kHz*N
                     98: // select=2: use clock from ACLK_32 pin  -> ACLK=32.0kHz*N
                     99: //  Since the programmable sample rate generator of the PCM1723 is connected to 
                    100: //  all 3 of them, it doen't matter wich one you choose.
                    101: // divider=0: ACLK=768*Fs / S/PDIF-BCLK=ACLK/6 / DAC-BCLK=ACLK/12 / DAC-A_ACLK=ACLK/3
                    102: // divider=1: ACLK=768*Fs / S/PDIF-BCLK=ACLK/6 / DAC-BCLK=ACLK/12 / DAC-A_ACLK=ACLK/2
                    103: // divider=2: ACLK=512*Fs / S/PDIF-BCLK=ACLK/4 / DAC-BCLK=ACLK/8  / DAC-A_ACLK=ACLK/2
                    104: // divider=3: ACLK=384*Fs / S/PDIF-BCLK=ACLK/3 / DAC-BCLK=ACLK/6  / DAC-A_ACLK=ACLK/1
                    105: // divider=4: ACLK=256*Fs / S/PDIF-BCLK=ACLK/2 / DAC-BCLK=ACLK/4  / DAC-A_ACLK=ACLK/1
                    106: // divider=5: ACLK=768*48kHz / S/PDIF-BCLK=ACLK/6 / DAC-BCLK=ACLK/6  / DAC-A_ACLK=ACLK/1
                    107: // divider=6: ACLK=512*48kHz / S/PDIF-BCLK=ACLK/4 / DAC-BCLK=ACLK/4  / DAC-A_ACLK=ACLK/1
                    108: // divider=C: ACLK=768*48kHz / S/PDIF-BCLK=ACLK/9 / DAC-BCLK=ACLK/18 / DAC-A_ACLK=ACLK/3
                    109: // divider=D: ACLK=512*48kHz / S/PDIF-BCLK=ACLK/6 / DAC-BCLK=ACLK/12 / DAC-A_ACLK=ACLK/3
                    110: // divider=E: ACLK=512*48kHz / S/PDIF-BCLK=ACLK/6 / DAC-BCLK=ACLK/12 / DAC-A_ACLK=ACLK/2
                    111: // divider=F: ACLK=256*48kHz / S/PDIF-BCLK=ACLK/3 / DAC-BCLK=ACLK/6  / DAC-A_ACLK=ACLK/1
                    112: //  Fs is the audio sample frequency
                    113: //  For the normal cases, (32, 44.1, and 48 kHz) select divider 0 through 4 and set 
                    114: //  sample frequency in PCM1723 accordingly
                    115: //  For 96 kHz, select divider 5 or 6, and set PCM1723 to 48kHz*768 or *512 resp.
                    116: //  Divider C through F are for 32 kHz sample frequency with a 48kHz*x ACLK
                    117: void AudioSetACLK(struct cvdv_cards *card, int select, int divider);
                    118: 
                    119: int AudioOpen(struct cvdv_cards *card);
                    120: 
                    121: int AudioClose(struct cvdv_cards *card);
                    122: 
                    123: // audiorate: 16, 32, 64, 22(.05), 44(.1), 88(.2), 24, 48, 96 kHz
                    124: // surround=0: Stereo
                    125: // surround=1: Surround
                    126: int AudioInit(struct cvdv_cards *card, int audiorate, int surround);
                    127: 
                    128: 
                    129: // returns size of the Video ES Buffer in bytes or 0=error
                    130: u32 DecoderGetAudioESSize(struct cvdv_cards *card);
                    131: 
                    132: // returns level of fullness in bytes
                    133: u32 DecoderGetAudioESLevel(struct cvdv_cards *card);
                    134: 
                    135: int DecoderKaraoke(struct cvdv_cards *card, int vocal1, int vocal2,
                    136:                   int melody);
                    137: 
                    138: #endif                         /* CVDV_AUDIO_H */

LinuxTV legacy CVS <linuxtv.org/cvs>