Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/linux-dbus-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
sudo apt-get -o Acquire::Retries=3 install -y fakeroot python3-dbus python3-gi dbus-x11 xvfb xauth playerctl libasound2t64 libgl1 libegl1
- name: Test D-Bus services and build release package
run: |
dbus-run-session -- bash gradlew :test --tests '*MprisServiceTest*' --tests '*LinuxStatusNotifierServiceTest*' -PdesktopOnly=true --console=plain
dbus-run-session -- bash gradlew :test --tests '*MprisServiceTest*' --tests '*LinuxStatusNotifierServiceTest*' --tests '*LazyAudioEngineTest*' -PdesktopOnly=true --console=plain
bash gradlew packageReleaseDeb -PdesktopOnly=true --console=plain
- name: Exercise final Debian package with its embedded runtime
run: |
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ tasks.register<Test>("headlessTest") {
"OnnxNativeLoadTest", "ToolWindowStyleRaiseToFrontTest", "*SoundCloudOAuthTest", "ClearStreamFilesTest", "ThemePersistenceTest", "SetupOnboardingTest",
"*WindowsProtectedPlaybackTest", "*WindowsProtectedMediaTest",
"Issue93BugfixesTest.testWindowsUpdaterScriptConstruction*", "InstallerProcessTest", "*ChromeCdmArchiveTest", "KittyTuneProcessesTest", "*SidecarLockOrderTest",
"*HlsOpeningTest", "*WindowsHeadphoneDetectionTest"
"*HlsOpeningTest", "*WindowsHeadphoneDetectionTest", "*LazyAudioEngineTest"
).forEach(::includeTestsMatching)
}
}
Expand Down
26 changes: 26 additions & 0 deletions experiments/deferred-dsp/EngineProbe.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import com.alananasss.kittytune.audio.AudioEngine;
import com.alananasss.kittytune.ui.player.AudioEffectsState;
import com.alananasss.kittytune.ui.player.EqualizerState;
import com.sun.management.ThreadMXBean;
import java.lang.management.ManagementFactory;
public class EngineProbe {
public static void main(String[] args) {
ThreadMXBean bean = (ThreadMXBean) ManagementFactory.getThreadMXBean();
bean.setThreadAllocatedMemoryEnabled(true);
long thread = Thread.currentThread().threadId();
for (int i=0; i<26; i++) {
long bytes = bean.getThreadAllocatedBytes(thread);
long cpu = bean.getCurrentThreadCpuTime();
long start = System.nanoTime();
AudioEngine engine = new AudioEngine(true);
engine.applyEffects(new AudioEffectsState());
engine.applyEqualizer(new EqualizerState());
engine.dspStages();
long elapsed = System.nanoTime()-start;
cpu=bean.getCurrentThreadCpuTime()-cpu;
bytes=bean.getThreadAllocatedBytes(thread)-bytes;
System.out.println("RESULT\t"+i+"\t"+elapsed+"\t"+cpu+"\t"+bytes);
engine.release();
}
}
}
22 changes: 22 additions & 0 deletions experiments/deferred-dsp/RESULTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
the shared audio engine built and configured every effect processor during player construction, even before any PCM existed. saved FX/EQ settings also updated the DSP directly from the caller's thread.

this creates the effect graph on the decoder's first PCM block and applies pending FX, EQ and stretch settings at block boundaries. it keeps the latest pre-play settings and automix ratios, configures processors before use, and releases a graph that loses a race with engine disposal. stopping or releasing an idle engine does not create DSP resources.

this is shared code for Linux and Windows. the six new tests run in the Windows headless job and both Linux jobs. no UI, DSP equations or signal order changed.

validation:

- the idle-allocation regression failed on the old engine. six new tests now pass, covering idle close, first-block mono/EQ, later changes, automix ratios and use after release.
- 73 relevant local audio, limiter, trim, HLS, DRM-session and updater regressions passed. these used the installed 1.6.0 dependencies; a fresh full source build remains for CI.
- a separate review found no important lifecycle or audio-output issues.
- five alternating pairs of fresh JVM launches, with two excluded warmups, the same runtime/dependencies/profile and AOT disabled for both: median main-screen drawn + visible startup was 6.376 s before and 6.109 s after (4.2%). one pair was slower. this is a modest whole-window change, not a large whole-app speedup.

| pair | before, ms | after, ms |
|---|---:|---:|
| 1 | 6918 | 6185 |
| 2 | 6376 | 6079 |
| 3 | 6269 | 6109 |
| 4 | 7206 | 7355 |
| 5 | 6168 | 5942 |

filesystem caches were warm. all paired samples were retained, launches were gated on quiet CPU, and the endpoint required the actual main screen's draw marker and a visible window owned by that process. these timings are from Windows hardware; Linux coverage is functional CI, not a claimed Linux timing result. preparing the already-existing AOT cache for the personal installed build is separate work and its gain is not attributed to this PR.
84 changes: 84 additions & 0 deletions experiments/deferred-dsp/startup-samples.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
[
{
"variant": "baseline",
"run": "warmup-baseline",
"warmup": true,
"drawn_visible_ms": 7086.339
},
{
"variant": "candidate",
"run": "warmup-candidate",
"warmup": true,
"drawn_visible_ms": 6167.294
},
{
"variant": "baseline",
"run": "pair-0-baseline",
"warmup": false,
"drawn_visible_ms": 6917.769,
"pair": 0
},
{
"variant": "candidate",
"run": "pair-0-candidate",
"warmup": false,
"drawn_visible_ms": 6185.471,
"pair": 0
},
{
"variant": "candidate",
"run": "pair-1-candidate",
"warmup": false,
"drawn_visible_ms": 6079.134,
"pair": 1
},
{
"variant": "baseline",
"run": "pair-1-baseline",
"warmup": false,
"drawn_visible_ms": 6375.69,
"pair": 1
},
{
"variant": "baseline",
"run": "pair-2-baseline",
"warmup": false,
"drawn_visible_ms": 6268.94,
"pair": 2
},
{
"variant": "candidate",
"run": "pair-2-candidate",
"warmup": false,
"drawn_visible_ms": 6109.437,
"pair": 2
},
{
"variant": "candidate",
"run": "pair-3-candidate",
"warmup": false,
"drawn_visible_ms": 7355.461,
"pair": 3
},
{
"variant": "baseline",
"run": "pair-3-baseline",
"warmup": false,
"drawn_visible_ms": 7205.841,
"pair": 3
},
{
"variant": "baseline",
"run": "pair-4-baseline",
"warmup": false,
"drawn_visible_ms": 6168.188,
"pair": 4
},
{
"variant": "candidate",
"run": "pair-4-candidate",
"warmup": false,
"drawn_visible_ms": 5942.297,
"pair": 4
}
]
Loading
Loading