Loading media/libaudioclient/AudioRecord.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -66,7 +66,8 @@ status_t AudioRecord::getMinFrameCount( // --------------------------------------------------------------------------- AudioRecord::AudioRecord(const String16 &opPackageName) : mActive(false), mStatus(NO_INIT), mOpPackageName(opPackageName), mSessionId(AUDIO_SESSION_ALLOCATE), : mActive(false), mStatus(NO_INIT), mOpPackageName(opPackageName), mSessionId(AUDIO_SESSION_ALLOCATE), mPreviousPriority(ANDROID_PRIORITY_NORMAL), mPreviousSchedulingGroup(SP_DEFAULT), mSelectedDeviceId(AUDIO_PORT_HANDLE_NONE), mPortId(AUDIO_PORT_HANDLE_NONE) { Loading media/libaudioclient/AudioSystem.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -554,7 +554,8 @@ void AudioSystem::AudioFlingerClient::ioConfigChanged(audio_io_config_event even "channel mask %#x frameCount %zu frameCountHAL %zu deviceId %d", event == AUDIO_OUTPUT_CONFIG_CHANGED ? "output" : "input", ioDesc->mIoHandle, ioDesc->mSamplingRate, ioDesc->mFormat, ioDesc->mChannelMask, ioDesc->mFrameCount, ioDesc->mFrameCountHAL, ioDesc->getDeviceId()); ioDesc->mChannelMask, ioDesc->mFrameCount, ioDesc->mFrameCountHAL, ioDesc->getDeviceId()); } break; } Loading media/libaudioclient/AudioTrack.cpp +6 −4 Original line number Diff line number Diff line Loading @@ -917,7 +917,8 @@ status_t AudioTrack::setPlaybackRate(const AudioPlaybackRate &playbackRate) } // Check resampler ratios are within bounds if ((uint64_t)effectiveRate > (uint64_t)mSampleRate * (uint64_t)AUDIO_RESAMPLER_DOWN_RATIO_MAX) { if ((uint64_t)effectiveRate > (uint64_t)mSampleRate * (uint64_t)AUDIO_RESAMPLER_DOWN_RATIO_MAX) { ALOGV("setPlaybackRate(%f, %f) failed. Resample rate exceeds max accepted value", playbackRate.mSpeed, playbackRate.mPitch); return BAD_VALUE; Loading Loading @@ -1274,9 +1275,10 @@ status_t AudioTrack::createTrack_l() mFlags, mSelectedDeviceId, &mPortId); if (status != NO_ERROR || output == AUDIO_IO_HANDLE_NONE) { ALOGE("Could not get audio output for session %d, stream type %d, usage %d, sample rate %u, format %#x," " channel mask %#x, flags %#x", mSessionId, streamType, mAttributes.usage, mSampleRate, mFormat, mChannelMask, mFlags); ALOGE("Could not get audio output for session %d, stream type %d, usage %d, sample rate %u," " format %#x, channel mask %#x, flags %#x", mSessionId, streamType, mAttributes.usage, mSampleRate, mFormat, mChannelMask, mFlags); return BAD_VALUE; } { Loading services/audioflinger/AudioFlinger.cpp +11 −8 Original line number Diff line number Diff line Loading @@ -292,7 +292,8 @@ status_t AudioFlinger::openMmapStream(MmapStreamInterface::stream_direction_t di sessionId, &streamType, client.clientUid, &fullConfig, (audio_output_flags_t)(AUDIO_OUTPUT_FLAG_MMAP_NOIRQ | AUDIO_OUTPUT_FLAG_DIRECT), (audio_output_flags_t)(AUDIO_OUTPUT_FLAG_MMAP_NOIRQ | AUDIO_OUTPUT_FLAG_DIRECT), *deviceId, &portId); } else { ret = AudioSystem::getInputForAttr(attr, &io, Loading Loading @@ -2017,7 +2018,8 @@ status_t AudioFlinger::openOutput(audio_module_handle_t module, uint32_t *latencyMs, audio_output_flags_t flags) { ALOGI("openOutput() this %p, module %d Device %x, SamplingRate %d, Format %#08x, Channels %x, flags %x", ALOGI("openOutput() this %p, module %d Device %x, SamplingRate %d, Format %#08x, Channels %x, " "flags %x", this, module, (devices != NULL) ? *devices : 0, config->sample_rate, Loading Loading @@ -2115,13 +2117,13 @@ status_t AudioFlinger::closeOutput_nonvirtual(audio_io_handle_t output) if (mPlaybackThreads.size()) { PlaybackThread *dstThread = checkPlaybackThread_l(mPlaybackThreads.keyAt(0)); if (dstThread != NULL) { // audioflinger lock is held here so the acquisition order of thread locks does not // matter // audioflinger lock is held so order of thread lock acquisition doesn't matter Mutex::Autolock _dl(dstThread->mLock); Mutex::Autolock _sl(playbackThread->mLock); Vector< sp<EffectChain> > effectChains = playbackThread->getEffectChains_l(); for (size_t i = 0; i < effectChains.size(); i ++) { moveEffectChain_l(effectChains[i]->sessionId(), playbackThread.get(), dstThread, true); moveEffectChain_l(effectChains[i]->sessionId(), playbackThread.get(), dstThread, true); } } } Loading Loading @@ -2293,7 +2295,8 @@ sp<AudioFlinger::ThreadBase> AudioFlinger::openInput_l(audio_module_handle_t mod inHwDev, inputStream, primaryOutputDevice_l(), devices, mSystemReady); mMmapThreads.add(*input, thread); ALOGV("openInput_l() created mmap capture thread: ID %d thread %p", *input, thread.get()); ALOGV("openInput_l() created mmap capture thread: ID %d thread %p", *input, thread.get()); return thread; } else { #ifdef TEE_SINK Loading Loading @@ -2399,7 +2402,7 @@ status_t AudioFlinger::closeInput_nonvirtual(audio_io_handle_t input) } } if (chain != 0) { // first check if a record thread is already opened with a client on the same session. // first check if a record thread is already opened with a client on same session. // This should only happen in case of overlap between one thread tear down and the // creation of its replacement size_t i; Loading @@ -2416,7 +2419,7 @@ status_t AudioFlinger::closeInput_nonvirtual(audio_io_handle_t input) break; } } // put the chain aside if we could not find a record thread with the same session id. // put the chain aside if we could not find a record thread with the same session id if (i == mRecordThreads.size()) { putOrphanEffectChain_l(chain); } Loading services/audioflinger/AudioFlinger.h +2 −1 Original line number Diff line number Diff line Loading @@ -593,7 +593,8 @@ private: virtual status_t createMmapBuffer(int32_t minSizeFrames, struct audio_mmap_buffer_info *info); virtual status_t getMmapPosition(struct audio_mmap_position *position); virtual status_t start(const MmapStreamInterface::Client& client, audio_port_handle_t *handle); virtual status_t start(const MmapStreamInterface::Client& client, audio_port_handle_t *handle); virtual status_t stop(audio_port_handle_t handle); virtual status_t standby(); Loading Loading
media/libaudioclient/AudioRecord.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -66,7 +66,8 @@ status_t AudioRecord::getMinFrameCount( // --------------------------------------------------------------------------- AudioRecord::AudioRecord(const String16 &opPackageName) : mActive(false), mStatus(NO_INIT), mOpPackageName(opPackageName), mSessionId(AUDIO_SESSION_ALLOCATE), : mActive(false), mStatus(NO_INIT), mOpPackageName(opPackageName), mSessionId(AUDIO_SESSION_ALLOCATE), mPreviousPriority(ANDROID_PRIORITY_NORMAL), mPreviousSchedulingGroup(SP_DEFAULT), mSelectedDeviceId(AUDIO_PORT_HANDLE_NONE), mPortId(AUDIO_PORT_HANDLE_NONE) { Loading
media/libaudioclient/AudioSystem.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -554,7 +554,8 @@ void AudioSystem::AudioFlingerClient::ioConfigChanged(audio_io_config_event even "channel mask %#x frameCount %zu frameCountHAL %zu deviceId %d", event == AUDIO_OUTPUT_CONFIG_CHANGED ? "output" : "input", ioDesc->mIoHandle, ioDesc->mSamplingRate, ioDesc->mFormat, ioDesc->mChannelMask, ioDesc->mFrameCount, ioDesc->mFrameCountHAL, ioDesc->getDeviceId()); ioDesc->mChannelMask, ioDesc->mFrameCount, ioDesc->mFrameCountHAL, ioDesc->getDeviceId()); } break; } Loading
media/libaudioclient/AudioTrack.cpp +6 −4 Original line number Diff line number Diff line Loading @@ -917,7 +917,8 @@ status_t AudioTrack::setPlaybackRate(const AudioPlaybackRate &playbackRate) } // Check resampler ratios are within bounds if ((uint64_t)effectiveRate > (uint64_t)mSampleRate * (uint64_t)AUDIO_RESAMPLER_DOWN_RATIO_MAX) { if ((uint64_t)effectiveRate > (uint64_t)mSampleRate * (uint64_t)AUDIO_RESAMPLER_DOWN_RATIO_MAX) { ALOGV("setPlaybackRate(%f, %f) failed. Resample rate exceeds max accepted value", playbackRate.mSpeed, playbackRate.mPitch); return BAD_VALUE; Loading Loading @@ -1274,9 +1275,10 @@ status_t AudioTrack::createTrack_l() mFlags, mSelectedDeviceId, &mPortId); if (status != NO_ERROR || output == AUDIO_IO_HANDLE_NONE) { ALOGE("Could not get audio output for session %d, stream type %d, usage %d, sample rate %u, format %#x," " channel mask %#x, flags %#x", mSessionId, streamType, mAttributes.usage, mSampleRate, mFormat, mChannelMask, mFlags); ALOGE("Could not get audio output for session %d, stream type %d, usage %d, sample rate %u," " format %#x, channel mask %#x, flags %#x", mSessionId, streamType, mAttributes.usage, mSampleRate, mFormat, mChannelMask, mFlags); return BAD_VALUE; } { Loading
services/audioflinger/AudioFlinger.cpp +11 −8 Original line number Diff line number Diff line Loading @@ -292,7 +292,8 @@ status_t AudioFlinger::openMmapStream(MmapStreamInterface::stream_direction_t di sessionId, &streamType, client.clientUid, &fullConfig, (audio_output_flags_t)(AUDIO_OUTPUT_FLAG_MMAP_NOIRQ | AUDIO_OUTPUT_FLAG_DIRECT), (audio_output_flags_t)(AUDIO_OUTPUT_FLAG_MMAP_NOIRQ | AUDIO_OUTPUT_FLAG_DIRECT), *deviceId, &portId); } else { ret = AudioSystem::getInputForAttr(attr, &io, Loading Loading @@ -2017,7 +2018,8 @@ status_t AudioFlinger::openOutput(audio_module_handle_t module, uint32_t *latencyMs, audio_output_flags_t flags) { ALOGI("openOutput() this %p, module %d Device %x, SamplingRate %d, Format %#08x, Channels %x, flags %x", ALOGI("openOutput() this %p, module %d Device %x, SamplingRate %d, Format %#08x, Channels %x, " "flags %x", this, module, (devices != NULL) ? *devices : 0, config->sample_rate, Loading Loading @@ -2115,13 +2117,13 @@ status_t AudioFlinger::closeOutput_nonvirtual(audio_io_handle_t output) if (mPlaybackThreads.size()) { PlaybackThread *dstThread = checkPlaybackThread_l(mPlaybackThreads.keyAt(0)); if (dstThread != NULL) { // audioflinger lock is held here so the acquisition order of thread locks does not // matter // audioflinger lock is held so order of thread lock acquisition doesn't matter Mutex::Autolock _dl(dstThread->mLock); Mutex::Autolock _sl(playbackThread->mLock); Vector< sp<EffectChain> > effectChains = playbackThread->getEffectChains_l(); for (size_t i = 0; i < effectChains.size(); i ++) { moveEffectChain_l(effectChains[i]->sessionId(), playbackThread.get(), dstThread, true); moveEffectChain_l(effectChains[i]->sessionId(), playbackThread.get(), dstThread, true); } } } Loading Loading @@ -2293,7 +2295,8 @@ sp<AudioFlinger::ThreadBase> AudioFlinger::openInput_l(audio_module_handle_t mod inHwDev, inputStream, primaryOutputDevice_l(), devices, mSystemReady); mMmapThreads.add(*input, thread); ALOGV("openInput_l() created mmap capture thread: ID %d thread %p", *input, thread.get()); ALOGV("openInput_l() created mmap capture thread: ID %d thread %p", *input, thread.get()); return thread; } else { #ifdef TEE_SINK Loading Loading @@ -2399,7 +2402,7 @@ status_t AudioFlinger::closeInput_nonvirtual(audio_io_handle_t input) } } if (chain != 0) { // first check if a record thread is already opened with a client on the same session. // first check if a record thread is already opened with a client on same session. // This should only happen in case of overlap between one thread tear down and the // creation of its replacement size_t i; Loading @@ -2416,7 +2419,7 @@ status_t AudioFlinger::closeInput_nonvirtual(audio_io_handle_t input) break; } } // put the chain aside if we could not find a record thread with the same session id. // put the chain aside if we could not find a record thread with the same session id if (i == mRecordThreads.size()) { putOrphanEffectChain_l(chain); } Loading
services/audioflinger/AudioFlinger.h +2 −1 Original line number Diff line number Diff line Loading @@ -593,7 +593,8 @@ private: virtual status_t createMmapBuffer(int32_t minSizeFrames, struct audio_mmap_buffer_info *info); virtual status_t getMmapPosition(struct audio_mmap_position *position); virtual status_t start(const MmapStreamInterface::Client& client, audio_port_handle_t *handle); virtual status_t start(const MmapStreamInterface::Client& client, audio_port_handle_t *handle); virtual status_t stop(audio_port_handle_t handle); virtual status_t standby(); Loading