Switching the equalizer on can freeze the whole app for over a minute, and a launch with it on shows no window until then

Open
#604 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
58/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
swift

Research direction

Read AudioEqualizerEngine.swift, EqualizerPrivilegedHelperClient.swift, EqualizerHALPluginController.swift, and SpotiglassApp.swift at the referenced call sites to trace which waits run from the main actor. Start with testStartingTheEqualizerNeverBlocksTheMainThread and use it to check that a delayed installer does not block the main queue. Done means equalizer setup runs off the main actor with timeouts, startup restoration happens after the window appears, and the test passes.

Written by the indexing model from the issue text.

Description

bug performance priority:medium status:queued

When the equalizer helper or Core Audio is slow (the helper is approved but hangs, or coreaudiod takes a while to come back, which it does after every install because the helper restarts it), switching the equalizer on freezes the whole app with a beachball for up to about a minute and a half. With the EQ already on, the window doesn't even appear until the wait is over.

AudioEqualizerEngine is @MainActor (AudioEqualizerEngine.swift:84-86) and start() calls pluginController.enable() synchronously (:235-252). On that thread:

If it then fails, the switch just flips back with no line saying why; that part is #587.

How to see it
testStartingTheEqualizerNeverBlocksTheMainThread: inject an installer that sleeps 2 s, call engine.start on the main actor, and check that a main-queue block scheduled 100 ms later ran before start returned. It fails today.

Done means

  • Installing, registering and waiting for the device and router run off the main actor, with timeouts; the Equalizer page shows "Starting…" and the rest of the app keeps working.
  • At launch the equalizer is restored after the window is up.
  • No Thread.sleep or semaphore wait is reachable from the main actor in the equalizer code (the guard issue proposes a CI check for this).
  • The test above, failing on today's code.
Dominant language
Swift
Stars
9
Forks
3
Avg merge
5h 37m
Merged PRs (30d)
111

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from isaaclins/wax

All issues in isaaclins/wax

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.