summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
Diffstat (limited to 'services')
-rw-r--r--services/audioflinger/AudioFlinger.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index e4c055a..5975b62 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -107,6 +107,7 @@
#ifdef QCOM_HARDWARE
#define DIRECT_TRACK_EOS 1
+#define DIRECT_TRACK_HW_FAIL 6
static const char lockName[] = "DirectTrack";
#endif
@@ -1162,9 +1163,29 @@ status_t AudioFlinger::setParameters(audio_io_handle_t ioHandle, const String8&
}
mHardwareStatus = AUDIO_HW_IDLE;
}
+#ifdef QCOM_HARDWARE
+ AudioParameter param = AudioParameter(keyValuePairs);
+ String8 value, key;
+ int i = 0;
+
+ key = String8(AudioParameter::keyADSPStatus);
+ if (param.get(key, value) == NO_ERROR) {
+ ALOGV("Set keyADSPStatus:%s", value.string());
+ if (value == "ONLINE" || value == "OFFLINE") {
+ if (!mDirectAudioTracks.isEmpty()) {
+ for (i=0; i < mDirectAudioTracks.size(); i++) {
+ mDirectAudioTracks.valueAt(i)->stream->common.set_parameters(
+ &mDirectAudioTracks.valueAt(i)->stream->common, keyValuePairs.string());
+ }
+ }
+ }
+ }
+#else
// disable AEC and NS if the device is a BT SCO headset supporting those pre processings
AudioParameter param = AudioParameter(keyValuePairs);
String8 value;
+#endif
+
if (param.get(String8(AUDIO_PARAMETER_KEY_BT_NREC), value) == NO_ERROR) {
bool btNrecIsOff = (value == AUDIO_PARAMETER_VALUE_OFF);
if (mBtNrecIsOff != btNrecIsOff) {
@@ -6262,8 +6283,18 @@ int64_t AudioFlinger::DirectAudioTrack::getTimeStamp() {
}
void AudioFlinger::DirectAudioTrack::postEOS(int64_t delayUs) {
+#ifdef QCOM_HARDWARE
+ if (delayUs == 0 ) {
+ ALOGV("Notify Audio Track of EOS event");
+ mClient->notify(DIRECT_TRACK_EOS);
+ } else {
+ ALOGV("Notify Audio Track of hardware failure event");
+ mClient->notify(DIRECT_TRACK_HW_FAIL);
+ }
+#else
ALOGV("Notify Audio Track of EOS event");
mClient->notify(DIRECT_TRACK_EOS);
+#endif
}
void AudioFlinger::DirectAudioTrack::allocateBufPool() {