add patch for microphone fix
Change-Id: I32c9098c16b05982c29c637dfdd760f13d304152 (cherry picked from commit df956c9636bd35cbebac7d362c461172ad792828)
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
From 7a3e536a584ecfa5aa9c12aaf0a166d3fa9b5c8b Mon Sep 17 00:00:00 2001
|
||||
From: adi766 <adityakumarteli7846@gmail.com>
|
||||
Date: Sat, 23 Sep 2017 16:07:34 +0000
|
||||
Subject: [PATCH] MediaTek: Fix Microphone
|
||||
|
||||
---
|
||||
services/audioflinger/Android.mk | 4 ++++
|
||||
services/audioflinger/Threads.cpp | 4 ++--
|
||||
2 files changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/services/audioflinger/Android.mk b/services/audioflinger/Android.mk
|
||||
index 886421516..1d09376ec 100644
|
||||
--- a/services/audioflinger/Android.mk
|
||||
+++ b/services/audioflinger/Android.mk
|
||||
@@ -87,6 +87,10 @@ endif
|
||||
endif
|
||||
#QTI Resampler
|
||||
|
||||
+ifeq ($(BOARD_HAS_MTK_HARDWARE),true)
|
||||
+LOCAL_CFLAGS += -DLEGACY_AUDIO_BLOB
|
||||
+endif
|
||||
+
|
||||
LOCAL_MODULE:= libaudioflinger
|
||||
|
||||
LOCAL_SRC_FILES += \
|
||||
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
|
||||
index e8c80c17c..a6c02dc98 100644
|
||||
--- a/services/audioflinger/Threads.cpp
|
||||
+++ b/services/audioflinger/Threads.cpp
|
||||
@@ -6461,7 +6461,7 @@ reacquire_wakelock:
|
||||
// systemTime() is optional if the hardware supports timestamps.
|
||||
mTimestamp.mPosition[ExtendedTimestamp::LOCATION_SERVER] += framesRead;
|
||||
mTimestamp.mTimeNs[ExtendedTimestamp::LOCATION_SERVER] = systemTime();
|
||||
-
|
||||
+#ifndef LEGACY_AUDIO_BLOB
|
||||
// Update server timestamp with kernel stats
|
||||
if (mInput->stream->get_capture_position != nullptr
|
||||
&& mPipeSource.get() == nullptr /* don't obtain for FastCapture, could block */) {
|
||||
@@ -6479,7 +6479,7 @@ reacquire_wakelock:
|
||||
}
|
||||
// Use this to track timestamp information
|
||||
// ALOGD("%s", mTimestamp.toString().c_str());
|
||||
-
|
||||
+#endif
|
||||
if (framesRead < 0 || (framesRead == 0 && mPipeSource == 0)) {
|
||||
ALOGE("read failed: framesRead=%zd", framesRead);
|
||||
// Force input into standby so that it tries to recover at next read attempt
|
||||
--
|
||||
2.15.0.windows.1
|
||||
|
||||
Reference in New Issue
Block a user