tizen beta release
[profile/ivi/avsystem.git] / include / avsys-audio.h
1 /*
2  * avsystem
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Jonghyuk Choi <jhchoi.choi@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22 #ifndef __AVSYS_AUDIO_H__
23 #define __AVSYS_AUDIO_H__
24
25 #include "avsys-types.h"
26 #include "avsys-error.h"
27
28 #ifdef __cplusplus
29         extern "C" {
30 #endif
31
32 /**
33         @addtogroup AVSYSTEM
34         @{
35
36         @par
37         This part describes the interface with audio input/output.
38  */
39
40 #define AVSYS_AUDIO_VOLUME_MAX_MULTIMEDIA       16
41 #define AVSYS_AUDIO_VOLUME_MAX_BASIC            8
42 #define AVSYS_AUDIO_VOLUME_MAX_SINGLE           1
43
44 /**
45  * Enumerations for audio mode
46  */
47 enum avsys_audio_mode_t {
48         AVSYS_AUDIO_MODE_OUTPUT,                                /**< Output mode of handle */
49         AVSYS_AUDIO_MODE_OUTPUT_CLOCK,                  /**< Output mode of gst audio only mode */
50         AVSYS_AUDIO_MODE_OUTPUT_VIDEO,                  /**< Output mode of gst video mode */
51         AVSYS_AUDIO_MODE_OUTPUT_LOW_LATENCY,    /**< Output mode for low latency play mode. typically for game */
52         AVSYS_AUDIO_MODE_INPUT,                                 /**< Input mode of handle */
53         AVSYS_AUDIO_MODE_INPUT_HIGH_LATENCY,    /**< Input mode for high latency capture mode. */
54         AVSYS_AUDIO_MODE_INPUT_LOW_LATENCY,             /**< Input mode for low latency capture mode. typically for VoIP */
55         AVSYS_AUDIO_MODE_CALL_OUT,                              /**< for voice call establish */
56         AVSYS_AUDIO_MODE_CALL_IN,                               /**< for voice call establish */
57         AVSYS_AUDIO_MODE_OUTPUT_AP_CALL,                /**< for VT call on thin modem */
58         AVSYS_AUDIO_MODE_INPUT_AP_CALL,                 /**< for VT call on thin modem */
59         AVSYS_AUDIO_MODE_NUM,                                   /**< Number of mode */
60 };
61
62 /**
63  * Enumerations for audio format
64  */
65 enum avsys_audio_format_t {
66         AVSYS_AUDIO_FORMAT_UNKNOWN      = -1,                                   /**< Invalid audio format */
67         AVSYS_AUDIO_FORMAT_8BIT,                                                        /**< Unsigned 8Bit */
68         AVSYS_AUDIO_FORMAT_16BIT,                                                       /**< Signed 16bit Little Endian */
69         AVSYS_AUDIO_FORMAT_MIN = AVSYS_AUDIO_FORMAT_8BIT,       /**< Minimum value 8-bit integer per sample */
70         AVSYS_AUDIO_FORMAT_MAX = AVSYS_AUDIO_FORMAT_16BIT,      /**< Maximum value 16-bit integer per sample */
71 };
72
73
74 /*
75  * Enums for volume types
76  */
77 enum avsys_audio_volume_type_t {
78         AVSYS_AUDIO_VOLUME_TYPE_SYSTEM,
79         AVSYS_AUDIO_VOLUME_TYPE_NOTIFICATION,
80         AVSYS_AUDIO_VOLUME_TYPE_ALARM,
81         AVSYS_AUDIO_VOLUME_TYPE_RINGTONE,
82         AVSYS_AUDIO_VOLUME_TYPE_MEDIA,
83         AVSYS_AUDIO_VOLUME_TYPE_CALL,
84         AVSYS_AUDIO_VOLUME_TYPE_FIXED,
85         AVSYS_AUDIO_VOLUME_TYPE_EXT_SYSTEM_JAVA,
86         AVSYS_AUDIO_VOLUME_TYPE_MEDIA_HL,
87         AVSYS_AUDIO_VOLUME_TYPE_NUM,
88         AVSYS_AUDIO_VOLUME_TYPE_MAX = AVSYS_AUDIO_VOLUME_TYPE_NUM,
89         AVSYS_AUDIO_VOLUME_TYPE_EXT_SYSTEM_ANDROID = AVSYS_AUDIO_VOLUME_TYPE_FIXED,
90 };
91
92 enum avsys_audio_priority_t {
93         AVSYS_AUDIO_PRIORITY_0 = 0,     /*< deprecated. use AVSYS_AUDIO_PRIORITY_NORMAL or AVSYS_AUDIO_PRIORITY_SOLO instead */
94         AVSYS_AUDIO_PRIORITY_NORMAL = AVSYS_AUDIO_PRIORITY_0,
95         AVSYS_AUDIO_PRIORITY_SOLO,
96         AVSYS_AUDIO_PRIORITY_SOLO_WITH_TRANSITION_EFFECT,
97         AVSYS_AUDIO_PRIORITY_MAX,
98 };
99
100 enum avsys_audio_device_t {
101         AVSYS_AUDIO_DEVICE_TYPE_SPK = 0,
102         AVSYS_AUDIO_DEVICE_TYPE_RECV,
103         AVSYS_AUDIO_DEVICE_TYPE_HEADSET,
104         AVSYS_AUDIO_DEVICE_TYPE_HANDSFREE,
105         AVSYS_AUDIO_DEVICE_TYPE_BT,
106         AVSYS_AUDIO_DEVICE_TYPE_NUM,
107         AVSYS_AUDIO_DEVICE_TYPE_MAX = AVSYS_AUDIO_DEVICE_TYPE_NUM,
108 };
109
110 /**
111  * Enumerations for audio channel
112  */
113 enum avsys_audio_channel_t {
114         AVSYS_AUDIO_CHANNEL_LEFT,                       /**< front-left channel */
115         AVSYS_AUDIO_CHANNEL_RIGHT,                      /**< front-righth channel */
116         AVSYS_AUDIO_CHANNEL_NUM,                        /**< Number of channels */
117 };
118
119 /**
120  * Enumerations for audio mute condition
121  */
122 enum avsys_audio_mute_t {
123         AVSYS_AUDIO_UNMUTE = 0,                         /**< Unmute state */
124         AVSYS_AUDIO_MUTE,                                       /**< Mute state */
125         AVSYS_AUDIO_UNMUTE_NOLOCK,                      /** < Unmute without lock */
126         AVSYS_AUDIO_MUTE_NOLOCK,                        /** < Mute without lock */
127 };
128
129 /**
130  * Enumerations for priority command
131  */
132 enum avsys_audio_priority_cmd_t {
133         AVSYS_AUDIO_SET_PRIORITY = 0,           /**< Command set priority */
134         AVSYS_AUDIO_UNSET_PRIORITY,                     /**< Command unset priority */
135 };
136
137 /**
138  * Structure for sound device parameters.
139  */
140 typedef struct {
141         int             mode;                                           /**< Open mode (In/Out) */
142         int             priority;                                       /**< Priority of sound handle */
143         int             channels;                                       /**< Number of channels */
144         int             samplerate;                                     /**< Sampling rate */
145         int             format;                                         /**< Sampling format */
146         int             bluetooth;                                      /**< Handle route information. refer. avsys_audio_handle_route_t */
147         int             vol_type;                                       /**< volume type */
148         int             allow_mix;
149 } avsys_audio_param_t;
150
151
152 /**
153  * Structure for volume information.
154  */
155 typedef struct {
156         int     level[AVSYS_AUDIO_CHANNEL_NUM]; /**< Array of volume level for each channel */
157 } avsys_audio_volume_t;
158
159 /* NEW PATH DEFINE */
160  /**
161   *
162   */
163 enum avsys_audio_path_ex {
164         AVSYS_AUDIO_PATH_EX_NONE = 0,
165         AVSYS_AUDIO_PATH_EX_SPK,
166         AVSYS_AUDIO_PATH_EX_RECV,
167         AVSYS_AUDIO_PATH_EX_HEADSET,
168         AVSYS_AUDIO_PATH_EX_BTHEADSET,
169         AVSYS_AUDIO_PATH_EX_A2DP,
170         AVSYS_AUDIO_PATH_EX_HANDSFREE,
171         AVSYS_AUDIO_PATH_EX_HDMI,
172         AVSYS_AUDIO_PATH_EX_OUTMAX,
173         AVSYS_AUDIO_PATH_EX_MIC = 1,
174         AVSYS_AUDIO_PATH_EX_HEADSETMIC,
175         AVSYS_AUDIO_PATH_EX_BTMIC,
176         AVSYS_AUDIO_PATH_EX_FMINPUT,
177         AVSYS_AUDIO_PATH_EX_HANDSFREEMIC,
178         AVSYS_AUDIO_PATH_EX_INMAX,
179 };
180
181 enum avsys_audio_gain_ex {
182         AVSYS_AUDIO_GAIN_EX_KEYTONE = 0,
183         AVSYS_AUDIO_GAIN_EX_RINGTONE,
184         AVSYS_AUDIO_GAIN_EX_ALARMTONE,
185         AVSYS_AUDIO_GAIN_EX_CALLTONE,
186         AVSYS_AUDIO_GAIN_EX_AUDIOPLAYER,
187         AVSYS_AUDIO_GAIN_EX_VIDEOPLAYER,
188         AVSYS_AUDIO_GAIN_EX_VOICECALL,
189         AVSYS_AUDIO_GAIN_EX_VIDEOCALL,
190         AVSYS_AUDIO_GAIN_EX_FMRADIO,
191         AVSYS_AUDIO_GAIN_EX_VOICEREC,
192         AVSYS_AUDIO_GAIN_EX_CAMCORDER,
193         AVSYS_AUDIO_GAIN_EX_CAMERA,
194         AVSYS_AUDIO_GAIN_EX_GAME,
195         AVSYS_AUDIO_GAIN_EX_MAX,
196         AVSYS_AUDIO_GAIN_EX_PDA_PLAYBACK = AVSYS_AUDIO_GAIN_EX_KEYTONE,
197 };
198
199 typedef enum {
200         AVSYS_AUDIO_EXT_DEVICE_FMRADIO = 0,
201         AVSYS_AUDIO_EXT_DEVICE_NUM
202 }avsysaudio_ext_device_t;
203
204
205 typedef enum {
206         AVSYS_AUDIO_ROUTE_POLICY_DEFAULT,
207         AVSYS_AUDIO_ROUTE_POLICY_IGNORE_A2DP,
208         AVSYS_AUDIO_ROUTE_POLICY_HANDSET_ONLY,
209         AVSYS_AUDIO_ROUTE_POLICY_MAX,
210 }avsys_audio_route_policy_t; /* system global configuration */
211
212 enum avsys_audio_handle_route_t{
213         AVSYS_AUDIO_HANDLE_ROUTE_FOLLOWING_POLICY,
214         AVSYS_AUDIO_HANDLE_ROUTE_HANDSET_ONLY,
215 }; /* custom routing per handle */
216
217 typedef enum {
218         AVSYS_AUDIO_ROUTE_DEVICE_UNKNOWN = -1,
219         AVSYS_AUDIO_ROUTE_DEVICE_HANDSET,
220         AVSYS_AUDIO_ROUTE_DEVICE_BLUETOOTH,
221         AVSYS_AUDIO_ROUTE_DEVICE_EARPHONE,
222         AVSYS_AUDIO_ROUTE_DEVICE_NUM,
223 }avsys_audio_playing_devcie_t;/* routing device */
224
225 /* path option */
226 #define AVSYS_AUDIO_PATH_OPTION_NONE                    0x00000000      /*!< Sound path option none */
227 #define AVSYS_AUDIO_PATH_OPTION_JACK_AUTO               0x00000001      /*!< Sound path auto change between SPK/Recv and headset */
228 #define AVSYS_AUDIO_PATH_OPTION_DUAL_OUT                0x00000002      /*!< SPK or Recv with headset sound path. used for Ringtone or Alarm */
229 #define AVSYS_AUDIO_PATH_OPTION_LEFT_SPK_ONLY   0x00000004      /*!< AP playback left speaker only */
230 #define AVSYS_AUDIO_PATH_OPTION_RIGHT_SPK_ONLY  0x00000008      /*!< AP playback right speaker only */
231 #define AVSYS_AUDIO_PATH_OPTION_VOICECALL_REC   0x00000010      /*!< Voice call recording path option */
232 #define AVSYS_AUDIO_PATH_OPTION_USE_SUBMIC              0x00000020      /*!< Use sub-mic when call or recording */
233 #define AVSYS_AUDIO_PATH_OPTION_USE_STEREOMIC   0x00000040      /*!< Use stereo mic when recording */
234 #define AVSYS_AUDIO_PATH_OPTION_FORCED                  0x01000000      /*!< Forced sound path setting. only for booting animation */
235 #define AVSYS_AUDIO_PATH_OPTION_LEGACY_MODE             0x10000000      /*!< Now Plus Style */
236
237
238 /**
239  * This function make instance for audio system, and retreives handle.
240  *
241  * @param       param           [in]    Parameters of audio system.
242  * @param       phandle         [out]   Handle of audio system.
243  * @param       size            [out]   Recomended buffer size.
244  *
245  * @return      This function returns AVSYS_STATE_SUCCESS on success, or negative
246  *                      value with error code.
247  *                      on failure.
248  * @remark
249  * @see
250  */
251 int avsys_audio_open(avsys_audio_param_t *param, avsys_handle_t *phandle, int *size);
252
253 /**
254  * This function is to close sound handle and release allocated resources.
255  *
256  * @param       handle          [in]    Handle of audio system
257  *
258  * @return      This function returns AVSYS_STATE_SUCCESS on success, or negative
259  *                      value with error code.
260  * @remark
261  * @see
262  */
263 int avsys_audio_close(avsys_handle_t handle);
264
265 /**
266  * This function is to stop playback stream immediately. this drops all buffer remaining data.
267  *
268  * @param       handle          [in]    Playback handle of audio system
269  *
270  * @return      This function returns AVSYS_STATE_SUCCESS on success, or negative
271  *                      value with error code.
272  * @remark
273  * @see
274  */
275 int avsys_audio_flush(avsys_handle_t handle);
276
277 /**
278  * This function is to stop playback stream after all remaining buffer data played.
279  *
280  * @param       handle          [in]    Playback handle of audio system
281  *
282  * @return      This function returns AVSYS_STATE_SUCCESS on success, or negative
283  *                      value with error code.
284  * @remark
285  * @see
286  */
287 int avsys_audio_drain(avsys_handle_t handle);
288
289 /**
290  * This function is turn on speaker amp.
291  *
292  *
293  * @return      This function returns AVSYS_STATE_SUCCESS on success, or negative
294  *                      value with error code.
295  * @remark
296  * @see
297  */
298 int avsys_audio_ampon(void) __attribute__((deprecated));
299
300 /**
301  * This function is turn off speaker amp.
302  *
303  * @return      This function returns AVSYS_STATE_SUCCESS on success, or negative
304  *                      value with error code.
305  * @remark
306  * @see
307  */
308 int avsys_audio_ampoff(void) __attribute__((deprecated));
309
310 /**
311  * This function is to read pcm data from sound handle.
312  *
313  * @param       handle          [in]    Handle of audio system
314  * @param       buf                     [in]    Buffer of audio data to read
315  * @param       size            [in]    Size of buffer
316  *
317  * @return      This function returns number of bytes read, or negative value with
318  *                      error code on failure.
319  * @remark
320  * @see
321  */
322 int avsys_audio_read(avsys_handle_t handle, void *buf, int size);
323
324 /**
325  * This function is to write audio data to sound handle.
326  *
327  * @param       handle          [in]    Handle of audio system
328  * @param       buf                     [in]    Buffer of audio data to write
329  * @param       size            [in]    Size of buffer
330  *
331  * @return      This function returns number of bytes written, or negative value
332  *                      with error code on failure.
333  * @remark
334  * @see
335  */
336 int avsys_audio_write(avsys_handle_t handle, void *buf, int size);
337
338 int avsys_audio_set_volume_table(int gain_type, int dev_type, int step, int lv, int rv);
339 int avsys_audio_get_volume_table(int gain_type, int dev_type, int step, int *lv, int *rv);
340
341 int avsys_audio_set_volume_fadeup(avsys_handle_t handle);
342
343 /**
344  * This function is to get volume max.
345  *
346  * @param       vol_type                [in]    Type of volume table
347  * @param       max                     [out]   number of volume steps
348  *
349  * @return      This function returns AVSYS_STATE_SUCCESS on success, or negative
350  *                      value with error code.
351  * @remark
352  * @see
353  */
354 int avsys_audio_get_volume_max_ex(int volume_table, int *max_step);
355
356 /**
357  * This function is to set relative mute of sound handle.
358  *
359  * @param       handle          [in]    Handle of audio system
360  * @param       mute            [in]    Mute information to set
361  *
362  * @return      This function returns AVSYS_STATE_SUCCESS on success, or negative
363  *                      value with error code.
364  * @remark
365  *  mute is AVSYS_AUDIO_MUTE : mute
366  *  mute is AVSYS_AUDIO_UNMUTE : unmute
367  * @see
368  */
369 int avsys_audio_set_mute(avsys_handle_t handle, int mute);
370
371
372 /**
373  * This function is to set mute of sound handle with fade out effect.
374  *
375  * @param       handle          [in]    Handle of audio system
376  *
377  * @return      This function returns AVSYS_STATE_SUCCESS on success, or negative
378  *                      value with error code.
379  * @remark
380  * @see
381  */
382 int avsys_audio_set_mute_fadedown(avsys_handle_t handle);
383
384 /**
385  * This function is to get relative mute of sound handle.
386  *
387  * @param       handle          [in]    Handle of audio system
388  * @param       pmute           [out] Pointer to mute information to retrieve
389  *
390  * @return      This function returns AVSYS_STATE_SUCCESS on success, or negative
391  *                      value with error code.
392  * @remark
393  *  pmute is AVSYS_AUDIO_MUTE : mute
394  *  pmute is AVSYS_AUDIO_UNMUTE : unmute
395  * @see avsys_audio_mute_t
396  */
397 int avsys_audio_get_mute(avsys_handle_t handle, int* pmute);
398
399
400 /**
401  * This function is to set amp on external device
402  *
403  * @param       device          [in]    External audio device type
404  *
405  * @return      This function returns AVSYS_STATE_SUCCESS on success, or negative
406  *                      value with error code.
407  * @remark
408  *  mute is AVSYS_AUDIO_MUTE : mute
409  *  mute is AVSYS_AUDIO_UNMUTE : unmute
410  * @see avsysaudio_ext_device_t
411  */
412 int avsys_audio_ext_device_ampon(avsysaudio_ext_device_t device);
413
414 /**
415  * This function is to set amp off external device
416  *
417  * @param       device          [in]    External audio device type
418  *
419  * @return      This function returns AVSYS_STATE_SUCCESS on success, or negative
420  *                      value with error code.
421  * @remark
422  *  pmute is AVSYS_AUDIO_MUTE : mute
423  *  pmute is AVSYS_AUDIO_UNMUTE : unmute
424  * @see avsysaudio_ext_device_t
425  */
426 int avsys_audio_ext_device_ampoff(avsysaudio_ext_device_t device);
427
428 /**
429  * This function is to set status of external device
430  *
431  * @param       device          [in]    External audio device type
432  * @param       onoff           [in]    1 for on , 0 for off
433  *
434  * @return      This function returns AVSYS_STATE_SUCCESS on success, or negative
435  *                      value with error code.
436  * @remark
437  * @see avsysaudio_ext_device_t
438  */
439 int avsys_audio_set_ext_device_status(avsysaudio_ext_device_t device_type, int onoff);
440
441 /**
442  * This function is to get status of external device
443  *
444  * @param       device          [in]    External audio device type
445  * @param       onoff           [out]   1 for on , 0 for off
446  *
447  * @return      This function returns AVSYS_STATE_SUCCESS on success, or negative
448  *                      value with error code.
449  * @remark
450  * @see avsys_audio_set_ext_device_status
451  */
452 int avsys_audio_get_ext_device_status(avsysaudio_ext_device_t device_type, int *onoff);
453 /**
454  * This function is to set sound path of sound device.
455  *
456  * @param       path            [in]    value of sound gain
457  * @param       output          [in]    value of output device
458  * @param       input           [in]    value of input device
459  * @param       option          [in]    value of sound path option
460  *
461  * @return      This function returns AVSYS_STATE_SUCCESS on success, or negative
462  *                      value with error code.
463  *                      AVSYS_STATE_ERR_RANGE_OVER : input path value is invalid range
464  *                      AVSYS_STATE_ERR_INTERNAL   : internal device error
465  * @remark
466  * @see
467  */
468 int avsys_audio_set_path_ex(int gain, int out, int in, int option);
469
470 /**
471  * This function is to get sound path of sound device.
472  *
473  * @param       path            [out]   value of sound gain
474  * @param       output          [out]   value of output device
475  * @param       input           [out]   value of input device
476  * @param       option          [out]   value of sound path option
477  *
478  * @return      This function returns AVSYS_STATE_SUCCESS on success, or negative
479  *                      value with error code.
480  *                      AVSYS_STATE_ERR_INTERNAL   : internal device error
481  * @remark
482  * @see
483  */
484 int avsys_audio_get_path_ex(int *gain, int *out, int *in, int *option);
485
486 /**
487  * This function is to set relative global mute of sound device.
488  *
489  * @param       mute            [in]    Global mute information to retreive
490  *
491  * @return      This function returns AVSYS_STATE_SUCCESS on success, or negative
492  *                      value with error code.
493  * @remark
494  *  mute is avsys_audio_mute_disable : unmute
495  *  mute is avsys_audio_mute_enable  : mute
496  *  others     : ignore
497  * @see avsys_audio_mute_t
498  */
499 int avsys_audio_set_global_mute(int mute);
500
501 /**
502  * This function is to get relative global mute of sound device.
503  *
504  * @param       pmute           [out]   Pointer to global mute information to retreive
505  *
506  * @return      This function returns AVSYS_STATE_SUCCESS on success, or negative
507  *                      value with error code.
508  * @remark
509  * *pbmute is avsys_audio_mute_disable or avsys_audio_mute_enable
510  * @see
511  */
512 int avsys_audio_get_global_mute(int* pmute);
513
514 /**
515  * This function is to get number of remaining audio frames in hw buffer.
516  *
517  * @param       handle          [in]    handle to get delay frames
518  * @param       frame_delay     [out]   value of number of remaining audio frames
519  *
520  * @return      This function returns AVSYS_STATE_SUCCESS on success, or negative
521  *                      value with error code.
522  * @remark
523  * @see
524  */
525 int avsys_audio_delay(avsys_handle_t handle, int *frame_delay);
526
527 /**
528  * This function is to reset audio stream. (drops all remaining audio frames in  device buffer)
529  *
530  * @param       handle          [in]    handle to reset
531  *
532  * @return      This function returns AVSYS_STATE_SUCCESS on success, or negative
533  *                      value with error code.
534  * @remark
535  * @see
536  */
537 int avsys_audio_reset(avsys_handle_t handle);
538
539 /**
540  * This function is to get period time and buffer time of audio stream.
541  *
542  * @param       handle          [in]    handle to get period & buffer time
543  * @param       period_time     [out]   value of period time in microsecond.
544  * @param       buffer_time     [out]   value of buffer time in microsecond.
545  *
546  * @return      This function returns AVSYS_STATE_SUCCESS on success, or negative
547  *                      value with error code.
548  * @remark
549  * @see
550  */
551 int avsys_audio_get_period_buffer_time(avsys_handle_t handle, unsigned int *period_time, unsigned int *buffer_time);
552
553 /**
554  * This function is to get playback audio device information of system.
555  *
556  * @param       dev     [out]   current playback device type
557  *
558  * @return      This function returns AVSYS_STATE_SUCCESS on success, or negative
559  *                      value with error code.
560  * @remark
561  * @see         avsys_audio_playing_devcie_t
562  */
563 int avsys_audio_get_playing_device_info(avsys_audio_playing_devcie_t *dev);
564
565 /**
566  * This function is to get audio capturing status of system.
567  *
568  * @param       on_capture      [out]   capture status.
569  *                                                              zero if there is no capture instance.
570  *                                                              positive value if there is capture instance
571  *
572  * @return      This function returns AVSYS_STATE_SUCCESS on success, or negative
573  *                      value with error code.
574  * @remark
575  * @see
576  */
577 int avsys_audio_get_capture_status(int *on_capture);
578
579 int avsys_audio_earjack_manager_init(int *earjack_type, int *waitfd);
580 int avsys_audio_earjack_manager_wait(int waitfd, int *current_earjack_type, int *new_earjack_type, int *need_mute);
581 int avsys_audio_earjack_manager_process(int new_earjack_type);
582 int avsys_audio_earjack_manager_deinit(int waitfd);
583 int avsys_audio_earjack_manager_unlock(void);
584
585 int avsys_audio_set_route_policy(avsys_audio_route_policy_t route);
586 int avsys_audio_get_route_policy(avsys_audio_route_policy_t *route);
587 int avsys_audio_get_current_playing_volume_type(int *volume_type);
588 int avsys_audio_set_volume_by_type(const int volume_type, const int volume_value);
589 int avsys_audio_set_primary_volume(const int pid, const int type);
590 int avsys_audio_clear_primary_volume(const int pid);
591 int avsys_audio_hibernation_reset(int *vol);
592 /**
593         @}
594  */
595
596 #ifdef __cplusplus
597         }
598 #endif
599
600 #endif /* __AVSYS_AUDIO_H__ */