mirror of
https://github.com/lucannez64/darling-lol.git
synced 2026-10-26 19:47:42 +00:00
Darling's libvDSP was almost entirely void stubs. Chromium's Blink WebAudio on macOS uses vDSP_vsmul for any GainNode gain other than 0 or 1, so with the League client's master volume below 100% the master gain output buffer was never written: silence when starting below 100%, and the last block repeating as a buzz when lowering the volume. vDSP_vadd was also a stub, so simultaneous sounds were not summed and a new sound replaced the previous one. Implement every vDSP function the Chromium Embedded Framework imports: vadd, vsub, vmul, vsmul, vsadd, vsma, svesq, vclip, conv, ctoz, ztoc, zvmul, deq22, deq22D, create_fftsetup, destroy_fftsetup and fft_zrip, with Apple's argument order and scaling (forward real FFT is 2x the DFT, inverse unscaled). The FFT is in place and keeps only read-only twiddles in the setup, which callers share across threads. Build vDSP at -O2 because it runs on the realtime render thread, and drop the uncompiled basic.c. The runtime installer now builds libvDSP and installs it at its absolute path in the stopped prefix, keeping a .before-vdsp backup. Verified against naive references for sizes up to 2^15 on the host; confirmed manually that client sound is fixed at any volume. Fixes #4 Co-Authored-By: Claude Opus 5.5 <[email protected]>