From 720055270a0412311d39ca77ff1c0e6d744d6b5e Mon Sep 17 00:00:00 2001 From: Ravishankar Sarawadi Date: Wed, 27 Feb 2013 18:47:54 +0100 Subject: 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 --- services/audioflinger/AudioFlinger.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'services') 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() { -- cgit v1.1