From patchwork Tue Oct 1 12:14:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13817911 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0A5FC1C1ACA for ; Tue, 1 Oct 2024 12:13:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727784836; cv=none; b=AfXX91dCd3ThkGOSqHUxbZEKia7N6IB664NwidhsKVEoZrj8vIl/Lhb9TpeGDiftSg/ha4qtaJIENpBxDLVkSJP00OxDmyls5aHwMuzObNv2pxGfQZrqyXZtgHmCf9Mz2pSvEUyO/zQ31iQ8Czm7kkw9Ondfsv5MMWoyHz+OySk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727784836; c=relaxed/simple; bh=n0CFpsmvj9RZA2eppSA5wYc1t80Gk9el5R49YGtpKp4=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=B+Ec/ry6JuTseMJaTAtIZJnKdTOYrKCFdSgZ2uNT6o2CKXmkHC2Knz568Fnzn2jCDJVkZCfHji8BKYMhRAgpUOi/L8KJAf3YUgZtvktSWejol4jn7uOUplw6uUdskDzAUlccltzcrX0NjqjGzQyDmr/RnCTS1FGle3xkupJF0GM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=G3TxhUsR; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=MOjesYz8; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=G3TxhUsR; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=MOjesYz8; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="G3TxhUsR"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="MOjesYz8"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="G3TxhUsR"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="MOjesYz8" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 4C0F021AFD; Tue, 1 Oct 2024 12:13:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1727784832; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=kXBjpX3bExZchztpaKePHFWygbacgUedybBPDYPc2qs=; b=G3TxhUsRi3c6/CgApwB2LptP+h66oV88jitC3UfzggebzjyHJOgib2MXAiotq063FEq5v9 oaOi4GFc553X8Y0bOYfxARzoj8GVaWIqsyTqbVk2lRmNQrX+h3U1m8CWIUOHGPix8AhL3g iNZJLgPXf2QAXKTHRRilQqM9tnVasTU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1727784832; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=kXBjpX3bExZchztpaKePHFWygbacgUedybBPDYPc2qs=; b=MOjesYz86sBy451Cb8lcRHeuyuY9PizCizDwS5MEXKb2kBCZ/DZbSiFxig77jeNJW+w1yZ 9VqzGrE+w2fVDGBA== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1727784832; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=kXBjpX3bExZchztpaKePHFWygbacgUedybBPDYPc2qs=; b=G3TxhUsRi3c6/CgApwB2LptP+h66oV88jitC3UfzggebzjyHJOgib2MXAiotq063FEq5v9 oaOi4GFc553X8Y0bOYfxARzoj8GVaWIqsyTqbVk2lRmNQrX+h3U1m8CWIUOHGPix8AhL3g iNZJLgPXf2QAXKTHRRilQqM9tnVasTU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1727784832; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=kXBjpX3bExZchztpaKePHFWygbacgUedybBPDYPc2qs=; b=MOjesYz86sBy451Cb8lcRHeuyuY9PizCizDwS5MEXKb2kBCZ/DZbSiFxig77jeNJW+w1yZ 9VqzGrE+w2fVDGBA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 3D82713A6E; Tue, 1 Oct 2024 12:13:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id vkt4DoDn+2YFdQAAD6G6ig (envelope-from ); Tue, 01 Oct 2024 12:13:52 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 1/2] ALSA: hda/generic: Unconditionally prefer preferred_dacs pairs Date: Tue, 1 Oct 2024 14:14:36 +0200 Message-ID: <20241001121439.26060-1-tiwai@suse.de> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.999]; MIME_GOOD(-0.10)[text/plain]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:url,suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Spam-Flag: NO X-Spam-Level: Some time ago, we introduced the obey_preferred_dacs flag for choosing the DAC/pin pairs specified by the driver instead of parsing the paths. This works as expected, per se, but there have been a few cases where we forgot to set this flag while preferred_dacs table is already set up. It ended up with incorrect wiring and made us wondering why it doesn't work. Basically, when the preferred_dacs table is provided, it means that the driver really wants to wire up to follow that. That is, the presence of the preferred_dacs table itself is already a "do-it" flag. In this patch, we simply replace the evaluation of obey_preferred_dacs flag with the presence of preferred_dacs table for fixing the misbehavior. Another patch to drop of the obsoleted flag will follow. Fixes: 242d990c158d ("ALSA: hda/generic: Add option to enforce preferred_dacs pairs") Link: https://bugzilla.suse.com/show_bug.cgi?id=1219803 Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_generic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index 9cff87dfbecb..b34d84fedcc8 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c @@ -1383,7 +1383,7 @@ static int try_assign_dacs(struct hda_codec *codec, int num_outs, struct nid_path *path; hda_nid_t pin = pins[i]; - if (!spec->obey_preferred_dacs) { + if (!spec->preferred_dacs) { path = snd_hda_get_path_from_idx(codec, path_idx[i]); if (path) { badness += assign_out_path_ctls(codec, path); @@ -1395,7 +1395,7 @@ static int try_assign_dacs(struct hda_codec *codec, int num_outs, if (dacs[i]) { if (is_dac_already_used(codec, dacs[i])) badness += bad->shared_primary; - } else if (spec->obey_preferred_dacs) { + } else if (spec->preferred_dacs) { badness += BAD_NO_PRIMARY_DAC; } From patchwork Tue Oct 1 12:14:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13817912 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DAD8819DF53 for ; Tue, 1 Oct 2024 12:13:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727784836; cv=none; b=OtmunnKrj8EdETM7irQ2mWIC+mwXszRbMtS6Ka40blx6M/ZGpSlhK5h5JhaxWU/MvJ+6fyALx/B4Xj1KjxRLOgp4SWthp9KLIa9hWkyAELQeI+tBy2RuUcG/BHOc6mCqk5JIQjsJVNzd/yxsF2zeL2h8IHc6WDBQp5lCHr/Wo6k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727784836; c=relaxed/simple; bh=qjSAddRcAId/ELoTA5Y+48thbLzBOwj5zprk3KwG7D4=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nTpMu4oRzZ3Zk7rPvlGY+7/s1UTkAsn7p1pBIu0L00HDwbhY8SEWZeNYxHvWdTwXBof1/NNs4DpjF2JGaG7oDgFjpW9bxOJVUEnEuSAVc0NHW/SiQvc1c5M8MRKf6dUkSlp21Jt8E37aJBT/WTc4vTjnHEcpiD0Svix/fMKIynw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=WDTeGDUb; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=8lYqbdfw; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=WDTeGDUb; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=8lYqbdfw; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="WDTeGDUb"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="8lYqbdfw"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="WDTeGDUb"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="8lYqbdfw" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 2385821B02; Tue, 1 Oct 2024 12:13:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1727784833; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vT40F3YM/tEVIKg6Wa8Nv3hX7ffZ+IhpotEMipuqjl0=; b=WDTeGDUbJbAejoBOOdhPPYLmikLDCGHqccVdp123nxPUCCaGqvF+FVybHg96wmUPZ1p8KZ bDWCLBfbB0QLJZ6uRZCw0iIgODbPCzlZoJxanglQSdHj/M++VeTxNAC2Y4+VCk/0w+C6ga wu15i5qdvekxS/RKoIYH/b1j4NTvFmc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1727784833; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vT40F3YM/tEVIKg6Wa8Nv3hX7ffZ+IhpotEMipuqjl0=; b=8lYqbdfwdzl0WEcS3YiY/s0f1UVMOWGnF0iHNNbLdJUsEUDSbpMsSZEVXjC93jvNXdjGy0 3RhGHDz1ueOdsJDg== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=WDTeGDUb; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=8lYqbdfw DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1727784833; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vT40F3YM/tEVIKg6Wa8Nv3hX7ffZ+IhpotEMipuqjl0=; b=WDTeGDUbJbAejoBOOdhPPYLmikLDCGHqccVdp123nxPUCCaGqvF+FVybHg96wmUPZ1p8KZ bDWCLBfbB0QLJZ6uRZCw0iIgODbPCzlZoJxanglQSdHj/M++VeTxNAC2Y4+VCk/0w+C6ga wu15i5qdvekxS/RKoIYH/b1j4NTvFmc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1727784833; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vT40F3YM/tEVIKg6Wa8Nv3hX7ffZ+IhpotEMipuqjl0=; b=8lYqbdfwdzl0WEcS3YiY/s0f1UVMOWGnF0iHNNbLdJUsEUDSbpMsSZEVXjC93jvNXdjGy0 3RhGHDz1ueOdsJDg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 0A5D813A6E; Tue, 1 Oct 2024 12:13:53 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id sCT3AYHn+2YFdQAAD6G6ig (envelope-from ); Tue, 01 Oct 2024 12:13:53 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 2/2] ALSA: hda/generic: Drop obsoleted obey_preferred_dacs flag Date: Tue, 1 Oct 2024 14:14:37 +0200 Message-ID: <20241001121439.26060-2-tiwai@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241001121439.26060-1-tiwai@suse.de> References: <20241001121439.26060-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Rspamd-Queue-Id: 2385821B02 X-Spam-Level: X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-0.999]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_DN_NONE(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,suse.de:dkim,suse.de:mid,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; MIME_TRACE(0.00)[0:+]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Action: no action X-Spam-Score: -3.01 X-Spam-Flag: NO Now we evaluate directly with preferred_dacs table, the flag is no longer used and merely a placeholder. Let's drop the definition and its users. Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_generic.h | 1 - sound/pci/hda/patch_realtek.c | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h index 08544601b4ce..9612afaa61c2 100644 --- a/sound/pci/hda/hda_generic.h +++ b/sound/pci/hda/hda_generic.h @@ -232,7 +232,6 @@ struct hda_gen_spec { unsigned int power_down_unused:1; /* power down unused widgets */ unsigned int dac_min_mute:1; /* minimal = mute for DACs */ unsigned int suppress_vmaster:1; /* don't create vmaster kctls */ - unsigned int obey_preferred_dacs:1; /* obey preferred_dacs assignment */ /* other internal flags */ unsigned int no_analog:1; /* digital I/O only */ diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index b42257e03344..eb45a41533dc 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -6645,10 +6645,8 @@ static void alc289_fixup_asus_ga401(struct hda_codec *codec, }; struct alc_spec *spec = codec->spec; - if (action == HDA_FIXUP_ACT_PRE_PROBE) { + if (action == HDA_FIXUP_ACT_PRE_PROBE) spec->gen.preferred_dacs = preferred_pairs; - spec->gen.obey_preferred_dacs = 1; - } } /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */