Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 47d862fe authored by Priyanka Advani (xWF)'s avatar Priyanka Advani (xWF)
Browse files

Revert "Propagate AudioFlinger open output flags to audio policy"

Revert submission 2835831-e-ac3-joc remote submix

Reason for revert: Droidmonitor created revert due to b/370533763. Will be verifying through ABTD before submission.

Reverted changes: /q/submissionid:2835831-e-ac3-joc+remote+submix

Change-Id: Idff1500ad1497296d17f0df9ae7622e27f4e8556
parent 455682fb
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -2923,7 +2923,7 @@ sp<IAfThreadBase> AudioFlinger::openOutput_l(audio_module_handle_t module,
                                                        audio_config_base_t *mixerConfig,
                                                        audio_devices_t deviceType,
                                                        const String8& address,
                                                        audio_output_flags_t *flags,
                                                        audio_output_flags_t flags,
                                                        const audio_attributes_t attributes)
{
    AudioHwDevice *outHwDev = findSuitableHwDev_l(module, deviceType);
@@ -2958,7 +2958,7 @@ sp<IAfThreadBase> AudioFlinger::openOutput_l(audio_module_handle_t module,
    mHardwareStatus = AUDIO_HW_IDLE;

    if (status == NO_ERROR) {
        if (*flags & AUDIO_OUTPUT_FLAG_MMAP_NOIRQ) {
        if (flags & AUDIO_OUTPUT_FLAG_MMAP_NOIRQ) {
            const sp<IAfMmapPlaybackThread> thread = IAfMmapPlaybackThread::create(
                    this, *output, outHwDev, outputStream, mSystemReady);
            mMmapThreads.add(*output, thread);
@@ -2967,22 +2967,22 @@ sp<IAfThreadBase> AudioFlinger::openOutput_l(audio_module_handle_t module,
            return thread;
        } else {
            sp<IAfPlaybackThread> thread;
            if (*flags & AUDIO_OUTPUT_FLAG_BIT_PERFECT) {
            if (flags & AUDIO_OUTPUT_FLAG_BIT_PERFECT) {
                thread = IAfPlaybackThread::createBitPerfectThread(
                        this, outputStream, *output, mSystemReady);
                ALOGV("%s() created bit-perfect output: ID %d thread %p",
                      __func__, *output, thread.get());
            } else if (*flags & AUDIO_OUTPUT_FLAG_SPATIALIZER) {
            } else if (flags & AUDIO_OUTPUT_FLAG_SPATIALIZER) {
                thread = IAfPlaybackThread::createSpatializerThread(this, outputStream, *output,
                                                    mSystemReady, mixerConfig);
                ALOGV("openOutput_l() created spatializer output: ID %d thread %p",
                      *output, thread.get());
            } else if (*flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) {
            } else if (flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) {
                thread = IAfPlaybackThread::createOffloadThread(this, outputStream, *output,
                        mSystemReady, halConfig->offload_info);
                ALOGV("openOutput_l() created offload output: ID %d thread %p",
                      *output, thread.get());
            } else if ((*flags & AUDIO_OUTPUT_FLAG_DIRECT)
            } else if ((flags & AUDIO_OUTPUT_FLAG_DIRECT)
                    || !IAfThreadBase::isValidPcmSinkFormat(halConfig->format)
                    || !IAfThreadBase::isValidPcmSinkChannelMask(halConfig->channel_mask)) {
                thread = IAfPlaybackThread::createDirectOutputThread(this, outputStream, *output,
@@ -3046,7 +3046,7 @@ status_t AudioFlinger::openOutput(const media::OpenOutputRequest& request,
    audio_utils::lock_guard _l(mutex());

    const sp<IAfThreadBase> thread = openOutput_l(module, &output, &halConfig,
            &mixerConfig, deviceType, address, &flags, attributes);
            &mixerConfig, deviceType, address, flags, attributes);
    if (thread != 0) {
        uint32_t latencyMs = 0;
        if ((flags & AUDIO_OUTPUT_FLAG_MMAP_NOIRQ) == 0) {
+1 −1
Original line number Diff line number Diff line
@@ -337,7 +337,7 @@ private:
            audio_config_base_t* mixerConfig,
            audio_devices_t deviceType,
            const String8& address,
            audio_output_flags_t* flags,
            audio_output_flags_t flags,
            audio_attributes_t attributes) final REQUIRES(mutex());
    const DefaultKeyedVector<audio_module_handle_t, AudioHwDevice*>&
            getAudioHwDevs_l() const final REQUIRES(mutex(), hardwareMutex()) {
+1 −1
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ public:
            audio_config_base_t* mixerConfig,
            audio_devices_t deviceType,
            const String8& address,
            audio_output_flags_t* flags,
            audio_output_flags_t flags,
            audio_attributes_t attributes) REQUIRES(mutex()) = 0;
    virtual audio_utils::mutex& mutex() const
            RETURN_CAPABILITY(audio_utils::AudioFlinger_Mutex) = 0;
+1 −1
Original line number Diff line number Diff line
@@ -268,7 +268,7 @@ status_t PatchPanel::createAudioPatch_l(const struct audio_patch* patch,
                                                            &mixerConfig,
                                                            outputDevice,
                                                            outputDeviceAddress,
                                                            &flags,
                                                            flags,
                                                            attributes);
                    ALOGV("mAfPatchPanelCallback->openOutput_l() returned %p", thread.get());
                    if (thread == 0) {
+7 −8
Original line number Diff line number Diff line
@@ -41,20 +41,19 @@ status_t AudioHwDevice::openOutputStream(
        AudioStreamOut **ppStreamOut,
        audio_io_handle_t handle,
        audio_devices_t deviceType,
        audio_output_flags_t *flags,
        audio_output_flags_t flags,
        struct audio_config *config,
        const char *address,
        const std::vector<playback_track_metadata_v7_t>& sourceMetadata)
{

    struct audio_config originalConfig = *config;
    auto outputStream = new AudioStreamOut(this);
    auto outputStream = new AudioStreamOut(this, flags);

    // Try to open the HAL first using the current format.
    ALOGV("openOutputStream(), try sampleRate %d, format %#x, channelMask %#x", config->sample_rate,
            config->format, config->channel_mask);
    status_t status = outputStream->open(handle, deviceType, config, flags, address,
                                        sourceMetadata);
    status_t status = outputStream->open(handle, deviceType, config, address, sourceMetadata);

    if (status != NO_ERROR) {
        delete outputStream;
@@ -68,13 +67,13 @@ status_t AudioHwDevice::openOutputStream(

        // If the data is encoded then try again using wrapped PCM.
        const bool wrapperNeeded = !audio_has_proportional_frames(originalConfig.format)
                && ((*flags & AUDIO_OUTPUT_FLAG_DIRECT) != 0)
                && ((*flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) == 0);
                && ((flags & AUDIO_OUTPUT_FLAG_DIRECT) != 0)
                && ((flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) == 0);

        if (wrapperNeeded) {
            if (SPDIFEncoder::isFormatSupported(originalConfig.format)) {
                outputStream = new SpdifStreamOut(this, originalConfig.format);
                status = outputStream->open(handle, deviceType, &originalConfig, flags, address,
                outputStream = new SpdifStreamOut(this, flags, originalConfig.format);
                status = outputStream->open(handle, deviceType, &originalConfig, address,
                                            sourceMetadata);
                if (status != NO_ERROR) {
                    ALOGE("ERROR - openOutputStream(), SPDIF open returned %d",
Loading