diff options
Diffstat (limited to 'audio')
-rw-r--r-- | audio/Android.mk | 2 | ||||
-rw-r--r-- | audio/audio_hw.c | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/audio/Android.mk b/audio/Android.mk index bdb47de..4ec8ae5 100644 --- a/audio/Android.mk +++ b/audio/Android.mk @@ -27,5 +27,7 @@ LOCAL_C_INCLUDES += \ LOCAL_SHARED_LIBRARIES := liblog libcutils libtinyalsa libaudioutils libdl libsecril-client LOCAL_MODULE_TAGS := optional +LOCAL_CFLAGS += -DFORCE_OUT_SAMPLING_RATE=44100 + include $(BUILD_SHARED_LIBRARY) diff --git a/audio/audio_hw.c b/audio/audio_hw.c index e865b5c..1776de1 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -217,12 +217,26 @@ /* minimum sleep time in out_write() when write threshold is not reached */ #define MIN_WRITE_SLEEP_US 5000 -#define DEFAULT_OUT_SAMPLING_RATE 48000 // TODO: Check with HDMI. +#ifdef FORCE_OUT_SAMPLING_RATE +#define DEFAULT_OUT_SAMPLING_RATE FORCE_OUT_SAMPLING_RATE +#define MM_LOW_POWER_SAMPLING_RATE FORCE_OUT_SAMPLING_RATE +#define MM_FULL_POWER_SAMPLING_RATE FORCE_OUT_SAMPLING_RATE +#endif + +#ifndef DEFAULT_OUT_SAMPLING_RATE +#define DEFAULT_OUT_SAMPLING_RATE 44100 +#endif /* sampling rate when using MM low power port */ +#ifndef MM_LOW_POWER_SAMPLING_RATE #define MM_LOW_POWER_SAMPLING_RATE 44100 +#endif + /* sampling rate when using MM full power port */ +#ifndef MM_FULL_POWER_SAMPLING_RATE #define MM_FULL_POWER_SAMPLING_RATE 48000 // affects MULTIPLIER_FACTOR +#endif + /* sampling rate when using VX port for narrow band */ #define VX_NB_SAMPLING_RATE 8000 /* sampling rate when using VX port for wide band */ |