Skip to content

fix: resolve audio service stop issue during logout#162

Merged
fly602 merged 1 commit intolinuxdeepin:masterfrom
fly602:master
Sep 23, 2025
Merged

fix: resolve audio service stop issue during logout#162
fly602 merged 1 commit intolinuxdeepin:masterfrom
fly602:master

Conversation

@fly602
Copy link
Copy Markdown
Contributor

@fly602 fly602 commented Sep 22, 2025

Previously, stopping audio service was handled asynchronously through direct service commands, which didn't guarantee immediate termination. This caused ALSA to remain occupied when playing logout sound effects, leading to playback failures. The fix replaces this with a synchronous call to the backend's StopAudioService method to ensure proper audio service termination before logout sound playback.

Log: Fixed issue where logout sound effects failed to play due to audio service still running

Influence:

  1. Test logout sound effects playback during system logout
  2. Verify audio service properly terminates before sound playback
  3. Check system stability during logout sequence
  4. Test with different audio backends (ALSA, PipeWire)

fix: 解决注销时音频服务停止问题

之前通过直接服务命令异步停止音频服务,无法保证立即终止。这导致播
放注销音效时ALSA仍处于占用状态,造成播放失败。现改为同步调用后端的
StopAudioService方法,确保在播放注销音效前正确终止音频服务。

Log: 修复了由于音频服务仍在运行导致注销音效播放失败的问题
PMS: BUG-315787
Influence:

  1. 测试系统注销时的注销音效播放
  2. 验证音频服务在声音播放前正确终止
  3. 检查注销序列中的系统稳定性
  4. 使用不同音频后端(ALSA, PipeWire)进行测试

Summary by Sourcery

Ensure the audio service is stopped synchronously before logout sound playback to prevent ALSA from remaining occupied and causing sound failures

Bug Fixes:

  • Replace asynchronous STOP_SERVICE calls with a synchronous StopAudioService backend call
  • Remove direct service stop invocations and pipewire socket shutdown to streamline termination process

Previously, stopping audio service was handled asynchronously through
direct service commands, which didn't guarantee immediate termination.
This caused ALSA to remain occupied when playing logout sound effects,
leading to playback failures. The fix replaces this with a synchronous
call to the backend's StopAudioService method to ensure proper audio
service termination before logout sound playback.

Log: Fixed issue where logout sound effects failed to play due to audio
service still running

Influence:
1. Test logout sound effects playback during system logout
2. Verify audio service properly terminates before sound playback
3. Check system stability during logout sequence
4. Test with different audio backends (ALSA, PipeWire)

fix: 解决注销时音频服务停止问题

之前通过直接服务命令异步停止音频服务,无法保证立即终止。这导致播
放注销音效时ALSA仍处于占用状态,造成播放失败。现改为同步调用后端的
StopAudioService方法,确保在播放注销音效前正确终止音频服务。

Log: 修复了由于音频服务仍在运行导致注销音效播放失败的问题
PMS: BUG-315787
Influence:
1. 测试系统注销时的注销音效播放
2. 验证音频服务在声音播放前正确终止
3. 检查注销序列中的系统稳定性
4. 使用不同音频后端(ALSA, PipeWire)进行测试
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Sep 22, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Replaces the previous asynchronous STOP_SERVICE commands with a synchronous backend StopAudioService call to ensure the audio service is fully terminated before logout sound playback.

File-Level Changes

Change Details Files
Switch audio service shutdown to a synchronous backend call
  • Removed getAudioServerBackend lookup and STOP_SERVICE/VIEW_SERVICE calls
  • Eliminated special-case handling for PipeWire socket
  • Replaced asynchronous NoRestartPulseAudio then STOP_SERVICE logic with interface.call("StopAudioService")
  • Preserved error logging for StopAudioService call
src/dde-session/impl/sessionmanager.cpp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes - here's some feedback:

  • Consider adding a timeout or watchdog around the synchronous StopAudioService call to prevent potential hangs during logout if the backend becomes unresponsive.
  • Ensure StopAudioService properly handles both ALSA and PipeWire (including the PipeWire-Pulse socket) or add a fallback path for backends that don’t support it.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider adding a timeout or watchdog around the synchronous StopAudioService call to prevent potential hangs during logout if the backend becomes unresponsive.
- Ensure StopAudioService properly handles both ALSA and PipeWire (including the PipeWire-Pulse socket) or add a fallback path for backends that don’t support it.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: fly602, mhduiy

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@fly602 fly602 merged commit a45c550 into linuxdeepin:master Sep 23, 2025
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants