Skip to content

Commit

Permalink
audio HAL update
Browse files Browse the repository at this point in the history
Change-Id: I2d92cde04c27757326c96073cb363fe29fdac10d
  • Loading branch information
Hashcode committed Aug 30, 2012
1 parent e430b41 commit 927db53
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 37 deletions.
2 changes: 1 addition & 1 deletion audio/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := audio.primary.omap4430
LOCAL_MODULE := audio.primary.otter
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
LOCAL_SRC_FILES := audio_hw.c
LOCAL_SRC_FILES += ril_interface.c
Expand Down
35 changes: 17 additions & 18 deletions audio/audio_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,14 @@
*/

#define LOG_TAG "audio_hw_primary"
/*#define LOG_NDEBUG 0*/
#define LOG_NDEBUG 0
/*#define LOG_NDEBUG_FUNCTION*/
#ifndef LOG_NDEBUG_FUNCTION
#define LOGFUNC(...) ((void)0)
#else
#define LOGFUNC(...) (ALOGV(__VA_ARGS__))
#endif

// #ifndef OMAP_ENHANCEMENT
#if 1
/* Setting these values to zero effectively disables all the FM_RADIO
* code paths.
*/
#define AUDIO_DEVICE_OUT_FM_RADIO_TX 0
#define AUDIO_DEVICE_IN_FM_RADIO_RX 0
#define AUDIO_PARAMETER_STREAM_FM_ROUTING "fm_routing"
#define AUDIO_PARAMETER_STREAM_FM_MUTE "fm_mute"
#endif

#include <errno.h>
#include <pthread.h>
#include <stdint.h>
Expand All @@ -60,6 +49,17 @@

#include "ril_interface.h"

// #ifndef OMAP_ENHANCEMENT
#if 1
/* Setting these values to zero effectively disables all the FM_RADIO
* code paths.
*/
#define AUDIO_DEVICE_OUT_FM_RADIO_TX 0
#define AUDIO_DEVICE_IN_FM_RADIO_RX 0
#define AUDIO_PARAMETER_STREAM_FM_ROUTING "fm_routing"
#define AUDIO_PARAMETER_STREAM_FM_MUTE "fm_mute"
#endif

/* Mixer control names */
#define MIXER_DL1_EQUALIZER "DL1 Equalizer"
#define MIXER_DL2_LEFT_EQUALIZER "DL2 Left Equalizer"
Expand Down Expand Up @@ -221,10 +221,9 @@
#define DB_TO_ABE_GAIN(x) ((x) + MIXER_ABE_GAIN_0DB)
#define DB_TO_CAPTURE_PREAMPLIFIER_VOLUME(x) (((x) + 6) / 6)
#define DB_TO_CAPTURE_VOLUME(x) (((x) - 6) / 6)
#define DB_TO_HEADSET_VOLUME(x) (((x) + 30) / 2)
#define DB_TO_HEADSET_VOLUME(x) (((x) + 15) / 2) // was 30
#define DB_TO_SPEAKER_VOLUME(x) (((x) + 52) / 2)
/* FIXME-HASHCODE: lowered EARPIECE volume was originally: (((x) + 24) / 2) */
#define DB_TO_EARPIECE_VOLUME(x) (((x) + 12) / 2)
#define DB_TO_EARPIECE_VOLUME(x) (((x) + 24) / 2)

/* use-case specific mic volumes, all in dB */
#define CAPTURE_DIGITAL_MIC_VOLUME 26
Expand Down Expand Up @@ -357,7 +356,7 @@ struct route_setting defaults[] = {
},
{
.ctl_name = MIXER_EARPHONE_PLAYBACK_VOLUME,
.intval = DB_TO_EARPIECE_VOLUME(4),
.intval = DB_TO_EARPIECE_VOLUME(6),
},
{
.ctl_name = MIXER_AUDUL_VOICE_UL_VOLUME,
Expand Down Expand Up @@ -1623,9 +1622,9 @@ static void select_input_device(struct omap_audio_device *adev)
} else if(adev->board_type == OMAP4_KC1) {
/* Select front end */
ALOGE(">>> [ASoC]select_input_device:: devices==%d, headset_on==%d, main_mic_on==%d, sub_mic_on==%d\n", adev->devices, headset_on, main_mic_on, sub_mic_on);
if (main_mic_on || sub_mic_on) {
if (main_mic_on || sub_mic_on || headset_on) {
set_route_by_array(adev->mixer, mm_ul2_dmic0, 1);
hw_is_stereo_only = 1;
// hw_is_stereo_only = 1;
}

/* Select back end */
Expand Down
19 changes: 1 addition & 18 deletions audio/audio_policy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,7 @@ audio_hw_modules {
sampling_rates 8000|11025|16000|22050|32000|44100|48000
channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET|AUDIO_DEVICE_IN_WIRED_HEADSET|AUDIO_DEVICE_IN_BACK_MIC|AUDIO_DEVICE_IN_FM_RADIO_RX
}
}
}
hdmi {
outputs {
stereo {
sampling_rates 44100|48000
channel_masks AUDIO_CHANNEL_OUT_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_OUT_AUX_DIGITAL
}
multichannel {
sampling_rates 44100|48000
channel_masks dynamic
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_OUT_AUX_DIGITAL
flags AUDIO_OUTPUT_FLAG_DIRECT
devices AUDIO_DEVICE_IN_WIRED_HEADSET
}
}
}
Expand Down

0 comments on commit 927db53

Please sign in to comment.