VirtualBox

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

最後變更 在這個檔案從32010是 31990,由 vboxsync 提交於 15 年 前

Audio/HDA: fixes assertion 0x1b is pin-node.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 6.0 KB
 
1/* $Id: DevCodec.h 31990 2010-08-26 12:45:26Z 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.alldomusa.eu.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
26/* RPM 5.3.1 */
27#define CODEC_RESPONSE_UNSOLICITED RT_BIT_64(34)
28
29typedef struct CODECVERB
30{
31 uint32_t verb;
32 /* operation bitness mask */
33 uint32_t mask;
34 PFNCODECVERBPROCESSOR pfn;
35} CODECVERB;
36
37#define CODECNODE_F0_PARAM_LENGTH 0x14
38typedef struct CODECCOMMONNODE
39{
40 uint8_t id; /* 7 - bit format */
41 const char *name;
42 /* RPM 5.3.6 */
43 uint32_t au32F00_param[CODECNODE_F0_PARAM_LENGTH];
44 uint8_t au8F02_param[16];
45} CODECCOMMONNODE, *PCODECCOMMONNODE;
46
47typedef struct ROOTCODECNODE
48{
49 CODECCOMMONNODE node;
50}ROOTCODECNODE, *PROOTCODECNODE;
51
52#define AMPLIFIER_SIZE 60
53typedef uint32_t AMPLIFIER[AMPLIFIER_SIZE];
54#define AMPLIFIER_IN 0
55#define AMPLIFIER_OUT 1
56#define AMPLIFIER_LEFT 1
57#define AMPLIFIER_RIGHT 0
58#define AMPLIFIER_REGISTER(amp, inout, side, index) ((amp)[30*(inout) + 15*(side) + (index)])
59typedef struct DACNODE
60{
61 CODECCOMMONNODE node;
62 uint32_t u32F0d_param;
63 uint32_t u32F04_param;
64 uint32_t u32F05_param;
65 uint32_t u32F06_param;
66 uint32_t u32F0c_param;
67
68 uint32_t u32A_param;
69 AMPLIFIER B_params;
70
71} DACNODE, *PDACNODE;
72
73typedef struct ADCNODE
74{
75 CODECCOMMONNODE node;
76 uint32_t u32F03_param;
77 uint32_t u32F05_param;
78 uint32_t u32F06_param;
79 uint32_t u32F09_param;
80
81 uint32_t u32A_param;
82 AMPLIFIER B_params;
83} ADCNODE, *PADCNODE;
84
85typedef struct SPDIFOUTNODE
86{
87 CODECCOMMONNODE node;
88 uint32_t u32F06_param;
89 uint32_t u32F09_param;
90 uint32_t u32F0d_param;
91
92 uint32_t u32A_param;
93 AMPLIFIER B_params;
94} SPDIFOUTNODE, *PSPDIFOUTNODE;
95
96typedef struct SPDIFINNODE
97{
98 CODECCOMMONNODE node;
99 uint32_t u32F06_param;
100 uint32_t u32F09_param;
101 uint32_t u32F0d_param;
102
103 uint32_t u32A_param;
104 AMPLIFIER B_params;
105} SPDIFINNODE, *PSPDIFINNODE;
106
107typedef struct AFGCODECNODE
108{
109 CODECCOMMONNODE node;
110 uint32_t u32F05_param;
111 uint32_t u32F08_param;
112 uint32_t u32F20_param;
113} AFGCODECNODE, *PAFGCODECNODE;
114
115typedef struct PORTNODE
116{
117 CODECCOMMONNODE node;
118 uint32_t u32F07_param;
119 uint32_t u32F08_param;
120 uint32_t u32F09_param;
121 uint32_t u32F1c_param;
122} PORTNODE, *PPORTNODE;
123
124typedef struct DIGOUTNODE
125{
126 CODECCOMMONNODE node;
127 uint32_t u32F01_param;
128 uint32_t u32F07_param;
129 uint32_t u32F09_param;
130 uint32_t u32F1c_param;
131} DIGOUTNODE, *PDIGOUTNODE;
132
133typedef struct DIGINNODE
134{
135 CODECCOMMONNODE node;
136 uint32_t u32F05_param;
137 uint32_t u32F07_param;
138 uint32_t u32F08_param;
139 uint32_t u32F09_param;
140 uint32_t u32F0c_param;
141 uint32_t u32F1c_param;
142 uint32_t u32F1e_param;
143} DIGINNODE, *PDIGINNODE;
144
145typedef struct ADCMUXNODE
146{
147 CODECCOMMONNODE node;
148 uint32_t u32F01_param;
149
150 uint32_t u32A_param;
151 AMPLIFIER B_params;
152} ADCMUXNODE, *PADCMUXNODE;
153
154typedef struct PCBEEPNODE
155{
156 CODECCOMMONNODE node;
157 uint32_t u32F0a_param;
158
159 uint32_t u32A_param;
160 AMPLIFIER B_params;
161} PCBEEPNODE, *PPCBEEPNODE;
162
163typedef struct CDNODE
164{
165 CODECCOMMONNODE node;
166 uint32_t u32F07_param;
167 uint32_t u32F1c_param;
168} CDNODE, *PCDNODE;
169
170typedef struct VOLUMEKNOBNODE
171{
172 CODECCOMMONNODE node;
173 uint32_t u32F08_param;
174 uint32_t u32F0f_param;
175} VOLUMEKNOBNODE, *PVOLUMEKNOBNODE;
176
177typedef struct ADCVOLNODE
178{
179 CODECCOMMONNODE node;
180 uint32_t u32F0c_param;
181 uint32_t u32A_params;
182 AMPLIFIER B_params;
183} ADCVOLNODE, *PADCVOLNODE;
184
185typedef struct RESNODE
186{
187 CODECCOMMONNODE node;
188 uint32_t u32F07_param;
189} RESNODE, *PRESNODE;
190
191typedef union CODECNODE
192{
193 CODECCOMMONNODE node;
194 ROOTCODECNODE root;
195 AFGCODECNODE afg;
196 DACNODE dac;
197 ADCNODE adc;
198 SPDIFOUTNODE spdifout;
199 SPDIFINNODE spdifin;
200 PORTNODE port;
201 DIGOUTNODE digout;
202 DIGINNODE digin;
203 ADCMUXNODE adcmux;
204 PCBEEPNODE pcbeep;
205 CDNODE cdnode;
206 VOLUMEKNOBNODE volumeKnob;
207 ADCVOLNODE adcvol;
208 RESNODE reserved;
209} CODECNODE, *PCODECNODE;
210
211typedef enum
212{
213 PI_INDEX = 0, /* PCM in */
214 PO_INDEX, /* PCM out */
215 MC_INDEX, /* Mic in */
216 LAST_INDEX
217} ENMSOUNDSOURCE;
218
219typedef struct CODECState
220{
221 uint16_t id;
222 CODECVERB *pVerbs;
223 int cVerbs;
224 PCODECNODE pNodes;
225 QEMUSoundCard card;
226 /** PCM in */
227 SWVoiceIn *voice_pi;
228 /** PCM out */
229 SWVoiceOut *voice_po;
230 /** Mic in */
231 SWVoiceIn *voice_mc;
232 void *pHDAState;
233 bool fInReset;
234 DECLR3CALLBACKMEMBER(int, pfnProcess, (struct CODECState *));
235 DECLR3CALLBACKMEMBER(int, pfnLookup, (struct CODECState *pState, uint32_t verb, PPFNCODECVERBPROCESSOR));
236 DECLR3CALLBACKMEMBER(int, pfnReset, (struct CODECState *pState));
237 DECLR3CALLBACKMEMBER(void, pfnTransfer, (struct CODECState *pState, ENMSOUNDSOURCE, int avail));
238} CODECState;
239
240int stac9220Construct(CODECState *pCodecState);
241int stac9220Destruct(CODECState *pCodecState);
242int stac9220SaveState(CODECState *pCodecState, PSSMHANDLE pSSMHandle);
243int stac9220LoadState(CODECState *pCodecState, PSSMHANDLE pSSMHandle);
244
245#endif
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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