Loading services/audioflinger/Threads.cpp +23 −1 Original line number Diff line number Diff line Loading @@ -269,6 +269,23 @@ static std::string patchSourcesToString(const struct audio_patch *patch) return ss.str(); } static std::string toString(audio_latency_mode_t mode) { // We convert to the AIDL type to print (eventually the legacy type will be removed). const auto result = legacy2aidl_audio_latency_mode_t_LatencyMode(mode); return result.has_value() ? media::toString(*result) : "UNKNOWN"; } // Could be made a template, but other toString overloads for std::vector are confused. static std::string toString(const std::vector<audio_latency_mode_t>& elements) { std::string s("{ "); for (const auto& e : elements) { s.append(toString(e)); s.append(" "); } s.append("}"); return s; } static pthread_once_t sFastTrackMultiplierOnce = PTHREAD_ONCE_INIT; static void sFastTrackMultiplierInit() Loading Loading @@ -7347,10 +7364,13 @@ status_t AudioFlinger::SpatializerThread::createAudioPatch_l(const struct audio_ void AudioFlinger::SpatializerThread::updateHalSupportedLatencyModes_l() { std::vector<audio_latency_mode_t> latencyModes; if (mOutput->stream->getRecommendedLatencyModes(&latencyModes) != NO_ERROR) { const status_t status = mOutput->stream->getRecommendedLatencyModes(&latencyModes); if (status != NO_ERROR) { latencyModes.clear(); } if (latencyModes != mSupportedLatencyModes) { ALOGD("%s: thread(%d) status %d supported latency modes: %s", __func__, mId, status, toString(latencyModes).c_str()); mSupportedLatencyModes.swap(latencyModes); sendHalLatencyModesChangedEvent_l(); } Loading Loading @@ -7390,6 +7410,8 @@ void AudioFlinger::SpatializerThread::setHalLatencyMode_l() { if (latencyMode != mSetLatencyMode) { status_t status = mOutput->stream->setLatencyMode(latencyMode); ALOGD("%s: thread(%d) setLatencyMode(%s) returned %d", __func__, mId, toString(latencyMode).c_str(), status); if (status == NO_ERROR) { mSetLatencyMode = latencyMode; } Loading services/audiopolicy/service/Spatializer.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -963,7 +963,10 @@ void Spatializer::checkSensorsState_l() { } } if (mOutput != AUDIO_IO_HANDLE_NONE && supportsSetLatencyMode) { const status_t status = AudioSystem::setRequestedLatencyMode(mOutput, requestedLatencyMode); ALOGD("%s: setRequestedLatencyMode for output thread(%d) to %s returned %d", __func__, mOutput, toString(requestedLatencyMode).c_str(), status); } } Loading services/audiopolicy/service/Spatializer.h +4 −8 Original line number Diff line number Diff line Loading @@ -165,14 +165,10 @@ class Spatializer : public media::BnSpatializer, std::string toString(unsigned level) const NO_THREAD_SAFETY_ANALYSIS; static std::string toString(audio_latency_mode_t mode) { switch (mode) { case AUDIO_LATENCY_MODE_FREE: return "LATENCY_MODE_FREE"; case AUDIO_LATENCY_MODE_LOW: return "LATENCY_MODE_LOW"; // We convert to the AIDL type to print (eventually the legacy type will be removed). const auto result = legacy2aidl_audio_latency_mode_t_LatencyMode(mode); return result.has_value() ? media::toString(*result) : "unknown_latency_mode"; } return "EnumNotImplemented"; }; /** * Format head to stage vector to a string, [0.00, 0.00, 0.00, -1.29, -0.50, 15.27]. Loading Loading
services/audioflinger/Threads.cpp +23 −1 Original line number Diff line number Diff line Loading @@ -269,6 +269,23 @@ static std::string patchSourcesToString(const struct audio_patch *patch) return ss.str(); } static std::string toString(audio_latency_mode_t mode) { // We convert to the AIDL type to print (eventually the legacy type will be removed). const auto result = legacy2aidl_audio_latency_mode_t_LatencyMode(mode); return result.has_value() ? media::toString(*result) : "UNKNOWN"; } // Could be made a template, but other toString overloads for std::vector are confused. static std::string toString(const std::vector<audio_latency_mode_t>& elements) { std::string s("{ "); for (const auto& e : elements) { s.append(toString(e)); s.append(" "); } s.append("}"); return s; } static pthread_once_t sFastTrackMultiplierOnce = PTHREAD_ONCE_INIT; static void sFastTrackMultiplierInit() Loading Loading @@ -7347,10 +7364,13 @@ status_t AudioFlinger::SpatializerThread::createAudioPatch_l(const struct audio_ void AudioFlinger::SpatializerThread::updateHalSupportedLatencyModes_l() { std::vector<audio_latency_mode_t> latencyModes; if (mOutput->stream->getRecommendedLatencyModes(&latencyModes) != NO_ERROR) { const status_t status = mOutput->stream->getRecommendedLatencyModes(&latencyModes); if (status != NO_ERROR) { latencyModes.clear(); } if (latencyModes != mSupportedLatencyModes) { ALOGD("%s: thread(%d) status %d supported latency modes: %s", __func__, mId, status, toString(latencyModes).c_str()); mSupportedLatencyModes.swap(latencyModes); sendHalLatencyModesChangedEvent_l(); } Loading Loading @@ -7390,6 +7410,8 @@ void AudioFlinger::SpatializerThread::setHalLatencyMode_l() { if (latencyMode != mSetLatencyMode) { status_t status = mOutput->stream->setLatencyMode(latencyMode); ALOGD("%s: thread(%d) setLatencyMode(%s) returned %d", __func__, mId, toString(latencyMode).c_str(), status); if (status == NO_ERROR) { mSetLatencyMode = latencyMode; } Loading
services/audiopolicy/service/Spatializer.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -963,7 +963,10 @@ void Spatializer::checkSensorsState_l() { } } if (mOutput != AUDIO_IO_HANDLE_NONE && supportsSetLatencyMode) { const status_t status = AudioSystem::setRequestedLatencyMode(mOutput, requestedLatencyMode); ALOGD("%s: setRequestedLatencyMode for output thread(%d) to %s returned %d", __func__, mOutput, toString(requestedLatencyMode).c_str(), status); } } Loading
services/audiopolicy/service/Spatializer.h +4 −8 Original line number Diff line number Diff line Loading @@ -165,14 +165,10 @@ class Spatializer : public media::BnSpatializer, std::string toString(unsigned level) const NO_THREAD_SAFETY_ANALYSIS; static std::string toString(audio_latency_mode_t mode) { switch (mode) { case AUDIO_LATENCY_MODE_FREE: return "LATENCY_MODE_FREE"; case AUDIO_LATENCY_MODE_LOW: return "LATENCY_MODE_LOW"; // We convert to the AIDL type to print (eventually the legacy type will be removed). const auto result = legacy2aidl_audio_latency_mode_t_LatencyMode(mode); return result.has_value() ? media::toString(*result) : "unknown_latency_mode"; } return "EnumNotImplemented"; }; /** * Format head to stage vector to a string, [0.00, 0.00, 0.00, -1.29, -0.50, 15.27]. Loading