Skip to content

Picking a sound device closes the Sound details and stalls their animation #928

Done

Description

@M4n0x

What happens

In the Sound widget's details popup, a click on an output or input device in the device list:

  • closes the popup, while the card's other controls (volume, mute, an app's output menu) keep it open, and Control Center keeps its Sound module open;
  • stalls the popup's closing animation, and anything else animating on the bar, for tens to hundreds of milliseconds.

Steps to reproduce

  1. Click the Sound widget, then the chevron next to Sound to list the outputs.
  2. Play something, such as music, and click another output.

Expected

The checkmark moves to the device and the popup stays open, without a stall.

Environment

  • StableBar 0.19.0, and main at f1db91a.
  • macOS 27.2, MacBook Pro speakers, a USB headset and a DisplayPort monitor.

Evidence

An isolated dev copy (its own bundle ID and a scratch configuration) with the Sound popup open, sampled with sample at 1 ms while the default output switched to the headset and back:

Main thread over 3 s No switch One switch
In AudioMixer.refresh() 0 samples 1,108 and 1,237 samples (1.1–1.2 s)
Idle 2,297 of 2,386 506 and 461

The copy had no mixer settings and no taps, so this doesn't depend on #897. A standalone harness with the same listeners saw 7 refreshes per switch, and main-thread gaps of 30 to 61 ms in the first 130 ms, while a popup closes. Setting the default output took 72 to 86 ms in 4 of 10 tries while sound played, and 1 to 5 ms otherwise.

Diagnosis

  • AudioMixer.start() (Sources/StableBar/DataSources/AudioMixer.swift) registers its CoreAudio listeners on .main, for the system and for every process's IsRunningOutput and IsRunning, and each notification runs a full refresh(). That reads the PID, bundle ID and playing state of every process (about 33) and every device, each a round trip to coreaudiod. A switch moves every app's sound, so it sends a burst of notifications while coreaudiod answers slowly. The mixer starts with the first Sound popup and keeps listening.
  • WidgetScripts.selectAudioDevice calls AudioMonitor.setDefaultDevice on the main actor, right after the popup starts closing. Volume and mute already go through runAction and BlockingWork.
  • SoundDetails sends a device click through context.selectAudioDevice, which PopupView closes the popup for when dismissOnAction is on, as it is by default.

Related

Triaged by Claude Code (Claude Opus 5.5).

Activity

  1. added
    bug
    on Nov 25, 2026
  2. stablebar-releases commented on Nov 29, 2026

    @stablebar-releases

    🎉 This issue has been resolved in version 0.20.0 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugreleased

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions