Re: [PATCH v2 09/21] ASoC: apple: Add macaudio machine driver
From: James Calligeros
Date: Tue Oct 13 2026 - 03:15:00 EST
On Mon, Oct 12, 2026 at 8:03 PM Cezary Rojewski
<cezary.rojewski@xxxxxxxxx> wrote:
> How does one know the speaker died? Is there some kind of signal, event
> or an interrupt we could depend on? As delayed-work is a mechanism of
> choice here for handling the case, I believe there is still a gap and a
> chance for bad things to happen.
speakersafetyd is a userspace daemon, not hardware. It cannot generate
interrupts. The daemon puts a magic value into a kctl every run of its
safety model to signal to the driver that it is alive. The driver checks
every time this kctl is put (see macaudio_slk_put) and schedules delayed
work for the timeout, resetting the timeout if the correct value is put. If
the kctl is not put within the timeout (e.g. if the daemon crashes),
it locks the speaker amp volumes to a safe level that will not cause
damage.
We do not want these checks running when the PCM is idle however,
so when there are no longer any active DAI BEs, we disable the timeout.
> Czarek
James