Skip to content

feat(sounds): fix audio playback engine, wire battery/window chimes & add audition preview - #156

Merged
berlin-566 merged 3 commits into
mainfrom
feat/sound-effects-engine
Oct 22, 2026
Merged

berlin-566 merged 3 commits into
mainfrom
feat/sound-effects-engine

Conversation

@berlin-566

Copy link
Copy Markdown
Member

Summary

This pull request resolves the issue where system sound effects were not playing, fixes the underlying audio playback engine, connects missing battery and window audio events, and adds a sound audition button in Settings.

1. Root Cause & Sound Engine Fix

  • Eliminated Process Creation/Destruction Race: Previously, SoundService.qml used dynamic soundComp.createObject() combined with onRunningChanged: if (!running) procItem.destroy(). Because running starts at false upon object instantiation, this caused premature object destruction before the process could spawn or complete.
  • Static Process Pool: Replaced dynamic allocations with a dedicated pool of 4 static Process runners (p0–p3), allowing instant, zero-latency, concurrent audio playback without memory churn.
  • Direct Low-Latency Execution: Spawns native PipeWire (pw-play) with automated fallback to PulseAudio (paplay), ALSA (aplay), and agl sound play.
  • Fallback Path Resolution: Searches user config (~/.config/agility-shell/sounds/), system directory (/usr/share/agility-shell/sounds/), and local repository paths (../../sounds/).

2. Comprehensive Shell Sound Coverage

  • session-start: Plays startup chime on shell/session launch.
  • session-quit: Plays on system lock engagement, power menu actions, and shutdown.
  • battery-charge: Triggers automatically when AC power adapter is plugged in (batteryStatus transitions to 'Charging').
  • battery-warning: Triggers when AC power is unplugged (batteryStatus transitions to 'Discharging') or battery drops to the 20% warning threshold.
  • battery-low: Triggers when battery drops to the critical 10% threshold.
  • widget-placed & widget-removed: Wired across all popups, widgets, applets, and standalone windows (Settings, PackageManager, Keybinds) via WidgetLoader and AppState.
  • notification: Plays on incoming desktop notifications in NotificationService.
  • confirm: Plays on lockscreen unlock, screenshot completion, and adding custom keyboard shortcuts.
  • error: Plays on lockscreen authentication failures.

3. Settings UI Enhancement

  • Added "Audition Sound Theme" with a "▶ Play Test Sound" button under Settings -> Effects -> Sound Effects, enabling users to instantly test and verify audio output.

Chintan Patel added 3 commits October 21, 2026 23:06
…eedback

- Replace dynamic Process allocation/destruction in SoundService with persistent 4-slot Process pool
- Add direct PipeWire (pw-play) and PulseAudio (paplay) execution with search path fallbacks
- Add battery state transitions to SystemInfoService: battery-charge on plug-in, battery-warning on unplug and 20% threshold, battery-low at 10%
- Wire widget-placed and widget-removed for standalone windows (Settings, PackageManager) in WidgetLoader
- Add Audition Sound Theme 'Test Sound' button to EffectsSettings
- Add confirm audio chime on custom shortcut addition
@berlin-566
berlin-566 merged commit defd1ae into main Oct 22, 2026
1 check passed
@berlin-566
berlin-566 deleted the feat/sound-effects-engine branch November 14, 2026 15:48
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.

1 participant