forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/Documentation/sound/designs/compress-offload.rst
....@@ -151,6 +151,57 @@
151151 - Addition of encoding options when required (derived from OpenMAX IL)
152152 - Addition of rateControlSupported (missing in OpenMAX AL)
153153
154
+State Machine
155
+=============
156
+
157
+The compressed audio stream state machine is described below ::
158
+
159
+ +----------+
160
+ | |
161
+ | OPEN |
162
+ | |
163
+ +----------+
164
+ |
165
+ |
166
+ | compr_set_params()
167
+ |
168
+ v
169
+ compr_free() +----------+
170
+ +------------------------------------| |
171
+ | | SETUP |
172
+ | +-------------------------| |<-------------------------+
173
+ | | compr_write() +----------+ |
174
+ | | ^ |
175
+ | | | compr_drain_notify() |
176
+ | | | or |
177
+ | | | compr_stop() |
178
+ | | | |
179
+ | | +----------+ |
180
+ | | | | |
181
+ | | | DRAIN | |
182
+ | | | | |
183
+ | | +----------+ |
184
+ | | ^ |
185
+ | | | |
186
+ | | | compr_drain() |
187
+ | | | |
188
+ | v | |
189
+ | +----------+ +----------+ |
190
+ | | | compr_start() | | compr_stop() |
191
+ | | PREPARE |------------------->| RUNNING |--------------------------+
192
+ | | | | | |
193
+ | +----------+ +----------+ |
194
+ | | | ^ |
195
+ | |compr_free() | | |
196
+ | | compr_pause() | | compr_resume() |
197
+ | | | | |
198
+ | v v | |
199
+ | +----------+ +----------+ |
200
+ | | | | | compr_stop() |
201
+ +--->| FREE | | PAUSE |---------------------------+
202
+ | | | |
203
+ +----------+ +----------+
204
+
154205
155206 Gapless Playback
156207 ================
....@@ -183,11 +234,6 @@
183234 EOF is reached and now DSP can start skipping padding delay. Also next write
184235 data would belong to next track
185236
186
-- set_next_track_param
187
-This routine is called to send to DSP codec specific data of subsequent track
188
-in gapless before first write.
189
-
190
-
191237 Sequence flow for gapless would be:
192238 - Open
193239 - Get caps / codec caps
....@@ -199,12 +245,43 @@
199245 - Indicate next track data by sending set_next_track
200246 - Set metadata of the next track
201247 - then call partial_drain to flush most of buffer in DSP
202
-- set codec specific data of subsequent track
203248 - Fill data of the next track
204249 - DSP switches to second track
205250
206251 (note: order for partial_drain and write for next track can be reversed as well)
207252
253
+Gapless Playback SM
254
+===================
255
+
256
+For Gapless, we move from running state to partial drain and back, along
257
+with setting of meta_data and signalling for next track ::
258
+
259
+
260
+ +----------+
261
+ compr_drain_notify() | |
262
+ +------------------------>| RUNNING |
263
+ | | |
264
+ | +----------+
265
+ | |
266
+ | |
267
+ | | compr_next_track()
268
+ | |
269
+ | V
270
+ | +----------+
271
+ | | |
272
+ | |NEXT_TRACK|
273
+ | | |
274
+ | +----------+
275
+ | |
276
+ | |
277
+ | | compr_partial_drain()
278
+ | |
279
+ | V
280
+ | +----------+
281
+ | | |
282
+ +------------------------ | PARTIAL_ |
283
+ | DRAIN |
284
+ +----------+
208285
209286 Not supported
210287 =============