fix(sound): match ActiveRoute events to the correct node#1979
Closed
tmshlvck wants to merge 1 commit into
Closed
Conversation
…file_device Fix pop-os/cosmic-applets#1388 When a device has multiple sink/source nodes (e.g. a GPU with multiple HDMI outputs on a single ALSA card), an ActiveRoute event for the currently active device caused the handler to pick the first node from the device_ids IntMap whose device matched. IntMap iteration order is hash-based, so the first node was effectively random among nodes sharing the same device. Use card_profile_device to disambiguate: only match a node when its card.profile.device is listed in route.devices. This mirrors the matching already done in update_device_route_name. A LLM was used to analyze the code paths and draft the patch. The diagnosis and fix were verified end-to-end against a real multi-HDMI setup (Radeon HDMI/DP card with three sink nodes) by reproducing the stuck-volume symptom and confirming it no longer occurs after the patch is applied.
Member
|
Conflicts with #1972 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix pop-os/cosmic-applets#1388
When a device has multiple sink/source nodes (e.g. a GPU with multiple HDMI outputs on a single ALSA card), an ActiveRoute event for the currently active device caused the handler to pick the first node from the device_ids IntMap whose device matched. IntMap iteration order is hash-based, so the first node was effectively random among nodes sharing the same device.
Use card_profile_device to disambiguate: only match a node when its card.profile.device is listed in route.devices. This mirrors the matching already done in update_device_route_name.
A LLM was used to analyze the code paths and draft the patch. The diagnosis and fix were verified end-to-end against a real multi-HDMI setup (Radeon HDMI/DP card with three sink nodes) by reproducing the stuck-volume symptom and confirming it no longer occurs after the patch is applied.