All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 1/2] ALSA: hda - Fix "PCM" name being used on one DAC when there are two DACs
@ 2014-10-16 13:33 David Henningsson
  2014-10-16 13:33 ` [RFC PATCH 2/2] ALSA: hda - Use "Line Out" name instead of "PCM" when there are other outputs David Henningsson
                   ` (2 more replies)
  0 siblings, 3 replies; 29+ messages in thread
From: David Henningsson @ 2014-10-16 13:33 UTC (permalink / raw)
  To: tiwai, alsa-devel; +Cc: David Henningsson

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 <david.henningsson@canonical.com>
---
 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

^ permalink raw reply related	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2014-10-22  7:43 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-16 13:33 [RFC PATCH 1/2] ALSA: hda - Fix "PCM" name being used on one DAC when there are two DACs David Henningsson
2014-10-16 13:33 ` [RFC PATCH 2/2] ALSA: hda - Use "Line Out" name instead of "PCM" when there are other outputs David Henningsson
2014-10-16 14:54 ` [RFC PATCH 1/2] ALSA: hda - Fix "PCM" name being used on one DAC when there are two DACs Takashi Iwai
2014-10-16 15:02 ` Raymond Yau
2014-10-16 15:10   ` David Henningsson
2014-10-18 12:33     ` Raymond Yau
2014-10-18 18:28       ` Takashi Iwai
2014-10-18 23:02         ` Raymond Yau
2014-10-19  9:02           ` Takashi Iwai
2014-10-20  1:10             ` Raymond Yau
2014-10-20  5:54               ` Takashi Iwai
2014-10-20  6:29           ` David Henningsson
2014-10-20  9:55             ` Raymond Yau
2014-10-20  9:58               ` Takashi Iwai
2014-10-20 11:31                 ` Raymond Yau
2014-10-20 11:48                   ` Takashi Iwai
2014-10-20 14:24                     ` Raymond Yau
2014-10-20 14:33                       ` Takashi Iwai
2014-10-20 23:37                         ` Raymond Yau
2014-10-21  2:29                       ` Robert Hancock
2014-10-21  7:55                         ` Raymond Yau
2014-10-21 13:06                           ` Raymond Yau
2014-10-22  7:43                     ` Raymond Yau
2014-10-20  9:59               ` David Henningsson
2014-10-20 10:02                 ` Takashi Iwai
2014-10-20 10:15                   ` David Henningsson
2014-10-20 11:27                     ` Takashi Iwai
2014-10-22  7:29                   ` Takashi Iwai
2014-10-20 14:38                 ` Raymond Yau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.