Sound Open Firmware
Loading...
Searching...
No Matches
stream.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 *
3 * Copyright(c) 2018 - 2023 Intel Corporation. All rights reserved.
4 *
5 * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
6 * Keyon Jie <yang.jie@linux.intel.com>
7 */
8
15
16#ifndef __IPC_STREAM_H__
17#define __IPC_STREAM_H__
18
19#include <module/ipc/stream.h>
20#include <ipc/header.h>
21#include <stdint.h>
22
23/*
24 * Stream configuration.
25 */
26/* common sample rates for use in masks */
27#define SOF_RATE_8000 (1 << 0)
28#define SOF_RATE_11025 (1 << 1)
29#define SOF_RATE_12000 (1 << 2)
30#define SOF_RATE_16000 (1 << 3)
31#define SOF_RATE_22050 (1 << 4)
32#define SOF_RATE_24000 (1 << 5)
33#define SOF_RATE_32000 (1 << 6)
34#define SOF_RATE_44100 (1 << 7)
35#define SOF_RATE_48000 (1 << 8)
36#define SOF_RATE_64000 (1 << 9)
37#define SOF_RATE_88200 (1 << 10)
38#define SOF_RATE_96000 (1 << 11)
39#define SOF_RATE_176400 (1 << 12)
40#define SOF_RATE_192000 (1 << 13)
41
42/* continuous and non-standard rates for flexibility */
43#define SOF_RATE_CONTINUOUS (1 << 30)
44#define SOF_RATE_KNOT (1 << 31)
45
46/* generic PCM flags for runtime settings */
47#define SOF_PCM_FLAG_XRUN_STOP (1 << 0)
48
49/* stream buffer format */
55
56/* stream direction */
61
62/* stream ring info */
65 uint32_t phy_addr;
66 uint32_t pages;
67 uint32_t size;
68 uint32_t reserved[3];
69} __attribute__((packed, aligned(4)));
70
74 uint32_t direction;
75 uint32_t frame_fmt;
76 uint32_t buffer_fmt;
77 uint32_t rate;
78 uint16_t stream_tag;
79 uint16_t channels;
82
86 uint8_t reserved0;
87 uint16_t ext_data_length;
88
89 uint8_t reserved[2];
90 uint16_t chmap[SOF_IPC_MAX_CHANNELS];
91 int8_t data[];
92} __attribute__((packed, aligned(4)));
93
94/* PCM params info - SOF_IPC_STREAM_PCM_PARAMS */
97 uint32_t comp_id;
98 uint32_t flags;
99 uint32_t reserved[2];
101} __attribute__((packed, aligned(4)));
102
103/* PCM params info reply - SOF_IPC_STREAM_PCM_PARAMS_REPLY */
106 uint32_t comp_id;
107 uint32_t posn_offset;
108} __attribute__((packed, aligned(4)));
109
110/* free stream - SOF_IPC_STREAM_PCM_PARAMS */
113 uint32_t comp_id;
114} __attribute__((packed, aligned(4)));
115
116/* flags indicating which time stamps are in sync with each other */
117#define SOF_TIME_HOST_SYNC (1 << 0)
118#define SOF_TIME_DAI_SYNC (1 << 1)
119#define SOF_TIME_WALL_SYNC (1 << 2)
120#define SOF_TIME_STAMP_SYNC (1 << 3)
121
122/* flags indicating which time stamps are valid */
123#define SOF_TIME_HOST_VALID (1 << 8)
124#define SOF_TIME_DAI_VALID (1 << 9)
125#define SOF_TIME_WALL_VALID (1 << 10)
126#define SOF_TIME_STAMP_VALID (1 << 11)
127
128/* flags indicating time stamps are 64bit else 3use low 32bit */
129#define SOF_TIME_HOST_64 (1 << 16)
130#define SOF_TIME_DAI_64 (1 << 17)
131#define SOF_TIME_WALL_64 (1 << 18)
132#define SOF_TIME_STAMP_64 (1 << 19)
133
136 uint32_t comp_id;
137 uint32_t flags;
138 uint32_t wallclock_hz;
139 uint32_t timestamp_ns;
140 uint64_t host_posn;
141 uint64_t dai_posn;
142 uint64_t comp_posn;
143 uint64_t wallclock;
144 uint64_t timestamp;
145 uint32_t xrun_comp_id;
146 int32_t xrun_size;
147} __attribute__((packed, aligned(4)));
148
149#endif /* __IPC_STREAM_H__ */
IPC command header.
sof_ipc_stream_direction
Definition stream.h:57
@ SOF_IPC_STREAM_CAPTURE
Definition stream.h:59
@ SOF_IPC_STREAM_PLAYBACK
Definition stream.h:58
sof_ipc_buffer_format
Definition stream.h:50
@ SOF_IPC_BUFFER_INTERLEAVED
Definition stream.h:51
@ SOF_IPC_BUFFER_NONINTERLEAVED
Definition stream.h:52
Command Header - Header for all IPC commands.
Definition header.h:357
Structure Header - Header for all IPC structures except command structs.
Definition header.h:347
Definition stream.h:63
struct sof_ipc_hdr hdr
Definition stream.h:64
uint32_t reserved[3]
Definition stream.h:68
uint32_t phy_addr
Definition stream.h:65
uint32_t size
Definition stream.h:67
uint32_t pages
Definition stream.h:66
Definition stream.h:104
uint32_t comp_id
Definition stream.h:106
struct sof_ipc_reply rhdr
Definition stream.h:105
uint32_t posn_offset
Definition stream.h:107
Definition stream.h:95
struct sof_ipc_stream_params params
Definition stream.h:100
uint32_t flags
generic PCM flags - SOF_PCM_FLAG_
Definition stream.h:98
uint32_t comp_id
Definition stream.h:97
uint32_t reserved[2]
Definition stream.h:99
struct sof_ipc_cmd_hdr hdr
Definition stream.h:96
Generic reply message.
Definition header.h:366
Definition stream.h:71
uint16_t channels
Definition stream.h:79
uint32_t direction
enum sof_ipc_stream_direction
Definition stream.h:74
uint16_t sample_valid_bytes
Definition stream.h:80
uint16_t sample_container_bytes
Definition stream.h:81
uint32_t buffer_fmt
enum sof_ipc_buffer_format
Definition stream.h:76
uint32_t rate
Definition stream.h:77
uint8_t reserved[2]
Definition stream.h:89
uint16_t stream_tag
Definition stream.h:78
struct sof_ipc_hdr hdr
Definition stream.h:72
uint16_t no_stream_position
1 means don't send stream position
Definition stream.h:84
uint32_t frame_fmt
enum sof_ipc_frame
Definition stream.h:75
int8_t data[]
extended data
Definition stream.h:91
uint32_t host_period_bytes
Definition stream.h:83
uint8_t cont_update_posn
1 means continuous update stream position
Definition stream.h:85
uint16_t ext_data_length
0 means no extended data
Definition stream.h:87
uint16_t chmap[SOF_IPC_MAX_CHANNELS]
channel map - SOF_CHMAP_
Definition stream.h:90
struct sof_ipc_host_buffer buffer
Definition stream.h:73
uint8_t reserved0
Definition stream.h:86
Definition stream.h:134
uint64_t comp_posn
comp position in bytes
Definition stream.h:142
uint64_t host_posn
host DMA position in bytes
Definition stream.h:140
uint32_t wallclock_hz
frequency of wallclock in Hz
Definition stream.h:138
uint64_t dai_posn
DAI DMA position in bytes.
Definition stream.h:141
uint32_t timestamp_ns
resolution of timestamp in ns
Definition stream.h:139
int32_t xrun_size
XRUN size in bytes.
Definition stream.h:146
struct sof_ipc_reply rhdr
Definition stream.h:135
uint64_t wallclock
audio wall clock
Definition stream.h:143
uint32_t flags
SOF_TIME_.
Definition stream.h:137
uint64_t timestamp
system time stamp
Definition stream.h:144
uint32_t comp_id
host component ID
Definition stream.h:136
uint32_t xrun_comp_id
comp ID of XRUN component
Definition stream.h:145
Definition stream.h:111
uint32_t comp_id
Definition stream.h:113
struct sof_ipc_cmd_hdr hdr
Definition stream.h:112