summaryrefslogtreecommitdiffstats
path: root/services/audioflinger
diff options
context:
space:
mode:
authorRavishankar Sarawadi <crsaraw@codeaurora.org>2013-02-27 18:47:54 +0100
committerGerrit Code Review <gerrit@cyanogenmod.org>2013-03-04 23:35:32 -0800
commit720055270a0412311d39ca77ff1c0e6d744d6b5e (patch)
treeb28146c1cb226734c35e14ce3c1225c486ee159c /services/audioflinger
parentab5138fa0d9bf3c149e3b586d7640f0d2fb90685 (diff)
downloadframeworks_av-720055270a0412311d39ca77ff1c0e6d744d6b5e.zip
frameworks_av-720055270a0412311d39ca77ff1c0e6d744d6b5e.tar.gz
frameworks_av-720055270a0412311d39ca77ff1c0e6d744d6b5e.tar.bz2
audio: Subsystem Restart changes
- Handle new ADSP status parameter - media/libmedia: Add new ADSP status audio parameter - framework/av: Add handling of new key-pair value in Audio Flinger - Handle Tunnel mode SubSys Restart - framework/av: Post SSR event to Audio Flinger - media/libmedia: Post SSR event to AudioTrack - media/libmediaplayerservice: Post SSR event to MediaPlayerService - media/libstagefright: Post SSR event to TunnelPlayer Change-Id: I8c8385af45be91caf7d7160ab2e0236d6591b159
Diffstat (limited to 'services/audioflinger')
-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() {