Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3373312pxf; Mon, 5 Apr 2021 10:17:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoH2rrVrdl1JMrbgp7pSHfVrlDGNA7vwuLQDCmuKrgvuKkqw8YHSKqk3XYtSHPR0DjkhTM X-Received: by 2002:a17:906:3544:: with SMTP id s4mr30006241eja.73.1617643070430; Mon, 05 Apr 2021 10:17:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617643070; cv=none; d=google.com; s=arc-20160816; b=jRSGsObapm3OFIfIDVlNg7umO2KUg1Ur750qeizHoli4cGdd1MiLJ01XE4wa7GCfYL OX2rgvh2vIbEWrxnLW+mPkK0nMnUGZmxbmPHqXxvK9XFyNXUy0Is6fN8j/mmGiAX7MJ0 1b+4UnIPTqIK670pDt+3KDrZ9RbP1augEJYSKSKC920tQ78XBRvK3UVP8b5FAEMc7gvL zTnqjH0g9u3+AQj1OgafibS/xGWCX6hZXo5oeJc6riVJLhiLLfpbdjabxPnb6sp0RPBR avmRzVJewVOIqC1A2cV7ejakoWCEx+SyBFZWJhme5Qx2X7Xn6zaBrcAUxmgWxJ0OqLGV YLrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7g2wrulrlGgTKqLz3L9V4vhL2J31xHoMcicc+nzLG3g=; b=PmvryWs5KNp82CNHzYp5TIl57OPU5for9UiwpbfrgEcBLjr+rxTPVcNQYyEdMqn/NF EDZayG9/yy0AqYM0jlKW8TVPLbAW7Cs/Eb6NVrAhaEOwGMv8HGLAkSFgoNjfT1ls/K9j O6jJcNWALoKuVxgBH8kdyBsP+q021o1fYycxozVQ1BFqDEUFy3G6BujmQw6fVvR1HQYc Ru9W/jcR+EwNmWdUHmx7xaUzPR7L2R1FI+LE6DXEVJSqjZdCwC7MrL3/4SK+Q9b2vusn 0tYwrdFdC2Q2cthIXmOLSvq0JEybG5InW/P1pncPcO2bYkjnEIPgsC9/Ng2vaubBOU5J sccQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=i7JrRdUH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b9si12672596edr.611.2021.04.05.10.17.26; Mon, 05 Apr 2021 10:17:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=i7JrRdUH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240206AbhDEJVC (ORCPT + 99 others); Mon, 5 Apr 2021 05:21:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:37556 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240683AbhDEJQT (ORCPT ); Mon, 5 Apr 2021 05:16:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3CC1E611C1; Mon, 5 Apr 2021 09:16:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617614172; bh=3y6gV7abTaiMEVM0s/CrvK3mwG9M62wV1EKPJAHJzK8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i7JrRdUHOLmjDRPGafKtNR27atuDOClIF55dZFZZzEheXkkDnLQdtQyIyHQihtB5q d819d3Y6iwHnLnd9BcjUHlCEKpyEvMYqGk+TakkudrNaGJNF8iFDVU5GWNvvQ6BUw1 AjZM3ffCkr5PMqfDh6E5U2f4PwFB8bioY4JxCr/E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hui Wang , Takashi Iwai Subject: [PATCH 5.11 074/152] ALSA: hda/realtek: fix a determine_headset_type issue for a Dell AIO Date: Mon, 5 Apr 2021 10:53:43 +0200 Message-Id: <20210405085036.672608883@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210405085034.233917714@linuxfoundation.org> References: <20210405085034.233917714@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hui Wang commit febf22565549ea7111e7d45e8f2d64373cc66b11 upstream. We found a recording issue on a Dell AIO, users plug a headset-mic and select headset-mic from UI, but can't record any sound from headset-mic. The root cause is the determine_headset_type() returns a wrong type, e.g. users plug a ctia type headset, but that function returns omtp type. On this machine, the internal mic is not connected to the codec, the "Input Source" is headset mic by default. And when users plug a headset, the determine_headset_type() will be called immediately, the codec on this AIO is alc274, the delay time for this codec in the determine_headset_type() is only 80ms, the delay is too short to correctly determine the headset type, the fail rate is nearly 99% when users plug the headset with the normal speed. Other codecs set several hundred ms delay time, so here I change the delay time to 850ms for alc2x4 series, after this change, the fail rate is zero unless users plug the headset slowly on purpose. Cc: Signed-off-by: Hui Wang Link: https://lore.kernel.org/r/20210320091542.6748-1-hui.wang@canonical.com Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/pci/hda/patch_realtek.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -5256,7 +5256,7 @@ static void alc_determine_headset_type(s case 0x10ec0274: case 0x10ec0294: alc_process_coef_fw(codec, coef0274); - msleep(80); + msleep(850); val = alc_read_coef_idx(codec, 0x46); is_ctia = (val & 0x00f0) == 0x00f0; break;