summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--IMPORTANT_LICENSE50
-rw-r--r--audio_a2dp_hw/Android.mk6
-rw-r--r--audio_a2dp_hw/audio_a2dp_hw.h5
-rw-r--r--btif/co/bta_av_co.c9
-rwxr-xr-xbtif/src/btif_media_task.c7
-rw-r--r--main/Android.mk6
6 files changed, 82 insertions, 1 deletions
diff --git a/IMPORTANT_LICENSE b/IMPORTANT_LICENSE
new file mode 100644
index 0000000..0978a09
--- /dev/null
+++ b/IMPORTANT_LICENSE
@@ -0,0 +1,50 @@
+
+Copyright (C) 1999-2012 Broadcom Corporation
+
+This license applies to all underlying Broadcom proprietary code and all
+changes thereto committed to the AOSP on or before the
+commit f80d3d045eab5f002be4b5e8a3d2d376fdf7581a ("Proprietary Files").
+
+In addition, this license applies to all Broadcom proprietary code that is NOT
+governed by the Apache License, Version 2.0, unless you originally licensed
+such Broadcom proprietary code under a license from Broadcom ("Broadcom SLA").
+If you have a Broadcom SLA, the terms and conditions of such SLA will continue
+to govern your use of the Broadcom proprietary code, including without
+limitation, the Proprietary Files.
+
+These Proprietary Files are the proprietary software of Broadcom Corporation
+and/or its licensors, and may only be duplicated or distributed (through
+multiple tiers) for internal evaluation purposes ("Authorized License"). Any
+commercial redistribution of the Proprietary Files is strictly prohibited.
+
+Except as set forth in this Authorized License, Broadcom grants no license
+(express or implied), right to use, or waiver of any kind with respect to the
+Authorized Files, and Broadcom expressly reserves all rights in and to the
+Authorized Files and all intellectual property rights therein.
+
+Except as expressly set forth in the Authorized License,
+
+1. These Proprietary Files, including its structure, sequence and organization,
+ constitutes the valuable trade secrets of Broadcom, and you shall use all
+ reasonable efforts to protect the confidentiality thereof, and to use this
+ information only for internal evaluation purposes.
+
+2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THESE PROPRIETARY FILES ARE PROVIDED
+ "AS IS" AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, REPRESENTATIONS
+ OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH
+ RESPECT TO THE PROPRIETARY FILES. BROADCOM SPECIFICALLY DISCLAIMS ANY AND
+ ALL IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS
+ FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET
+ ENJOYMENT, QUIET POSSESSION OR CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE
+ ENTIRE RISK ARISING OUT OF YOUR USE OF THE PROPRIETARY FILES UNDER THE
+ AUTHORIZED LICENSE. IF YOU VIOLATE THE AUTHORIZED LICENSE, THIS LICENSE WILL
+ BE IMMEDIATELY RESCINDED AND TERMINATED.
+
+3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR ITS
+ LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, OR
+ EXEMPLARY DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO YOUR
+ USE OF OR INABILITY TO USE THE PROPRIETARY FILES EVEN IF BROADCOM HAS BEEN
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS OF
+ THE AMOUNT ACTUALLY PAID FOR THE PROPRIETARY FILES ITSELF OR U.S. $1,
+ WHICHEVER IS GREATER. THESE LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY
+ FAILURE OF ESSENTIAL PURPOSE OF ANY LIMITED REMEDY.
diff --git a/audio_a2dp_hw/Android.mk b/audio_a2dp_hw/Android.mk
index d98e4bb..bf00342 100644
--- a/audio_a2dp_hw/Android.mk
+++ b/audio_a2dp_hw/Android.mk
@@ -2,6 +2,12 @@ LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
+ifeq ($(BOARD_USES_ALSA_AUDIO),true)
+ifeq ($(TARGET_QCOM_AUDIO_VARIANT),caf)
+ LOCAL_CFLAGS += -DSAMPLE_RATE_48K
+endif
+endif
+
LOCAL_SRC_FILES:= \
audio_a2dp_hw.c
diff --git a/audio_a2dp_hw/audio_a2dp_hw.h b/audio_a2dp_hw/audio_a2dp_hw.h
index 2015591..3076a6d 100644
--- a/audio_a2dp_hw/audio_a2dp_hw.h
+++ b/audio_a2dp_hw/audio_a2dp_hw.h
@@ -1,6 +1,7 @@
/******************************************************************************
*
* Copyright (C) 2009-2012 Broadcom Corporation
+ * Copyright (c) 2013, Linux Foundation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,7 +36,11 @@
#define A2DP_CTRL_PATH "/data/misc/bluedroid/.a2dp_ctrl"
#define A2DP_DATA_PATH "/data/misc/bluedroid/.a2dp_data"
+#ifdef SAMPLE_RATE_48K
+#define AUDIO_STREAM_DEFAULT_RATE 48000
+#else
#define AUDIO_STREAM_DEFAULT_RATE 44100
+#endif
#define AUDIO_STREAM_DEFAULT_FORMAT AUDIO_FORMAT_PCM_16_BIT
#define AUDIO_STREAM_DEFAULT_CHANNEL_FLAG AUDIO_CHANNEL_OUT_STEREO
#define AUDIO_STREAM_OUTPUT_BUFFER_SZ (20*512)
diff --git a/btif/co/bta_av_co.c b/btif/co/bta_av_co.c
index 6089532..98f3708 100644
--- a/btif/co/bta_av_co.c
+++ b/btif/co/bta_av_co.c
@@ -1,6 +1,7 @@
/******************************************************************************
*
* Copyright (C) 2004-2012 Broadcom Corporation
+ * Copyright (c) 2013, Linux Foundation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -69,7 +70,11 @@ const UINT8 bta_av_co_cp_scmst[BTA_AV_CP_INFO_LEN] = "\x02\x02\x00";
/* SBC codec capabilities */
const tA2D_SBC_CIE bta_av_co_sbc_caps =
{
+#ifdef SAMPLE_RATE_48K
+ (A2D_SBC_IE_SAMP_FREQ_48), /* samp_freq */
+#else
(A2D_SBC_IE_SAMP_FREQ_44), /* samp_freq */
+#endif
(A2D_SBC_IE_CH_MD_MONO | A2D_SBC_IE_CH_MD_STEREO | A2D_SBC_IE_CH_MD_JOINT | A2D_SBC_IE_CH_MD_DUAL), /* ch_mode */
(A2D_SBC_IE_BLOCKS_16 | A2D_SBC_IE_BLOCKS_12 | A2D_SBC_IE_BLOCKS_8 | A2D_SBC_IE_BLOCKS_4), /* block_len */
(A2D_SBC_IE_SUBBAND_4 | A2D_SBC_IE_SUBBAND_8), /* num_subbands */
@@ -79,8 +84,12 @@ const tA2D_SBC_CIE bta_av_co_sbc_caps =
};
#if !defined(BTIF_AV_SBC_DEFAULT_SAMP_FREQ)
+#ifdef SAMPLE_RATE_48K
+#define BTIF_AV_SBC_DEFAULT_SAMP_FREQ A2D_SBC_IE_SAMP_FREQ_48
+#else
#define BTIF_AV_SBC_DEFAULT_SAMP_FREQ A2D_SBC_IE_SAMP_FREQ_44
#endif
+#endif
/* Default SBC codec configuration */
const tA2D_SBC_CIE btif_av_sbc_default_config =
diff --git a/btif/src/btif_media_task.c b/btif/src/btif_media_task.c
index 8978cf6..bda0d9f 100755
--- a/btif/src/btif_media_task.c
+++ b/btif/src/btif_media_task.c
@@ -1,6 +1,7 @@
/******************************************************************************
*
* Copyright (C) 2009-2012 Broadcom Corporation
+ * Copyright (c) 2013, Linux Foundation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -764,8 +765,12 @@ void btif_a2dp_setup_codec(void)
GKI_disable();
- /* for now hardcode 44.1 khz 16 bit stereo */
+ /* for now hardcode 44/48 khz 16 bit stereo */
+#ifdef SAMPLE_RATE_48K
+ media_feeding.cfg.pcm.sampling_freq = 48000;
+#else
media_feeding.cfg.pcm.sampling_freq = 44100;
+#endif
media_feeding.cfg.pcm.bit_per_sample = 16;
media_feeding.cfg.pcm.num_channel = 2;
media_feeding.format = BTIF_AV_CODEC_PCM;
diff --git a/main/Android.mk b/main/Android.mk
index 8ecb3c3..23a9783 100644
--- a/main/Android.mk
+++ b/main/Android.mk
@@ -6,6 +6,12 @@ LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
+ifeq ($(BOARD_USES_ALSA_AUDIO),true)
+ifeq ($(TARGET_QCOM_AUDIO_VARIANT),caf)
+ LOCAL_CFLAGS += -DSAMPLE_RATE_48K
+endif
+endif
+
# HAL layer
LOCAL_SRC_FILES:= \
../btif/src/bluetooth.c