Loading services/audiopolicy/common/include/policy.h +5 −2 Original line number Diff line number Diff line Loading @@ -22,11 +22,14 @@ static const audio_format_t gDynamicFormat = AUDIO_FORMAT_DEFAULT; // For mixed output and inputs, the policy will use max mixer sampling rates. // Do not limit sampling rate otherwise #define MAX_MIXER_SAMPLING_RATE 192000 #define SAMPLE_RATE_HZ_MAX 192000 // Used when a client opens a capture stream, without specifying a desired sample rate. #define SAMPLE_RATE_HZ_DEFAULT 48000 // For mixed output and inputs, the policy will use max mixer channel count. // Do not limit channel count otherwise #define MAX_MIXER_CHANNEL_COUNT 8 #define MAX_MIXER_CHANNEL_COUNT FCC_8 /** * A device mask for all audio input devices that are considered "virtual" when evaluating Loading services/audiopolicy/common/managerdefinitions/include/IOProfile.h +1 −1 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ public: // For a Profile aka MixPort, tag name and name are equivalent. virtual const String8 getTagName() const { return getName(); } // This method is used for both output and input. // This method is used for input and direct output, and is not used for other output. // If parameter updatedSamplingRate is non-NULL, it is assigned the actual sample rate. // For input, flags is interpreted as audio_input_flags_t. // TODO: merge audio_output_flags_t and audio_input_flags_t. Loading services/audiopolicy/common/managerdefinitions/src/AudioPort.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -165,7 +165,7 @@ void AudioPort::pickSamplingRate(uint32_t &pickedRate,const SampleRateVector &sa } pickedRate = (samplingRate == UINT_MAX) ? 0 : samplingRate; } else { uint32_t maxRate = MAX_MIXER_SAMPLING_RATE; uint32_t maxRate = SAMPLE_RATE_HZ_MAX; // For mixed output and inputs, use max mixer sampling rates. Do not // limit sampling rate otherwise Loading services/audiopolicy/common/managerdefinitions/src/AudioProfile.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -63,10 +63,13 @@ bool operator == (const AudioProfile &left, const AudioProfile &compareTo) status_t AudioProfile::checkCompatibleSamplingRate(uint32_t samplingRate, uint32_t &updatedSamplingRate) const { ALOG_ASSERT(samplingRate > 0); if (mSamplingRates.isEmpty()) { updatedSamplingRate = samplingRate; return NO_ERROR; } // Search for the closest supported sampling rate that is above (preferred) // or below (acceptable) the desired sampling rate, within a permitted ratio. // The sampling rates are sorted in ascending order. Loading services/audiopolicy/common/managerdefinitions/src/IOProfile.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -55,8 +55,8 @@ bool IOProfile::isCompatibleProfile(audio_devices_t device, } } if (samplingRate == 0 || !audio_is_valid_format(format) || (isPlaybackThread && (!audio_is_output_channel(channelMask))) || if (!audio_is_valid_format(format) || (isPlaybackThread && (samplingRate == 0 || !audio_is_output_channel(channelMask))) || (isRecordThread && (!audio_is_input_channel(channelMask)))) { return false; } Loading Loading
services/audiopolicy/common/include/policy.h +5 −2 Original line number Diff line number Diff line Loading @@ -22,11 +22,14 @@ static const audio_format_t gDynamicFormat = AUDIO_FORMAT_DEFAULT; // For mixed output and inputs, the policy will use max mixer sampling rates. // Do not limit sampling rate otherwise #define MAX_MIXER_SAMPLING_RATE 192000 #define SAMPLE_RATE_HZ_MAX 192000 // Used when a client opens a capture stream, without specifying a desired sample rate. #define SAMPLE_RATE_HZ_DEFAULT 48000 // For mixed output and inputs, the policy will use max mixer channel count. // Do not limit channel count otherwise #define MAX_MIXER_CHANNEL_COUNT 8 #define MAX_MIXER_CHANNEL_COUNT FCC_8 /** * A device mask for all audio input devices that are considered "virtual" when evaluating Loading
services/audiopolicy/common/managerdefinitions/include/IOProfile.h +1 −1 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ public: // For a Profile aka MixPort, tag name and name are equivalent. virtual const String8 getTagName() const { return getName(); } // This method is used for both output and input. // This method is used for input and direct output, and is not used for other output. // If parameter updatedSamplingRate is non-NULL, it is assigned the actual sample rate. // For input, flags is interpreted as audio_input_flags_t. // TODO: merge audio_output_flags_t and audio_input_flags_t. Loading
services/audiopolicy/common/managerdefinitions/src/AudioPort.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -165,7 +165,7 @@ void AudioPort::pickSamplingRate(uint32_t &pickedRate,const SampleRateVector &sa } pickedRate = (samplingRate == UINT_MAX) ? 0 : samplingRate; } else { uint32_t maxRate = MAX_MIXER_SAMPLING_RATE; uint32_t maxRate = SAMPLE_RATE_HZ_MAX; // For mixed output and inputs, use max mixer sampling rates. Do not // limit sampling rate otherwise Loading
services/audiopolicy/common/managerdefinitions/src/AudioProfile.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -63,10 +63,13 @@ bool operator == (const AudioProfile &left, const AudioProfile &compareTo) status_t AudioProfile::checkCompatibleSamplingRate(uint32_t samplingRate, uint32_t &updatedSamplingRate) const { ALOG_ASSERT(samplingRate > 0); if (mSamplingRates.isEmpty()) { updatedSamplingRate = samplingRate; return NO_ERROR; } // Search for the closest supported sampling rate that is above (preferred) // or below (acceptable) the desired sampling rate, within a permitted ratio. // The sampling rates are sorted in ascending order. Loading
services/audiopolicy/common/managerdefinitions/src/IOProfile.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -55,8 +55,8 @@ bool IOProfile::isCompatibleProfile(audio_devices_t device, } } if (samplingRate == 0 || !audio_is_valid_format(format) || (isPlaybackThread && (!audio_is_output_channel(channelMask))) || if (!audio_is_valid_format(format) || (isPlaybackThread && (samplingRate == 0 || !audio_is_output_channel(channelMask))) || (isRecordThread && (!audio_is_input_channel(channelMask)))) { return false; } Loading