From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [RFC PATCH 1/2] ALSA: hda - Fix "PCM" name being used on one DAC when there are two DACs Date: Thu, 16 Oct 2014 16:54:16 +0200 Message-ID: References: <1413466426-2672-1-git-send-email-david.henningsson@canonical.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 2B0D42614CB for ; Thu, 16 Oct 2014 16:54:17 +0200 (CEST) In-Reply-To: <1413466426-2672-1-git-send-email-david.henningsson@canonical.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: David Henningsson Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Thu, 16 Oct 2014 15:33:45 +0200, David Henningsson wrote: > > 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 The changes look good. If this passes the tests and is confirmed to work with the real machine, let's merge them. As this is rather a fix, we can merge them to 3.18, too, IMO. thanks, Takashi > --- > 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 */ > -- > 1.9.1 >