• src/syncterm/CHANGES HACKING.md Manual.txt syncterm.c src/xpdev/xpbeep

    From Deuc¿@VERT to Git commit to main/sbbs/master on Wednesday, May 20, 2026 14:22:13
    https://gitlab.synchro.net/main/sbbs/-/commit/35933ca0b6ae02e5c90f883b
    Modified Files:
    src/syncterm/CHANGES HACKING.md Manual.txt syncterm.c src/xpdev/xpbeep.c
    Log Message:
    xpbeep: reorder audio backends to put native + cross-platform first

    Master's xptone_open_locked() try-order was PulseAudio second (after CoreAudio), which on Linux meant PortAudio and SDL both fell in line
    behind a libpulse-based path that re-runs the protocol setup on every
    fallback and can wedge on a misbehaving pipewire-pulse server (ticket
    254). PortAudio reuses a persistent stream and is far less exposed.

    New order in xptone_open_locked() and do_xp_play_sample():

    CoreAudio, Win32 WASAPI, PortAudio, SDL, PulseAudio, ALSA, OSS

    Native platform APIs first (guaranteed-present on their platforms),
    then cross-platform abstractions (battle-tested for desktop audio),
    then the server-specific PulseAudio path, then direct-hardware paths
    in declining modernity. This means PulseAudio is consulted only when
    the build was specifically configured PA-only or PortAudio/SDL both
    declined to open.

    While here, drop the recursive xptone_open_locked() call inside do_xp_play_sample()'s non-THREAD_SAFE PA fallback and legacy ALSA
    failure paths. Reopening mid-call left do_xp_play_sample()'s
    need_copy state stale for the new backend (landing on PortAudio /
    Win32 / SDL after a PA failure would skip the required buffer copy). Close-without-reopen instead; the worker thread's next iteration runs xptone_open_locked() with fresh state and a correctly computed
    need_copy. The THREAD_SAFE PA path (master's audio overhaul) already
    handles this through the mixer layer and isn't affected.

    UI and documentation updated to match:

    - syncterm.c: audio_output_bits[] and audio_output_types[] reordered
    so the Audio Output Mode menu in bbslist.c renders backends in the
    order they will actually be tried. Added the missing CoreAudio
    entry to both arrays (pre-existing gap: the engine has used
    CoreAudio as first-try on macOS the whole time but it was absent
    from the UI list). Numeric INI representation is unchanged because
    the bit values come from XPBEEP_DEVICE_* constants, not from array
    position; existing INIs continue to parse correctly and the
    "WaveOut" read-side alias for "WASAPI" is preserved.

    - HACKING.md, Manual.txt: backend enumerations reflect the new try
    order.

    CHANGES line goes under Version 1.9 because the equivalent fix shipped
    on the syncterm-1.9 branch as aded625a68.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net