Developer World
Spresense SDK Library v3.3.0-375c679
audio_outputmix_api.h
Go to the documentation of this file.
1/****************************************************************************
2 * modules/include/audio/audio_outputmix_api.h
3 *
4 * Copyright 2018 Sony Semiconductor Solutions Corporation
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in
14 * the documentation and/or other materials provided with the
15 * distribution.
16 * 3. Neither the name of Sony Semiconductor Solutions Corporation nor
17 * the names of its contributors may be used to endorse or promote
18 * products derived from this software without specific prior written
19 * permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *
34 ****************************************************************************/
35
36#ifndef __MODULES_INCLUDE_AUDIO_AUDIO_OUTPUTMIX_API_H
37#define __MODULES_INCLUDE_AUDIO_AUDIO_OUTPUTMIX_API_H
38
53/****************************************************************************
54 * Included Files
55 ****************************************************************************/
56
58
60#include "memutils/message/MsgPacket.h"
61
62/****************************************************************************
63 * Pre-processor Definitions
64 ****************************************************************************/
65
66#define AS_FEATURE_OUTPUTMIX_ENABLE
67
70#define LENGTH_INIT_OUTPUTMIXER 4
71
74#define LENGTH_INITMPP 5
75
78#define LENGTH_SUB_SETMPP_COMMON 4
79
82#define LENGTH_SUB_SETMPP_XLOUD 4
83
86#define AS_POSTPROC_FILE_PATH_LEN (AS_AUDIO_DSP_PATH_LEN)
87
88#define PF_COMMAND_PACKET_SIZE_MAX (32)
89
90/****************************************************************************
91 * Public Types
92 ****************************************************************************/
94{
98
102};
103
105{
109
113
117
118 OutputMixDeviceNum
119};
120
123{
127
131
135
136 OutputMixerTypeNum
137};
138
142{
146
150};
151
154{
158
162
166
170
174
178
179 OutputMixDoneCmdTypeNum
180};
181
184typedef enum
185{
189
193
198
202{
206
210
211 AsPostprocTypeInvalid = 0xff,
212};
213
216typedef struct
217{
220 uint8_t mixer;
221
224 uint8_t mng;
225
231 uint8_t render_path1_filter_dsp;
232
234
237typedef struct
238{
244 MemMgrLite::PoolId render_path1_filter_pcm;
245
251 MemMgrLite::PoolId render_path1_filter_dsp;
252
254
255typedef struct
256{
262 uint8_t render_path1_filter_pcm;
263
269 uint8_t render_path1_filter_dsp;
270
272
275typedef struct
276{
280
284
286
287typedef struct
288{
292
296
298
302{
306
310
313 bool result;
314
317 uint32_t ecode;
318};
319
320typedef void (*OutputMixerCallback)(MsgQueId requester_dtq, MsgType msgtype, AsOutputMixDoneParam *param);
321typedef void (*OutputMixerErrorCallback)(uint8_t handle);
322
323typedef struct
324{
331
337 uint8_t mixer_type;
338
344 uint8_t post_enable;
345
348 OutputMixerCallback cb;
349
352 OutputMixerErrorCallback error_cb;
353
355
358typedef struct
359{
363
367
369
372typedef struct
373{
374 uint8_t reserve;
375
377
380typedef struct
381{
384 uint8_t handle;
385
388 PcmProcDoneCallback callback;
389
393
395
398typedef struct
399{
402 int8_t direction;
403
406 uint32_t times;
407
409
412typedef struct
413{
416 uint8_t cmd_type;
417
420 uint8_t *addr;
421
424 uint32_t size;
425
427
429
432typedef struct
433{
434 uint8_t handle;
435
436 union
437 {
438 AsActivateOutputMixer act_param;
439 AsInitOutputMixer init_param;
440 AsDeactivateOutputMixer deact_param;
441 AsFrameTermFineControl fterm_param;
442 AsInitPostProc initpp_param;
443 AsSetPostProc setpp_param;
444 };
446
447/****************************************************************************
448 * Public Data
449 ****************************************************************************/
450
451/****************************************************************************
452 * Inline Functions
453 ****************************************************************************/
454
455/****************************************************************************
456 * Public Function Prototypes
457 ****************************************************************************/
458
470 AudioAttentionCb attcb);
471
473 AudioAttentionCb attcb);
474
475__attribute__((deprecated(
476 "\n \
477 \n Deprecated create API is used. \
478 \n Use \"AS_CreateOutputMixer(AsCreateOutputMixParam_t * \
479 \n AudioAttentionCb)\". \
480 \n \
481 \n")))
483
485
495bool AS_ActivateOutputMixer(uint8_t handle, FAR AsActivateOutputMixer *actparam);
496
506bool AS_InitOutputMixer(uint8_t handle, FAR AsInitOutputMixer *initparam);
507
518
528bool AS_FrameTermFineControlOutputMixer(uint8_t handle, FAR AsFrameTermFineControl *ftermparam);
529
539bool AS_InitPostprocOutputMixer(uint8_t handle, FAR AsInitPostProc *initppparam);
540
550bool AS_SetPostprocOutputMixer(uint8_t handle, FAR AsSetPostProc *setppparam);
551
561bool AS_DeactivateOutputMixer(uint8_t handle, FAR AsDeactivateOutputMixer *deactparam);
562
571
580
581#endif /* __MODULES_INCLUDE_AUDIO_AUDIO_OUTPUTMIX_API_H */
Memory Handler API.
CXD5602 Audio Common Definitions.
__attribute__((deprecated("\nDeprecated attention callback type is used. \ \nPlease use \"AudioAttentionCb\" as callback type. \ \n"))) int AS_CreateAudioManager(AudioSubSystemIDs ids
Activate AudioSubSystem[Deprecated] This API is to make it compatible with old application....
void(* AudioAttentionCb)(const ErrorAttentionParam *attparam)
Definition: audio_common_defs.h:810
AsOutputMixerHandle
Definition: audio_outputmix_api.h:94
AsOutputMixerType
Definition: audio_outputmix_api.h:123
AsOutputMixDevice
Definition: audio_outputmix_api.h:105
bool AS_InitOutputMixer(uint8_t handle, FAR AsInitOutputMixer *initparam)
Init audio output mixer.
#define AS_POSTPROC_FILE_PATH_LEN
Length of Recognizer dsp file name and path.
Definition: audio_outputmix_api.h:86
bool AS_FrameTermFineControlOutputMixer(uint8_t handle, FAR AsFrameTermFineControl *ftermparam)
Set clock recovery parameters.
AsClkRecoveryDirection
Definition: audio_outputmix_api.h:185
bool AS_DeleteOutputMix(void)
Delete output mixer.
bool AS_SetPostprocOutputMixer(uint8_t handle, FAR AsSetPostProc *setppparam)
Set parameters Postproces DSP.
bool AS_DeactivateOutputMixer(uint8_t handle, FAR AsDeactivateOutputMixer *deactparam)
Deactivate audio output mixer.
bool AS_InitPostprocOutputMixer(uint8_t handle, FAR AsInitPostProc *initppparam)
Init Postproces DSP.
AsPostprocType
Definition: audio_outputmix_api.h:202
bool AS_ActivateOutputMixer(uint8_t handle, FAR AsActivateOutputMixer *actparam)
Activate audio output mixer.
AsOutputMixDoneCmdType
Definition: audio_outputmix_api.h:154
bool AS_CreateOutputMixer(FAR AsCreateOutputMixParam_t *param, AudioAttentionCb attcb)
Create audio output mixer.
bool AS_checkAvailabilityOutputMixer(void)
Check availability of OutputMixer.
AsOutputMixerPostFilter
Definition: audio_outputmix_api.h:142
bool AS_SendDataOutputMixer(FAR AsSendDataOutputMixer *sendparam)
Send audio data via outputmixer.
@ OutputMixer0
OutputMixer No.0.
Definition: audio_outputmix_api.h:97
@ OutputMixer1
OutputMixer No.1.
Definition: audio_outputmix_api.h:101
@ MainSoundEffectMix
Main & SoundEffet.
Definition: audio_outputmix_api.h:134
@ MainOnly
Main.
Definition: audio_outputmix_api.h:126
@ SoundEffectOnly
SoundEffet.
Definition: audio_outputmix_api.h:130
@ A2dpSrcOutputDevice
A2DP out.
Definition: audio_outputmix_api.h:116
@ I2SOutputDevice
I2S out.
Definition: audio_outputmix_api.h:112
@ HPOutputDevice
Speaker out.
Definition: audio_outputmix_api.h:108
@ OutputMixNoAdjust
No adjust.
Definition: audio_outputmix_api.h:192
@ OutputMixAdvance
Adjust to the + direction.
Definition: audio_outputmix_api.h:188
@ OutputMixDelay
Adjust to the - direction.
Definition: audio_outputmix_api.h:196
@ AsPostprocTypeThrough
Definition: audio_outputmix_api.h:205
@ AsPostprocTypeUserCustom
Definition: audio_outputmix_api.h:209
@ OutputMixSetPostDone
Set Postproc command done.
Definition: audio_outputmix_api.h:177
@ OutputMixInitPostDone
Init Postproc command done.
Definition: audio_outputmix_api.h:173
@ OutputMixDeactDone
Deactivation done.
Definition: audio_outputmix_api.h:165
@ OutputMixInitDone
Init done.
Definition: audio_outputmix_api.h:161
@ OutputMixSetClkRcvDone
Set Clock recovery done.
Definition: audio_outputmix_api.h:169
@ OutputMixActDone
Activation done.
Definition: audio_outputmix_api.h:157
@ PostFilterDisable
Definition: audio_outputmix_api.h:145
@ PostFilterEnable
Definition: audio_outputmix_api.h:149
Definition: audio_outputmix_api.h:324
uint8_t output_device
[in] Output device type
Definition: audio_outputmix_api.h:330
uint8_t post_enable
[in] Enable postfilter
Definition: audio_outputmix_api.h:344
uint8_t mixer_type
[in] Mixer typ
Definition: audio_outputmix_api.h:337
Definition: audio_outputmix_api.h:276
AsOutputMixMsgQueId_t msgq_id
[in] ID for sending messages to each function
Definition: audio_outputmix_api.h:279
AsOutputMixPoolId_old_t pool_id
[in] ID of memory pool for processing data
Definition: audio_outputmix_api.h:283
Definition: audio_outputmix_api.h:288
AsOutputMixMsgQueId_t msgq_id
[in] ID for sending messages to each function
Definition: audio_outputmix_api.h:291
AsOutputMixPoolId_t pool_id
[in] ID of memory pool for processing data
Definition: audio_outputmix_api.h:295
Definition: audio_outputmix_api.h:373
Definition: audio_outputmix_api.h:399
int8_t direction
[in] Recovery direction (advance or delay)
Definition: audio_outputmix_api.h:402
uint32_t times
[in] Recovery term
Definition: audio_outputmix_api.h:406
Definition: audio_outputmix_api.h:359
uint8_t postproc_type
[in] Set postproc type. Use AsPostprocType enum type
Definition: audio_outputmix_api.h:362
Definition: audio_outputmix_api.h:413
uint8_t cmd_type
Definition: audio_outputmix_api.h:416
uint8_t * addr
Definition: audio_outputmix_api.h:420
uint32_t size
Definition: audio_outputmix_api.h:424
Definition: audio_outputmix_api.h:302
int handle
Definition: audio_outputmix_api.h:305
bool result
Definition: audio_outputmix_api.h:313
uint32_t ecode
Definition: audio_outputmix_api.h:317
AsOutputMixDoneCmdType done_type
Definition: audio_outputmix_api.h:309
Definition: audio_outputmix_api.h:217
uint8_t mng
[in] Message queue id of audio_manager
Definition: audio_outputmix_api.h:224
uint8_t mixer
[in] Message queue id of output mixer
Definition: audio_outputmix_api.h:220
uint8_t render_path0_filter_dsp
[in] Message queue id of dsp Effective only when use postfilter
Definition: audio_outputmix_api.h:230
Definition: audio_outputmix_api.h:256
uint8_t render_path0_filter_pcm
[in] Memory pool id of pcm data Effective only when use postfilter
Definition: audio_outputmix_api.h:261
uint8_t render_path0_filter_dsp
[in] Memory pool id of dsp command data Effective only when use postfilter
Definition: audio_outputmix_api.h:268
Definition: audio_outputmix_api.h:238
MemMgrLite::PoolId render_path0_filter_pcm
[in] Memory pool id of pcm data Effective only when use postfilter
Definition: audio_outputmix_api.h:243
MemMgrLite::PoolId render_path0_filter_dsp
[in] Memory pool id of dsp command data Effective only when use postfilter
Definition: audio_outputmix_api.h:250
Definition: audio_common_defs.h:703
Definition: audio_outputmix_api.h:381
uint8_t handle
[in] Handle of OutputMixer
Definition: audio_outputmix_api.h:384
AsPcmDataParam pcm
[in] PCM data parameter
Definition: audio_outputmix_api.h:392
Definition: MemMgrTypes.h:88
Definition: audio_outputmix_api.h:433