Changelog
Windows builds: free code signing provided by SignPath.io, certificate by SignPath Foundation (code signing policy).
FYI:
Lokal is 100% local; the library, history, anything in database, or any info that is used for API's such as yt-dlp, LRCLIB, is NOT seen by us.
What's Changed
-
Keep Chromium on the real device clock during native PCM output (#262)
Details
Summary
With 16-bit PCM or 32-bit float output, native playback still stuttered while minimized. After #259 it starts a minute or two in instead of right away. Both delays have the same cause: Chromium's fake audio sink.
The lokal-pcm-output worklet runs on Chromium's AudioContext clock. Its output is all zeros, because only the native ring is meant to be heard.
- Before #259: setSinkId({ type: 'none' }) put the context on Chromium's timer-driven FakeAudioWorker straight away, so the stutter was instant.
- After #259: the context renders to the real speaker, but the default "interactive" latency still runs silence detection, because the native graph has no automatic pull nodes (RealtimeAudioDestinationHandler::SetDetectSilenceIfNecessary). After 30 s of exact zeros (AudioBus::AreFramesZero), SilentSinkSuspender moves the context back onto FakeAudioWorker.
- FakeAudioWorker::DoRead skips ticks when it runs late. Timers get late when the window is minimized, so the worklet produces fewer blocks than the device uses, and the native ring underruns.
Fix: while the worklet is active, it writes a constant 1e-9 (about -180 dBFS, below a 24-bit LSB) instead of zeros. SilentSinkSuspender never switches over, so the worklet stays paced by the real device clock. This works with any latencyHint.
Testing: node --test scripts/native-output.test.mjs passes (39/39). Not tested on Windows hardware: play 5+ min minimized with PCM16 and Float32, and check the [audio-visibility] log shows underrunEventsSincePreviousVisibility: 0.
-
Crossfade with pear-desktop style fade-in/fade-out and a logarithmic curve (#263)
Details
Summary
The existing crossfade was hard to hear: both songs used a linear gain ramp over the same window. Perceived loudness is logarithmic, so the old song stayed near full volume and then dropped at the very end, while the new one stayed inaudible until late. It came across as a quick swap, not a fade.
This ports pear-desktop's crossfade plugin (MIT) onto Lokal's existing two-element Web Audio graph:
- Timing: the next song starts
crossfade_secondsbefore the end (slider now goes to 20s). It fades in overcrossfade_fade_in(default 1.5s) while the old song fades out overcrossfade_fade_out(default 5s). The fade-out is capped at the time the old song has left. - Curve: pear's VolumeFader logarithmic scaling (linear in dB over a 60 dB range), applied with AudioParam.setValueCurveAtTime. Linear is still available via
crossfade_curve. Defaults to logarithmic, unlike pear's plugin default (linear). - Fades run on dedicated per-side fade gain nodes after the volume gains, so volume changes mid-fade no longer rescale or cut the fade.
- Crossfade settings now apply live from Settings, not just at startup.
- Existing readiness, timeout, fallback, stale-event and cancel handling is unchanged.
Logic lives in src/audio/crossfade.js, with tests in scripts/crossfade.test.mjs.
Testing: node --test scripts/*.test.mjs (476 pass, 0 fail) and vite build. Not yet tested by ear on hardware.
- Timing: the next song starts
Full Changelog: v6.1.0...v6.1.1
Setup
See README.md for full setup instructions.
Binary Checksums (SHA-256)
Lokal-6.1.1-arm64-mac.zip:
[C5699C0DC335B7807A3904B684949E02A0F04E97197AE6C35C42A89CBB6E9E2F]
Lokal-6.1.1-arm64-mac.zip.blockmap:[03526AF6529F837922BBEE8D77C90858C1940D1A8B69848B6729E9EBD4D95399]
Lokal-6.1.1-arm64.dmg:[76FC0B2C74DFF84A8E1C5D9AC89E4016A9736AA826F634B7F07FC96E7BB96C0D]
Lokal-6.1.1-arm64.dmg.blockmap:[615E653560B00694AF9025EA339956AC477C38465EAC7F3EBBB9E11120E5F8E6]
Lokal-6.1.1.AppImage:[476BA756246232E092648F7687E2AFEBD247CB45FA290DD967C8AFB8AB0E33D0]
Lokal-6.1.1.exe:[C1B350188A63A825740FC3CCA3B825714E73E9E7ECF896FA1BAEA981FE02A244]
Lokal-Setup-6.1.1.exe:[D89875306AD566AF8EA0848DEEF486E95DB67A9BCFB5526E2EDF5185DF323D49]
Lokal-Setup-6.1.1.exe.blockmap:[2A8312FBF373A0DC109D4213C91CB44B952F4C49D743748D79D2B6F12DB46286]
builder-debug.yml:[25DBC24C31C9E866DB814A66EE09509202B3D4E4EE6FAE55051F2F976F892579]
latest-linux.yml:[15427C560CADB55107DDD77A170241E616DD1490116EE8E8CC4CA28CFDD67950]
latest-mac.yml:[634E0913F477C41E10E73EF5DF19015B507D492FE796EEFC83457D9C769B7C4C]
latest.yml:[D72E5065B596B82A6D7C9F50193B57FF147A767A3DB36FD64826ECE314222083]
lokal-music_6.1.1_amd64.deb:[BE36BB2B515991EB2FB90C5A59143F14C3951073A64E05CBFC9409DAC6EF346E]
