tenacityteam/tenacity
47
939
Fork
You've already forked tenacity
31

Remove outdated PortMixer device selection on Launch #736

Merged
generic-pers0n merged 1 commit from issue-719-fix into main 2026年07月02日 02:39:09 +02:00

What issue does your PR resolve?

#719

Describe your PR

Remove outdated code that was left in WASAPI device initialization. In DeviceManager::Rescan(), the input Pa_OpenStream was being called to handle PortMixer, which cdcb2bb18 removed. The stream's result isn't actually used for anything except deciding "totalSources <= 1", which is always true now. Removing the Pa_OpenStream call entirely eliminates the issue. Removing that meant that we no longer needed AddSourcesFromStream, DummyPaStreamCallback, IsInputDeviceAMapperDevice or the WASAPI header, since they were no longer being used, so those were also removed. The dead code was replaced with the functional equivalent of the fallthrough case, which because totalSources <= 1 in all branches is much simpler than the previous code.

IsPlaybackRateSupported and IsCaptureRateSupported within AudioIoBase.cpp may also need to be modified to trust the default OS sample rate (PaDeviceInfo::defaultSampleRate instead of a call to Pa_IsFormatSupported()), as currently the WASAPI code does not have the same kind of guard code as the DirectSound implementation. The TODO within AudioIOBase even anticipates improving the sample rate detection, so it seems that at some point Audacity intended to improve how this works as well.

For now I have only made the one change and would like to see if this single fix (removing the dead code) is enough to address the bug. I was no longer able to reproduce the bug on my machine after implementing this fix, but I would expect to need more people confirming that this new code is working correctly before merge.

Checklist

  • This PR compiles on my machine

  • My contributions are licensed under GPL v2 or later (unless
    otherwise exempted).

  • All commits have been signed-off to comply with the DCO.

  • I made sure the title of this PR reflects the core meaning of the
    issue I am solving.

  • I did not make unnecessary changes to the code.

  • I have descriptive commit message(s) that thoroughly cover my
    changes.

### What issue does your PR resolve? #719 ### Describe your PR Remove outdated code that was left in WASAPI device initialization. In `DeviceManager::Rescan()`, the input `Pa_OpenStream` was being called to handle PortMixer, which cdcb2bb18 removed. The stream's result isn't actually used for anything except deciding "totalSources <= 1", which is always true now. Removing the `Pa_OpenStream` call entirely eliminates the issue. Removing that meant that we no longer needed `AddSourcesFromStream`, `DummyPaStreamCallback`, `IsInputDeviceAMapperDevice` or the WASAPI header, since they were no longer being used, so those were also removed. The dead code was replaced with the functional equivalent of the fallthrough case, which because totalSources <= 1 in all branches is much simpler than the previous code. `IsPlaybackRateSupported` and `IsCaptureRateSupported` within AudioIoBase.cpp may also need to be modified to trust the default OS sample rate (`PaDeviceInfo::defaultSampleRate` instead of a call to `Pa_IsFormatSupported()`), as currently the WASAPI code does not have the same kind of guard code as the DirectSound implementation. The TODO within AudioIOBase even anticipates improving the sample rate detection, so it seems that at some point Audacity intended to improve how this works as well. For now I have only made the one change and would like to see if this single fix (removing the dead code) is enough to address the bug. I was no longer able to reproduce the bug on my machine after implementing this fix, but I would expect to need more people confirming that this new code is working correctly before merge. ### Checklist - [x] This PR compiles on my machine - [x] My contributions are licensed under GPL v2 or later (unless otherwise exempted). - [x] All commits have been signed-off to comply with the DCO. - [x] I made sure the title of this PR reflects the core meaning of the issue I am solving. - [x] I did not make unnecessary changes to the code. - [x] I have descriptive commit message(s) that thoroughly cover my changes.
When PortMixer was removed in cdcb2bb18, vestigal code
attempting to use it was left in device initialization
under WASAPI on Windows hosts. Because PortMixer was
always failing, the default OS sample rate of 44100
was being selected as the default for WASAPI driver.
Fixes #719
Signed-off-by: Emily Mabrey <emilymabrey93@gmail.com>
emabrey changed title from (削除) WIP: Remove outdated PortMixer device selection on Launch (削除ここまで) to Remove outdated PortMixer device selection on Launch 2026年06月25日 11:55:25 +02:00

I edited your issue so it links to the actual issue because why not :)

I'll be testing this right now too.

I edited your issue so it links to the actual issue because why not :) I'll be testing this right now too.
generic-pers0n left a comment
Copy link

Unfortunately, I wasn't quite able to reproduce the original issue, but I am putting my trust in this PR and merging it. You have my approval! 😄

Unfortunately, I wasn't quite able to reproduce the original issue, but I am putting my trust in this PR and merging it. You have my approval! 😄
generic-pers0n deleted branch issue-719-fix 2026年07月02日 02:39:10 +02:00
First-time contributor
Copy link

I was able to confirm the bug is patched in the latest nightly. Thanks all

I was able to confirm the bug is patched in the latest nightly. Thanks all
Sign in to join this conversation.
No reviewers
Labels
Clear labels
bug
Something isn't working
build
Related to the software build process
can't reproduce
This issue can't be reproduced
cleanups
Involves code cleanups
Design
Issues and pull requests concerning the design and overall look and feel of the project
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
export
Something related to exporting audio
external
An issue regarding something outside of Tenacity (e.g., a wxWidgets problem causing a bug)
ffmpeg
An issue related to FFmpeg
good first issue
Good for newcomers
governance
An issue relating to project governance
hacktoberfest
Contributors meant for DigitalOcean's Hacktoberfest event
help wanted
Extra attention is needed
HIGH PRIORITY
This should be the FIRST thing you think about when fixing something!
import
Something related to importing audio or MIDI
In progress
We'er working on it!
invalid
This doesn't seem right
linux
A Linux-specific/Linux-only issue
mac
A macOS-specific/macOS-only issue
major
Something that represents a major change
needs discussion
Needs additional discussion before something can proceed.
platforms
An issue regarding platforms
PSA
An issue that also backs as an announcement and has other important implications
question
Further information is requested
refactoring
Related to a refactoring task
remerge
Something re-merged from an older codebase, like from pre-rebase Tenacity or tenacity-legacy.
translations
Something related to translations. Couls be an improvement or suggestion.
website
Website issues or requests (might be migrated to our website repo)
windows
A Window-specific/Windows-only issue
wontfix
This issue will not be worked on
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
tenacityteam/tenacity!736
Reference in a new issue
tenacityteam/tenacity
No description provided.
Delete branch "issue-719-fix"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?