VirtualBox

source: vbox/trunk/src/VBox/Devices/Audio/DevIchHdaCodec.h@ 60925

最後變更 在這個檔案從60925是 60925,由 vboxsync 提交於 9 年 前

Audio: Update on infrastructure:

  • More work on HDA stream interleaving + surround support
  • The mixer can now (optionally) act as a supplemental layer between audio connector interface and device emulation (where applicable)
  • Multiple LUN streams can be bound to a certain sink, which in turn then can be treated as separate input/output channels
  • Unified more code which was duplicated between different audio device emulations
  • Tiny bit of documentation

Work in progress.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 5.0 KB
 
1/* $Id: DevIchHdaCodec.h 60925 2016-05-10 13:27:44Z vboxsync $ */
2/** @file
3 * DevIchHdaCodec - VBox ICH Intel HD Audio Codec.
4 */
5
6/*
7 * Copyright (C) 2006-2016 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
18#ifndef DEV_HDA_CODEC_H
19#define DEV_HDA_CODEC_H
20
21/** The ICH HDA (Intel) controller. */
22typedef struct HDASTATE *PHDASTATE;
23/** The ICH HDA (Intel) codec state. */
24typedef struct HDACODEC *PHDACODEC;
25/** The HDA host driver backend. */
26typedef struct HDADRIVER *PHDADRIVER;
27typedef struct PDMIAUDIOCONNECTOR *PPDMIAUDIOCONNECTOR;
28typedef struct PDMAUDIOGSTSTRMOUT *PPDMAUDIOGSTSTRMOUT;
29typedef struct PDMAUDIOGSTSTRMIN *PPDMAUDIOGSTSTRMIN;
30
31/**
32 * Verb processor method.
33 */
34typedef DECLCALLBACK(int) FNHDACODECVERBPROCESSOR(PHDACODEC pThis, uint32_t cmd, uint64_t *pResp);
35typedef FNHDACODECVERBPROCESSOR *PFNHDACODECVERBPROCESSOR;
36typedef FNHDACODECVERBPROCESSOR **PPFNHDACODECVERBPROCESSOR;
37
38/* PRM 5.3.1 */
39#define CODEC_RESPONSE_UNSOLICITED RT_BIT_64(34)
40
41typedef struct CODECVERB
42{
43 /** Verb. */
44 uint32_t verb;
45 /** Verb mask. */
46 uint32_t mask;
47 /** Function pointer for implementation callback. */
48 PFNHDACODECVERBPROCESSOR pfn;
49 /** Friendly name, for debugging. */
50 const char *pszName;
51} CODECVERB;
52
53union CODECNODE;
54typedef union CODECNODE CODECNODE, *PCODECNODE;
55
56/**
57 * Structure for keeping a HDA codec state.
58 */
59typedef struct HDACODEC
60{
61 uint16_t id;
62 uint16_t u16VendorId;
63 uint16_t u16DeviceId;
64 uint8_t u8BSKU;
65 uint8_t u8AssemblyId;
66 /** List of assigned HDA drivers to this codec.
67 * A driver only can be assigned to one codec at a time. */
68 RTLISTANCHOR lstDrv;
69
70 CODECVERB const *paVerbs;
71 size_t cVerbs;
72
73 PCODECNODE paNodes;
74 /** Pointer to HDA state (controller) this
75 * codec is assigned to. */
76 PHDASTATE pHDAState;
77 bool fInReset;
78
79 const uint8_t cTotalNodes;
80 const uint8_t *au8Ports;
81 const uint8_t *au8Dacs;
82 const uint8_t *au8AdcVols;
83 const uint8_t *au8Adcs;
84 const uint8_t *au8AdcMuxs;
85 const uint8_t *au8Pcbeeps;
86 const uint8_t *au8SpdifIns;
87 const uint8_t *au8SpdifOuts;
88 const uint8_t *au8DigInPins;
89 const uint8_t *au8DigOutPins;
90 const uint8_t *au8Cds;
91 const uint8_t *au8VolKnobs;
92 const uint8_t *au8Reserveds;
93 const uint8_t u8AdcVolsLineIn;
94 const uint8_t u8DacLineOut;
95
96 /** Callbacks to the HDA controller, mostly used for multiplexing to the various host backends. */
97 DECLR3CALLBACKMEMBER(int, pfnMixerAddStream, (PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl, PPDMAUDIOSTREAMCFG pCfg));
98 DECLR3CALLBACKMEMBER(int, pfnMixerRemoveStream, (PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl));
99 DECLR3CALLBACKMEMBER(int, pfnMixerSetVolume, (PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl, PPDMAUDIOVOLUME pVol));
100 /** Callbacks by codec implementation. */
101 DECLR3CALLBACKMEMBER(int, pfnLookup, (PHDACODEC pThis, uint32_t uVerb, uint64_t *puResp));
102 DECLR3CALLBACKMEMBER(int, pfnReset, (PHDACODEC pThis));
103 DECLR3CALLBACKMEMBER(int, pfnCodecNodeReset, (PHDACODEC pThis, uint8_t, PCODECNODE));
104 /** These callbacks are set by codec implementation to answer debugger requests. */
105 DECLR3CALLBACKMEMBER(void, pfnDbgListNodes, (PHDACODEC pThis, PCDBGFINFOHLP pHlp, const char *pszArgs));
106 DECLR3CALLBACKMEMBER(void, pfnDbgSelector, (PHDACODEC pThis, PCDBGFINFOHLP pHlp, const char *pszArgs));
107} HDACODEC;
108
109int hdaCodecConstruct(PPDMDEVINS pDevIns, PHDACODEC pThis, uint16_t uLUN, PCFGMNODE pCfg);
110void hdaCodecDestruct(PHDACODEC pThis);
111void hdaCodecPowerOff(PHDACODEC pThis);
112int hdaCodecSaveState(PHDACODEC pThis, PSSMHANDLE pSSM);
113int hdaCodecLoadState(PHDACODEC pThis, PSSMHANDLE pSSM, uint32_t uVersion);
114int hdaCodecAddStream(PHDACODEC pThis, PDMAUDIOMIXERCTL enmMixerCtl, PPDMAUDIOSTREAMCFG pCfg);
115int hdaCodecRemoveStream(PHDACODEC pThis, PDMAUDIOMIXERCTL enmMixerCtl);
116
117#define HDA_SSM_VERSION 6
118/** Introduced dynamic number of streams + stream identifiers for serialization.
119 * Bug: Did not save the BDLE states correctly.
120 * Those will be skipped on load then. */
121#define HDA_SSM_VERSION_5 5
122/** Since this version the number of MMIO registers can be flexible. */
123#define HDA_SSM_VERSION_4 4
124#define HDA_SSM_VERSION_3 3
125#define HDA_SSM_VERSION_2 2
126#define HDA_SSM_VERSION_1 1
127
128#endif /* DEV_HDA_CODEC_H */
129
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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