Skip to content

Commit

Permalink
Bluetooth: Change Sampling Frequency to 48 kHz
Browse files Browse the repository at this point in the history
Change Default Sampling Frequency to 48 kHz by default to
match Audio Source.
CRs-fixed: 436686
Change-Id: I0a4aa9ca61964e76220c77fa60c281f7a5df58b4
  • Loading branch information
Sunny Kapdi authored and Mallikarjuna GB committed Jan 23, 2013
1 parent 32ae0f0 commit 48597f9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion 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.
Expand Down Expand Up @@ -35,7 +36,7 @@
#define A2DP_CTRL_PATH "/data/misc/bluedroid/.a2dp_ctrl"
#define A2DP_DATA_PATH "/data/misc/bluedroid/.a2dp_data"

#define AUDIO_STREAM_DEFAULT_RATE 44100
#define AUDIO_STREAM_DEFAULT_RATE 48000
#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)
Expand Down
5 changes: 3 additions & 2 deletions 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.
Expand Down Expand Up @@ -69,7 +70,7 @@ 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 =
{
(A2D_SBC_IE_SAMP_FREQ_44), /* samp_freq */
(A2D_SBC_IE_SAMP_FREQ_48), /* samp_freq */
(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 */
Expand All @@ -79,7 +80,7 @@ const tA2D_SBC_CIE bta_av_co_sbc_caps =
};

#if !defined(BTIF_AV_SBC_DEFAULT_SAMP_FREQ)
#define BTIF_AV_SBC_DEFAULT_SAMP_FREQ A2D_SBC_IE_SAMP_FREQ_44
#define BTIF_AV_SBC_DEFAULT_SAMP_FREQ A2D_SBC_IE_SAMP_FREQ_48
#endif

/* Default SBC codec configuration */
Expand Down
5 changes: 3 additions & 2 deletions 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.
Expand Down Expand Up @@ -764,8 +765,8 @@ void btif_a2dp_setup_codec(void)

GKI_disable();

/* for now hardcode 44.1 khz 16 bit stereo */
media_feeding.cfg.pcm.sampling_freq = 44100;
/* for now hardcode 48 khz 16 bit stereo */
media_feeding.cfg.pcm.sampling_freq = 48000;
media_feeding.cfg.pcm.bit_per_sample = 16;
media_feeding.cfg.pcm.num_channel = 2;
media_feeding.format = BTIF_AV_CODEC_PCM;
Expand Down

0 comments on commit 48597f9

Please sign in to comment.