From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DE731C433F5 for ; Tue, 5 Apr 2022 05:58:14 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 40A8C1702; Tue, 5 Apr 2022 07:57:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 40A8C1702 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1649138292; bh=WTEqoba+HGqrhmIu7D0ULSf5yuod+p3l5ZwyoiWwnEU=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=vYuvSNTvRg2OVrkbtKUbcO924swclQgN8teZFIEK36EaGs4sF6pHfKxl1K4i680zg mrGyGUoGshsBovTQjVFSNnWnqp/enfqG+xoBmLcFtWLLhPCljhtWVMiF6HW7sYv+ty fJFDLiNYJoosi8j+D/7c9BSxTtg4h/di9oeZZL7s= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C2F5DF8014B; Tue, 5 Apr 2022 07:57:21 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C9D0CF8016A; Tue, 5 Apr 2022 07:57:19 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 3C98EF800D1 for ; Tue, 5 Apr 2022 07:57:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3C98EF800D1 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="nGu2CIBB"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="FMvCcseb" Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 775201F37E; Tue, 5 Apr 2022 05:57:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1649138230; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=aq+dfe7t7uVb6nhFWo1ZuXqHwk+7toIxAoNOkXg7JeM=; b=nGu2CIBBBIVdM9h/HXw2+mXUxdT4zvs8uLiwvCpeQBtTvNRk2bVzoQAmjmigT/DJennzvY Rkwvvee04yfAS/2VtE1Q+SHqesryFM/fMwPy+86C2CFdfLW5a5dxFveIjUzSztWMDTtO3F SPURh6iJms3RPNL2iAL42BkUHY5GQ+0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1649138230; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=aq+dfe7t7uVb6nhFWo1ZuXqHwk+7toIxAoNOkXg7JeM=; b=FMvCcsebYvOYoGOtv2oF54oHadK6D06fDLoZbg23UtWhc7dUnAM6LkeJQO2vKWVGeKIBCT 8K03Ttjniez8yyDw== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id 9B3DAA3B82; Tue, 5 Apr 2022 05:57:09 +0000 (UTC) Date: Tue, 05 Apr 2022 07:57:09 +0200 Message-ID: From: Takashi Iwai To: Mohan Kumar Subject: Re: [PATCH] ALSA: hda/tegra: Fix hda Jack detection In-Reply-To: <20220405032607.8489-1-mkumard@nvidia.com> References: <20220405032607.8489-1-mkumard@nvidia.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, spujar@nvidia.com, tiwai@suse.com, jonathanh@nvidia.com, thierry.reding@gmail.com, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Tue, 05 Apr 2022 05:26:07 +0200, Mohan Kumar wrote: > > Tegra HDA Jack detection logic doesn't work when the HDACODEC > in runtime suspended state as unsol event won't be triggered > during D3 state. As pulseaudio server in userspace rely on the > jack mixer control status to show the audio devices in gui and > any display sink device hotplug event during D3 state will never > updates the jack status which will result in no audio device option > available in userspace settings. > > The possible option available to resolve this issue for multiple > tegra platforms is to use Jack polling method for every 5 seconds. > Also to make Jack detection work seamlessly the Jack worker thread > needs to run continuously after HDA sound card registered > irrespective of whether HDMI sink device connected or not, but the > Jack state update call happens only when Codec is not powered on. > > Signed-off-by: Mohan Kumar Hmm, any reason not to use the standard jackpoll stuff that is already implemented in HD-audio controller side? That is, doesn't the following oneliner work instead? thanks, Takashi -- 8< -- --- a/sound/pci/hda/hda_tegra.c +++ b/sound/pci/hda/hda_tegra.c @@ -421,6 +421,7 @@ static int hda_tegra_create(struct snd_card *card, chip->driver_type = driver_caps & 0xff; chip->dev_index = 0; INIT_LIST_HEAD(&chip->pcm_list); + chip->jackpoll_interval = msecs_to_jiffies(5000); chip->codec_probe_mask = -1; From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E597C433EF for ; Tue, 5 Apr 2022 05:57:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229968AbiDEF7K (ORCPT ); Tue, 5 Apr 2022 01:59:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229735AbiDEF7J (ORCPT ); Tue, 5 Apr 2022 01:59:09 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD8A069728; Mon, 4 Apr 2022 22:57:11 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 775201F37E; Tue, 5 Apr 2022 05:57:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1649138230; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=aq+dfe7t7uVb6nhFWo1ZuXqHwk+7toIxAoNOkXg7JeM=; b=nGu2CIBBBIVdM9h/HXw2+mXUxdT4zvs8uLiwvCpeQBtTvNRk2bVzoQAmjmigT/DJennzvY Rkwvvee04yfAS/2VtE1Q+SHqesryFM/fMwPy+86C2CFdfLW5a5dxFveIjUzSztWMDTtO3F SPURh6iJms3RPNL2iAL42BkUHY5GQ+0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1649138230; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=aq+dfe7t7uVb6nhFWo1ZuXqHwk+7toIxAoNOkXg7JeM=; b=FMvCcsebYvOYoGOtv2oF54oHadK6D06fDLoZbg23UtWhc7dUnAM6LkeJQO2vKWVGeKIBCT 8K03Ttjniez8yyDw== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id 9B3DAA3B82; Tue, 5 Apr 2022 05:57:09 +0000 (UTC) Date: Tue, 05 Apr 2022 07:57:09 +0200 Message-ID: From: Takashi Iwai To: Mohan Kumar Cc: , , , , , , , Subject: Re: [PATCH] ALSA: hda/tegra: Fix hda Jack detection In-Reply-To: <20220405032607.8489-1-mkumard@nvidia.com> References: <20220405032607.8489-1-mkumard@nvidia.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org On Tue, 05 Apr 2022 05:26:07 +0200, Mohan Kumar wrote: > > Tegra HDA Jack detection logic doesn't work when the HDACODEC > in runtime suspended state as unsol event won't be triggered > during D3 state. As pulseaudio server in userspace rely on the > jack mixer control status to show the audio devices in gui and > any display sink device hotplug event during D3 state will never > updates the jack status which will result in no audio device option > available in userspace settings. > > The possible option available to resolve this issue for multiple > tegra platforms is to use Jack polling method for every 5 seconds. > Also to make Jack detection work seamlessly the Jack worker thread > needs to run continuously after HDA sound card registered > irrespective of whether HDMI sink device connected or not, but the > Jack state update call happens only when Codec is not powered on. > > Signed-off-by: Mohan Kumar Hmm, any reason not to use the standard jackpoll stuff that is already implemented in HD-audio controller side? That is, doesn't the following oneliner work instead? thanks, Takashi -- 8< -- --- a/sound/pci/hda/hda_tegra.c +++ b/sound/pci/hda/hda_tegra.c @@ -421,6 +421,7 @@ static int hda_tegra_create(struct snd_card *card, chip->driver_type = driver_caps & 0xff; chip->dev_index = 0; INIT_LIST_HEAD(&chip->pcm_list); + chip->jackpoll_interval = msecs_to_jiffies(5000); chip->codec_probe_mask = -1;