From 129ad0217901d6c140939254c95a7b8825388e20 Mon Sep 17 00:00:00 2001 From: "mengmeng.chang" Date: Thu, 22 Jan 2026 13:20:35 +0800 Subject: [PATCH 1/3] Deep buffer and offload should not be enabled simultaneously; this should be a logical AND operation, not a bitwise AND. --- session/src/SessionAlsaPcm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/session/src/SessionAlsaPcm.cpp b/session/src/SessionAlsaPcm.cpp index 687954e6..0b9062ce 100644 --- a/session/src/SessionAlsaPcm.cpp +++ b/session/src/SessionAlsaPcm.cpp @@ -3044,7 +3044,7 @@ int SessionAlsaPcm::setParameters(Stream *streamHandle, int tagId, uint32_t para goto exit; } if (sAttr.direction == PAL_AUDIO_OUTPUT && - (sAttr.type == PAL_STREAM_DEEP_BUFFER || PAL_STREAM_PCM_OFFLOAD)) { + (sAttr.type == PAL_STREAM_DEEP_BUFFER || sAttr.type == PAL_STREAM_PCM_OFFLOAD)) { status = SessionAlsaUtils::getModuleInstanceId(mixer, device, rxAifBackEnds[0].second.data(), tagId, &miid); PAL_DBG(LOG_TAG, "Gainlog - Get MIID status - %d", status); From d7080f76997e2ba481fd2cfb32820238f65b7d18 Mon Sep 17 00:00:00 2001 From: MrChangMM <535856754@qq.com> Date: Sat, 24 Jan 2026 23:53:21 +0800 Subject: [PATCH 2/3] Revert "Deep buffer and offload should not be enabled simultaneously; this should be a logical AND operation, not a bitwise AND." This reverts commit 129ad0217901d6c140939254c95a7b8825388e20. --- session/src/SessionAlsaPcm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/session/src/SessionAlsaPcm.cpp b/session/src/SessionAlsaPcm.cpp index 0b9062ce..687954e6 100644 --- a/session/src/SessionAlsaPcm.cpp +++ b/session/src/SessionAlsaPcm.cpp @@ -3044,7 +3044,7 @@ int SessionAlsaPcm::setParameters(Stream *streamHandle, int tagId, uint32_t para goto exit; } if (sAttr.direction == PAL_AUDIO_OUTPUT && - (sAttr.type == PAL_STREAM_DEEP_BUFFER || sAttr.type == PAL_STREAM_PCM_OFFLOAD)) { + (sAttr.type == PAL_STREAM_DEEP_BUFFER || PAL_STREAM_PCM_OFFLOAD)) { status = SessionAlsaUtils::getModuleInstanceId(mixer, device, rxAifBackEnds[0].second.data(), tagId, &miid); PAL_DBG(LOG_TAG, "Gainlog - Get MIID status - %d", status); From ee5cd364de8d1f409f81b62a521ae0dcc25d3a57 Mon Sep 17 00:00:00 2001 From: MrChangMM <535856754@qq.com> Date: Sun, 25 Jan 2026 00:05:59 +0800 Subject: [PATCH 3/3] fix stream type comparison in SessionAlsaPcm Change condition to use && and compare PAL_STREAM_PCM_OFFLOAD with sAttr.type so the branch only runs when sAttr.direction is output and sAttr.type is DEEP_BUFFER or PCM_OFFLOAD. --- session/src/SessionAlsaPcm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/session/src/SessionAlsaPcm.cpp b/session/src/SessionAlsaPcm.cpp index 687954e6..0b9062ce 100644 --- a/session/src/SessionAlsaPcm.cpp +++ b/session/src/SessionAlsaPcm.cpp @@ -3044,7 +3044,7 @@ int SessionAlsaPcm::setParameters(Stream *streamHandle, int tagId, uint32_t para goto exit; } if (sAttr.direction == PAL_AUDIO_OUTPUT && - (sAttr.type == PAL_STREAM_DEEP_BUFFER || PAL_STREAM_PCM_OFFLOAD)) { + (sAttr.type == PAL_STREAM_DEEP_BUFFER || sAttr.type == PAL_STREAM_PCM_OFFLOAD)) { status = SessionAlsaUtils::getModuleInstanceId(mixer, device, rxAifBackEnds[0].second.data(), tagId, &miid); PAL_DBG(LOG_TAG, "Gainlog - Get MIID status - %d", status);