From fb94e2d27f48ad0bb6e97e7697fa4427625107d0 Mon Sep 17 00:00:00 2001 From: UK KIM Date: Tue, 31 Aug 2010 09:13:09 -0700 Subject: LIBAUDIO: use libaudio of lsi, alsa-lib, alsa-utils, not generic lib. disable BOARD_USES_GENERIC_AUDIO feature modified libaudio, alsa-lib, alsa-utils to build according to crespo's source tree. Change-Id: I3f8b57e60c1ddd691ab9d85a161705a833155e4e --- BoardConfig.mk | 2 +- alsa-lib/include/alsa | 0 alsa-utils/Android.mk | 6 +-- libaudio/Android.mk | 3 +- libaudio/AudioHardwareALSA.h | 2 +- libaudio/secril-client.h | 124 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 130 insertions(+), 7 deletions(-) mode change 100644 => 120000 alsa-lib/include/alsa create mode 100755 libaudio/secril-client.h diff --git a/BoardConfig.mk b/BoardConfig.mk index 788131e..d699202 100755 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -42,7 +42,7 @@ ARCH_ARM_HAVE_TLS_REGISTER := true # Enable JIT WITH_JIT := true -BOARD_USES_GENERIC_AUDIO := true +BOARD_USES_GENERIC_AUDIO := false ifeq ($(BOARD_USES_GENERIC_AUDIO),false) BOARD_USES_ALSA_AUDIO := true BUILD_WITH_ALSA_UTILS := true diff --git a/alsa-lib/include/alsa b/alsa-lib/include/alsa deleted file mode 100644 index 945c9b4..0000000 --- a/alsa-lib/include/alsa +++ /dev/null @@ -1 +0,0 @@ -. \ No newline at end of file diff --git a/alsa-lib/include/alsa b/alsa-lib/include/alsa new file mode 120000 index 0000000..945c9b4 --- /dev/null +++ b/alsa-lib/include/alsa @@ -0,0 +1 @@ +. \ No newline at end of file diff --git a/alsa-utils/Android.mk b/alsa-utils/Android.mk index 54e055e..2609fc1 100644 --- a/alsa-utils/Android.mk +++ b/alsa-utils/Android.mk @@ -19,7 +19,7 @@ LOCAL_CFLAGS := \ LOCAL_C_INCLUDES:= \ $(LOCAL_PATH)/include \ $(LOCAL_PATH)/android \ - external/alsa-lib/include + device/samsung/crespo/alsa-lib/include LOCAL_SRC_FILES := \ aplay/aplay.c @@ -48,7 +48,7 @@ LOCAL_CFLAGS := \ LOCAL_C_INCLUDES:= \ $(LOCAL_PATH)/include \ $(LOCAL_PATH)/android \ - external/alsa-lib/include + device/samsung/crespo/alsa-lib/include LOCAL_SRC_FILES := \ alsactl/alsactl.c \ @@ -80,7 +80,7 @@ LOCAL_CFLAGS := \ LOCAL_C_INCLUDES:= \ $(LOCAL_PATH)/include \ $(LOCAL_PATH)/android \ - external/alsa-lib/include + device/samsung/crespo/alsa-lib/include LOCAL_SRC_FILES := \ amixer/amixer.c diff --git a/libaudio/Android.mk b/libaudio/Android.mk index efe16f2..70908dd 100644 --- a/libaudio/Android.mk +++ b/libaudio/Android.mk @@ -32,8 +32,7 @@ ifeq ($(TARGET_BOARD_PLATFORM),s5pc100) LOCAL_CFLAGS += -DSLSI_S5PC100 endif - LOCAL_C_INCLUDES += external/alsa-lib/include - + LOCAL_C_INCLUDES += device/samsung/crespo/alsa-lib/include LOCAL_SRC_FILES := AudioHardwareALSA.cpp LOCAL_MODULE := libaudio diff --git a/libaudio/AudioHardwareALSA.h b/libaudio/AudioHardwareALSA.h index 690b4db..9774f88 100644 --- a/libaudio/AudioHardwareALSA.h +++ b/libaudio/AudioHardwareALSA.h @@ -28,7 +28,7 @@ #include // sangsu fix : headers for IPC -#include "../libsecril-client/secril-client.h" +#include "secril-client.h" // sangsu fix : defines for IPC #define OEM_FUNCTION_ID_SOUND 0x08 // sound Main Cmd diff --git a/libaudio/secril-client.h b/libaudio/secril-client.h new file mode 100755 index 0000000..d301566 --- /dev/null +++ b/libaudio/secril-client.h @@ -0,0 +1,124 @@ +/** + * @file secril-client.h + * + * @author Myeongcheol Kim (mcmount.kim@samsung.com) + * + * @brief RIL client library for multi-client support + */ + +#ifndef __SECRIL_CLIENT_H__ +#define __SECRIL_CLIENT_H__ + +#include + + +#ifdef __cplusplus +extern "C" +{ +#endif + +struct RilClient +{ + void *prv; +}; + +typedef struct RilClient * HRilClient; + + +//--------------------------------------------------------------------------- +// Defines +//--------------------------------------------------------------------------- +#define RIL_CLIENT_ERR_SUCCESS 0 +#define RIL_CLIENT_ERR_AGAIN 1 +#define RIL_CLIENT_ERR_INIT 2 // Client is not initialized +#define RIL_CLIENT_ERR_INVAL 3 // Invalid value +#define RIL_CLIENT_ERR_CONNECT 4 // Connection error +#define RIL_CLIENT_ERR_IO 5 // IO error +#define RIL_CLIENT_ERR_RESOURCE 6 // Resource not available +#define RIL_CLIENT_ERR_UNKNOWN 7 + + +//--------------------------------------------------------------------------- +// Type definitions +//--------------------------------------------------------------------------- + +typedef int (*RilOnComplete)(HRilClient handle, const void *data, size_t datalen); + +typedef int (*RilOnUnsolicited)(HRilClient handle, const void *data, size_t datalen); + +typedef int (*RilOnError)(void *data, int error); + + +//--------------------------------------------------------------------------- +// Client APIs +//--------------------------------------------------------------------------- + +/** + * Open RILD multi-client. + * Return is client handle, NULL on error. + */ +HRilClient OpenClient_RILD(void); + +/** + * Stop RILD multi-client. If client socket was connected, + * it will be disconnected. + */ +int CloseClient_RILD(HRilClient client); + +/** + * Connect to RIL deamon. One client task starts. + * Return is 0 or error code. + */ +int Connect_RILD(HRilClient client); + +/** + * check whether RILD is connected + * Returns 0 or 1 + */ +int isConnected_RILD(HRilClient client); + +/** + * Disconnect connection to RIL deamon(socket close). + * Return is 0 or error code. + */ +int Disconnect_RILD(HRilClient client); + +/** + * Register unsolicited response handler. If handler is NULL, + * the handler for the request ID is unregistered. + * The response handler is invoked in the client task context. + * Return is 0 or error code. + */ +int RegisterUnsolicitedHandler(HRilClient client, uint32_t id, RilOnUnsolicited handler); + +/** + * Register solicited response handler. If handler is NULL, + * the handler for the ID is unregistered. + * The response handler is invoked in the client task context. + * Return is 0 or error code. + */ +int RegisterRequestCompleteHandler(HRilClient client, uint32_t id, RilOnComplete handler); + + +/** + * Register error callback. If handler is NULL, + * the callback is unregistered. + * The response handler is invoked in the client task context. + * Return is 0 or error code. + */ +int RegisterErrorCallback(HRilClient client, RilOnError cb, void *data); + +/** + * Invoke OEM request. Request ID is RIL_REQUEST_OEM_HOOK_RAW. + * Return is 0 or error code. For RIL_CLIENT_ERR_AGAIN caller should retry. + */ +int InvokeOemRequestHookRaw(HRilClient client, char *data, size_t len); + +#ifdef __cplusplus +}; +#endif + +#endif // __SECRIL_CLIENT_H__ + +// end of file + -- cgit v1.1