Repository navigation
Download / ダウンロード
English: Requires macOS 12.0 or later. Download BackgroundMusic-0.5.0-dp.1.pkg, double-click to install. No Terminal required. DPA = DigiPressApps.
日本語: macOS 12.0 以降。BackgroundMusic-0.5.0-dp.1.pkg をダウンロードし、ダブルクリックでインストール。ターミナル不要。DPA は DigiPressApps の略称です。
Signed & notarized / 署名・公証済み: Developer ID + Apple notarization. Gatekeeper should accept a normal double-click install.
Developer ID 署名・Apple 公証済みです。通常はダブルクリックでインストールできます。
Checksum (SHA256): 1e3f769ce5bfd01e5deca1ac998736eb7968703bc674f89407ffa07173e6271a
Critical fix vs upstream 0.5.0 / 本家 0.5.0 からの致命的修正
Upstream 0.5.0 on recent macOS (especially macOS 26) can grow BGMApp memory into the multi‑GB range (Activity Monitor Physical Footprint) during long idle runs, until the menu bar app becomes unusable or is killed. That behavior is not a normal footprint; it is a destructive memory leak driven by AppKit/SwiftUI UI paths that keep dirtying heap while the menu is closed.
本家 0.5.0 を最近の macOS(特に macOS 26)で長時間放置すると、BGMApp のメモリ(アクティビティモニタの物理メモリ)が 数 GB まで肥大し、メニューバーアプリが実用不能になる/強制終了されることがあります。通常の常駐フットプリントではなく、メニューを閉じたままでも UI 経路がヒープを汚し続ける 致命的なメモリリークです。
Cause / 原因(本家 0.5.0)
English
- Status-bar volume icons via SF Symbols (
imageWithSystemSymbolName:) — pulls IconServices / SwiftUI / AttributeGraph into the always-on status item; repeatedsetImage:while idle accumulates bitmap/AG state. - Output volume
NSSliderupdates while the menu is closed — on macOS 26 the slider is SwiftUI-backed (DesignLibrary); Core Audio volume/mute notifications still push slider updates overnight and grow AttributeGraph. - Over-broad Core Audio property listeners — volume change callbacks fire more often than needed, amplifying the redundant UI work above.
- Per-app mute buttons using SF Symbols — same IconServices/SwiftUI path inside the volumes menu.
日本語
- ステータスバー音量アイコンの SF Symbol 利用(
imageWithSystemSymbolName:)— 常駐ステータス項目に IconServices / SwiftUI / AttributeGraph が入り、アイドル中の繰り返しsetImage:でビットマップ/AG 状態が蓄積する。 - メニュー閉鎖中の出力音量
NSSlider更新 — macOS 26 ではスライダーが SwiftUI 実装(DesignLibrary)。Core Audio の音量/ミュート通知が夜間もスライダーを更新し AttributeGraph が成長する。 - 広すぎる Core Audio プロパティリスナー — 音量変更コールバックが過剰に発火し、上記の無駄な UI 更新を増幅する。
- アプリ別ミュートボタンの SF Symbol — 音量メニュー内でも同じ IconServices/SwiftUI 経路を踏む。
What DPA 0.5.0-dp.1 changes / DPA が直した内容
| Area / 箇所 | Upstream 0.5.0 | DPA 0.5.0-dp.1 |
|---|---|---|
| Status bar icon | SF Symbol volume glyphs | Pre-rendered bitmap Volume0–3 icons; skip setImage: when appearance unchanged (BGMStatusBarItem.mm) |
| Output volume slider | Sync on every volume notification | Sync only while the menu is open (or first apply); skip identical value/enabled updates (BGMOutputVolumeMenuItem.mm) |
| Volume listeners | Broader device property set | Listen to volume + mute only (BGMVolumeChangeListener.cpp) |
| App mute buttons | SF Symbol mute/unmute images | Text titles only; no SF Symbol in mute controls (BGMAppVolumes.m) |
Result / 結果: After ~20 hours idle on macOS 26, Physical Footprint stayed around ~180–190 MB instead of climbing into multi‑GB. Residual DesignLibrary cost from always-visible per-app NSSliders in the menu is accepted for UX.
約 20 時間の放置で物理メモリは 約 180–190 MB 前後で安定(本家経路では数 GB 級まで増加)。メニュー内の常設アプリ別 NSSlider による DesignLibrary 残コストは UX 優先で許容。
Commit: 6c748cd — Fix macOS 26 menu-bar memory growth from status item and volume UI.
Highlights / 主な機能
English
- Based on upstream Background Music 0.5.0 (idle IO stop, mute button, browser helper volumes, crash fixes)
- Fixes the multi‑GB menu-bar memory leak that affects upstream 0.5.0 on recent macOS (see above)
- Persist per-app volume and pan across restarts (DPA)
- Restore saved levels when playback starts (e.g. Finder Quick Look)
日本語
- 本家 Background Music 0.5.0 ベース(無音時 IO 停止、ミュート、ブラウザ helper 音量、クラッシュ修正など)
- 本家 0.5.0 で発生する数 GB 級メニューバーメモリリークを修正(上記参照)
- アプリ別音量・パンの永続化(DPA)
- 再生開始時の自動音量復元
Details: MIGRATION · CHANGELOG · README
Notes / 注意
- Upgrading from 0.4.4-dp.1 or upstream 0.5.0: uninstall first, then install this package (driver + app must match). Upstream 0.5.0 users on recent macOS should upgrade to this build specifically for the memory-leak fix.
- Chrome may need a restart after Background Music launches so it uses the Background Music output device.
- If you still see multi‑GB memory growth after long idle runs, please open an issue.