All of lore.kernel.org
 help / color / mirror / Atom feed
* Aureal Vortex PATCH [Fwd: via workaround error]
@ 2004-01-10  3:04 Manuel Jander
  2004-01-12 14:00 ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Manuel Jander @ 2004-01-10  3:04 UTC (permalink / raw)
  To: Alsa Devel list

Please apply to CVS. Thanks

-----Forwarded Message-----
From: Wilfried Weissmann <Wilfried.Weissmann@gmx.at>
To: openvortex-dev@nongnu.org, manuel.jander@mat.utfsm.cl
Subject: via workaround error
Date: Fri, 09 Jan 2004 20:16:01 +0100

i made a stupid error when i wrote the via workaround patch. the pci 
latency for the vortex was still set to 0xff when using autodetection 
and no via chipset was found. i discovered this after i exchanged my 
motherboard from a via kt133 to a sis 735. the fix is attached. the bug 
should not have caused any troubles but it is just not right...

bye,
wilfried

________________________________________________________________________
--- alsa-driver-1.0.0rc1-ww1/pci/au88x0/au88x0.c	2003-12-03 01:01:19.000000000 +0100
+++ alsa-driver-1.0.0rc1-ww2/pci/au88x0/au88x0.c	2004-01-09 20:01:32.000000000 +0100
@@ -77,6 +77,10 @@ static void __devinit snd_vortex_workaro
 		}
 		break;
 	}
+
+		/* do not do anything if autodetection was enabled and found no VIA */
+	if(fix == 255)
+		return;
 	
 	int rc;
 



-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html

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

* Re: Aureal Vortex PATCH [Fwd: via workaround error]
  2004-01-10  3:04 Aureal Vortex PATCH [Fwd: via workaround error] Manuel Jander
@ 2004-01-12 14:00 ` Takashi Iwai
  2004-01-12 18:08   ` Wilfried Weissmann
  0 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2004-01-12 14:00 UTC (permalink / raw)
  To: manuel.jander; +Cc: alsa-devel

At Fri, 09 Jan 2004 23:04:49 -0400,
Manuel Jander wrote:
> 
> Please apply to CVS. Thanks
> 
> -----Forwarded Message-----
> From: Wilfried Weissmann <Wilfried.Weissmann@gmx.at>
> To: openvortex-dev@nongnu.org, manuel.jander@mat.utfsm.cl
> Subject: via workaround error
> Date: Fri, 09 Jan 2004 20:16:01 +0100
> 
> i made a stupid error when i wrote the via workaround patch. the pci 
> latency for the vortex was still set to 0xff when using autodetection 
> and no via chipset was found. i discovered this after i exchanged my 
> motherboard from a via kt133 to a sis 735. the fix is attached. the bug 
> should not have caused any troubles but it is just not right...

i didn't receive the VIA workaround patch itself yet.
could you send the whole patch?


thanks,

Takashi


-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html

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

* Re: Aureal Vortex PATCH [Fwd: via workaround error]
  2004-01-12 14:00 ` Takashi Iwai
@ 2004-01-12 18:08   ` Wilfried Weissmann
  2004-01-12 18:23     ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Wilfried Weissmann @ 2004-01-12 18:08 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: manuel.jander, alsa-devel

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

Takashi Iwai wrote:
> At Fri, 09 Jan 2004 23:04:49 -0400,
> Manuel Jander wrote:
> 
>>Please apply to CVS. Thanks
>>
>>-----Forwarded Message-----
>>From: Wilfried Weissmann <Wilfried.Weissmann@gmx.at>
>>To: openvortex-dev@nongnu.org, manuel.jander@mat.utfsm.cl
>>Subject: via workaround error
>>Date: Fri, 09 Jan 2004 20:16:01 +0100
>>
>>i made a stupid error when i wrote the via workaround patch. the pci 
>>latency for the vortex was still set to 0xff when using autodetection 
>>and no via chipset was found. i discovered this after i exchanged my 
>>motherboard from a via kt133 to a sis 735. the fix is attached. the bug 
>>should not have caused any troubles but it is just not right...
> 
> 
> i didn't receive the VIA workaround patch itself yet.
> could you send the whole patch?

here we go...

[-- Attachment #2: alsa-0.9.7c-aureal-via-quirks.patch --]
[-- Type: text/plain, Size: 2897 bytes --]

--- alsa-driver-0.9.7c/pci/au88x0/au88x0.c	2003-10-06 16:01:04.000000000 +0200
+++ alsa-driver-0.9.7c-ww/pci/au88x0/au88x0.c	2003-10-25 22:31:09.000000000 +0200
@@ -26,6 +26,7 @@
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
+static int pcifix[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 255 };
 
 MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
 MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard.");
@@ -36,6 +37,9 @@ MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
 MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
 MODULE_PARM_DESC(enable, "Enable " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
+MODULE_PARM(pcifix, "1-255i");
+MODULE_PARM_DESC(pcifix, "Enable VIA-workaround for " CARD_NAME " soundcard.");
+MODULE_PARM_SYNTAX(pcifix, SNDRV_ENABLED ",allows:{{0,Disabled},{1,Latency},{2,Bridge},{3,Both},{255,Auto}},default:4,dialog:check");
 
 MODULE_DESCRIPTION("Aureal vortex");
 MODULE_CLASSES("{sound}");
@@ -61,6 +65,56 @@ __setup("snd-au88x0=", alsa_card_vortex_
 
 MODULE_DEVICE_TABLE(pci, snd_vortex_ids);
 
+static void __devinit snd_vortex_workaround(struct pci_dev *vortex, int fix) {
+	struct pci_dev *via=NULL;
+		/* autodetect if workarounds are required */
+	while( (via = pci_find_device(PCI_VENDOR_ID_VIA,
+				PCI_DEVICE_ID_VIA_8365_1, via)) ) {
+		if(fix == 255) {
+			printk(KERN_INFO CARD_NAME
+				": detected VIA KT133/KM133. activating workaround...\n");
+			fix = 3; // do latency and via bridge workaround
+		}
+		break;
+	}
+	
+	int rc;
+
+		/* fix vortex latency */
+	if(fix & 0x01) {
+		if( !(rc = pci_write_config_byte(vortex, 0x40, 0xff)) ) {
+			printk(KERN_INFO CARD_NAME
+					": vortex latency is 0xff\n");
+		}
+		else {
+			printk(KERN_WARNING CARD_NAME ": could not set vortex latency: pci error 0x%x\n", rc);
+		}
+	}
+
+		/* fix via agp bridge */
+	if(via && (fix & 0x02)) {
+		u8 value;
+
+			/*
+			 * only set the bit (Extend PCI#2 Internal Master for
+			 * Efficient Handling of Dummy Requests) if the can
+			 * read the config and it is not already set
+			 */
+
+		if( !(rc = pci_read_config_byte(via, 0x42, &value)) && (
+			(value & 0x10) ||
+			!(rc=pci_write_config_byte(via, 0x42, value|0x10)) ) ) {
+
+			printk(KERN_INFO CARD_NAME
+					": bridge config is 0x%x\n",
+					value|0x10);
+		}
+		else {
+			printk(KERN_WARNING CARD_NAME ": could not set vortex latency: pci error 0x%x\n", rc);
+		}
+	}
+}
+
 
 // component-destructor
 // (see "Management of Cards and Components")
@@ -198,6 +252,7 @@ snd_vortex_probe(struct pci_dev *pci, co
         snd_card_free(card);
         return err;
     }
+    snd_vortex_workaround(pci, pcifix[dev]);
     // (4) Alloc components.
     // ADB pcm.
     if ((err = snd_vortex_new_pcm(chip, VORTEX_PCM_ADB, NR_ADB)) < 0) {

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

* Re: Aureal Vortex PATCH [Fwd: via workaround error]
  2004-01-12 18:08   ` Wilfried Weissmann
@ 2004-01-12 18:23     ` Takashi Iwai
  2004-01-13 19:47       ` Wilfried Weissmann
  0 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2004-01-12 18:23 UTC (permalink / raw)
  To: Wilfried Weissmann; +Cc: manuel.jander, alsa-devel

At Mon, 12 Jan 2004 19:08:21 +0100,
Wilfried Weissmann wrote:
> 
> [1  <text/plain; us-ascii (7bit)>]
> Takashi Iwai wrote:
> > At Fri, 09 Jan 2004 23:04:49 -0400,
> > Manuel Jander wrote:
> > 
> >>Please apply to CVS. Thanks
> >>
> >>-----Forwarded Message-----
> >>From: Wilfried Weissmann <Wilfried.Weissmann@gmx.at>
> >>To: openvortex-dev@nongnu.org, manuel.jander@mat.utfsm.cl
> >>Subject: via workaround error
> >>Date: Fri, 09 Jan 2004 20:16:01 +0100
> >>
> >>i made a stupid error when i wrote the via workaround patch. the pci 
> >>latency for the vortex was still set to 0xff when using autodetection 
> >>and no via chipset was found. i discovered this after i exchanged my 
> >>motherboard from a via kt133 to a sis 735. the fix is attached. the bug 
> >>should not have caused any troubles but it is just not right...
> > 
> > 
> > i didn't receive the VIA workaround patch itself yet.
> > could you send the whole patch?
> 
> here we go...

thanks!

> +static void __devinit snd_vortex_workaround(struct pci_dev *vortex, int fix) {
> +	struct pci_dev *via=NULL;
> +		/* autodetect if workarounds are required */
> +	while( (via = pci_find_device(PCI_VENDOR_ID_VIA,
> +				PCI_DEVICE_ID_VIA_8365_1, via)) ) {
> +		if(fix == 255) {
> +			printk(KERN_INFO CARD_NAME
> +				": detected VIA KT133/KM133. activating workaround...\n");
> +			fix = 3; // do latency and via bridge workaround
> +		}
> +		break;
> +	}

i think "if" is enough in the above.

> +	
> +	int rc;

gcc-2.9.x won't accept this.


i applied the fixed version to cvs.  please check it later.

could you also provide the patch to INSTALL (document) file?


thanks,

Takashi


-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html

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

* Re: Aureal Vortex PATCH [Fwd: via workaround error]
  2004-01-12 18:23     ` Takashi Iwai
@ 2004-01-13 19:47       ` Wilfried Weissmann
  0 siblings, 0 replies; 5+ messages in thread
From: Wilfried Weissmann @ 2004-01-13 19:47 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: manuel.jander, alsa-devel

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

Takashi Iwai wrote:
[snip]
> i applied the fixed version to cvs.  please check it later.

the changes are fine.

> 
> could you also provide the patch to INSTALL (document) file?

the patch is attached (against current alsa CVS)...

> 
> 
> thanks,
> 
> Takashi

greetings,
wilfried

[-- Attachment #2: alsa-1.0.1-aureal-via-quirks-docs.patch --]
[-- Type: text/plain, Size: 791 bytes --]

Index: INSTALL
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/INSTALL,v
retrieving revision 1.154
diff -u -r1.154 INSTALL
--- INSTALL	12 Jan 2004 14:40:21 -0000	1.154
+++ INSTALL	13 Jan 2004 19:39:29 -0000
@@ -261,6 +261,14 @@
            control correctly. If you have problems regarding this, try
            another ALSA compliant mixer (alsamixer works).
 
+    pcifix	- Control PCI workarounds
+		  0 = Disable all workarounds
+		  1 = Force the PCI latency of the Aureal card to 0xff
+		  2 = Force the Extend PCI#2 Internal Master for Efficient
+		      Handling of Dummy Requests on the VIA KT133 AGP Bridge
+		  3 = Force both settings
+		  255 = Autodetect what is required (default)
+
 
 Trouble Shooting
 ================

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

end of thread, other threads:[~2004-01-13 19:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-10  3:04 Aureal Vortex PATCH [Fwd: via workaround error] Manuel Jander
2004-01-12 14:00 ` Takashi Iwai
2004-01-12 18:08   ` Wilfried Weissmann
2004-01-12 18:23     ` Takashi Iwai
2004-01-13 19:47       ` Wilfried Weissmann

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.