Re: [PATCH 16/28] ASoC: apple: Add macaudio machine driver

From: Mark Brown

Date: Wed Sep 30 2026 - 07:20:44 EST


On Wed, Sep 30, 2026 at 05:36:21PM +1000, James Calligeros wrote:
> On Monday, 28 September 2026 9:03:13 pm Australian Eastern Standard Time Mark
> Brown wrote:
> > On Sat, Sep 26, 2026 at 11:06:02AM +1000, James Calligeros wrote:
> > > On Tuesday, 22 September 2026 7:38:54 pm Australian Eastern Standard Time

> > > > > + if (props->is_sense) {
> > > > > + rate->min = rate->max = cpu_dai->symmetric_rate;
> > > > > + return 0;
> > > > > + }

> > > > It feels like this DAI ought to have separate ops... Also, for the
> > > > sense link will we definitely already have a rate set up?

> > > AIUI, the cpu rate should always be set up by the time we hit
> > > this path as it is only taken when setting up the VISENSE FE (after the
> > > playback stuff is already set up).

> > Is that something we actually enforce or is that just a thing a sensible
> > userspace should do? I can see something racing.

> We don't really enforce it. speakersafetyd is the only thing that opens the
> VISENSE PCM and does a blocking read of samples
> which only starts and subsequently completes after the "real" PCM
> is configured and playback begins. The sample rate is reliably
> reflected to speakersafetyd via the kcontrol on the VISENSE PCM. We
> have not experienced any race issues with this arrangement in ~5 years
> nor has anyone reported any to us. I'm happy to take pointers on
> how we should be doing this if the current approach won't fly.

You could just return an error if there's no rate set, it sounds like
your actual userspace will DTRT anyway.

Attachment: signature.asc
Description: PGP signature