1 #ifndef __ALSA_DEAMON_H__ 2 #define __ALSA_DEAMON_H__ 3 4 #include <stdint.h> 5 6 #ifdef __cplusplus 7 extern "C" { 8 #endif 9 10 #ifdef ALSA_SRC_PROCESS_EN 11 #define ALSA_SAMPLERATE AUD_SAMPRATE_48000 12 #else 13 #define ALSA_SAMPLERATE AUD_SAMPRATE_16000 14 #endif 15 16 #ifdef ALSA_STEREO_TO_MONO_EN 17 #define ALSA_CHANNELS AUD_CHANNEL_NUM_1 18 #else 19 #define ALSA_CHANNELS AUD_CHANNEL_NUM_2 20 #endif 21 22 #ifdef ALSA_24BIT_PROCESS_EN 23 #define ALSA_BITS AUD_BITS_24 24 #else 25 #define ALSA_BITS AUD_BITS_16 26 #endif 27 28 typedef enum 29 { 30 ALSA_STATE_CLOSE = 0, 31 ALSA_STATE_OPEN, 32 ALSA_STATE_START, 33 ALSA_STATE_STOP, 34 } alsa_state_t; 35 36 typedef uint32_t (*ALSA_GET_USER_DATA_CB)(uint8_t *, uint32_t); 37 typedef int (*ALSA_USER_DATA_LEN_CHANGED_CB)(uint32_t); 38 39 void alsa_deamon_init(ALSA_GET_USER_DATA_CB alsa_get_user_data_cb, ALSA_USER_DATA_LEN_CHANGED_CB alsa_user_data_len_changed_cb); 40 41 int alsa_open_for_user(uint8_t user_id); 42 int alsa_start_for_user(uint8_t user_id); 43 int alsa_stop_for_user(uint8_t user_id); 44 int alsa_close_for_user(uint8_t user_id); 45 46 int alsa_check_only_ultra_playing(void); 47 int alsa_modify_adc_gain_for_ultra(uint8_t only_ultra_playing); 48 49 #ifdef __cplusplus 50 } 51 #endif 52 53 #endif /* __ALSA_DEAMON_H__ */