From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH 2/2] ALSA: hda - Enforces runtime_resume after S3 and S4 for each codec Date: Tue, 19 Mar 2019 06:56:51 +0100 Message-ID: References: <20190319012844.6543-1-hui.wang@canonical.com> <20190319012844.6543-2-hui.wang@canonical.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: Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A7B82F80791 for ; Tue, 19 Mar 2019 06:56:51 +0100 (CET) In-Reply-To: <20190319012844.6543-2-hui.wang@canonical.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" To: Hui Wang Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org On Tue, 19 Mar 2019 02:28:44 +0100, Hui Wang wrote: > > Recently we found the audio jack detection stop working after suspend > on many machines with Realtek codec. Sometimes the audio selection > dialogue didn't show up after users plugged headhphone/headset into > the headset jack, sometimes after uses plugged headphone/headset, then > click the sound icon on the upper-right corner of gnome-desktop, it > also showed the speaker rather than the headphone. > > The root cause is that before suspend, the codec already call the > runtime_suspend since this codec is not used by any apps, then in > resume, it will not call runtime_resume for this codec. But for some > realtek codec (so far, alc236, alc255 and alc891) with the specific > BIOS, if it doesn't run runtime_resume after suspend, all codec > functions including jack detection stop working anymore. > > This problem existed for a long time, but it was not exposed, that is > because when problem happens, if users play sound or open > sound-setting to check audio device, this will trigger calling to > runtime_resume (via snd_hda_power_up), then the codec starts working > again before users notice this problem. > > Since we don't know how many codec and BIOS combinations have this > problem, to fix it, let the driver call runtime_resume for all codecs > in pm_resume, maybe for some codecs, this is not needed, but it is > harmless. After a codec is runtime resumed, if it is not used by any > apps, it will be runtime suspended soon and furthermore we don't run > suspend frequently, this change will not add much power consumption. > > Signed-off-by: Hui Wang Applied, thanks. Takashi