Skip to content

fix: macOS 26 compatibility — replace OSLogStore with Process()-based log reader#209

Closed
llostinthesauce wants to merge 1 commit into
vincentneo:mainfrom
llostinthesauce:fix/macos-26-compatibility
Closed

fix: macOS 26 compatibility — replace OSLogStore with Process()-based log reader#209
llostinthesauce wants to merge 1 commit into
vincentneo:mainfrom
llostinthesauce:fix/macos-26-compatibility

Conversation

@llostinthesauce

Copy link
Copy Markdown

Summary

  • Fixes 100% CPU usage on macOS 26+ by replacing OSLogStore.local() with Process()-based log streaming (/usr/bin/log stream)
  • Fixes duplicate OutputDevices/MediaRemoteController instances
  • Adds OrderedCollections dependency for efficient log-to-track pairing
  • Cleans up dead OSLog imports

What Changed

Root Cause

On macOS 26 (Tahoe), OSLogStore.local() causes 100% CPU usage and makes the app non-functional. This is documented in issues #183, #190, and #208.

Fix: LogReader (Process-based log streaming)

New LogReader.swift uses Process() to spawn /usr/bin/log stream with a predicate targeting Apple Music's ampplay category. Log entries are parsed and published as a Combine stream. This is based on the approach in the v3 draft PR #201.

Other Fixes

  • Duplicate instances: AppDelegate now owns the single OutputDevices instance; MenuBarController receives it via setup. Previously both created their own instances, with only one wired to the UI.
  • Removed OSLogStore: Console.getRecentEntries() is now a stub; OSLog imports removed from CMPlayerStuff.swift and ContentView.swift.
  • New models: CMEntry, AudioFormat, InfoPair for structured log entry parsing and track-format pairing.
  • Safer unwrapping: AppVersion.swift uses optional chaining with defaults instead of force unwrap.

Dependencies Added

  • swift-collections (1.3.0) — for OrderedDictionary used in log-to-track pairing

Related Issues

Fixes #183, Fixes #190, Resolves #208

Testing

Built and tested on macOS 26.5 (Dev Beta 2). The log stream approach successfully reads Apple Music lossless track metadata without CPU spikes.

…()-based log reader

The core fix: OSLogStore.local() causes 100% CPU usage on macOS 26+.
Replace it with Process() spawning /usr/bin/log stream to read Apple
Music log entries as a Combine stream. This is the approach from the
v3 draft PR #201, cleaned up for a minimal, focused change.

Also fixes:
- Duplicate OutputDevices/MediaRemoteController instances:
  AppDelegate is now the single source of truth; MenuBarController
  receives a reference from AppDelegate instead of creating its own.
- Removed unused OSLog imports from CMPlayerStuff and ContentView.
- Console.getRecentEntries() stubbed out (OSLogStore removed).
- Added OrderedCollections dependency (swift-collections 1.3.0).
- Added helper models: CMEntry, AudioFormat, InfoPair.
- Safer optional unwrap in AppVersion.swift.
@llostinthesauce
llostinthesauce deleted the fix/macos-26-compatibility branch April 29, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Version 3 CPU usage 100% MAC OS 26 CPU Usage at 100% Does Not Work on Tahoe

1 participant