From: Takashi Iwai Subject: Re: Power management questions... Date: Wed, 08 Mar 2006 12:45:31 +0100 Message-ID: References: Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Tehn Yit Chin Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Wed, 8 Mar 2006 14:55:55 +1100, Tehn Yit Chin wrote: > > Hi all, > > 1) suspending/resuming > I am putting some power managment coding into my alsa driver. When I want to suspend, > I inform ALSA via the following two calls. > > snd_pcm_suspend_all(card->pcm); > snd_power_change_state(card->card, SNDRV_CTL_POWER_D3cold); > > When I am doing a resume, I would have assumed that they is an equivalent to > snd_pcm_suspend_all(), but all I could find snd_pcmd_resume() which is usually OK, > but this is declared as a static as in > > static int snd_pcm_resume(snd_pcm_substream_t *substream) > > At the moment, all I am doing when I am resuming is to call > > snd_power_change_state(card->card, SNDRV_CTL_POWER_D0); > > This seems to be working, but I think that I am doing the wrong thing. It's OK as long as you do _not_ set SNDRV_PCM_INFO_RESUME flag in hw.info field. If this bit isn't set, the app usually resets the PCM state and restarts it again by itself. > 2) SND_PCM_TRIGGER_SUSPEND and SND_PCM_TRIGGER_RESUME > If I follow the call tree down for snd_pcm_suspend_call(), it calls a trigger callback > with a command of SND_PCM_TRIGGER_SUSPEND. A similiar thing occurs for resume where > the trigger callback is called with the command of SND_PCM_TRIGGER_RESUME. Should I > handling these two commands in my trigger callback and manage the DMA transfer > accordingly? Yes, these callbacks should be added if PM is supported. I updated the document a bit, so please refer to the latest version. Takashi ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642