Sound Open Firmware
Loading...
Searching...
No Matches
selector.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 *
3 * Copyright(c) 2019 Intel Corporation. All rights reserved.
4 *
5 * Author: Lech Betlej <lech.betlej@linux.intel.com>
6 */
7
14#ifndef __SOF_AUDIO_SELECTOR_H__
15#define __SOF_AUDIO_SELECTOR_H__
16
18#include <sof/trace/trace.h>
19#include <ipc/stream.h>
20#if CONFIG_IPC_MAJOR_4
21#include <ipc4/base-config.h>
22#endif
23#include <user/selector.h>
24#include <user/trace.h>
25#include <stdint.h>
26
27struct comp_buffer;
28struct comp_dev;
29struct cir_buf_source;
30struct cir_buf_sink;
31
33#define SEL_COEF_ONE_Q10 1024 /* int16(1 * 2^10) */
34
35#if CONFIG_IPC_MAJOR_3
37#define SEL_SOURCE_1CH 1
38#define SEL_SOURCE_2CH 2
39#define SEL_SOURCE_4CH 4
40
42#define SEL_SINK_1CH 1
43#define SEL_SINK_2CH 2
44#define SEL_SINK_4CH 4
45#else
47#define SEL_SOURCE_CHANNELS_MAX 8
48
50#define SEL_SINK_CHANNELS_MAX 8
51
53#define SEL_MAX_NUM_CONFIGS 8
54
55#define SEL_NUM_IN_PIN_FMTS 1
56#define SEL_NUM_OUT_PIN_FMTS 1
57
58#endif
59
60#if CONFIG_IPC_MAJOR_4
62typedef void (*sel_func)(struct processing_module *mod,
63 const struct cir_buf_source *source,
64 struct cir_buf_sink *sink, size_t frames);
65
70
79 int16_t coeffs[SEL_SINK_CHANNELS_MAX][SEL_SOURCE_CHANNELS_MAX];
80};
81
86
91
92/*
93 * Base module config is not added in this structure because it is handled
94 * by module adapter.
95 */
97 /*
98 * Windows will send the base_config + output_format payload, but Linux will
99 * send the base_config + base_config_ext payload, use a union to make the
100 * selector module be compatible for both OSes.
101 */
102 union {
105 };
107};
108
113
114#else
115typedef int (*sel_func)(struct comp_dev *dev, struct sof_sink *sink,
116 struct sof_source *source, size_t frames);
117#endif
118
120struct comp_data {
121#if CONFIG_IPC_MAJOR_4
126#endif
127
137};
138
145
147extern const struct comp_func_map func_map[];
148
149#if CONFIG_IPC_MAJOR_4
155
156#ifdef UNIT_TEST
158#endif
159#else
165
166#ifdef UNIT_TEST
167void sys_comp_selector_init(void);
168#endif
169#endif
170
171#endif /* __SOF_AUDIO_SELECTOR_H__ */
void sys_comp_selector_init(void)
void sys_comp_module_selector_interface_init(void)
sof_ipc_frame
Definition stream.h:16
ipc4_selector_init_payload_fmt
Definition selector.h:82
@ IPC4_SEL_INIT_PAYLOAD_BASE_WITH_EXT
Definition selector.h:83
@ IPC4_SEL_INIT_PAYLOAD_BASE_WITH_OUT_FMT
Definition selector.h:84
ipc4_selector_config_id
IPC4 configuration IDs for selector.
Definition selector.h:67
@ IPC4_SELECTOR_COEFFS_CONFIG_ID
Mixing coefficients config ID.
Definition selector.h:68
sel_func sel_get_processing_function(struct processing_module *mod)
Retrieves selector processing function.
void(* sel_func)(struct processing_module *mod, const struct cir_buf_source *source, struct cir_buf_sink *sink, size_t frames)
selector processing function interface
Definition selector.h:62
const struct comp_func_map func_map[]
Map of formats with dedicated processing functions.
User-space ABI log levels and binary trace packet header definitions.
Writable view of sink data in a circular buffer.
Definition audio_stream.h:128
void * ptr
Current write pointer within the buffer.
Definition audio_stream.h:131
Read-only view of source data in a circular buffer.
Definition audio_stream.h:116
Audio component interconnect buffer connecting two pipeline components.
Definition buffer.h:150
Selector component private data.
Definition igo_nr_comp.h:21
struct sof_igo_nr_config config
blob data buffer
Definition igo_nr_comp.h:41
uint32_t source_period_bytes
source number of period bytes
Definition selector.h:128
size_t multi_coeffs_config_size
Definition selector.h:125
uint32_t source_format
source frame format
Definition igo_nr_comp.h:36
struct ipc4_selector_coeffs_config * multi_coeffs_config
Definition selector.h:124
bool new_config
True if new configuration has been received.
Definition selector.h:136
struct ipc4_selector_coeffs_config coeffs_config
Definition selector.h:123
int num_configs
Number of coefficients sets in configuration blob.
Definition selector.h:134
bool passthrough
Use a passthrough copy function when no up/down mix.
Definition selector.h:135
uint32_t sink_format
sink frame format
Definition igo_nr_comp.h:35
sel_func sel_func
channel selector processing function
Definition selector.h:133
uint32_t sink_period_bytes
sink number of period bytes
Definition selector.h:129
struct sof_selector_ipc4_config sel_ipc4_cfg
Definition selector.h:122
Audio component base device "class" used by all other component types.
Definition component.h:587
Selector processing functions map.
Definition selector.h:140
sel_func sel_func
selector processing function
Definition selector.h:143
uint16_t source
source frame format
Definition selector.h:141
uint32_t out_channels
number of output stream channels
Definition selector.h:142
Standard audio format descriptor across all IPC4 modules and gateways.
Definition base-config.h:144
Base module configuration parameters provided upon module instantiation.
Definition base-config.h:160
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
IPC4 mixing coefficients configuration.
Definition selector.h:72
int16_t coeffs[SEL_SINK_CHANNELS_MAX][SEL_SOURCE_CHANNELS_MAX]
Mixing coefficients in Q10 fixed point format.
Definition selector.h:79
uint8_t source_channels_count
Used when multiple profiles are packed into one blob.
Definition selector.h:73
uint8_t sink_channels_count
Used when multiple profiles are packed into one blob.
Definition selector.h:74
uint8_t source_channel_config
Used when multiple profiles are packed into one blob.
Definition selector.h:75
uint8_t sink_channel_config
Used when multiple profiles are packed into one blob.
Definition selector.h:76
Definition base.h:103
Selector component configuration data.
Definition selector.h:14
Definition selector.h:109
struct ipc4_audio_format output_format
Definition selector.h:111
struct ipc4_base_module_cfg base_cfg
Definition selector.h:110
Definition selector.h:96
struct sof_selector_ipc4_pin_config pin_cfg
Definition selector.h:103
enum ipc4_selector_init_payload_fmt init_payload_fmt
Definition selector.h:106
struct ipc4_audio_format output_format
Definition selector.h:104
Definition selector.h:87
struct ipc4_input_pin_format in_pin
Definition selector.h:88
struct ipc4_output_pin_format out_pin
Definition selector.h:89
internals of sink API.
Definition sink_api.h:141
internals of source API.
Definition source_api.h:137