Repository navigation
Conversation
… the lock SimpleVolume::SetMasterVolume, StreamVolume::SetChannelVolume and StreamVolume::SetAllVolumes tested `level < 0 || level > 1`, which is false for NaN, so a NaN level was stored (kevincommits' finding in ProjectLeonida#1608). They now share volume_level(), which accepts only 0 <= level <= 1, as SpatialObject::SetVolume in the same file already does. SimpleVolume also read and wrote AudioClient::master_ and mute_ without the client's lock, unlike the channel volumes. They are now private and reached through locked accessors. silent_audio_test gains checks that each setter refuses NaN and keeps the previous level (3 fail with the old test), plus a mute round trip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Closing as a duplicate of #2521 (RT-SILENT-AUDIO-VOLUME-AND-SPATIAL), which two of our sessions opened against the same item at the same time. #2521 covers everything here (NaN volumes refused through one check, master volume and mute under the client's lock) plus the rest of item 4. Sorry for the noise. AI-assisted (Claude Code). |
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.
Claimed in the coordination issue as: RT-SILENT-AUDIO-VOLUME-NAN (#1608 (comment))
What and why
This fixes the first bullet of item 4 in kevincommits' finding in #1608 (#1608 (comment)).
SimpleVolume::SetMasterVolume,StreamVolume::SetChannelVolumeandStreamVolume::SetAllVolumestestedlevel < 0.0f || level > 1.0f. That test is false for NaN, so a NaN level was stored and read back. All three now sharevolume_level(), which accepts only0 <= level <= 1.SpatialObject::SetVolumein the same file already checks it that way.SimpleVolumeread and wroteAudioClient::master_andmute_directly, withoutclient_->lock_, while the channel volumes take that lock. Both members are now private and are reached through locked accessors.Not changed: the second bullet, about
SpatialStream::ActivateSpatialAudioObjectoutsideBeginUpdatingAudioObjectsandResetkeeping objects active. Microsoft's own spatial audio sample activates its static objects beforeStart, outside an update, so refusing that call would break titles that follow it. Nothing I could check shows that Windows'Resetdeactivates objects either. Both are left as they are.Merges cleanly with the other open
silent_audioPRs, #2133, #2134 and #2387.Tested
silent_audio_testgains checks:SetAllVolumeswith one NaN sets none.ctest -R silent_audiopasses.GPUs tested: profile M: NVIDIA GeForce RTX 4070 SUPER, 12 GB, desktop, driver 621.01, Windows 11 (CPU-only test)
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code