From patchwork Thu Oct 16 13:33:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Henningsson X-Patchwork-Id: 5091951 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C1A9FC11AC for ; Thu, 16 Oct 2014 13:34:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F1F8E201D3 for ; Thu, 16 Oct 2014 13:34:11 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id B874F201B9 for ; Thu, 16 Oct 2014 13:34:09 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id E53BB261A7E; Thu, 16 Oct 2014 15:34:07 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00, RCVD_IN_SORBS_WEB, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id C6C5B260706; Thu, 16 Oct 2014 15:33:59 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id A1A852608F0; Thu, 16 Oct 2014 15:33:57 +0200 (CEST) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by alsa0.perex.cz (Postfix) with ESMTP id BBF3E2605C9 for ; Thu, 16 Oct 2014 15:33:50 +0200 (CEST) Received: from [62.156.150.204] (helo=david-trusty.fdxtended.com) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1XelBe-0005fK-7V; Thu, 16 Oct 2014 13:33:50 +0000 From: David Henningsson To: tiwai@suse.de, alsa-devel@alsa-project.org Date: Thu, 16 Oct 2014 15:33:45 +0200 Message-Id: <1413466426-2672-1-git-send-email-david.henningsson@canonical.com> X-Mailer: git-send-email 1.9.1 Cc: David Henningsson Subject: [alsa-devel] [RFC PATCH 1/2] ALSA: hda - Fix "PCM" name being used on one DAC when there are two DACs X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP In the scenario where there is one "Line Out", one "Speaker" and one "Headphone", and there are only two DACs, two outputs will share a DAC. Currently any mixer on such a DAC will get the "PCM" name, which is misleading. Instead use "Headphone+LO" or "Speaker+LO" to better specify what the volume actually controls. Signed-off-by: David Henningsson --- sound/pci/hda/hda_generic.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index 64220c0..1d742ea 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c @@ -1038,6 +1038,19 @@ static const char *get_line_out_pfx(struct hda_codec *codec, int ch, break; *index = ch; return "Headphone"; + case AUTO_PIN_LINE_OUT: + /* This deals with the case where we have two DACs and + * one LO, one HP and one Speaker */ + if (!ch && cfg->speaker_outs && cfg->hp_outs) { + bool hp_lo_shared = !path_has_mixer(codec, spec->hp_paths[0], ctl_type); + bool spk_lo_shared = !path_has_mixer(codec, spec->speaker_paths[0], ctl_type); + if (hp_lo_shared && spk_lo_shared) + return spec->vmaster_mute.hook ? "PCM" : "Master"; + if (hp_lo_shared) + return "Headphone+LO"; + if (spk_lo_shared) + return "Speaker+LO"; + } } /* for a single channel output, we don't have to name the channel */