All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Alsa-user] 4 channel stereo with ALC650 (MSI KT3-ultra)
       [not found]   ` <200210121718.49766.bernatik@kn.vutbr.cz>
@ 2002-10-14 13:47     ` Takashi Iwai
  0 siblings, 0 replies; only message in thread
From: Takashi Iwai @ 2002-10-14 13:47 UTC (permalink / raw)
  To: bernatik; +Cc: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 1728 bytes --]

At Sat, 12 Oct 2002 17:18:49 +0200,
Jan Bernatík wrote:
> 
> Dne pá 11. říjen 2002 16:41 Takashi Iwai napsal(a):
> > At Fri, 11 Oct 2002 16:24:36 +0200,
> >
> > Jan Bernatík wrote:
> > > Hallo everyone
> > >
> > > I have alsa drivers 0.9rc3 working with my via8233 (ALC650) onboard
> > > soundcard. But I really don't know, if there is some way to play
> > > 4-channel stereo (neither with S-bracket nor without it). In alsamixer I
> > > don't have "rear speaker" option or something like that ... I installed
> > > windows just to try if it's working there, and it is (with new driver
> > > downloaded from realtek, whan i open windows sound mixer i have "rear
> > > speaker" option). So I'm asking for help or some documentation about that
> > > ... if it exist.
> >
> > the via82xx driver itself supports the multi-channel playback, simply
> > by setting up and passing 4-channel interleaved samples.
> > but, i guess, the problem is the multi-channel output on this codec.
> > there are some vendor-specific registers for multichannel controls on
> > ALC650, but they are still not supported on the alsa driver, mainly
> > due to lack of hardware for tests.
> >
> > i'll let you know if the experimental patch is ready.
> >
> >
> > ciao,
> >
> > Takashi
> 
> Thank U a lot. 
> I think U are probably really busy, but i want to thank you
> for what are you doing. I'm starting with programming, i want to contribute to 
> opensource as well. 

the attached is a patch to control switches for surround, center/lfe
pins.  you'll have "Line-In As Surround" and "Mic As Center/LFE".
if you don't get sounds even after changing "Surround" and "Center",
"LFE" volumes and switches, please try to change the values above.


Takashi

[-- Attachment #2: alc650-fix.dif --]
[-- Type: application/octet-stream, Size: 5732 bytes --]

Index: alsa-kernel/include/ac97_codec.h
===================================================================
RCS file: /suse/tiwai/cvs/alsa/alsa-kernel/include/ac97_codec.h,v
retrieving revision 1.14
diff -u -r1.14 ac97_codec.h
--- alsa-kernel/include/ac97_codec.h	17 Sep 2002 13:40:06 -0000	1.14
+++ alsa-kernel/include/ac97_codec.h	14 Oct 2002 13:33:58 -0000
@@ -195,6 +195,10 @@
 #define AC97_CXR_SPDIF_PCM	0x0
 #define AC97_CXR_SPDIF_AC3	0x2
 
+/* specific - ALC */
+#define AC97_ALC650_MULTICH	0x6a
+#define AC97_ALC650_CLOCK	0x7a
+
 /* ac97->scaps */
 #define AC97_SCAP_AUDIO		(1<<0)	/* audio AC'97 codec */
 #define AC97_SCAP_MODEM		(1<<1)	/* modem AC'97 codec */
Index: alsa-kernel/pci/ac97/ac97_codec.c
===================================================================
RCS file: /suse/tiwai/cvs/alsa/alsa-kernel/pci/ac97/ac97_codec.c,v
retrieving revision 1.37
diff -u -r1.37 ac97_codec.c
--- alsa-kernel/pci/ac97/ac97_codec.c	18 Sep 2002 12:25:21 -0000	1.37
+++ alsa-kernel/pci/ac97/ac97_codec.c	14 Oct 2002 13:33:27 -0000
@@ -105,7 +105,7 @@
 { 0x414c4310, 0xfffffff0, "RL5382", 		NULL },
 { 0x414c4320, 0xfffffff0, "RL5383", 		NULL },
 { 0x414c4710, 0xfffffff0, "ALC200/200P",	NULL },
-{ 0x414c4720, 0xfffffff0, "ALC650",		NULL },
+{ 0x414c4720, 0xfffffff0, "ALC650",		patch_alc650 },
 { 0x414c4730, 0xffffffff, "ALC101",		NULL },
 { 0x414c4740, 0xfffffff0, "ALC202",		NULL },
 { 0x414c4750, 0xfffffff0, "ALC250",		NULL },
@@ -915,6 +915,25 @@
 };
 
 /*
+ * ALC650
+ */
+static const snd_kcontrol_new_t snd_ac97_controls_alc650[] = {
+	AC97_SINGLE("Duplicate Front", AC97_ALC650_MULTICH, 0, 1, 0),
+	AC97_SINGLE("Surround Down Mix", AC97_ALC650_MULTICH, 1, 1, 0),
+	AC97_SINGLE("Center/LFE Down Mix", AC97_ALC650_MULTICH, 2, 1, 0),
+	AC97_SINGLE("Exchange Center/LFE", AC97_ALC650_MULTICH, 3, 1, 0),
+	AC97_SINGLE("Line-In As Surround", AC97_ALC650_MULTICH, 9, 1, 0),
+	AC97_SINGLE("Mic As Center/LFE", AC97_ALC650_MULTICH, 10, 1, 0),
+	AC97_SINGLE("IEC958 Capture Switch", AC97_ALC650_MULTICH, 11, 1, 0),
+	AC97_SINGLE("Analog to IEC958 Output", AC97_ALC650_MULTICH, 12, 1, 0),
+	AC97_SINGLE("IEC958 Input Monitor", AC97_ALC650_MULTICH, 13, 1, 0),
+#if 0 /* always set in patch_alc650 */
+	AC97_SINGLE("IEC958 Input Clock Enable", AC97_ALC650_CLOCK, 0, 1, 0),
+	AC97_SINGLE("IEC958 Input Pin Enable", AC97_ALC650_CLOCK, 1, 1, 0),
+#endif
+};
+
+/*
  *
  */
 
@@ -1340,7 +1359,7 @@
 	}
 	
 	/* build S/PDIF controls */
-	if (ac97->ext_id & AC97_EA_SPDIF) {
+	if (ac97->ext_id & AC97_EI_SPDIF) {
 		if (ac97->flags & AC97_CS_SPDIF) {
 			for (idx = 0; idx < 3; idx++)
 				if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_spdif[idx], ac97))) < 0)
@@ -1379,7 +1398,7 @@
 		ac97->spdif_status = SNDRV_PCM_DEFAULT_CON_SPDIF;
 	}
 	
-	/* build Sigmatel specific controls */
+	/* build chip specific controls */
 	switch (ac97->id) {
 	case AC97_ID_STAC9700:
 	case AC97_ID_STAC9708:
@@ -1393,6 +1412,12 @@
 		if (snd_ac97_try_bit(ac97, AC97_SIGMATEL_ANALOG, 0))
 			if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_sigmatel_controls[1], ac97))) < 0)
 				return err;
+		break;
+	case AC97_ID_ALC650:
+		for (idx = 0; idx < ARRAY_SIZE(snd_ac97_controls_alc650); idx++)
+			if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_alc650[idx], ac97))) < 0)
+				return err;
+		break;
 	default:
 		/* nothing */
 		break;
Index: alsa-kernel/pci/ac97/ac97_id.h
===================================================================
RCS file: /suse/tiwai/cvs/alsa/alsa-kernel/pci/ac97/ac97_id.h,v
retrieving revision 1.2
diff -u -r1.2 ac97_id.h
--- alsa-kernel/pci/ac97/ac97_id.h	4 Sep 2002 13:06:58 -0000	1.2
+++ alsa-kernel/pci/ac97/ac97_id.h	14 Oct 2002 13:33:47 -0000
@@ -43,3 +43,4 @@
 #define AC97_ID_CS4299		0x43525930
 #define AC97_ID_CS4201		0x43525948
 #define AC97_ID_CS4205		0x43525958
+#define AC97_ID_ALC650		0x414c4720
Index: alsa-kernel/pci/ac97/ac97_patch.c
===================================================================
RCS file: /suse/tiwai/cvs/alsa/alsa-kernel/pci/ac97/ac97_patch.c,v
retrieving revision 1.4
diff -u -r1.4 ac97_patch.c
--- alsa-kernel/pci/ac97/ac97_patch.c	11 Sep 2002 08:53:51 -0000	1.4
+++ alsa-kernel/pci/ac97/ac97_patch.c	14 Oct 2002 13:35:11 -0000
@@ -168,7 +168,7 @@
 
 	ac97->flags |= AC97_CS_SPDIF; 
 	ac97->rates[AC97_RATES_SPDIF] &= ~SNDRV_PCM_RATE_32000;
-        ac97->ext_id |= AC97_EA_SPDIF;	/* force the detection of spdif */
+        ac97->ext_id |= AC97_EI_SPDIF;	/* force the detection of spdif */
 	snd_ac97_write_cache(ac97, AC97_CSR_ACMODE, 0x0080);
 	return 0;
 }
@@ -184,7 +184,7 @@
 int patch_conexant(ac97_t * ac97)
 {
 	ac97->flags |= AC97_CX_SPDIF;
-        ac97->ext_id |= AC97_EA_SPDIF;	/* force the detection of spdif */
+        ac97->ext_id |= AC97_EI_SPDIF;	/* force the detection of spdif */
 	return 0;
 }
 
@@ -334,5 +334,13 @@
 	/* it seems that most vendors connect line-out connector to headphone out of AC'97 */
 	misc = snd_ac97_read(ac97, AC97_AD_MISC);
 	snd_ac97_write_cache(ac97, AC97_AD_MISC, misc | 0x0420);
+	return 0;
+}
+
+int patch_alc650(ac97_t * ac97)
+{
+	/* enable spdif in */
+	snd_ac97_write_cache(ac97, AC97_ALC650_CLOCK,
+			     snd_ac97_read(ac97, AC97_ALC650_CLOCK) | 0x03);
 	return 0;
 }
Index: alsa-kernel/pci/ac97/ac97_patch.h
===================================================================
RCS file: /suse/tiwai/cvs/alsa/alsa-kernel/pci/ac97/ac97_patch.h,v
retrieving revision 1.3
diff -u -r1.3 ac97_patch.h
--- alsa-kernel/pci/ac97/ac97_patch.h	11 Sep 2002 08:53:51 -0000	1.3
+++ alsa-kernel/pci/ac97/ac97_patch.h	14 Oct 2002 13:28:26 -0000
@@ -38,3 +38,4 @@
 int patch_ad1885(ac97_t * ac97);
 int patch_ad1886(ac97_t * ac97);
 int patch_ad1980(ac97_t * ac97);
+int patch_alc650(ac97_t * ac97);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-10-14 13:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200210111624.36543.bernatik@kn.vutbr.cz>
     [not found] ` <s5hadllca1p.wl@alsa2.suse.de>
     [not found]   ` <200210121718.49766.bernatik@kn.vutbr.cz>
2002-10-14 13:47     ` [Alsa-user] 4 channel stereo with ALC650 (MSI KT3-ultra) Takashi Iwai

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.