| 1 | /****************************************************************************** |
|---|
| 2 | *_Copyright (c) 2009 Digital Stream Technology Inc. All Rights Reserved. |
|---|
| 3 | * |
|---|
| 4 | * Module: dsthalaud.c |
|---|
| 5 | * |
|---|
| 6 | * Description |
|---|
| 7 | * This file includes following Audio Processing functions; |
|---|
| 8 | * - Audio Output Control (Mute/Fade in-out) |
|---|
| 9 | * - Volume Control |
|---|
| 10 | * - Basic Audio Processing (Bass/Treble/Balance) |
|---|
| 11 | * - Advanced Audio Processing (AVL/SRS/MaxxBass/BBE) |
|---|
| 12 | * - Audio Output Delay |
|---|
| 13 | * |
|---|
| 14 | * Notes |
|---|
| 15 | * Audio decoders, AC3 and MPEG, are included in DTV block. |
|---|
| 16 | * |
|---|
| 17 | * |
|---|
| 18 | * @author Junku Park (hwatk@dstreamtech.com) |
|---|
| 19 | * @version $Revision: 1.1 $ |
|---|
| 20 | * |
|---|
| 21 | ******************************************************************************/ |
|---|
| 22 | |
|---|
| 23 | #include "dsthalcommon.h" |
|---|
| 24 | |
|---|
| 25 | |
|---|
| 26 | /****************************************************************************** |
|---|
| 27 | * Global variable declaration |
|---|
| 28 | ******************************************************************************/ |
|---|
| 29 | |
|---|
| 30 | /****************************************************************************** |
|---|
| 31 | * Imported variable declaration |
|---|
| 32 | ******************************************************************************/ |
|---|
| 33 | |
|---|
| 34 | /****************************************************************************** |
|---|
| 35 | * Imported function declaration |
|---|
| 36 | ******************************************************************************/ |
|---|
| 37 | extern int SRS_COMP; |
|---|
| 38 | extern int AVL_COMP; |
|---|
| 39 | extern int ST_SRS_COMP; |
|---|
| 40 | extern int ST_AVL_COMP; |
|---|
| 41 | |
|---|
| 42 | /****************************************************************************** |
|---|
| 43 | * Local definitions |
|---|
| 44 | ******************************************************************************/ |
|---|
| 45 | //#define AUDIO_INIT_TASK_PRIORITY 90 |
|---|
| 46 | //#define AUDIO_INIT_TASK_STACKSIZE 16384 |
|---|
| 47 | //static OS_TASK_ID AudioInitTaskId; |
|---|
| 48 | |
|---|
| 49 | /****************************************************************************** |
|---|
| 50 | * Local typedefs |
|---|
| 51 | ******************************************************************************/ |
|---|
| 52 | |
|---|
| 53 | /****************************************************************************** |
|---|
| 54 | * Local variable declaration |
|---|
| 55 | ******************************************************************************/ |
|---|
| 56 | static DS_BOOL m_SRSEnable = _FALSE_; |
|---|
| 57 | static DS_BOOL m_AVLEnable = _FALSE_; |
|---|
| 58 | |
|---|
| 59 | |
|---|
| 60 | /****************************************************************************** |
|---|
| 61 | * Local function prototypes |
|---|
| 62 | ******************************************************************************/ |
|---|
| 63 | |
|---|
| 64 | #if 0 |
|---|
| 65 | ___Common_APIs___() |
|---|
| 66 | #endif |
|---|
| 67 | void DD_AUD_PresetAudioOutput(int iAudOut) |
|---|
| 68 | { |
|---|
| 69 | } |
|---|
| 70 | |
|---|
| 71 | DHL_RESULT DD_AUD_Init(void) |
|---|
| 72 | { |
|---|
| 73 | DHL_RESULT dhlResult = DHL_OK; |
|---|
| 74 | |
|---|
| 75 | return dhlResult; |
|---|
| 76 | } |
|---|
| 77 | |
|---|
| 78 | DHL_RESULT DD_AUD_ChangeAudOutFormat(DHL_AUD_OUTPUT_FORMAT UserAudOutFmt) |
|---|
| 79 | { |
|---|
| 80 | DHL_RESULT dhlResult = DHL_OK; |
|---|
| 81 | |
|---|
| 82 | switch ( UserAudOutFmt ) { |
|---|
| 83 | case DHL_STREAM_AUDOUT_AC3: |
|---|
| 84 | break; |
|---|
| 85 | |
|---|
| 86 | case DHL_STREAM_AUDOUT_PCM: |
|---|
| 87 | break; |
|---|
| 88 | |
|---|
| 89 | default: |
|---|
| 90 | DHL_DbgPrintf(0,DDDBG_AV,"SPDIF mode is not set to PCM or AC3! ==> PCM.\n"); |
|---|
| 91 | break; |
|---|
| 92 | } |
|---|
| 93 | |
|---|
| 94 | return dhlResult; |
|---|
| 95 | } |
|---|
| 96 | |
|---|
| 97 | #if 0 |
|---|
| 98 | ___VOLUME_APIs___() |
|---|
| 99 | #endif |
|---|
| 100 | DHL_RESULT DD_AUD_SetVolume(DS_U16 uVolLvl) |
|---|
| 101 | { |
|---|
| 102 | DHL_RESULT dhlResult = DHL_OK; |
|---|
| 103 | |
|---|
| 104 | /* Do nothing; All volume control is under DD_AUD_SetVolumeAMP(). */ |
|---|
| 105 | |
|---|
| 106 | return dhlResult; |
|---|
| 107 | } |
|---|
| 108 | |
|---|
| 109 | DHL_RESULT DD_AUD_GetVolume(DS_U16 *uVolLvl) |
|---|
| 110 | { |
|---|
| 111 | DHL_RESULT dhlResult = DHL_OK; |
|---|
| 112 | |
|---|
| 113 | return dhlResult; |
|---|
| 114 | } |
|---|
| 115 | |
|---|
| 116 | DHL_RESULT DD_AUD_SetVolumeHP(DS_U16 uVolLvl) |
|---|
| 117 | { |
|---|
| 118 | DHL_RESULT dhlResult = DHL_OK; |
|---|
| 119 | |
|---|
| 120 | return dhlResult; |
|---|
| 121 | } |
|---|
| 122 | |
|---|
| 123 | DHL_RESULT DD_AUD_SetVolumeAMP(DS_U16 uVolLvl) |
|---|
| 124 | { |
|---|
| 125 | DHL_RESULT dhlResult = DHL_OK; |
|---|
| 126 | |
|---|
| 127 | return dhlResult; |
|---|
| 128 | } |
|---|
| 129 | |
|---|
| 130 | DHL_RESULT DD_AUD_SetAMPPower(int n) |
|---|
| 131 | { |
|---|
| 132 | DHL_RESULT dhlResult = DHL_OK; |
|---|
| 133 | |
|---|
| 134 | return dhlResult; |
|---|
| 135 | } |
|---|
| 136 | |
|---|
| 137 | DHL_RESULT DD_AUD_VolumeFadeInOut_I2S(DS_BOOL bFadeIn) |
|---|
| 138 | { |
|---|
| 139 | return DHL_OK; |
|---|
| 140 | } |
|---|
| 141 | |
|---|
| 142 | DHL_RESULT DD_AUD_VolumeFadeInOut_Amp(DS_BOOL bFadeIn) |
|---|
| 143 | { |
|---|
| 144 | DHL_RESULT dhlResult = DHL_OK; |
|---|
| 145 | |
|---|
| 146 | return dhlResult; |
|---|
| 147 | } |
|---|
| 148 | |
|---|
| 149 | DHL_RESULT DD_AUD_SetVolumeDelay(DS_U32 vDelay) |
|---|
| 150 | { |
|---|
| 151 | DHL_RESULT dhlResult = DHL_OK; |
|---|
| 152 | |
|---|
| 153 | return dhlResult; |
|---|
| 154 | } |
|---|
| 155 | |
|---|
| 156 | DHL_RESULT DD_AUD_GetVolumeDelay(DS_U32 *pVDelay) |
|---|
| 157 | { |
|---|
| 158 | DHL_RESULT dhlResult = DHL_OK; |
|---|
| 159 | |
|---|
| 160 | return dhlResult; |
|---|
| 161 | } |
|---|
| 162 | |
|---|
| 163 | #if 0 |
|---|
| 164 | ___AUDIO_MUTE_APIs___() |
|---|
| 165 | #endif |
|---|
| 166 | DHL_RESULT DD_AUD_AudioMute( DS_BOOL bMute ) |
|---|
| 167 | { |
|---|
| 168 | DHL_RESULT dhlResult = DHL_OK; |
|---|
| 169 | |
|---|
| 170 | return dhlResult; |
|---|
| 171 | } |
|---|
| 172 | |
|---|
| 173 | DHL_RESULT DD_AUD_AudioMuteSPDIF( DS_BOOL bMute ) |
|---|
| 174 | { |
|---|
| 175 | DHL_RESULT dhlResult = DHL_OK; |
|---|
| 176 | |
|---|
| 177 | return dhlResult; |
|---|
| 178 | } |
|---|
| 179 | |
|---|
| 180 | DHL_RESULT DD_AUD_AudioMuteHP( DS_BOOL bMute ) |
|---|
| 181 | { |
|---|
| 182 | DHL_RESULT dhlResult = DHL_OK; |
|---|
| 183 | |
|---|
| 184 | return dhlResult; |
|---|
| 185 | } |
|---|
| 186 | |
|---|
| 187 | DHL_RESULT DD_AUD_AudioMuteAUX( DS_BOOL bMute ) |
|---|
| 188 | { |
|---|
| 189 | DHL_RESULT dhlResult = DHL_OK; |
|---|
| 190 | return dhlResult; |
|---|
| 191 | } |
|---|
| 192 | |
|---|
| 193 | #if 0 |
|---|
| 194 | ___AUDIO_FEATURE_APIs___() |
|---|
| 195 | #endif |
|---|
| 196 | DHL_RESULT DD_AUD_SetBalance(int Balance) |
|---|
| 197 | { |
|---|
| 198 | DHL_RESULT dhlResult = DHL_OK; |
|---|
| 199 | |
|---|
| 200 | return dhlResult; |
|---|
| 201 | } |
|---|
| 202 | |
|---|
| 203 | DHL_RESULT DD_AUD_GetBalance( int *pBalance ) |
|---|
| 204 | { |
|---|
| 205 | DHL_RESULT dhlResult = DHL_OK; |
|---|
| 206 | |
|---|
| 207 | return dhlResult; |
|---|
| 208 | } |
|---|
| 209 | |
|---|
| 210 | DHL_RESULT DD_AUD_SetTrebleBass( int Treble, int Bass ) |
|---|
| 211 | { |
|---|
| 212 | DHL_RESULT dhlResult = DHL_OK; |
|---|
| 213 | |
|---|
| 214 | return dhlResult; |
|---|
| 215 | } |
|---|
| 216 | |
|---|
| 217 | DHL_RESULT DD_AUD_SetAVL( DS_BOOL Enable ) |
|---|
| 218 | { |
|---|
| 219 | DHL_RESULT dhlResult = DHL_OK; |
|---|
| 220 | |
|---|
| 221 | m_AVLEnable = Enable; |
|---|
| 222 | |
|---|
| 223 | return dhlResult; |
|---|
| 224 | } |
|---|
| 225 | |
|---|
| 226 | DHL_RESULT DD_AUD_SetSRS(DS_BOOL Enable) |
|---|
| 227 | { |
|---|
| 228 | DHL_RESULT dhlResult = DHL_OK; |
|---|
| 229 | |
|---|
| 230 | m_SRSEnable = Enable; |
|---|
| 231 | |
|---|
| 232 | return dhlResult; |
|---|
| 233 | } |
|---|
| 234 | |
|---|
| 235 | DHL_RESULT DD_AUD_SetAudioDelay( DS_S32 offset ) |
|---|
| 236 | { |
|---|
| 237 | DHL_RESULT dhlResult = DHL_OK; |
|---|
| 238 | |
|---|
| 239 | return dhlResult; |
|---|
| 240 | } |
|---|