Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3063843pxf; Mon, 5 Apr 2021 02:07:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJIlt2lMy+4ZCz0IIiz8RF7vzOyZ6uQ/0ypJRKfLSnewN3gSHUhvGORteX+cpQ+6YMNOPh X-Received: by 2002:a02:cad9:: with SMTP id f25mr22731501jap.26.1617613644556; Mon, 05 Apr 2021 02:07:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617613644; cv=none; d=google.com; s=arc-20160816; b=gh7jD4FmB3ezPTOObnPmskonT/HlhSp73T2rUh04l7byF0JEBdpe5H7K/JddsQVKSy u4tvubXBW3jug+w5saXCCreGXYyoI2bgc7K789PIjOVTuiNBDsBIXBfSntMioA9BZfuM wghto8+dxEHhUK9dt1Ku7dGZjDSvo1+HCoJWrJ/C0sQr6k3vNgoYcsLgp/TRUOOJySxT MOSRuHNSNtv8h6DQfgoKhyjJEwHRPX8ZXK6t78IoHXZB68qljqKOCj+Va+K5MTXv798Q PVTLPbVWE7qCdIeKOBFZ4pG3VPdW2HfGIhlidHFq0t2lYv82T2E+9+dFp1gnXJijtyf4 Sbdg== 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=WZzu+Ps+BFBZk2N6JPuoN3HepH/+gIfnIbT354I5WjM=; b=fEEDCUvN66sljP10fh0CKT1kO0oFsa610AK1eTVez7MWaRNfjk93ZETCJFkRZbC4UB WoBB6/+ElkM2i5AP+B8A1txhWyOk40W84Akl0j3EiT2ghYPknApL/MCXWDtJ2dWH272p lB+ifsYkkIoVoidWLnsUeY9aRJiN6yd3x7yQBXYQlbdhtCPvQEj0Br8UxrM/rZ6QcTr3 ujjsjybUla4ccemU1AWmnbIRUd8DdbC14M7y8fwQlM1hsA0VOHei8Jp/HxoGbacu9eDW Q53gUGOTYxEAZAt5VbiJcrRv9dOqO9zuJkVFQngdKYNLymLx6fBRPubge6hIWgAVuurS x9GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="GizJyJ/L"; 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 s11si15021921jam.7.2021.04.05.02.07.12; Mon, 05 Apr 2021 02:07:24 -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="GizJyJ/L"; 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 S238287AbhDEJGD (ORCPT + 99 others); Mon, 5 Apr 2021 05:06:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:47960 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238130AbhDEJE3 (ORCPT ); Mon, 5 Apr 2021 05:04:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8173661393; Mon, 5 Apr 2021 09:04:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617613462; bh=+rVl4jhU2e9mq9REOVtefD3OfuH0dIJsE4fUJ8fqP5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GizJyJ/LfIFgKmjOr8HpCaOMn0x0bwhQ3f9B09ePsiEE7yUfpnzVHTwQS3g/H1EDG k8e8omxB8Fx+L6RWKkIWkXXPc9nqmByttSEyRXX2nD83dHowtgdoNy9dxVaG4FqbxQ yoHS0LA0Tmd/CBrgKC0DLwhCYmCHX3Onrlz7M/QA= 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.4 44/74] ALSA: hda/realtek: fix a determine_headset_type issue for a Dell AIO Date: Mon, 5 Apr 2021 10:54:08 +0200 Message-Id: <20210405085026.163320175@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210405085024.703004126@linuxfoundation.org> References: <20210405085024.703004126@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 @@ -5192,7 +5192,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;