OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
AudioIo.h File Reference
#include <Uefi.h>

Go to the source code of this file.

Data Structures

struct  EFI_AUDIO_IO_PROTOCOL_PORT
 
struct  EFI_AUDIO_IO_PROTOCOL_
 

Macros

#define EFI_AUDIO_IO_PROTOCOL_GUID
 
#define EFI_AUDIO_IO_PROTOCOL_REVISION   4
 
#define EFI_AUDIO_IO_PROTOCOL_MAX_CHANNELS   16
 
#define EFI_AUDIO_IO_PROTOCOL_MAX_VOLUME   100
 

Typedefs

typedef struct EFI_AUDIO_IO_PROTOCOL_ EFI_AUDIO_IO_PROTOCOL
 
typedef VOID(EFIAPI * EFI_AUDIO_IO_CALLBACK) (IN EFI_AUDIO_IO_PROTOCOL *AudioIo, IN VOID *Context)
 
typedef EFI_STATUS(EFIAPI * EFI_AUDIO_IO_GET_OUTPUTS) (IN EFI_AUDIO_IO_PROTOCOL *This, OUT EFI_AUDIO_IO_PROTOCOL_PORT **OutputPorts, OUT UINTN *OutputPortsCount)
 
typedef EFI_STATUS(EFIAPI * EFI_AUDIO_IO_RAW_GAIN_TO_DECIBELS) (IN EFI_AUDIO_IO_PROTOCOL *This, IN UINT64 OutputIndexMask, IN UINT8 GainParam, OUT INT8 *Gain)
 
typedef EFI_STATUS(EFIAPI * EFI_AUDIO_IO_SETUP_PLAYBACK) (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)
 
typedef EFI_STATUS(EFIAPI * EFI_AUDIO_IO_START_PLAYBACK) (IN EFI_AUDIO_IO_PROTOCOL *This, IN VOID *Data, IN UINTN DataLength, IN UINTN Position OPTIONAL)
 
typedef EFI_STATUS(EFIAPI * EFI_AUDIO_IO_START_PLAYBACK_ASYNC) (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)
 
typedef EFI_STATUS(EFIAPI * EFI_AUDIO_IO_STOP_PLAYBACK) (IN EFI_AUDIO_IO_PROTOCOL *This)
 

Enumerations

enum  EFI_AUDIO_IO_PROTOCOL_TYPE { EfiAudioIoTypeOutput , EfiAudioIoTypeInput , EfiAudioIoTypeMaximum }
 
enum  EFI_AUDIO_IO_PROTOCOL_DEVICE {
  EfiAudioIoDeviceLine , EfiAudioIoDeviceSpeaker , EfiAudioIoDeviceHeadphones , EfiAudioIoDeviceSpdif ,
  EfiAudioIoDeviceMic , EfiAudioIoDeviceHdmi , EfiAudioIoDeviceOther , EfiAudioIoDeviceMaximum
}
 
enum  EFI_AUDIO_IO_PROTOCOL_LOCATION {
  EfiAudioIoLocationNone , EfiAudioIoLocationRear , EfiAudioIoLocationFront , EfiAudioIoLocationLeft ,
  EfiAudioIoLocationRight , EfiAudioIoLocationTop , EfiAudioIoLocationBottom , EfiAudioIoLocationOther ,
  EfiAudioIoLocationMaximum
}
 
enum  EFI_AUDIO_IO_PROTOCOL_SURFACE { EfiAudioIoSurfaceExternal , EfiAudioIoSurfaceInternal , EfiAudioIoSurfaceOther , EfiAudioIoSurfaceMaximum }
 
enum  EFI_AUDIO_IO_PROTOCOL_BITS {
  EfiAudioIoBits8 = BIT0 , EfiAudioIoBits16 = BIT1 , EfiAudioIoBits20 = BIT2 , EfiAudioIoBits24 = BIT3 ,
  EfiAudioIoBits32 = BIT4
}
 
enum  EFI_AUDIO_IO_PROTOCOL_FREQ {
  EfiAudioIoFreq8kHz = BIT0 , EfiAudioIoFreq11kHz = BIT1 , EfiAudioIoFreq16kHz = BIT2 , EfiAudioIoFreq22kHz = BIT3 ,
  EfiAudioIoFreq32kHz = BIT4 , EfiAudioIoFreq44kHz = BIT5 , EfiAudioIoFreq48kHz = BIT6 , EfiAudioIoFreq88kHz = BIT7 ,
  EfiAudioIoFreq96kHz = BIT8 , EfiAudioIoFreq192kHz = BIT9
}
 

Variables

EFI_GUID gEfiAudioIoProtocolGuid
 

Macro Definition Documentation

◆ EFI_AUDIO_IO_PROTOCOL_GUID

#define EFI_AUDIO_IO_PROTOCOL_GUID
Value:
{ 0x22266891, 0x2032, 0x4BAE, \
{ 0xB7, 0xB5, 0x43, 0x74, 0xE7, 0x32, 0x09, 0x49 } }

Audio I/O protocol GUID. Protocol now versioned, so GUID updated from previous when non-versioned.

Definition at line 34 of file AudioIo.h.

◆ EFI_AUDIO_IO_PROTOCOL_MAX_CHANNELS

#define EFI_AUDIO_IO_PROTOCOL_MAX_CHANNELS   16

Maximum number of channels.

Definition at line 132 of file AudioIo.h.

◆ EFI_AUDIO_IO_PROTOCOL_MAX_VOLUME

#define EFI_AUDIO_IO_PROTOCOL_MAX_VOLUME   100

Definition at line 133 of file AudioIo.h.

◆ EFI_AUDIO_IO_PROTOCOL_REVISION

#define EFI_AUDIO_IO_PROTOCOL_REVISION   4

Definition at line 40 of file AudioIo.h.

Typedef Documentation

◆ EFI_AUDIO_IO_CALLBACK

typedef VOID(EFIAPI * EFI_AUDIO_IO_CALLBACK) (IN EFI_AUDIO_IO_PROTOCOL *AudioIo, IN VOID *Context)

Callback function.

Definition at line 139 of file AudioIo.h.

◆ EFI_AUDIO_IO_GET_OUTPUTS

typedef EFI_STATUS(EFIAPI * EFI_AUDIO_IO_GET_OUTPUTS) (IN EFI_AUDIO_IO_PROTOCOL *This, OUT EFI_AUDIO_IO_PROTOCOL_PORT **OutputPorts, OUT UINTN *OutputPortsCount)

Gets the collection of output ports.

Parameters
[in]ThisA pointer to the EFI_AUDIO_IO_PROTOCOL instance.
[out]OutputPortsA pointer to a buffer where the output ports will be placed.
[out]OutputPortsCountThe number of ports in OutputPorts.
Return values
EFI_SUCCESSThe audio data was played successfully.
EFI_INVALID_PARAMETEROne or more parameters are invalid.

Definition at line 156 of file AudioIo.h.

◆ EFI_AUDIO_IO_PROTOCOL

Definition at line 38 of file AudioIo.h.

◆ EFI_AUDIO_IO_RAW_GAIN_TO_DECIBELS

typedef EFI_STATUS(EFIAPI * EFI_AUDIO_IO_RAW_GAIN_TO_DECIBELS) (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 all have the same params as each other.

Parameters
[in]ThisA pointer to the EFI_AUDIO_IO_PROTOCOL instance.
[in]OutputIndexMaskA mask indicating the desired outputs.
[in]GainParamThe raw gain parameter for the amplifier.
[out]GainThe 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).
Return values
EFI_SUCCESSThe gain value was calculated successfully.
EFI_INVALID_PARAMETEROne or more parameters are invalid.

Definition at line 179 of file AudioIo.h.

◆ EFI_AUDIO_IO_SETUP_PLAYBACK

typedef EFI_STATUS(EFIAPI * EFI_AUDIO_IO_SETUP_PLAYBACK) (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.

Parameters
[in]ThisA pointer to the EFI_AUDIO_IO_PROTOCOL instance.
[in]OutputIndexMaskA mask indicating the desired outputs.
[in]GainThe 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]BitsThe width in bits of the source data.
[in]FreqThe frequency of the source data.
[in]ChannelsThe number of channels the source data contains.
[in]PlaybackDelayThe required delay before playback after a change in setup in milliseconds.
Return values
EFI_SUCCESSThe audio data was played successfully.
EFI_INVALID_PARAMETEROne or more parameters are invalid.

Definition at line 204 of file AudioIo.h.

◆ EFI_AUDIO_IO_START_PLAYBACK

typedef EFI_STATUS(EFIAPI * EFI_AUDIO_IO_START_PLAYBACK) (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.

Parameters
[in]ThisA pointer to the EFI_AUDIO_IO_PROTOCOL instance.
[in]DataA pointer to the buffer containing the audio data to play.
[in]DataLengthThe size, in bytes, of the data buffer specified by Data.
[in]PositionThe position in the buffer to start at.
Return values
EFI_SUCCESSThe audio data was played successfully.
EFI_INVALID_PARAMETEROne or more parameters are invalid.

Definition at line 227 of file AudioIo.h.

◆ EFI_AUDIO_IO_START_PLAYBACK_ASYNC

typedef EFI_STATUS(EFIAPI * EFI_AUDIO_IO_START_PLAYBACK_ASYNC) (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. The callback if specified will be executed with TPL_NOTIFY.

Parameters
[in]ThisA pointer to the EFI_AUDIO_IO_PROTOCOL instance.
[in]DataA pointer to the buffer containing the audio data to play.
[in]DataLengthThe size, in bytes, of the data buffer specified by Data.
[in]PositionThe position in the buffer to start at.
[in]CallbackA pointer to an optional callback to be invoked when playback is complete.
[in]ContextA pointer to data to be passed to the callback function.
Return values
EFI_SUCCESSThe audio data was played successfully.
EFI_INVALID_PARAMETEROne or more parameters are invalid.

Definition at line 250 of file AudioIo.h.

◆ EFI_AUDIO_IO_STOP_PLAYBACK

typedef EFI_STATUS(EFIAPI * EFI_AUDIO_IO_STOP_PLAYBACK) (IN EFI_AUDIO_IO_PROTOCOL *This)

Stops playback on the device. Note, this will not call registered callbacks for stop audio.

Parameters
[in]ThisA pointer to the EFI_AUDIO_IO_PROTOCOL instance.
Return values
EFI_SUCCESSThe audio data was played successfully.
EFI_INVALID_PARAMETEROne or more parameters are invalid.

Definition at line 270 of file AudioIo.h.

Enumeration Type Documentation

◆ EFI_AUDIO_IO_PROTOCOL_BITS

Size in bits of each sample.

Enumerator
EfiAudioIoBits8 
EfiAudioIoBits16 
EfiAudioIoBits20 
EfiAudioIoBits24 
EfiAudioIoBits32 

Definition at line 93 of file AudioIo.h.

◆ EFI_AUDIO_IO_PROTOCOL_DEVICE

Device type.

Enumerator
EfiAudioIoDeviceLine 
EfiAudioIoDeviceSpeaker 
EfiAudioIoDeviceHeadphones 
EfiAudioIoDeviceSpdif 
EfiAudioIoDeviceMic 
EfiAudioIoDeviceHdmi 
EfiAudioIoDeviceOther 
EfiAudioIoDeviceMaximum 

Definition at line 54 of file AudioIo.h.

◆ EFI_AUDIO_IO_PROTOCOL_FREQ

Frequency of each sample.

Enumerator
EfiAudioIoFreq8kHz 
EfiAudioIoFreq11kHz 
EfiAudioIoFreq16kHz 
EfiAudioIoFreq22kHz 
EfiAudioIoFreq32kHz 
EfiAudioIoFreq44kHz 
EfiAudioIoFreq48kHz 
EfiAudioIoFreq88kHz 
EfiAudioIoFreq96kHz 
EfiAudioIoFreq192kHz 

Definition at line 104 of file AudioIo.h.

◆ EFI_AUDIO_IO_PROTOCOL_LOCATION

Port location.

Enumerator
EfiAudioIoLocationNone 
EfiAudioIoLocationRear 
EfiAudioIoLocationFront 
EfiAudioIoLocationLeft 
EfiAudioIoLocationRight 
EfiAudioIoLocationTop 
EfiAudioIoLocationBottom 
EfiAudioIoLocationOther 
EfiAudioIoLocationMaximum 

Definition at line 68 of file AudioIo.h.

◆ EFI_AUDIO_IO_PROTOCOL_SURFACE

Port surface.

Enumerator
EfiAudioIoSurfaceExternal 
EfiAudioIoSurfaceInternal 
EfiAudioIoSurfaceOther 
EfiAudioIoSurfaceMaximum 

Definition at line 83 of file AudioIo.h.

◆ EFI_AUDIO_IO_PROTOCOL_TYPE

Port type.

Enumerator
EfiAudioIoTypeOutput 
EfiAudioIoTypeInput 
EfiAudioIoTypeMaximum 

Definition at line 45 of file AudioIo.h.

Variable Documentation

◆ gEfiAudioIoProtocolGuid

EFI_GUID gEfiAudioIoProtocolGuid
extern