fix: prevent auto-switch to unavailable audio ports - #1269
MyLeeJiEun wants to merge 1 commit into
Conversation
1. Remove AvailableTypeNo filter in refreshPorts to keep temporarily unavailable but enabled ports in priority queue 2. Add port availability check in checkAutoSwitchOutputPort to skip unavailable ports during auto-switch 3. Add symmetric availability check in checkAutoSwitchInputPort 4. Prevent incorrect auto-switch to HDMI when wired/USB ports disabled Log: Fixed audio output incorrectly switching to HDMI when wired headphone and USB speaker ports are disabled Influence: 1. Test disabling wired headphone and USB speaker ports, verify output does not switch to HDMI 2. Test audio auto-switch with Bluetooth devices and HDMI hot-plug 3. Test PulseAudio and PipeWire backends 4. Test input port auto-switch behavior fix: 修复禁用有线耳机和USB扬声器时音频端口错误切换 1. 移除 refreshPorts 中 AvailableTypeNo 过滤条件,临时不可用但已启用的端口保留在优先级队列中 2. 在 checkAutoSwitchOutputPort 中新增端口可用性检查,跳过不可用端口 3. 在 checkAutoSwitchInputPort 中新增对称的可用性检查 4. 防止禁用有线耳机和USB扬声器时输出错误切换到HDMI Log: 修复禁用有线耳机和USB扬声器端口时输出设置自动切换为HDMI的问题 Influence: 1. 测试禁用有线耳机和USB扬声器端口后,输出不会切换到HDMI 2. 测试蓝牙设备和HDMI热插拔场景下的音频自动切换 3. 测试 PulseAudio 和 PipeWire 后端兼容性 4. 测试输入端口自动切换行为 PMS: BUG-378321
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: MyLeeJiEun The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe fix separates priority-list membership from current port availability: enabled ports remain prioritized through transient profile states, while auto-switch logic checks availability at selection time and skips unavailable input or output candidates. Flow diagram for availability-aware audio auto-switchingflowchart TD
A[refreshPorts] --> B{Port enabled?}
B -->|No| C[Exclude from priority queue]
B -->|Yes| D[Keep in priority queue]
D --> E[checkAutoSwitchOutputPort or checkAutoSwitchInputPort]
E --> F{Available == AvailableTypeNo?}
F -->|Yes| G[Skip candidate]
F -->|No| H[Select candidate for auto-switch]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Hi @MyLeeJiEun. Thanks for your PR. I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
修复禁用有线耳机和USB扬声器端口时输出设置错误切换为HDMI的问题
问题描述
禁用有线耳机和USB扬声器端口后,输出设置错误切换为HDMI,且音频仍从有线耳机输出。
修改内容
audio1/priority_manager.go:refreshPorts移除对AvailableTypeNo端口的过滤,仅按!pc.Enabled跳过,临时不可用但已启用的端口保留在优先级队列中audio1/audio_events.go:checkAutoSwitchOutputPort/checkAutoSwitchInputPort新增端口可用性检查,Available == AvailableTypeNo时跳过,避免自动切换到不可用端口Multica Issue
DDE-400
PMS
https://pms.uniontech.com/bug-view-378321.html
Summary by Sourcery
Prevent automatic audio routing from selecting unavailable ports while preserving enabled ports across transient availability changes.
Bug Fixes: