Sound Open Firmware
Loading...
Searching...
No Matches
smart_amp_test.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 *
3 * Copyright(c) 2020 Intel Corporation. All rights reserved.
4 *
5 * Author: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
6 */
7
8#ifndef __SOF_AUDIO_SMART_AMP_H__
9#define __SOF_AUDIO_SMART_AMP_H__
10
11#include <sof/audio/component.h>
12#include <sof/audio/data_blob.h>
13
14#if CONFIG_IPC_MAJOR_4
15#include <ipc4/base-config.h>
16
17#define SOF_SMART_AMP_FEEDBACK_QUEUE_ID 1
18#endif
19
20#define SMART_AMP_MAX_STREAM_CHAN 8
21
23#define SOF_SMART_AMP_CONFIG 0
24#define SOF_SMART_AMP_MODEL 1
25
27 uint32_t data_size;
28 void *data;
29 uint32_t crc;
30 uint32_t data_pos;
31};
32
33/* Each channel map specifies which channel from input (buffer between host
34 * and smart amp - source_chan_map[] or feedback buffer between smart amp and
35 * demux - feedback_chan_map[]) will be copied to specific smart amp output
36 * channel. Value -1 means that for this output channel we will not take any
37 * channel from specific input.
38 *
39 * E.g. assuming that a smart amplifier input stream is configured
40 * with channels parameter set to 2, feedback stream with channels set to 8
41 * and smart amplifier output stream with channels set to 4 (smart amplifier
42 * converts stream from 2 to 4 channels) and source/feedback_ch_map's are as
43 * follows:
44 *
45 * source_ch_map = [0, 1, -1, -1, -1 ,-1 ,-1, -1]
46 * feedback_ch_map = [-1, -1, 0, 1, -1, -1, -1, -1]
47 *
48 * As a result smart amplifier test component will procces source and feedback
49 * streams in following way:
50 *
51 *
52 *
53 * PLAYBACK
54 * STREAM +---+
55 * | 0 +------------+
56 * +---+ | SMART AMPLIFIER
57 * | 1 +---------+ | OUTPUT
58 * +---+ | | +---+
59 * | +-->+ 0 |
60 * | +---+
61 * +----->+ 1 |
62 * +---+
63 * +---+ +--->+ 2 |
64 * FEEDBACK | 0 +-----------+ +---+
65 * STREAM +---+ +->| 3 |
66 * | 1 +-------------+ +---+
67 * +---+ | 4 |
68 * | 2 | +---+
69 * +---+ | 5 |
70 * | 3 | +---+
71 * +---+ | 6 |
72 * | 4 | +---+
73 * +---+ | 7 |
74 * | 5 | +---+
75 * +---+
76 * | 6 |
77 * +---+
78 * | 7 |
79 * +---+
80 *
81 */
82
84 uint32_t size;
85 uint32_t feedback_channels;
86 int8_t source_ch_map[PLATFORM_MAX_CHANNELS];
87 int8_t feedback_ch_map[PLATFORM_MAX_CHANNELS];
88};
89
90#if CONFIG_IPC_MAJOR_4
91
92#define SMART_AMP_NUM_IN_PINS 2
93#define SMART_AMP_NUM_OUT_PINS 1
94
95struct sof_smart_amp_ipc4_config {
96 struct ipc4_input_pin_format input_pins[SMART_AMP_NUM_IN_PINS];
97 struct ipc4_output_pin_format output_pin;
98};
99
100enum smart_amp_config_params {
101 SMART_AMP_SET_MODEL = 1,
102 SMART_AMP_SET_CONFIG = 2,
103 SMART_AMP_GET_CONFIG = 3
104};
105
106#endif
107
108#endif /* __SOF_AUDIO_SMART_AMP_H__ */
Component API definition.
Definition smart_amp_test.h:26
uint32_t data_pos
Definition smart_amp_test.h:30
uint32_t crc
Definition smart_amp_test.h:29
uint32_t data_size
Definition smart_amp_test.h:27
void * data
Definition smart_amp_test.h:28
Definition smart_amp.h:14
int8_t source_ch_map[PLATFORM_MAX_CHANNELS]
Definition smart_amp.h:20
uint32_t feedback_channels
Definition smart_amp.h:18
int8_t feedback_ch_map[PLATFORM_MAX_CHANNELS]
Definition smart_amp.h:22
uint32_t size
Definition smart_amp.h:16