From: Takashi Iwai Subject: Re: [RFC] echoaudio, suspend/resume Date: Mon, 27 Feb 2006 15:23:34 +0100 Message-ID: References: <20060225174117.1979de90.pochini@shiny.it> 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: Giuliano Pochini Cc: Alsa-devel List-Id: alsa-devel@alsa-project.org At Mon, 27 Feb 2006 15:13:52 +0100 (CET), Giuliano Pochini wrote: > > > > On Mon, 27 Feb 2006, Takashi Iwai wrote: > > > At Sat, 25 Feb 2006 17:41:17 +0100, > > Giuliano Pochini wrote: > > > > > > The following patch is not to be merged yet. It adds suspend/resume support > > > to the echoaudio driver. It's ready for testing if someone wants to give it > > > a try. Maybe some detail is missing, but it should work on all cards. > > > > > > The problem is that the DSP "dies" if the driver tries to send it a command > > > (for example, set the output volume) after is has been shut down and a > > > reboot is required to resurrect it. ALSA doesn't automatically prevent the > > > user from accessing the card when it's suspended. Is there a simple way to > > > to it ? > > > > In which timing does it occur? > > echo -n 3 >/sys/.../power/state > --> power down ok > > amixer cset xyz > --> DSP dead > > > > If it occurs before calling resume callback (not meaning before > > completing resume callack), we should handle it better in the sound > > core to prevent it. > > The resume callback has to reinit the card from scratch. It involves > loading 2 to 5 firmare images which takes several ms. I didn't check > after which phase the DSP begins behaving nicely when it receives an > unexpected command. > Of cource I can put an "if (suspended) return -EBUSY;" in each .put() > and trigger function, but if the middle layer already provides some sort > of global switch it's better IMHO. Other proposals are welcome. Hm, strange, prepare or trigger callback shouldn't be called at least unless snd_power_change_state(D0) is called. The power status is checked in the middle layer. The other interfaces have no power-state check so far. It'd be nice to have, yes. 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