[alsa-devel] [PATCH v5 05/14] ASoC: SOF: Add PCM operations support

Takashi Iwai tiwai at suse.de
Fri Apr 5 14:30:20 CEST 2019


On Thu, 04 Apr 2019 21:13:43 +0200,
Ranjani Sridharan wrote:
> 
> > > +
> > > +	/* set runtime config */
> > > +	runtime->hw.info = SNDRV_PCM_INFO_MMAP |
> > > +			  SNDRV_PCM_INFO_MMAP_VALID |
> > > +			  SNDRV_PCM_INFO_INTERLEAVED |
> > > +			  SNDRV_PCM_INFO_PAUSE |
> > > +			  SNDRV_PCM_INFO_RESUME |
> > > +			  SNDRV_PCM_INFO_NO_PERIOD_WAKEUP;
> > 
> > Does SOF support the full resume?  That is, the stream gets resumed
> > at
> > the exact position that was suspended.  Most devices can't, hence
> > they
> > don't set *_INFO_RESUME flag and let user-space restarting.
> Hi Takashi,
> 
> Thanks for your comment. The SOF driver definitely cannot guarantee to
> resume from the exact same position due to the fact that triggers for
> the host dma and link dma are not synchronized and also IPC scheduling
> will affect this. So we should remove INOF_RESUME from hw.info.
> 
> I do one follow up question for you. When a stream resumes/restarts
> after suspend, we have the need for restoring the hw_params in the SOF
> driver prior to handling the START trigger. I noticed that the
> legacy/skylake driver does not seem to do this though. Do you have any
> insights on what we might be missing in the SOF driver?

So, SOF mandates the re-setup of the hw params in BE at resume?
Then the right place to do is in the prepare callback.  Without
SNDRV_PCM_INFO_RESUME flag, the PCM core won't trigger RESUME, but
returns -ENOSYS.  Then user-space will do prepare, and start with the
normal trigger.

You'd need a flag indicating the BE hw_params resetup, and at the
beginning of prepare function, the flag is checked and the (internal)
hw_params is done accordingly.


Takashi


More information about the Alsa-devel mailing list