Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3326061pxf; Mon, 5 Apr 2021 09:05:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHWO9+fIMvuHOo6kjOTLafqaXeijZoE+34ejDek0wsUIpFN/OJDtMRCC6yZ+I9L2sRGfhW X-Received: by 2002:a1c:c918:: with SMTP id f24mr26583550wmb.12.1617638748279; Mon, 05 Apr 2021 09:05:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617638748; cv=none; d=google.com; s=arc-20160816; b=lu7PNIhnV7cdx0YuOiIAOnVkZnlYdRZdMPO7a0lB/vXlcFmudr4Is41ycajcSUdNaB ER3XL+1TMLPjKC4jyk1cN+08ayGXxNNkzB4JCzDKWfQskOb8z+ZnKlGVzRYWZrRkej58 P5NnLn2GRl1UR4ChyhVJWh6/kW3A380W8t2tVpUmTFXzchC4eej0yVTIWPiHquZDzLrP AKrMNQ+mltgrF/R43Hb0eUKuZNhxissUJo+XB7jQEyd7DVUz8HxU1+6JEN9hGnek9RJp d/snATk3E+4hNqPXdh5k+BwcNOB8UeH5ntgU5a6zQvE5TnipMQcSgoD7gEE+LK4Lfnfx I5uw== 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=l0d83EacK2SjY3/ZlVvjTtOgURSfmQ++/LxIxF0oi9cAUhAFkkJIZsvC5X2xOt2EGw KR2EymZ7zMXgpPh94tqOj5v5nqx3DPN7jpUOTZPmrPt2iyJTWgcJG5KcKVt3ENcr9FNP Iwol7BN75iqTZRidIr4x14A3sMtl8piNz5WQ0/FNxjBox8LB2YCEiClpiIf5iPBA0rl/ LFBth878rJuXvHp4e5/kP2phIHX8775waXEx/seJnX3Lr7H8gZTJcOGHLkVRJgyV3UYB lcjUO+xU7Oy2jvOMBIxL+1DQNN3kFHO7od1kxCYrjqi81fucOnmEU69txH/kwDI3s/xB 2GHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wsAhaBVr; 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 o13si13362513eje.367.2021.04.05.09.05.24; Mon, 05 Apr 2021 09:05:48 -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=wsAhaBVr; 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 S238925AbhDEJLC (ORCPT + 99 others); Mon, 5 Apr 2021 05:11:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:54112 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238606AbhDEJI3 (ORCPT ); Mon, 5 Apr 2021 05:08:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 885D6613A0; Mon, 5 Apr 2021 09:08:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617613702; bh=3y6gV7abTaiMEVM0s/CrvK3mwG9M62wV1EKPJAHJzK8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wsAhaBVrwlBowQOESBDVNn0U4RsZ/8fspJMc2POJ9ESpzy38OZzjgB6LstIiYTWqa 0n1vn7P3tsHW7vBiFGbz8xZDPtRgUq27oteu2qscsN5NJPkcTEwNGXAlkk90gH+IB0 1kcTBS3XmjIrDIDizzNXas9mY/Ct6EyYbHVSdU+o= 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.10 060/126] ALSA: hda/realtek: fix a determine_headset_type issue for a Dell AIO Date: Mon, 5 Apr 2021 10:53:42 +0200 Message-Id: <20210405085033.036763839@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210405085031.040238881@linuxfoundation.org> References: <20210405085031.040238881@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;