Skip to content

cplay v2.3 — Seamless USB DAC Support & Dynamic Device Switching

Choose a tag to compare

@Kosmodrom-lab Kosmodrom-lab released this 22 Oct 05:53
· 4 commits to main since this release
ccf3e98

🎧 Engine & Hardware Improvements

Universal USB DAC & High-Res Audio Stabilization: Resolved DirectSound device initialization failures (BASS_ERROR_ILLPARAM / Error 20) and driver buffer starvation artifacts across external USB DACs (validated on FiiO Q series and iBasso DC-03 Pro).

On-the-Fly Dynamic Device Switching: Added seamless audio output device switching during active playback without requiring an application restart, dropping active stream handles, or crashing Windows USB audio endpoints.

USB Ring-Buffer Headroom Optimization: Configured BASS buffer timing parameters (BASS_CONFIG_BUFFER, BASS_CONFIG_UPDATEPERIOD, BASS_CONFIG_DEV_BUFFER) specifically tuned to prevent USB audio packet drops and hotplugging stalls under Windows 7+.

🛠 Fixes & Stability

Startup Initialization Order: Fixed a race condition where audio device initialization ran before device enumeration and configuration parsing. The app now scans soundcards and loads cplay.ini first to guarantee correct hardware targeting.

Context Reset on Driver Failures: Implemented forced BASS_Free() calls between BASS driver init attempts to prevent stale DirectSound handle leaks (BASS_ERROR_ALREADY).

Infinite Track-Skipping Prevention: Guarded the main playlist processing loop against dead/lost audio device contexts (hStream == 0), replacing rapid track-skipping loops with clear, interactive user recovery prompts.

Clean Fallback Execution: Improved fallback logic when targeted soundcards are disconnected—gracefully falling back to the default Windows system endpoint without locking audio handles.