Skip to content

release

Latest

Choose a tag to compare

@bitnestt bitnestt released this 16 Aug 10:27

szync v1.2 Release Notes & Fixes

🛠️ Overview of Changes in Version 1.2

Version 1.2 introduces critical bug fixes, stability improvements, memory and resource leak resolutions, and hardened buffer safety across the entire audio pipeline.


🐛 Critical Bug Fixes & Stability Improvements

  1. Atomic Configuration Persistence (Windows File Overwrite Fix)

    • Issue: Under Windows, std::filesystem::rename failed with ERROR_ALREADY_EXISTS whenever the destination configuration file already existed, causing modified device preferences, volume levels, and window coordinates to be lost on application restarts.
    • Fix: Switched to atomic overwrite semantics using MoveFileExW(..., MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH) with automatic directory creation and fallback error recovery in src/config_manager.h.
  2. Eliminated HMODULE Handle Leak on Loopback Activation

    • Issue: Dynamic loading of mmdevapi.dll during process loopback activation called FreeLibrary only on error paths. Successful activations and recurring re-connections leaked module references over time.
    • Fix: Ensured deterministic module cleanup via FreeLibrary across all execution branches in src/audio_engine.cpp.
  3. Automatic Stream Start upon Filter / Routing Updates

    • Issue: When transitioning a stopped renderer (such as the default output device without filtering) to an isolated application process filter, UpdateSourceFormat only resumed playback if the stream was already running, leaving the stream in a perpetual stopped state.
    • Fix: AudioCoordinator::EnableDevice now automatically invokes Start() when an eligible device or filter becomes active.
  4. Unified COM Multi-Threaded Apartment (MTA) Initialization

    • Issue: ComInitRAII defaulted to COINIT_APARTMENTTHREADED (STA), causing RPC_E_CHANGED_MODE errors and uninitialized COM states (CO_E_NOTINITIALIZED) when called across background threads and audio engines.
    • Fix: Standardized ComInitRAII to COINIT_MULTITHREADED (MTA) across all routines (GetBaselineFormat, StartInternal, and capture loops).
  5. Hardened Ring Buffer & Resampler Safety

    • Issue: Zero-frame capacities or zero-channel formats could cause integer underflow (SIZE_MAX) or modulo-by-zero division crashes in AudioRingBuffer.
    • Fix: Added minimum capacity thresholds (≥ 1024 frames, ≥ 1 channel) alongside comprehensive bounds and null pointer guards in all buffer, resampler, and matrix processing functions.
  6. COM Endpoint Notification Callback Error Handling

    • Fix: Verified return status on RegisterEndpointNotificationCallback in src/main.cpp, ensuring the instance is released immediately if registration fails.