VirtualBox

source: vbox/trunk/src/VBox/Devices/Audio/DevCodec.h@ 31028

Last change on this file since 31028 was 31028, checked in by vboxsync, 15 years ago

audio/HDA: some todo.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.3 KB
Line 
1/* $Id: DevCodec.h 31028 2010-07-23 03:33:34Z vboxsync $ */
2/** @file
3 * DevCodec - VBox ICH Intel HD Audio Codec.
4 */
5
6/*
7 * Copyright (C) 2006-2008 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17#ifndef DEV_CODEC_H
18#define DEV_CODEC_H
19struct CODECState;
20struct INTELHDLinkState;
21
22typedef DECLCALLBACK(int) FNCODECVERBPROCESSOR(struct CODECState *pState, uint32_t cmd, uint64_t *pResp);
23typedef FNCODECVERBPROCESSOR *PFNCODECVERBPROCESSOR;
24typedef FNCODECVERBPROCESSOR **PPFNCODECVERBPROCESSOR;
25
26typedef struct CODECVERB
27{
28 uint32_t verb;
29 /* operation bitness mask */
30 uint32_t mask;
31 PFNCODECVERBPROCESSOR pfn;
32} CODECVERB;
33
34#define CODECNODE_F0_PARAM_LENGTH 0x14
35typedef struct CODECCOMMONNODE
36{
37 uint8_t id; /* 7 - bit format */
38 const char *name;
39 /* RPM 5.3.6 */
40 uint32_t au32F00_param[CODECNODE_F0_PARAM_LENGTH];
41 uint8_t au8F02_param[16];
42} CODECCOMMONNODE, *PCODECCOMMONNODE;
43
44typedef struct ROOTCODECNODE
45{
46 CODECCOMMONNODE node;
47}ROOTCODECNODE, *PROOTCODECNODE;
48
49#define AMPLIFIER_SIZE 60
50typedef uint32_t AMPLIFIER[AMPLIFIER_SIZE];
51#define AMPLIFIER_IN 0
52#define AMPLIFIER_OUT 1
53#define AMPLIFIER_LEFT 1
54#define AMPLIFIER_RIGHT 0
55#define AMPLIFIER_REGISTER(amp, inout, side, index) ((amp)[30*(inout) + 15*(side) + (index)])
56typedef struct DACNODE
57{
58 CODECCOMMONNODE node;
59 uint32_t u32F0d_param;
60 uint32_t u32F04_param;
61 uint32_t u32F05_param;
62 uint32_t u32F06_param;
63 uint32_t u32F0c_param;
64
65 uint32_t u32A_param;
66 AMPLIFIER B_params;
67
68} DACNODE, *PDACNODE;
69
70typedef struct ADCNODE
71{
72 CODECCOMMONNODE node;
73 uint32_t u32F03_param;
74 uint32_t u32F05_param;
75 uint32_t u32F06_param;
76 uint32_t u32F09_param;
77
78 uint32_t u32A_param;
79 AMPLIFIER B_params;
80} ADCNODE, *PADCNODE;
81
82typedef struct SPDIFOUTNODE
83{
84 CODECCOMMONNODE node;
85 uint32_t u32F06_param;
86 uint32_t u32F09_param;
87 uint32_t u32F0d_param;
88
89 uint32_t u32A_param;
90 AMPLIFIER B_params;
91} SPDIFOUTNODE, *PSPDIFOUTNODE;
92
93typedef struct AFGCODECNODE
94{
95 CODECCOMMONNODE node;
96 uint32_t u32F05_param;
97 uint32_t u32F08_param;
98 uint32_t u32F20_param;
99} AFGCODECNODE, *PAFGCODECNODE;
100
101typedef struct PORTNODE
102{
103 CODECCOMMONNODE node;
104 uint32_t u32F07_param;
105 uint32_t u32F08_param;
106 uint32_t u32F09_param;
107 uint32_t u32F1c_param;
108} PORTNODE, *PPORTNODE;
109
110typedef struct DIGOUTNODE
111{
112 CODECCOMMONNODE node;
113 uint32_t u32F01_param;
114 uint32_t u32F07_param;
115 uint32_t u32F09_param;
116 uint32_t u32F1c_param;
117} DIGOUTNODE, *PDIGOUTNODE;
118
119typedef struct DIGINNODE
120{
121 CODECCOMMONNODE node;
122 uint32_t u32F05_param;
123 uint32_t u32F07_param;
124 uint32_t u32F08_param;
125 uint32_t u32F09_param;
126 uint32_t u32F0c_param;
127 uint32_t u32F1c_param;
128 uint32_t u32F1e_param;
129} DIGINNODE, *PDIGINNODE;
130
131typedef struct ADCMUXNODE
132{
133 CODECCOMMONNODE node;
134 uint32_t u32F01_param;
135
136 uint32_t u32A_param;
137 AMPLIFIER B_params;
138} ADCMUXNODE, *PADCMUXNODE;
139
140typedef struct PCBEEPNODE
141{
142 CODECCOMMONNODE node;
143 uint32_t u32F0a_param;
144
145 uint32_t u32A_param;
146 AMPLIFIER B_params;
147} PCBEEPNODE, *PPCBEEPNODE;
148
149typedef struct CDNODE
150{
151 CODECCOMMONNODE node;
152 uint32_t u32F07_param;
153 uint32_t u32F1c_param;
154} CDNODE, *PCDNODE;
155
156typedef struct VOLUMEKNOBNODE
157{
158 CODECCOMMONNODE node;
159 uint32_t u32F08_param;
160 uint32_t u32F0f_param;
161} VOLUMEKNOBNODE, *PVOLUMEKNOBNODE;
162
163typedef struct ADCVOLNODE
164{
165 CODECCOMMONNODE node;
166 uint32_t u32F0c_param;
167 uint32_t u32A_params;
168 AMPLIFIER B_params;
169} ADCVOLNODE, *PADCVOLNODE;
170
171typedef union CODECNODE
172{
173 CODECCOMMONNODE node;
174 ROOTCODECNODE root;
175 AFGCODECNODE afg;
176 DACNODE dac;
177 ADCNODE adc;
178 SPDIFOUTNODE spdifout;
179 PORTNODE port;
180 DIGOUTNODE digout;
181 DIGINNODE digin;
182 ADCMUXNODE adcmux;
183 PCBEEPNODE pcbeep;
184 CDNODE cdnode;
185 VOLUMEKNOBNODE volumeKnob;
186 ADCVOLNODE adcvol;
187} CODECNODE, *PCODECNODE;
188
189typedef enum
190{
191 PI_INDEX = 0, /* PCM in */
192 PO_INDEX, /* PCM out */
193 MC_INDEX, /* Mic in */
194 LAST_INDEX
195} ENMSOUNDSOURCE;
196
197typedef struct CODECState
198{
199 CODECVERB *pVerbs;
200 int cVerbs;
201 PCODECNODE pNodes;
202 QEMUSoundCard card;
203 /** PCM in */
204 SWVoiceIn *voice_pi;
205 /** PCM out */
206 SWVoiceOut *voice_po;
207 /** Mic in */
208 SWVoiceIn *voice_mc;
209 void *pHDAState;
210 DECLR3CALLBACKMEMBER(int, pfnProcess, (struct CODECState *));
211 DECLR3CALLBACKMEMBER(int, pfnLookup, (struct CODECState *pState, uint32_t verb, PPFNCODECVERBPROCESSOR));
212 DECLR3CALLBACKMEMBER(int, pfnReset, (struct CODECState *pState));
213 DECLR3CALLBACKMEMBER(void, pfnTransfer, (struct CODECState *pState, ENMSOUNDSOURCE, int avail));
214} CODECState;
215
216int stac9220Construct(CODECState *pCodecState);
217int stac9220Destruct(CODECState *pCodecState);
218
219#endif
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette