[Bugfix] --audio-off and config.audio_enabled are dead code: audio plays under --headless #406
Labels
No labels
Alpha Release Requirement
Bugfix
Demo Target
Documentation
Major Feature
Minor Feature
priority:tier1-active
priority:tier2-foundation
priority:tier3-future
priority:tier4-deferred
Refactoring & Cleanup
system:animation
system:documentation
system:grid
system:input
system:performance
system:procgen
system:python-binding
system:rendering
system:ui-hierarchy
Tiny Feature
workflow:blocked
workflow:needs-benchmark
workflow:needs-documentation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
john/McRogueFace#406
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Found while working #394 (seeding the engine's internal RNG streams).
McRogueFaceConfig::audio_enabledis written and never read:Nothing in
GameEngine,PySound,PySoundBufferorPyMusicconsults it. Consequences:--audio-offis a no-op. Constructing aSoundstill opens an OpenAL device andplay()still plays.
--headlessis a runtime flag andMCRF_HEADLESSis a build option — unrelated. The stockbuild/mcroguefaceis a full SFML build, so--headlessgets the real OpenAL-backedsf::Sound,not
src/platform/HeadlessTypes.h's stubs. Verified: aSoundbuilt fromSoundBuffer.sfxr(...)under--headless --audio-offreportsplaying == True.This is also the likely mechanism behind #400 (
alc_cleanup: 1 device not closedaborts duringteardown in the default headless suite): a suite that believes it is running without audio is
opening and closing real devices.
Suggested fix: have
PySound/PySoundBuffer/PyMusichonouraudio_enabled— either refuse toopen a device (Fail Early, loud) or make playback a documented no-op. Deleting the flag is the other
honest option; silently accepting a flag that does nothing is the worst of the three.