Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4555390ybv; Mon, 10 Feb 2020 22:24:25 -0800 (PST) X-Google-Smtp-Source: APXvYqyMGClKiemIp6xQu+nmYBHQifAMbUOGLwtCCtprFv4o4gDpR+8EaVa6vIOKge3ayHzUMKs3 X-Received: by 2002:a05:6830:22cd:: with SMTP id q13mr4132460otc.224.1581402264991; Mon, 10 Feb 2020 22:24:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581402264; cv=none; d=google.com; s=arc-20160816; b=ashwPmKefNTN95RlTUiinft6pA4LyNn4yrQFDreJYxuDTEdlOLHE90qtO4Id6g/lAP aSPJfQosbmgpi/CraDe+T4TgH0aIbZ6p/X4357avyWbNgteajYJrWZBDsuUBjzYLF63i /3nJOKqArehiRI2By0tpZUAlnaDwzxv5padKAnxFvye0OTrGzoc0z8vekq+JnTkzjfQA dkAfEIVwuJB9bhpAvhvsAAO88unB4B94oMQB2rkWafriAl9ex6P5rSnIjQIi9Yhlk4Hm 3LDI/omyGZ53hdH8jEB6qPS7FCCDnYbztsatHZ2MHnOOzFjwzLaWQzOx3ig/8xTxrQkN gnZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RtcACHY1GteKSUYIoiEzAwSY/JFxUKopsQ/nQ/UelxI=; b=xF2/Wv5QKErkF7INgsbrBzDNXvXjMXe9HjFkLLBKS0Au5XZ9WCxtH8YT3+8NyWUyUJ THEB950pIb7lbFu8xavMp2bvwXVckT+CqiJ8CKTS7wroJ6YnyOd4R2DBEATEkEWTE2E5 Z/rZFHm3FSBnDBjNirExMCG2WRnjseCq9eDPWg/t1zV0WWAFyPWSp9aR59hk5wbbUdHo BF6qeXOe3U9Fs/GaF3mkU+M3PWx04+ampduSM9D4Q80P06O0bPc8kgwBguxjQQPpqzMM k3jfx/G372wD+QNOF4qdzE9j8RNH98bfdHfA2mRQNCD1duxB4+6+VaY0tCqY6bfcB3aX rTDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uGIPMgze; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z15si1386635otm.168.2020.02.10.22.24.13; Mon, 10 Feb 2020 22:24:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uGIPMgze; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728270AbgBKF5v (ORCPT + 99 others); Tue, 11 Feb 2020 00:57:51 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:45159 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726942AbgBKF5u (ORCPT ); Tue, 11 Feb 2020 00:57:50 -0500 Received: by mail-pf1-f193.google.com with SMTP id 2so4913436pfg.12 for ; Mon, 10 Feb 2020 21:57:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RtcACHY1GteKSUYIoiEzAwSY/JFxUKopsQ/nQ/UelxI=; b=uGIPMgze54HdLetRttejcgVMdUMlVlZkhEspiWqqqdkOH3lzSVGcJCK3qlMJp4oEoO +AQibt5qwbOn4CDt02cT4IXmHlE5WOz2XRHjXT/EyeOcfZuPiPlvmR+lw6FixpphVsmq yuXuVtzmNrDo8qXM/xuVARxvnjcJcQNYS77qsMazdQG3e10aiXkJ6ZHgKyxQbTVrRb0n ZDzXRMxWhE+WmLA2DjSVqB2DVkkOCzX2frTVlAHsYRVY3rKNCJTU9cMpOfuyW/4EnD9V OKpguDR32powtQmqXuS6zW4EEfT1FRxc14JeR3LcCkLZKu3AsSWGUrKOBxmHOwi38KcJ zm0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RtcACHY1GteKSUYIoiEzAwSY/JFxUKopsQ/nQ/UelxI=; b=NsxOpSlGAPsOnVdmN8PrWNUVPrV6X56R7v26ktvMqOyoUZKACBETfhjyCiqOVO12JQ QqwzLbXKtamS11pT6rWgAyaQKV4Hk1znbwAY/tZu8HP25bypevUoTZBIXzwNoV7yqeNh Nm5GZzSiqqjhANB7tXM0m1SOcXbz2GqLv+2Upvk3QoEDQpo8LbbsYEWdXS8jbykBS6NB HkjEt+YBhqdCqYyTbl6TciTpoK/XLG9ZHKdSbdPvVLe5O8RnsYE0HHxx3aAcagh+8g6y qq63WdrP/eEPn+hYK6++vawIDyeW8SCeXhx1xJ5Yor+H+ANGdRrhUqsQmmtn0F879YTY nLgg== X-Gm-Message-State: APjAAAXA6p7p1huILnS5fkaRer7adltCrQI8yWWGbaaYB/YZtkiB5nwP DrDI+VM98KqAVzBKnGd7bJw= X-Received: by 2002:a63:6607:: with SMTP id a7mr5450503pgc.310.1581400669771; Mon, 10 Feb 2020 21:57:49 -0800 (PST) Received: from f3.synalogic.ca (ag119225.dynamic.ppp.asahi-net.or.jp. [157.107.119.225]) by smtp.gmail.com with ESMTPSA id x6sm2355617pfi.83.2020.02.10.21.57.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Feb 2020 21:57:49 -0800 (PST) From: Benjamin Poirier To: Jaroslav Kysela , Takashi Iwai Cc: Kailang Yang , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] ALSA: hda/realtek - Fix Lenovo Thinkpad X1 Carbon 7th quirk value Date: Tue, 11 Feb 2020 14:56:51 +0900 Message-Id: <20200211055651.4405-2-benjamin.poirier@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200211055651.4405-1-benjamin.poirier@gmail.com> References: <20200211055651.4405-1-benjamin.poirier@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As a result of commit d2cd795c4ece ("ALSA: hda - fixup for the bass speaker on Lenovo Carbon X1 7th gen"), the maximum sound output level on my machine, an X1 Carbon, was reduced to ~60% of its previous level. This laptop model has two sets of stereo speakers: Front and Bass (aka Rear in some contexts). Before commit d2cd795c4ece, volume control was commonly ineffective (using the Master slider in alsa or pulseaudio apparently had little effect or alternated between mute or max with nothing in between - more details below) commit d2cd795c4ece added quirk ALC285_FIXUP_SPEAKER2_TO_DAC1 which resulted in assigning both sets of speakers to the same DAC, bringing the two sets of speakers under one effective volume control but also lowering the max output volume noticeably. Fix this by changing the quirk so that each set of speakers can be controlled individually and the max output volume is restored to what it was before commit d2cd795c4ece. Since there is no documentation about the audio codec, here is some detailed information about the result of applying different quirks. DAC connection (which is what's affected by the quirk) is reported as found in /proc/asound/card0/codec#0, Node 0x17. pavucontrol controls are reported with the device configured with the "Analog Surround 4.0 Output" profile. no quirk Loud max output volume DAC connection Connection: 3 0x02 0x03 0x06* Controls in alsamixer Master controls front speakers only. Speaker controls front speakers only. Bass Speaker is a toggle that mutes everything. PCM controls all speakers. There is no "Front" mixer. Controls in pavucontrol "Front Left"/"Front Right" sliders work as expected. "Rear Left"/"Rear Right" sliders seem to operate in a non-linear fashion such that most values above 0% result in max volume output. -> Because the bass speakers (Rear) are more powerful, the net effect is that when the channels are linked into a single slider, it seems like it has just two modes: mute or max. ALC285_FIXUP_SPEAKER2_TO_DAC1 Weak (~60%) max output volume DAC connection Connection: 3 0x02* 0x03 0x06 In-driver Connection: 1 0x02 Controls in alsamixer Master controls all four speakers. Speaker controls all four speakers. Bass Speaker is a toggle that mutes everything. PCM controls all four speakers. There is no "Front" mixer. Controls in pavucontrol "Front Left"/"Front Right" sliders have no effect. "Rear Left"/"Rear Right" sliders control both front and bass speakers. -> Volume control is effective but it's not possible to control front and bass speakers individually. ALC295_FIXUP_DISABLE_DAC3 Loud max output volume DAC connection Connection: 3 0x02 0x03* 0x06 In-driver Connection: 2 0x02 0x03 Controls in alsamixer Master controls all speakers. Speaker is a toggle that mutes everything. Bass Speaker controls bass speakers only. PCM controls all speakers. Front controls front speakers only. Controls in pavucontrol "Front Left"/"Front Right" sliders control front speakers only. "Rear Left"/"Rear Right" sliders control bass speakers only. -> Volume control is effective and it's possible to control each of the four speakers individually. In summary, Node 0x17 DAC connection 0x3 offers the loudest max volume and the most detailed mixer controls. That connection is obtained with quirk ALC295_FIXUP_DISABLE_DAC3. Therefore, change the ThinkPad X1 Carbon 7th to use ALC295_FIXUP_DISABLE_DAC3. Fixes: d2cd795c4ece ("ALSA: hda - fixup for the bass speaker on Lenovo Carbon X1 7th gen") Link: https://lore.kernel.org/alsa-devel/20200210025249.GA2700@f3/ Cc: Jaroslav Kysela Cc: Kailang Yang Signed-off-by: Benjamin Poirier --- sound/pci/hda/patch_realtek.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 05d44df2008e..3171da10123e 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -7268,7 +7268,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), - SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_SPEAKER2_TO_DAC1), + SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC295_FIXUP_DISABLE_DAC3), SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), -- 2.25.0