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

Commit 2c798912 authored by samin.ryu's avatar samin.ryu Committed by Iliyan Malchev
Browse files

alsa_sound: avoid pcm_open error

sometimes occur pcm_open error caused by mDevices 0.
so, must not change mDevices to 0.

Bug: 7293209

Change-Id: I3ffaca81dea15145bd8f03e3abedb2840d7c9f2c
parent bf1c8748
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -214,12 +214,16 @@ status_t ALSAStreamOps::setParameters(const String8& keyValuePairs)

    if (param.getInt(key, device) == NO_ERROR) {
        // Ignore routing if device is 0.
        ALOGD("setParameters(): keyRouting with device %d", device);
        ALOGD("setParameters(): keyRouting with device 0x%x", device);
        // reset to speaker when disconnecting HDMI to avoid timeout due to write errors
        if ((device == 0) && (mDevices == AudioSystem::DEVICE_OUT_AUX_DIGITAL)) {
            device = AudioSystem::DEVICE_OUT_SPEAKER;
        }
        if (device)
            mDevices = device;
        else
            ALOGV("must not change mDevices to 0");

        if(device) {
            mParent->doRouting(device);
        }
+0 −2
Original line number Diff line number Diff line
@@ -178,8 +178,6 @@ ssize_t AudioStreamOutALSA::write(const void *buffer, size_t bytes)
            mHandle->module->route(mHandle, mDevices , mParent->mode());
#endif
        } else {
            if (!mDevices)
               mDevices = mParent->mCurDevice;
            mHandle->module->route(mHandle, mDevices , mParent->mode());
        }
        if (!strcmp(mHandle->useCase, SND_USE_CASE_VERB_HIFI) ||