summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorKyle Repinski <repinski23@gmail.com>2015-03-20 14:21:01 -0500
committerZiyan <jaraidaniel@gmail.com>2016-01-15 12:27:22 +0100
commit99f831a93a267f9c97257bd53e6ca6b757ebbefb (patch)
treeb1ffbeaf888b213a046cef593b8f3dbac01aa278 /audio
parent0f006c0b2ad1da3ad691246c698ba829cf28bb26 (diff)
downloaddevice_samsung_tuna-99f831a93a267f9c97257bd53e6ca6b757ebbefb.zip
device_samsung_tuna-99f831a93a267f9c97257bd53e6ca6b757ebbefb.tar.gz
device_samsung_tuna-99f831a93a267f9c97257bd53e6ca6b757ebbefb.tar.bz2
audio: Add ability to actually force the out stream sampling rate.
This audio HAL has always required some sort of resampling. THIS. ENDS. NOW.
Diffstat (limited to 'audio')
-rw-r--r--audio/Android.mk2
-rw-r--r--audio/audio_hw.c16
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 */