Disable the automatic stereo-forcing heuristic for multichannel ALSA ... - #558
Draft
diamondsea11 wants to merge 1 commit into
Draft
Disable the automatic stereo-forcing heuristic for multichannel ALSA ...#558diamondsea11 wants to merge 1 commit into
diamondsea11 wants to merge 1 commit into
Conversation
…devices ShouldForceStereoChannels() collapses a device to stereo based on inspecting its ALSA channel map -- the function's own comment already describes it as "high-risk code, because it attempts to anticipate hypothetical device configurations with no actual testing." On genuinely multichannel interfaces (more than 2 real channels, not a legacy device reporting a bogus channel count) this heuristic misfires and forces the device down to 2 channels it does not actually need collapsing. This disables the heuristic unconditionally for channelsMax > 2, rather than attempting to refine it. The original channel-map-inspection logic is left in place below the new early return -- intentionally not deleted, so the exact conditions it was trying to detect remain visible for whoever decides its long-term fate. The channelsMax <= 2 fast path above is untouched. Test status, stated plainly rather than implied: there is no isolated unit test for this function, and writing one that means anything would need either real device channel-map fixtures or refactoring the function to take mock channel-map data instead of live snd_pcm_t/hw_params handles. Flagging this rather than claiming coverage that does not exist. Extracted as a single, minimal change from the diamondsea11/pipedal fork (feature/multipath-v1) for independent review, per the maintainer's request in rerdavies#555 to evaluate fork changes one topic at a time rather than as one combined diff. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
diamondsea11
marked this pull request as draft
August 6, 2026 11:53
diamondsea11
pushed a commit
to diamondsea11/pipedal
that referenced
this pull request
Aug 6, 2026
All four extracted branches are now open as drafts against rerdavies/pipedal: rerdavies#558 ALSA multichannel, rerdavies#559 S24_LE scaling, rerdavies#560 JUCE sidechain group fallback, rerdavies#561 LV2 category patching. All target main, which is what the branches were cut from; retargeting to dev is offered in each PR body. rerdavies#558 already existed as a non-draft and was converted, with its auto-populated commit-message body replaced by one written for review. Each PR body states the provenance Robin asked about in rerdavies#555 (not a developer, AI-implemented from descriptions) so he can calibrate review effort, and states verification honestly per PR -- only rerdavies#561 has actually been compiled. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Extracted from the
diamondsea11/pipedalfork as one self-contained change, per your request in #555 to review fork work one topic at a time rather than as a single large diff.What this does
ShouldForceStereoChannels()inspects a device's ALSA channel map and collapses it to stereo when the map looks like a legacy or surround configuration. On genuinely multichannel interfaces (more than 2 real channels, not a legacy driver reporting a bogus count) that heuristic misfires and forces the device down to 2 channels it does not need collapsing to.This adds an unconditional early return for
channelsMax > 2, disabling the heuristic rather than trying to refine it.Diff is one line. The original channel-map logic is deliberately left in place below the new return, not deleted, so the conditions it was trying to detect stay visible for whoever decides its long-term fate. The
channelsMax <= 2fast path above is untouched.Your own comment on that function already reads:
so this may be a change you'd rather make differently — happy to follow your lead on that.
Test status
There is no isolated unit test for this function, and I have not added one. Writing a meaningful test needs either real device channel-map fixtures or refactoring the function to accept mock channel-map data instead of live
snd_pcm_t/hw_paramshandles. Flagging that rather than implying coverage that doesn't exist.Verified in practice only on the hardware I have here (RME Babyface Pro FS, 4 in / 4 out), where the heuristic was the thing preventing all four channels from being available.
Provenance
As discussed in #555: I'm not a developer, and this code is AI-implemented from my descriptions. Please review it as such. I've kept the change as small as I could specifically so that reviewing it is cheap.
Targeting
mainsince that's what the branch is based on — happy to retarget todevif you'd prefer.