Skip to contentSkip to conversation

PATCH: acore/wrappers.c hosed snprintf

PATCH Matthias Andree 3 participants 11 messages Jul 13, 2003 – Sep 1, 2003

lore
Share & tools
lore
#0 lore raw

Hi,

for some reason, alsa-driver-0.9.5 chose to use its snd_compat_*snprintf stuff on Linux 2.4.22-pre3-ac1. This triggered bugs in wrappers.c that break the compile, trivial patch below. Please apply.

acore/wrappers.c renamed from acore/wrappers.c.orig +2 -2
@@ -58,7 +58,6 @@
 int snd_compat_vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
 {
 	char *ptr = (void *) __get_free_pages(GFP_KERNEL, 0);
-	va_list args;
 	if (ptr == NULL) {	/* should not happen - GFP_KERNEL has wait flag */
 		if (size > 0)
 			buf[0] = 0;
@@ -73,9 +72,10 @@
 int snd_compat_snprintf(char *buf, size_t size, const char * fmt, ...)
 {
 	int res;
+	va_list args;
 
 	va_start(args, fmt);
-	res = snd_compat_vsnprintf(buf, size, args);
+	res = snd_compat_vsnprintf(buf, size, fmt, args);
 	va_end(args);
 	return res;
 }
Signature · 8 lines
Matthias Andree


-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps1
#1 lore raw

alsa 0.9.5 - ymfpci - Yay!

Thanks guys!
I finally have a working sound system on my Toshiba Notebook (Tecra 8100)!

tom.

-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here: http://www.vmware.com/wl/offer/345/0

#2 lore raw

Re: alsa 0.9.5 - ymfpci - Yay!

Quoted 1 line · tom burkart

I finally have a working sound system on my Toshiba Notebook (Tecra 8100)!

Ok, it worked once, just after the kernel upgrade (with alsa 0.9.5) and hasn't since... :-(

tom.

-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here: http://www.vmware.com/wl/offer/345/0

#3 lore raw

Re: Re: alsa 0.9.5 - ymfpci - Yay!

At Thu, 17 Jul 2003 11:11:13 +1000 (EST),

Quoted 6 lines · tom burkart
Quoted 1 line · tom burkart

I finally have a working sound system on my Toshiba Notebook (Tecra 8100)!

Ok, it worked once, just after the kernel upgrade (with alsa 0.9.5) and hasn't since... :-(

i believe this is just a missing initialization somewhere.

could you try once whether the oss ymfpci driver works? if it works, then unload it and start the ALSA again?

Takashi

-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here: http://www.vmware.com/wl/offer/345/0

#4 lore raw

Re: Re: alsa 0.9.5 - ymfpci - Yay!

Quoted 2 lines · Takashi Iwai

could you try once whether the oss ymfpci driver works? if it works, then unload it and start the ALSA again?

works, works.

tom.

-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here: http://www.vmware.com/wl/offer/345/0

#5 lore raw

Re: Re: alsa 0.9.5 - ymfpci - Yay!

At Thu, 17 Jul 2003 21:09:05 +1000 (EST),

Quoted 6 lines · tom burkart
Quoted 2 lines · Takashi Iwai

could you try once whether the oss ymfpci driver works? if it works, then unload it and start the ALSA again?

works, works.

ok, then please try the following
- apply the attach patch
- reboot your machine and load the (non-working) alsa driver first. check whether it really doesn't work
- get the register dump from /proc/asound/card0/ymfpci
- get the pci registers via "lspci -vvxxx" (only for the ymfpci device)
- unload alsa module, load oss, check the performance
- unload oss, and reload the alsa again.
check the performance.
- if it works at this stage, get the reg dump.
also, get pci registers.
- compare the two dumps.

TIA.

Takashi

#6 lore raw

Re: Re: alsa 0.9.5 - ymfpci - Yay!

Quoted 1 line · Takashi Iwai

- unload alsa module, load oss, check the performance

Ok, works as before.

Quoted 1 line

- unload oss, and reload the alsa again.

It didn't want to do it for quite a while - I eventually got to repeat it... There are a lot of artifacts in the sound that are not there when oss is active - may leave that for another day...

The attached patch I got from Jaroslav some time ago when he was trying to chase the same bug - it was still applied.

The other diff is the differences in the ymfpci output. The lspci output is identical over before (alsa), oss, after (alsa) - not supplied. I still have all the original files if required.

tom.

alsa-kernel/pci/ymfpci/ymfpci.c renamed from alsa-kernel/pci/ymfpci/ymfpci.c.org +2 -0
@@ -245,6 +245,8 @@
 	}
 	pci_set_drvdata(pci, chip);
 	dev++;
+	legacy_ctrl = 0x907f;
+	pci_write_config_word(pci, PCIR_DSXG_LEGACY, legacy_ctrl);
 	return 0;
 }
 
after-ymfpci renamed from before-ymfpci +11 -11
@@ -24,7 +24,7 @@
 0054: ff00ff
 0058: 555500ff
 005c: 0000
-0060: 208000
+0060: 1c8000
 0064: 26800f
 0068: 80000000
 006c: 0000
@@ -32,16 +32,16 @@
 0074: 0000
 0078: 0000
 007c: 0000
-0080: 31e731e7
-0084: 31e731e7
-0088: 31e731e7
+0080: 3fff3fff
+0084: 3fff3fff
+0088: 3fff3fff
 008c: 0000
 0090: 0000
 0094: 0000
-0098: 31e731e7
+0098: 0000
 009c: 0000
 00a0: 0000
-00a4: 0000
+00a4: 3fff3fff
 00a8: 3fff3fff
 00ac: 3fff3fff
 00b0: 0000
@@ -65,7 +65,7 @@
 00f8: 0000
 00fc: 0000
 0100: 0000
-0104: 0001
+0104: 0000
 0108: 0000
 010c: 0000
 0110: 0000
@@ -86,7 +86,7 @@
 014c: 0100
 0150: 0000
 0154: 0018
-0158: 4808000
-015c: 480be00
-0160: 480bf00
-0164: 480c000
+0158: 3ac8000
+015c: 3acbe00
+0160: 3acbf00
+0164: 3acc000
#7 lore raw

Re: Re: alsa 0.9.5 - ymfpci - Yay!

In reply to Takashi Iwai
Quoted 2 lines · Takashi Iwai

could you try once whether the oss ymfpci driver works? if it works, then unload it and start the ALSA again?

While it works, I noticed a lot of arifacts in the sound that never used to be there...

tom.
Consultant

AUSSEC Phone: 61 4 1768 2202
339 Blaxland Rd., Ryde NSW 2112
Email: [email protected]

-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here: http://www.vmware.com/wl/offer/345/0

#8 lore raw
In reply to Matthias Andree

Hi,

six weeks ago, I sent this patch to fix bugs in wrappers.c that are triggered when the kernel throws warnings in ./configure (-Werror is used there, it should not -- I've seen warnings by some kernel versions depending on GCC version).

I haven't yet seen any response, therefore full quote.

feed this mail into this pipe: grep '^> ' | sed 's/^> //' | patch

Please report if this patch is scheduled for inclusion into alsa-driver, is rejected permanently or other feelings you may have.

Thanks in advance.

Quoted 26 lines

for some reason, alsa-driver-0.9.5 chose to use its snd_compat_*snprintf stuff on Linux 2.4.22-pre3-ac1. This triggered bugs in wrappers.c that break the compile, trivial patch below. Please apply.

acore/wrappers.c renamed from acore/wrappers.c.orig +2 -2
@@ -58,7 +58,6 @@
 int snd_compat_vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
 {
 	char *ptr = (void *) __get_free_pages(GFP_KERNEL, 0);
-	va_list args;
 	if (ptr == NULL) {	/* should not happen - GFP_KERNEL has wait flag */
 		if (size > 0)
 			buf[0] = 0;
@@ -73,9 +72,10 @@
 int snd_compat_snprintf(char *buf, size_t size, const char * fmt, ...)
 {
 	int res;
+	va_list args;
 
 	va_start(args, fmt);
-	res = snd_compat_vsnprintf(buf, size, args);
+	res = snd_compat_vsnprintf(buf, size, fmt, args);
 	va_end(args);
 	return res;
 }
Signature · 9 lines
Matthias Andree

Encrypt your mail: my GnuPG key ID is 0x052E7D95


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
#9 lore raw

At Mon, 01 Sep 2003 17:40:25 +0200,

Quoted 8 lines · Matthias Andree

Hi,

six weeks ago, I sent this patch to fix bugs in wrappers.c that are triggered when the kernel throws warnings in ./configure (-Werror is used there, it should not -- I've seen warnings by some kernel versions depending on GCC version).

Quoted 6 lines

I haven't yet seen any response, therefore full quote.

feed this mail into this pipe: grep '^> ' | sed 's/^> //' | patch

Please report if this patch is scheduled for inclusion into alsa-driver, is rejected permanently or other feelings you may have.

your patch was already included (at least, 0.9.6 tarball includes it).

thanks,

Takashi

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#10 lore raw

Takashi Iwai schrieb am 2003-09-01:

Quoted 2 lines

your patch was already included (at least, 0.9.6 tarball includes it).

Ah, ok, so I'll remove the reminder flag here. Thanks.

Signature · 9 lines
Matthias Andree

Encrypt your mail: my GnuPG key ID is 0x052E7D95


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf