OpenCore
1.0.4
OpenCore Bootloader
|
#include <Guid/AppleVariable.h>
#include "HdaCodec.h"
#include <Protocol/AudioIo.h>
#include <Library/OcMiscLib.h>
#include <Library/PcdLib.h>
Go to the source code of this file.
Functions | |
VOID EFIAPI | HdaCodecHdaIoStreamCallback (IN EFI_HDA_IO_PROTOCOL_TYPE Type, IN VOID *Context1, IN VOID *Context2, IN VOID *Context3) |
EFI_STATUS EFIAPI | HdaCodecAudioIoGetOutputs (IN EFI_AUDIO_IO_PROTOCOL *This, OUT EFI_AUDIO_IO_PROTOCOL_PORT **OutputPorts, OUT UINTN *OutputPortsCount) |
EFI_STATUS EFIAPI | HdaCodecAudioIoRawGainToDecibels (IN EFI_AUDIO_IO_PROTOCOL *This, IN UINT64 OutputIndexMask, IN UINT8 GainParam, OUT INT8 *Gain) |
EFI_STATUS EFIAPI | HdaCodecAudioIoSetupPlayback (IN EFI_AUDIO_IO_PROTOCOL *This, IN UINT64 OutputIndexMask, IN INT8 Gain, IN EFI_AUDIO_IO_PROTOCOL_FREQ Freq, IN EFI_AUDIO_IO_PROTOCOL_BITS Bits, IN UINT8 Channels, IN UINTN PlaybackDelay) |
EFI_STATUS EFIAPI | HdaCodecAudioIoStartPlayback (IN EFI_AUDIO_IO_PROTOCOL *This, IN VOID *Data, IN UINTN DataLength, IN UINTN Position OPTIONAL) |
EFI_STATUS EFIAPI | HdaCodecAudioIoStartPlaybackAsync (IN EFI_AUDIO_IO_PROTOCOL *This, IN VOID *Data, IN UINTN DataLength, IN UINTN Position OPTIONAL, IN EFI_AUDIO_IO_CALLBACK Callback OPTIONAL, IN VOID *Context OPTIONAL) |
EFI_STATUS EFIAPI | HdaCodecAudioIoStopPlayback (IN EFI_AUDIO_IO_PROTOCOL *This) |
Variables | |
STATIC UINT64 | mOutputIndexMask = 0 |
STATIC INT8 | mGain = APPLE_SYSTEM_AUDIO_VOLUME_DB_MIN |
STATIC EFI_AUDIO_IO_PROTOCOL_FREQ | mFreq = 0 |
STATIC EFI_AUDIO_IO_PROTOCOL_BITS | mBits = 0 |
STATIC UINT8 | mChannels = 0xFFU |
Copyright (C) 2018-2021, John Davis, Mike Beaton. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
Definition in file HdaCodecAudioIo.c.
EFI_STATUS EFIAPI HdaCodecAudioIoGetOutputs | ( | IN EFI_AUDIO_IO_PROTOCOL * | This, |
OUT EFI_AUDIO_IO_PROTOCOL_PORT ** | OutputPorts, | ||
OUT UINTN * | OutputPortsCount ) |
Gets the collection of output ports.
[in] | This | A pointer to the EFI_AUDIO_IO_PROTOCOL instance. |
[out] | OutputPorts | A pointer to a buffer where the output ports will be placed. |
[out] | OutputPortsCount | The number of ports in OutputPorts. |
EFI_SUCCESS | The audio data was played successfully. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
Definition at line 59 of file HdaCodecAudioIo.c.
EFI_STATUS EFIAPI HdaCodecAudioIoRawGainToDecibels | ( | IN EFI_AUDIO_IO_PROTOCOL * | This, |
IN UINT64 | OutputIndexMask, | ||
IN UINT8 | GainParam, | ||
OUT INT8 * | Gain ) |
Convert raw amplifier gain setting to decibel gain value; converts using the parameters of the first channel specified in OutputIndexMask which has non-zero amp capabilities. Note: It seems very typical - though it is certainly not required by the spec - that all amps on a codec which have non-zero amp capabilities, actually all have the same params as each other.
[in] | This | A pointer to the EFI_AUDIO_IO_PROTOCOL instance. |
[in] | OutputIndexMask | A mask indicating the desired outputs. |
[in] | GainParam | The raw gain parameter for the amplifier. |
[out] | Gain | The amplifier gain (or attentuation if negative) in dB to use, relative to 0 dB level (0 dB is usually at at or near max available volume, but is not required to be so in the spec). |
EFI_SUCCESS | The gain value was calculated successfully. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
Definition at line 270 of file HdaCodecAudioIo.c.
EFI_STATUS EFIAPI HdaCodecAudioIoSetupPlayback | ( | IN EFI_AUDIO_IO_PROTOCOL * | This, |
IN UINT64 | OutputIndexMask, | ||
IN INT8 | Gain, | ||
IN EFI_AUDIO_IO_PROTOCOL_FREQ | Freq, | ||
IN EFI_AUDIO_IO_PROTOCOL_BITS | Bits, | ||
IN UINT8 | Channels, | ||
IN UINTN | PlaybackDelay ) |
Sets up the device to play audio data. Basic caching is implemented: no actions are taken the second and subsequent times that set up is called again with exactly the same paremeters.
[in] | This | A pointer to the EFI_AUDIO_IO_PROTOCOL instance. |
[in] | OutputIndexMask | A mask indicating the desired outputs. |
[in] | Gain | The amplifier gain (or attentuation if negative) in dB to use, relative to 0 dB level (0 dB is usually at at or near max available volume, but is not required to be so in the spec). |
[in] | Bits | The width in bits of the source data. |
[in] | Freq | The frequency of the source data. |
[in] | Channels | The number of channels the source data contains. |
[in] | PlaybackDelay | The required delay before playback after a change in setup. |
EFI_SUCCESS | The audio data was played successfully. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
< TODO: Why does Clover has TRUE here?
< TODO: Why does Clover has TRUE here?
< Enable all available pins
Definition at line 327 of file HdaCodecAudioIo.c.
EFI_STATUS EFIAPI HdaCodecAudioIoStartPlayback | ( | IN EFI_AUDIO_IO_PROTOCOL * | This, |
IN VOID * | Data, | ||
IN UINTN | DataLength, | ||
IN UINTN Position | OPTIONAL ) |
Begins playback on the device and waits for playback to complete.
[in] | This | A pointer to the EFI_AUDIO_IO_PROTOCOL instance. |
[in] | Data | A pointer to the buffer containing the audio data to play. |
[in] | DataLength | The size, in bytes, of the data buffer specified by Data. |
[in] | Position | The position in the buffer to start at. |
EFI_SUCCESS | The audio data was played successfully. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
Definition at line 764 of file HdaCodecAudioIo.c.
EFI_STATUS EFIAPI HdaCodecAudioIoStartPlaybackAsync | ( | IN EFI_AUDIO_IO_PROTOCOL * | This, |
IN VOID * | Data, | ||
IN UINTN | DataLength, | ||
IN UINTN Position | OPTIONAL, | ||
IN EFI_AUDIO_IO_CALLBACK Callback | OPTIONAL, | ||
IN VOID *Context | OPTIONAL ) |
Begins playback on the device asynchronously.
[in] | This | A pointer to the EFI_AUDIO_IO_PROTOCOL instance. |
[in] | Data | A pointer to the buffer containing the audio data to play. |
[in] | DataLength | The size, in bytes, of the data buffer specified by Data. |
[in] | Position | The position in the buffer to start at. |
[in] | Callback | A pointer to an optional callback to be invoked when playback is complete. |
[in] | Context | A pointer to data to be passed to the callback function. |
EFI_SUCCESS | The audio data was played successfully. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
Definition at line 840 of file HdaCodecAudioIo.c.
EFI_STATUS EFIAPI HdaCodecAudioIoStopPlayback | ( | IN EFI_AUDIO_IO_PROTOCOL * | This | ) |
Stops playback on the device.
[in] | This | A pointer to the EFI_AUDIO_IO_PROTOCOL instance. |
EFI_SUCCESS | The audio data was played successfully. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
Definition at line 890 of file HdaCodecAudioIo.c.
VOID EFIAPI HdaCodecHdaIoStreamCallback | ( | IN EFI_HDA_IO_PROTOCOL_TYPE | Type, |
IN VOID * | Context1, | ||
IN VOID * | Context2, | ||
IN VOID * | Context3 ) |
Definition at line 25 of file HdaCodecAudioIo.c.
STATIC EFI_AUDIO_IO_PROTOCOL_BITS mBits = 0 |
Definition at line 19 of file HdaCodecAudioIo.c.
STATIC UINT8 mChannels = 0xFFU |
Definition at line 20 of file HdaCodecAudioIo.c.
STATIC EFI_AUDIO_IO_PROTOCOL_FREQ mFreq = 0 |
Definition at line 18 of file HdaCodecAudioIo.c.
STATIC INT8 mGain = APPLE_SYSTEM_AUDIO_VOLUME_DB_MIN |
Definition at line 17 of file HdaCodecAudioIo.c.
STATIC UINT64 mOutputIndexMask = 0 |
Definition at line 16 of file HdaCodecAudioIo.c.