forked from thesofproject/sof
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaudio_stream.h
More file actions
53 lines (44 loc) · 1.85 KB
/
audio_stream.h
File metadata and controls
53 lines (44 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright(c) 2023 Intel Corporation. All rights reserved.
*
* Author: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
* Adrian Warecki <adrian.warecki@intel.com>
*/
#ifndef __MODULE_AUDIO_AUDIO_STREAM_H__
#define __MODULE_AUDIO_AUDIO_STREAM_H__
#include <stdint.h>
#include <stdbool.h>
#include "../ipc/stream.h"
/**
* set of parameters describing audio stream
* this structure is shared between audio_stream.h and sink/source interface
* TODO: compressed formats
*/
struct sof_audio_stream_params {
enum sof_ipc_frame frame_fmt; /**< Sample data format */
enum sof_ipc_frame valid_sample_fmt;
uint32_t rate; /**< Number of data frames per second [Hz] */
uint16_t channels; /**< Number of samples in each frame */
/**
* align_frame_cnt indicates minimum number of frames that satisfies both byte
* align and frame align requirements. E.g: Consider an algorithm that processes
* in blocks of 3 frames configured to process 16-bit stereo using xtensa HiFi3
* SIMD. Therefore with 16-bit stereo we have a frame size of 4 bytes, and
* SIMD intrinsic requirement of 8 bytes(2 frames) for HiFi3 and an algorithim
* requirement of 3 frames. Hence the common processing block size has to align
* with frame(1), intrinsic(2) and algorithm (3) giving us an optimum processing
* block size of 6 frames.
*/
uint16_t align_frame_cnt;
/**
* the free/available bytes of sink/source right shift align_shift_idx, the result
* multiplied by align_frame_cnt is the frame count free/available that can meet
* the align requirement.
*/
uint16_t align_shift_idx;
bool overrun_permitted; /**< indicates whether overrun is permitted */
bool underrun_permitted; /**< indicates whether underrun is permitted */
uint32_t buffer_fmt; /**< enum sof_ipc_buffer_format */
};
#endif /* __MODULE_AUDIO_AUDIO_STREAM_H__ */