home-assistant / home-assistant/iOS
macOS: "Audio Input In Use" misses microphone-only sessions — no live update for Dictation or Voice Memos
- Dominant language
- Swift
- Stars
- 2.4k
- Forks
- 520
- Avg merge
- 7h 27m
- Merged PRs (30d)
- 264
Description
**Device model, version and app version**
Model Name: MacBook Pro (Mac16,7)
macOS Version: 26.6.2 (25G83)
App Version: 2026.9.0 (2026.2874)
Safari Version: 26.6.2
**Home Assistant Core Version**
2026.9.2
**Describe the bug**
On macOS, `Audio Input In Use` and `Active Audio Input` report the correct value, but only at moments decided by something else. If the microphone starts and stops between two sensor updates, Home Assistant never sees it at all.
The practical effect is that macOS Dictation never registers. It's short, and it doesn't change the frontmost app, so nothing prompts an update while the mic is actually live. Same for a quick voice memo, or any other short recording.
This isn't #5635 — the sensors do work on this machine, they read the right device name and they do turn on. They just update at the wrong times.
**To Reproduce**
1. Enable `Audio Input In Use` and `Active Audio Input`.
2. Open Voice Memos and record for ~30 seconds without touching anything else. Neither sensor changes in Home Assistant for the whole recording.
3. Record again, and this time click to another app while still recording. `Audio Input In Use` goes to `on` within a second, and `Active Audio Input` fills in with the device name.
4. Alternatively, keep recording until the 5-minute periodic update lands. That picks it up too.
Step 3 is the same recording on the same microphone as step 2. The only difference is the window focus change.
**Expected behavior**
`Audio Input In Use` turns on when the microphone starts and off when it stops, without needing unrelated activity to prompt an update.
**Additional context**
The app's own logs show this pretty clearly. This is the entire log for the recording in step 2:
```
13:53:32.420 updateSignaled(from:) > live update triggering from FrontmostAppSensor
13:53:32.436 UpdateSensors(trigger:limitedTo:location:) > updating sensors [...]
13:53:56.133 WebSocket: Ping
13:54:00.652 WebSocket: Sending: {"id":2744,"type":"ping"}
13:54:05.504 updateSignaled(from:) > live update triggering from FrontmostAppSensor
13:54:05.521 UpdateSensors(trigger:limitedTo:location:) > updating sensors [...]
```
The recording ran for the whole gap between those two updates, and both of them were triggered by the frontmost app changing (opening Voice Memos, then leaving it), not by the audio sensor.
`InputOutputDeviceSensor` isn't dead, though — it signals 182 times across my logs, and earlier the same day it matched the microphone going on and off during video calls to within 50-80ms:
```
09:30:49.738 live update triggering from InputOutputDeviceSensor (HA: Audio Input In Use -> on at 09:30:49.8)
11:42:31.658 live update triggering from InputOutputDeviceSensor (HA: Audio Input In Use -> off at 11:42:31.7)
```
So the observer added in `InputOutputDeviceSensor.swift` does fire, but not for microphone-only activity.
One pattern I noticed, which I'd offer as a guess rather than something I've established: every microphone transition that signalled promptly had audio *output* starting at the same instant (they were calls — input and output flip at identical timestamps in the HA history). The two microphone-only sessions I tested deliberately, Voice Memos and Dictation, signalled nothing. I haven't read enough of the CoreAudio side to say whether input-device observers are genuinely not firing or whether something downstream is discarding them.
Happy to run anything else on this machine if it helps narrow it down.
Contributor guide
Research direction
Start with InputOutputDeviceSensor.swift and reproduce the Voice Memos or Dictation recording described in the issue, comparing its live-update behavior with a call that changes audio output. Trace why microphone-only transitions do not reach the sensors, using the supplied logs as a reference. Done means Audio Input In Use turns on and off promptly for microphone-only sessions without unrelated app activity.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- macos, swift
- Domain
- desktop-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100