Skip to content

sound: derive WTBUFLEN from WT_FREQ#6951

Merged
OBattler merged 1 commit into
86Box:masterfrom
skiretic:pr/wtbuflen-sound-fix
Mar 17, 2026
Merged

sound: derive WTBUFLEN from WT_FREQ#6951
OBattler merged 1 commit into
86Box:masterfrom
skiretic:pr/wtbuflen-sound-fix

Conversation

@skiretic

@skiretic skiretic commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

Summary

fix WTBUFLEN so the wavetable buffer length is derived from WT_FREQ instead of MUSIC_FREQ.

the old code mixed two different subsystems:

#define MUSIC_FREQ  FREQ_49716
#define MUSICBUFLEN (MUSIC_FREQ / 36)

#define WT_FREQ     FREQ_44100
#define WTBUFLEN    (MUSIC_FREQ / 45)

that meant the wavetable path declared a 44.1 khz rate, but sized its buffer as if it were running at 49.716 khz. this changes the batching threshold from 1104 samples to 980 samples and makes the wavetable path internally inconsistent.

this pull request changes it to:

#define WTBUFLEN    (WT_FREQ / 45)

Checklist

References

  • /src/include/86box/sound.h
  • local verification in a windows 98 gaming pc workload showed no obvious regression after correcting the constant

@OBattler OBattler merged commit 44cb8b8 into 86Box:master Mar 17, 2026
44 checks passed
@skiretic skiretic deleted the pr/wtbuflen-sound-fix branch March 18, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants