Sound Open Firmware
Loading...
Searching...
No Matches
IPC4 Audio Formats & Pin Contracts

Audio format specification bitfields, sampling rates, bit depths, channel configurations, and pin format descriptors. More...

Collaboration diagram for IPC4 Audio Formats & Pin Contracts:

Files

file  base-config.h
 Firmware internal stream parameter and buffer format bridge routines for IPC4.
 
file  base-config.h
 IPC4 audio formats, sampling frequencies, bit depths, and pin descriptors.
 

Data Structures

struct  AudioFormat
 Standard audio format descriptor across all IPC4 modules and gateways. More...
 
struct  LegacyModuleInitialSettings
 Base module configuration parameters provided upon module instantiation. More...
 
struct  InputPinFormat
 Input pin format specification for multi-pin modules. More...
 
struct  OutputPinFormat
 Output pin format specification for multi-pin modules. More...
 
struct  ipc4_base_module_cfg_ext
 Extended module configuration header describing dynamic input and output pins. More...
 
struct  ipc4_base_module_extended_cfg
 Combined base and extended module configuration payload for easy parsing. More...
 
struct  ipc4_pin_props
 Runtime properties of a module pin connection. More...
 
struct  ipc4_pin_list_info
 List of active pin properties for a module instance. More...
 
struct  ipc4_module_instance_props
 Detailed module instance runtime state, memory consumption, and queue alignment. More...
 
struct  ipc4_in_out_gateway
 Direct gateway attachment identifiers for a module instance. More...
 
union  ipc4_cfg_param_id_data
 16-bit small parameter register encoding for MOD_CONFIG_SET/GET. More...
 

Macros

#define ipc4_calc_base_module_cfg_ext_size(in_pins, out_pins)
 Helper macro to calculate serialized byte size of struct ipc4_base_module_cfg_ext.
 

Enumerations

enum  ipc4_sampling_frequency {
  IPC4_FS_8000HZ = 8000 , IPC4_FS_11025HZ = 11025 , IPC4_FS_12000HZ = 12000 , IPC4_FS_16000HZ = 16000 ,
  IPC4_FS_18900HZ = 18900 , IPC4_FS_22050HZ = 22050 , IPC4_FS_24000HZ = 24000 , IPC4_FS_32000HZ = 32000 ,
  IPC4_FS_37800HZ = 37800 , IPC4_FS_44100HZ = 44100 , IPC4_FS_48000HZ = 48000 , IPC4_FS_64000HZ = 64000 ,
  IPC4_FS_88200HZ = 88200 , IPC4_FS_96000HZ = 96000 , IPC4_FS_176400HZ = 176400 , IPC4_FS_192000HZ = 192000 ,
  IPC4_FS_INVALID
}
 Standard PCM and encoded audio sampling frequencies supported by IPC4. More...
 
enum  ipc4_bit_depth {
  IPC4_DEPTH_8BIT = 8 , IPC4_DEPTH_16BIT = 16 , IPC4_DEPTH_24BIT = 24 , IPC4_DEPTH_32BIT = 32 ,
  IPC4_DEPTH_64BIT = 64 , IPC4_DEPTH_INVALID
}
 Container bit depth for sample storage in memory. More...
 
enum  ipc4_channel_config {
  IPC4_CHANNEL_CONFIG_MONO = 0 , IPC4_CHANNEL_CONFIG_STEREO = 1 , IPC4_CHANNEL_CONFIG_2_POINT_1 = 2 , IPC4_CHANNEL_CONFIG_3_POINT_0 = 3 ,
  IPC4_CHANNEL_CONFIG_3_POINT_1 = 4 , IPC4_CHANNEL_CONFIG_QUATRO = 5 , IPC4_CHANNEL_CONFIG_4_POINT_0 = 6 , IPC4_CHANNEL_CONFIG_5_POINT_0 = 7 ,
  IPC4_CHANNEL_CONFIG_5_POINT_1 = 8 , IPC4_CHANNEL_CONFIG_DUAL_MONO = 9 , IPC4_CHANNEL_CONFIG_I2S_DUAL_STEREO_0 = 10 , IPC4_CHANNEL_CONFIG_I2S_DUAL_STEREO_1 = 11 ,
  IPC4_CHANNEL_CONFIG_7_POINT_1 = 12 , IPC4_CHANNEL_CONFIG_INVALID
}
 Audio channel configurations and speaker mappings. More...
 
enum  ipc4_channel_index {
  CHANNEL_LEFT = 0 , CHANNEL_CENTER = 1 , CHANNEL_RIGHT = 2 , CHANNEL_LEFT_SURROUND = 3 ,
  CHANNEL_CENTER_SURROUND = 3 , CHANNEL_RIGHT_SURROUND = 4 , CHANNEL_LEFT_SIDE = 5 , CHANNEL_RIGHT_SIDE = 6 ,
  CHANNEL_LFE = 7 , CHANNEL_INVALID = 0xF
}
 Logical channel position indices used in channel maps. More...
 
enum  ipc4_interleaved_style { IPC4_CHANNELS_INTERLEAVED = 0 , IPC4_CHANNELS_NONINTERLEAVED = 1 }
 Sample interleaving styles. More...
 
enum  ipc4_sample_type {
  IPC4_TYPE_MSB_INTEGER = 0 , IPC4_TYPE_LSB_INTEGER = 1 , IPC4_TYPE_SIGNED_INTEGER = 2 , IPC4_TYPE_UNSIGNED_INTEGER = 3 ,
  IPC4_TYPE_FLOAT = 4 , IPC4_TYPE_A_LAW = 5 , IPC4_TYPE_MU_LAW = 6
}
 Audio sample representation and arithmetic type. More...
 
enum  ipc4_stream_type {
  IPC4_STREAM_PCM = 0 , IPC4_STREAM_MP3 = 1 , IPC4_STREAM_AAC = 2 , IPC4_STREAM_COUNT = 3 ,
  IPC4_STREAM_INVALID = 0xFF
}
 Stream container encoding type. More...
 
enum  ipc4_base_module_params { IPC4_MOD_INST_PROPS = 0xFE , IPC4_MOD_INST_ENABLE = 0x3000 }
 Common 16-bit parameter IDs supported across all IPC4 module instances. More...
 

Functions

void ipc4_base_module_cfg_to_stream_params (const struct ipc4_base_module_cfg *base_cfg, struct sof_ipc_stream_params *params)
 Convert an IPC4 base module configuration structure to internal SOF stream parameters.
 
void ipc4_audio_format_to_stream_params (const struct ipc4_audio_format *audio_fmt, struct sof_ipc_stream_params *params)
 Convert an IPC4 audio format descriptor to internal SOF stream parameters.
 
void ipc4_update_buffer_format (struct comp_buffer *buf_c, const struct ipc4_audio_format *fmt)
 Apply an IPC4 audio format configuration to an intermediate component buffer.
 
void ipc4_update_source_format (struct sof_source *source, const struct ipc4_audio_format *fmt)
 Apply an IPC4 audio format configuration to an audio streaming source endpoint.
 
void ipc4_update_sink_format (struct sof_sink *sink, const struct ipc4_audio_format *fmt)
 Apply an IPC4 audio format configuration to an audio streaming sink endpoint.
 

Detailed Description

Audio format specification bitfields, sampling rates, bit depths, channel configurations, and pin format descriptors.

Macro Definition Documentation

◆ ipc4_calc_base_module_cfg_ext_size

#define ipc4_calc_base_module_cfg_ext_size (   in_pins,
  out_pins 
)
Value:
(sizeof(struct ipc4_base_module_cfg_ext) + \
(in_pins) * sizeof(struct ipc4_input_pin_format) + \
(out_pins) * sizeof(struct ipc4_output_pin_format))
Extended module configuration header describing dynamic input and output pins.
Definition base-config.h:192
Input pin format specification for multi-pin modules.
Definition base-config.h:172
Output pin format specification for multi-pin modules.
Definition base-config.h:182

Helper macro to calculate serialized byte size of struct ipc4_base_module_cfg_ext.

Enumeration Type Documentation

◆ ipc4_base_module_params

Common 16-bit parameter IDs supported across all IPC4 module instances.

Enumerator
IPC4_MOD_INST_PROPS 

Retrieve module instance runtime memory and queue properties via LargeConfigGet.

IPC4_MOD_INST_ENABLE 

Enable or disable module instance processing via ConfigSet (0 = disable, 1 = enable).

◆ ipc4_bit_depth

Container bit depth for sample storage in memory.

Enumerator
IPC4_DEPTH_8BIT 

8-bit sample container depth.

IPC4_DEPTH_16BIT 

16-bit sample container depth.

IPC4_DEPTH_24BIT 

24-bit sample container depth (Default).

IPC4_DEPTH_32BIT 

32-bit sample container depth.

IPC4_DEPTH_64BIT 

64-bit sample container depth.

IPC4_DEPTH_INVALID 

Sentinel for invalid bit depth.

◆ ipc4_channel_config

Audio channel configurations and speaker mappings.

Enumerator
IPC4_CHANNEL_CONFIG_MONO 

Single mono channel.

IPC4_CHANNEL_CONFIG_STEREO 

Standard stereo (Left & Right).

IPC4_CHANNEL_CONFIG_2_POINT_1 

2.1 Audio: Left, Right & LFE (PCM only).

IPC4_CHANNEL_CONFIG_3_POINT_0 

3.0 Audio: Left, Center & Right (MP3 & AAC only).

IPC4_CHANNEL_CONFIG_3_POINT_1 

3.1 Audio: Left, Center, Right & LFE (PCM only).

IPC4_CHANNEL_CONFIG_QUATRO 

4.0 Surround: Left, Right, Left Surround & Right Surround.

IPC4_CHANNEL_CONFIG_4_POINT_0 

4.0 Cinema: Left, Center, Right & Center Surround.

IPC4_CHANNEL_CONFIG_5_POINT_0 

5.0 Surround: Left, Center, Right, Left Surround & Right Surround.

IPC4_CHANNEL_CONFIG_5_POINT_1 

5.1 Surround: Left, Center, Right, Left Surround, Right Surround & LFE.

IPC4_CHANNEL_CONFIG_DUAL_MONO 

Dual mono: single logical channel duplicated into two slots.

IPC4_CHANNEL_CONFIG_I2S_DUAL_STEREO_0 

Stereo (L,R) in 4 slots, 1st stream: [ L, R, -, - ].

IPC4_CHANNEL_CONFIG_I2S_DUAL_STEREO_1 

Stereo (L,R) in 4 slots, 2nd stream: [ -, -, L, R ].

IPC4_CHANNEL_CONFIG_7_POINT_1 

7.1 Surround: L, C, R, Ls, Rs, LFE, Left Side & Right Side.

IPC4_CHANNEL_CONFIG_INVALID 

Sentinel for unsupported channel configuration.

◆ ipc4_channel_index

Logical channel position indices used in channel maps.

Enumerator
CHANNEL_LEFT 

Front Left channel.

CHANNEL_CENTER 

Front Center channel.

CHANNEL_RIGHT 

Front Right channel.

CHANNEL_LEFT_SURROUND 

Left Surround channel.

CHANNEL_CENTER_SURROUND 

Center Surround channel.

CHANNEL_RIGHT_SURROUND 

Right Surround channel.

CHANNEL_LEFT_SIDE 

Left Side Surround channel.

CHANNEL_RIGHT_SIDE 

Right Side Surround channel.

CHANNEL_LFE 

Low Frequency Effects (subwoofer) channel.

CHANNEL_INVALID 

Unmapped or inactive channel slot.

◆ ipc4_interleaved_style

Sample interleaving styles.

Enumerator
IPC4_CHANNELS_INTERLEAVED 

Channels interleaved sample-by-sample (L0, R0, L1, R1...).

IPC4_CHANNELS_NONINTERLEAVED 

Planar non-interleaved channels (all Left samples, then all Right).

◆ ipc4_sample_type

Audio sample representation and arithmetic type.

Enumerator
IPC4_TYPE_MSB_INTEGER 

Integer with valid bits MSB-aligned in container (e.g.

S24 in bits [31:8]).

IPC4_TYPE_LSB_INTEGER 

Integer with valid bits LSB-aligned in container (e.g.

S24 in bits [23:0]).

IPC4_TYPE_SIGNED_INTEGER 

Standard 2's complement signed integer (e.g.

Q1.15, Q1.23, Q1.31).

IPC4_TYPE_UNSIGNED_INTEGER 

Unsigned integer PCM.

IPC4_TYPE_FLOAT 

32-bit IEEE 754 floating point.

IPC4_TYPE_A_LAW 

ITU-T G.711 A-law companded audio.

IPC4_TYPE_MU_LAW 

ITU-T G.711 mu-law companded audio.

◆ ipc4_sampling_frequency

Standard PCM and encoded audio sampling frequencies supported by IPC4.

Enumerator
IPC4_FS_8000HZ 

8.0 kHz sampling rate.

IPC4_FS_11025HZ 

11.025 kHz sampling rate.

IPC4_FS_12000HZ 

12.0 kHz (MP3, AAC, SRC only).

IPC4_FS_16000HZ 

16.0 kHz sampling rate (standard voice/telephony).

IPC4_FS_18900HZ 

18.9 kHz (SRC only for 44.1 kHz fractional rates).

IPC4_FS_22050HZ 

22.05 kHz sampling rate.

IPC4_FS_24000HZ 

24.0 kHz (MP3, AAC, SRC only).

IPC4_FS_32000HZ 

32.0 kHz sampling rate.

IPC4_FS_37800HZ 

37.8 kHz (SRC only for 44.1 kHz fractional rates).

IPC4_FS_44100HZ 

44.1 kHz CD audio sampling rate.

IPC4_FS_48000HZ 

48.0 kHz standard DSP audio rate (Default).

IPC4_FS_64000HZ 

64.0 kHz (AAC, SRC only).

IPC4_FS_88200HZ 

88.2 kHz high-resolution audio.

IPC4_FS_96000HZ 

96.0 kHz high-resolution audio.

IPC4_FS_176400HZ 

176.4 kHz studio master rate.

IPC4_FS_192000HZ 

192.0 kHz studio master rate.

IPC4_FS_INVALID 

Sentinel for invalid or uninitialized sampling rate.

◆ ipc4_stream_type

Stream container encoding type.

Enumerator
IPC4_STREAM_PCM 

Linear Pulse Code Modulated (PCM) uncompressed audio.

IPC4_STREAM_MP3 

MPEG-1 Audio Layer III encoded bitstream.

IPC4_STREAM_AAC 

Advanced Audio Coding encoded bitstream.

IPC4_STREAM_COUNT 

Total count of defined stream types.

IPC4_STREAM_INVALID 

Sentinel for invalid stream type.

Function Documentation

◆ ipc4_audio_format_to_stream_params()

void ipc4_audio_format_to_stream_params ( const struct ipc4_audio_format *  audio_fmt,
struct sof_ipc_stream_params *  params 
)

Convert an IPC4 audio format descriptor to internal SOF stream parameters.

Parameters
[in]audio_fmtPointer to the IPC4 audio format structure.
[out]paramsDestination SOF stream parameters structure to populate.

◆ ipc4_base_module_cfg_to_stream_params()

void ipc4_base_module_cfg_to_stream_params ( const struct ipc4_base_module_cfg *  base_cfg,
struct sof_ipc_stream_params *  params 
)

Convert an IPC4 base module configuration structure to internal SOF stream parameters.

Parameters
[in]base_cfgPointer to the IPC4 base module configuration.
[out]paramsDestination SOF stream parameters structure to populate.

◆ ipc4_update_buffer_format()

void ipc4_update_buffer_format ( struct comp_buffer *  buf_c,
const struct ipc4_audio_format *  fmt 
)

Apply an IPC4 audio format configuration to an intermediate component buffer.

Parameters
[in,out]buf_cComponent buffer whose stream format will be updated.
[in]fmtIPC4 audio format specification to apply.

◆ ipc4_update_sink_format()

void ipc4_update_sink_format ( struct sof_sink *  sink,
const struct ipc4_audio_format *  fmt 
)

Apply an IPC4 audio format configuration to an audio streaming sink endpoint.

Parameters
[in,out]sinkAudio sink interface to configure.
[in]fmtIPC4 audio format specification to apply.

◆ ipc4_update_source_format()

void ipc4_update_source_format ( struct sof_source *  source,
const struct ipc4_audio_format *  fmt 
)

Apply an IPC4 audio format configuration to an audio streaming source endpoint.

Parameters
[in,out]sourceAudio source interface to configure.
[in]fmtIPC4 audio format specification to apply.