From: Takashi Iwai Subject: Re: debugging nm256: some results, many questions Date: Mon, 13 Mar 2006 12:58:46 +0100 Message-ID: References: <20060223185253.GA7954@tigerbay> <20060311174421.GB7775@tigerbay> <20060313064627.GA3864@tigerbay> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <20060313064627.GA3864@tigerbay> 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: Florian Schlichting Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Mon, 13 Mar 2006 14:46:28 +0800, Florian Schlichting wrote: > > I went ahead implementing caching of reads to the ac97 mixer registers > inside the nm256 driver, and also included "preloading" of the cache, > just as the OSS driver does. And it works like a charm: no reads to the > mixers, no crashes any more! Great, thanks for nailing it down. > Alas, this improvement has taught me what some of the reads were for - > detection of volume resolution, for example: I suddenly had two maxima > on the PCM mixer. As all my mixers have a resolution of 31, I customized > the values being written to the cache so that the ac97_codec would > "detect" the correct value. Now the only difference to the non-patched > state (according to alsactl) is that a few mixers are stereo instead of > mono - but up to now this doesn't seem to have any effect on anything I > do, everything works fine... > > The question is: how portable is this to other users of nm256? Will we > need a detect for this workaround? I don't think so. The read cache should work in general. > I've attached a patch against 1.0.10rc3 - I just saw that in 1.0.11rc3 > there has been a cleanup in nm256, and my patch doesn't apply cleanly > any more... although I don't think it will need to be changed. Perhaps I > could have some feedback first? The writes in snd_nm256_ac97_reset() break the PM resume. You should check reg_accessed[] and use the cached value if already written. Also, it's simpler to call snd_nm256_ac97_write() directly there instead of snd_ac97_write_cache(). Additionally, we may use a static resolution table to skip the volume resolution detection with the latest ac97_codec. 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