diff --git a/audio/Android.mk b/audio/Android.mk index a68b6bf..bf91516 100644 --- a/audio/Android.mk +++ b/audio/Android.mk @@ -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 diff --git a/audio/audio_hw.c b/audio/audio_hw.c index 2879fce..d73f860 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -19,7 +19,7 @@ */ #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) @@ -27,17 +27,6 @@ #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 #include #include @@ -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" @@ -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 @@ -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, @@ -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 */ diff --git a/audio/audio_policy.conf b/audio/audio_policy.conf index 9dbf7b9..bd26ee4 100644 --- a/audio/audio_policy.conf +++ b/audio/audio_policy.conf @@ -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 } } }