From: Takashi Iwai Subject: Re: [PATCH v5 05/14] ASoC: SOF: Add PCM operations support Date: Fri, 05 Apr 2019 14:30:20 +0200 Message-ID: References: <20190321161016.26515-1-pierre-louis.bossart@linux.intel.com> <20190321161016.26515-6-pierre-louis.bossart@linux.intel.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" To: Ranjani Sridharan Cc: Daniel Baluta , sound-open-firmware@alsa-project.org, alsa-devel@alsa-project.org, Pierre-Louis Bossart , liam.r.girdwood@linux.intel.com, vkoul@kernel.org, broonie@kernel.org, andriy.shevchenko@linux.intel.com, Alan Cox List-Id: alsa-devel@alsa-project.org 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