Skip to contentSkip to conversation

1.0.12 breaks firmware loading

DISCUSSION Dmitry Baikov 2 participants 21 messages Aug 28, 2006 – Sep 6, 2006

lore
Share & tools
lore
#0 lore raw

Hi!

Another bug report.

After upgrading from 1.0.11 to 1.0.12 I can no longer use Echo Indigo IO and RME Multiface. They both can get firmware loaded:

For indigo:
echoaudio.c:46: get_firmware(): Firmware not available (-2)

For hdsp, hdsploader gives Input/Output error.

Downgrading to 1.0.11 solves the problem.

Regards,
Dmitry.

P.S. please, cc me in your replies.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#1 lore raw

At Mon, 28 Aug 2006 23:01:46 +0400,

Quoted 8 lines · Dmitry Baikov

Hi!

Another bug report.

After upgrading from 1.0.11 to 1.0.12 I can no longer use Echo Indigo IO and RME Multiface. They both can get firmware loaded:

Quoted 6 lines

For indigo:
echoaudio.c:46: get_firmware(): Firmware not available (-2)

For hdsp, hdsploader gives Input/Output error.

Downgrading to 1.0.11 solves the problem.

Which directories are the firmware installed?

Takashi

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#2 lore raw
Quoted 1 line · Takashi Iwai

Which directories are the firmware installed?

/lib/firmware

BTW, googling for get_firmware() error reveals same problems for Ubuntu users.

I am on gentoo.

Dmitry.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#3 lore raw

At Tue, 29 Aug 2006 00:01:16 +0400,

Quoted 9 lines · Dmitry Baikov
Quoted 1 line · Takashi Iwai

Which directories are the firmware installed?

/lib/firmware

BTW, googling for get_firmware() error reveals same problems for Ubuntu users.

I am on gentoo.

OK, then what did you mean "downgrading"? Downgrading both driver and firmware? Does alsa-driver 1.0.12 + alsa-firmware 1.0.11 work?

Takashi

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#4 lore raw
Quoted 2 lines · Takashi Iwai

OK, then what did you mean "downgrading"? Downgrading both driver and firmware? Does alsa-driver 1.0.12 + alsa-firmware 1.0.11 work?

I meant both driver and firmware.

Driver 1.0.12 with firmware 1.0.11 does not work. When I tried to reinsert the hdsp cardbus, my machine even freezed.

Driver 1.0.11 with alsa-firmware-1.0.12 does work fine.

Dmitry.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#5 lore raw

At Tue, 29 Aug 2006 17:06:08 +0400,

Quoted 11 lines · Dmitry Baikov
Quoted 2 lines · Takashi Iwai

OK, then what did you mean "downgrading"? Downgrading both driver and firmware? Does alsa-driver 1.0.12 + alsa-firmware 1.0.11 work?

I meant both driver and firmware.

Driver 1.0.12 with firmware 1.0.11 does not work. When I tried to reinsert the hdsp cardbus, my machine even freezed.

Driver 1.0.11 with alsa-firmware-1.0.12 does work fine.

Interesting. Basically there is no change in hdsp driver itself. The diff is like below.

Which do you use, hdsploader or kernel firmware loader?

Takashi

pci/rme9652/hdsp.c +6 -5
diff -r 5b5af1f96df9 -r 22d22dcfa660 pci/rme9652/hdsp.c
@@ -389,7 +389,7 @@ MODULE_SUPPORTED_DEVICE("{{RME Hammerfal
 
 /* use hotplug firmeare loader? */
 #if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE)
-#ifndef HDSP_USE_HWDEP_LOADER
+#if !defined(HDSP_USE_HWDEP_LOADER) && !defined(CONFIG_SND_HDSP)
 #define HDSP_FW_LOADER
 #endif
 #endif
@@ -1356,7 +1356,7 @@ static struct snd_rawmidi_ops snd_hdsp_m
 	.trigger =	snd_hdsp_midi_input_trigger,
 };
 
-static int __devinit snd_hdsp_create_midi (struct snd_card *card, struct hdsp *hdsp, int id)
+static int snd_hdsp_create_midi (struct snd_card *card, struct hdsp *hdsp, int id)
 {
 	char buf[32];
 
@@ -3169,9 +3169,10 @@ snd_hdsp_proc_read(struct snd_info_entry
 	char *clock_source;
 	int x;
 
-	if (hdsp_check_for_iobox (hdsp))
+	if (hdsp_check_for_iobox (hdsp)) {
 		snd_iprintf(buffer, "No I/O box connected.\nPlease connect one and upload firmware.\n");
 		return;
+        }
 
 	if (hdsp_check_for_firmware(hdsp, 0)) {
 		if (hdsp->state & HDSP_FirmwareCached) {
@@ -3470,7 +3471,7 @@ static void __devinit snd_hdsp_proc_init
 	struct snd_info_entry *entry;
 
 	if (! snd_card_proc_new(hdsp->card, "hdsp", &entry))
-		snd_info_set_text_ops(entry, hdsp, 1024, snd_hdsp_proc_read);
+		snd_info_set_text_ops(entry, hdsp, snd_hdsp_proc_read);
 }
 
 static void snd_hdsp_free_buffers(struct hdsp *hdsp)
@@ -4911,7 +4912,7 @@ static int __devinit snd_hdsp_create(str
 		return -EBUSY;
 	}
 
-	if (request_irq(pci->irq, snd_hdsp_interrupt, SA_INTERRUPT|SA_SHIRQ, "hdsp", (void *)hdsp)) {
+	if (request_irq(pci->irq, snd_hdsp_interrupt, IRQF_DISABLED|IRQF_SHARED, "hdsp", (void *)hdsp)) {
 		snd_printk(KERN_ERR "Hammerfall-DSP: unable to use IRQ %d\n", pci->irq);
 		return -EBUSY;
 	}

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#6 lore raw
Quoted 1 line · Takashi Iwai

Which do you use, hdsploader or kernel firmware loader?

I tried both.

Quoted 2 lines

Interesting. Basically there is no change in hdsp driver itself. The diff is like below.

Seems much changed. The only suspicious line for me is one with request_irq(). I see it uses different flags in 1.0.12.

I can test 1.0.12 with old request_irq if it does make sense. But a bit later this day.

Dmitry

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#7 lore raw

At Tue, 29 Aug 2006 17:57:18 +0400,

Quoted 9 lines · Dmitry Baikov
Quoted 1 line · Takashi Iwai

Which do you use, hdsploader or kernel firmware loader?

I tried both.

Quoted 2 lines

Interesting. Basically there is no change in hdsp driver itself. The diff is like below.

Seems much changed. The only suspicious line for me is one with request_irq(). I see it uses different flags in 1.0.12.

It's just a rename of constants in the recent kernel, so shouldn't matter...

Takashi

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#8 lore raw

At Tue, 29 Aug 2006 16:00:54 +0200,

Quoted 8 lines · I wrote:

At Tue, 29 Aug 2006 17:57:18 +0400,

Quoted 5 lines · Dmitry Baikov
Quoted 1 line · Takashi Iwai

Which do you use, hdsploader or kernel firmware loader?

I tried both.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Interesting. Basically there is no change in hdsp driver itself. The diff is like below.

Seems much changed. The only suspicious line for me is one with request_irq(). I see it uses different flags in 1.0.12.

It's just a rename of constants in the recent kernel, so shouldn't matter...

It appears to be a brokenness of autoconf and linux/autoconfg.h hack. Could you try the patch below to alsa-driver tree and run hgcompile?

Takashi

configure.in +3 -3
diff -r d3eaedda963b configure.in
@@ -2615,9 +2615,9 @@ EOF
   else
     grep -v CONFIG_SND_ $CONFIG_SND_KERNELDIR/include/linux/autoconf.h > include/linux/autoconf.h
   fi
-  sed -e's@/\* #undef \([A-Za-z0-9_]\+\) .*$@#undef \1@g' \
-    include/autoconf-extra.h \
-    include/config1.h >> include/linux/autoconf.h
+  cat include/autoconf-extra.h include/config1.h | grep CONFIG_SND \
+    | sed -e's@/\* #undef \([A-Za-z0-9_]\+\) .*$@#undef \1@g' \
+      >> include/linux/autoconf.h
 else
   rm -f include/linux/autoconf.h
 fi

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#9 lore raw
Quoted 1 line · Takashi Iwai

Could you try the patch below to alsa-driver tree and run hgcompile?

Patch seems to be in HG already :)

Gentlemen, my bad.
I incorrectly tested and claimed that alsa-firmware-1.0.12 does work. It does not. I forgot to unplug the cards while testing.

alsa-firmware-1.0.11 with alsa-driver-1.0.12 works for Indigo IO without problems.
With hdsp there's one issue, but seems not new.
When I plug cardbus in, firmware loads fine, But any other attempt to load it finishes with

Hwdep ioctl error on card hw:0 : Device or resource busy.

It would be cool to have ability to upload firmware again, in case if I power-cycle exernal box. I think most of bugreports (on lad) about this (unable to load firmware) are about this very case, when firmware was once loaded (on carbus insertion) and after switching off-on external box user is unable to load firmware again.
And with pci card it demands to reboot.

Dmitry.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#10 lore raw

At Wed, 30 Aug 2006 00:41:45 +0400,

Quoted 4 lines · Dmitry Baikov
Quoted 1 line · Takashi Iwai

Could you try the patch below to alsa-driver tree and run hgcompile?

Quoted 8 lines

Patch seems to be in HG already :)

Gentlemen, my bad.
I incorrectly tested and claimed that alsa-firmware-1.0.12 does work. It does not. I forgot to unplug the cards while testing.

alsa-firmware-1.0.11 with alsa-driver-1.0.12 works for Indigo IO without problems.

So, the problem was alsa-firmware-1.0.12?

Quoted 4 lines

With hdsp there's one issue, but seems not new.
When I plug cardbus in, firmware loads fine, But any other attempt to load it finishes with

Quoted 8 lines

Hwdep ioctl error on card hw:0 : Device or resource busy.

It would be cool to have ability to upload firmware again, in case if I power-cycle exernal box. I think most of bugreports (on lad) about this (unable to load firmware) are about this very case, when firmware was once loaded (on carbus insertion) and after switching off-on external box user is unable to load firmware again.
And with pci card it demands to reboot.

Actually, the auto-loading mechanism is in the driver code, but there seems a bug there. Please try the patch below?

A possible bug with this feature is that the mixer setting might be reset after power-on.

Takashi

pci/rme9652/hdsp.c +19 -13
diff -r ffa4d40c5a96 pci/rme9652/hdsp.c
@@ -726,22 +726,28 @@ static int hdsp_get_iobox_version (struc
 }
 
 
-static int hdsp_check_for_firmware (struct hdsp *hdsp, int show_err)
-{
-	if (hdsp->io_type == H9652 || hdsp->io_type == H9632) return 0;
+static int hdsp_check_for_firmware (struct hdsp *hdsp, int load_on_demand)
+{
+	if (hdsp->io_type == H9652 || hdsp->io_type == H9632)
+		return 0;
 	if ((hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DllError) != 0) {
+		hdsp->state &= ~HDSP_FirmwareLoaded;
+		if (! load_on_demand)
+			return -EIO;
 		snd_printk(KERN_ERR "Hammerfall-DSP: firmware not present.\n");
-		hdsp->state &= ~HDSP_FirmwareLoaded;
-		if (! show_err)
+		/* try to load firmware */
+		if (! (hdsp->state & HDSP_FirmwareCached)) {
+			snd_printk(KERN_ERR
+				   "Hammerfall-DSP: No firmware loaded nor "
+				   "cached, please upload firmware.\n");
 			return -EIO;
-		/* try to load firmware */
-		if (hdsp->state & HDSP_FirmwareCached) {
-			if (snd_hdsp_load_firmware_from_cache(hdsp) != 0)
-				snd_printk(KERN_ERR "Hammerfall-DSP: Firmware loading from cache failed, please upload manually.\n");
-		} else {
-			snd_printk(KERN_ERR "Hammerfall-DSP: No firmware loaded nor cached, please upload firmware.\n");
 		}
-		return -EIO;
+		if (snd_hdsp_load_firmware_from_cache(hdsp) != 0) {
+			snd_printk(KERN_ERR
+				   "Hammerfall-DSP: Firmware loading from "
+				   "cache failed, please upload manually.\n");
+			return -EIO;
+		}
 	}
 	return 0;
 }
@@ -3851,7 +3857,7 @@ static int snd_hdsp_trigger(struct snd_p
 	if (hdsp_check_for_iobox (hdsp))
 		return -EIO;
 
-	if (hdsp_check_for_firmware(hdsp, 1))
+	if (hdsp_check_for_firmware(hdsp, 0)) /* no auto-loading in trigger */
 		return -EIO;
 
 	spin_lock(&hdsp->lock);

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#11 lore raw
Quoted 1 line · Takashi Iwai

So, the problem was alsa-firmware-1.0.12?

Definetely.

Quoted 6 lines

Actually, the auto-loading mechanism is in the driver code, but there seems a bug there. Please try the patch below?

A possible bug with this feature is that the mixer setting might be reset after power-on.

Thank you.
I will test the patch tomorrow and report back.

Regards,
Dmitry.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#12 lore raw

At Wed, 30 Aug 2006 18:30:00 +0400,

Quoted 4 lines · Dmitry Baikov
Quoted 1 line · Takashi Iwai

So, the problem was alsa-firmware-1.0.12?

Definetely.

Hm, could you compare the files installed between 1.0.11 and 1.0.12? You can install to any local directory (even without root privilege) like

	% make install DESTDIR=/tmp/alsa-1.0.12

and see the difference between the file trees.

thanks,

Takashi

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#13 lore raw

Sorry for the delay.

Quoted 1 line · Takashi Iwai

Hm, could you compare the files installed between 1.0.11 and 1.0.12?

Only in alsa-1.0.12/lib/firmware: asihpi Only in alsa-1.0.11/lib/firmware/ea: loader_dsp.fw Only in alsa-1.0.12/lib/firmware: emu

I incorrectly stated problems with RME Multiface, it works with 1.0.12. Echo Indigo IO does not. And there's a new file in .12 - loader_dsp.fw. I suppose, echo firmware loading was changed.

As for multiface, patch did not help. I stiil have to replug cardbus if I power-cycle multiface box. hdsploader still gives:
Upload firmware for card hw:0
Hwdep ioctl error on card hw:0 : Device or resource busy.

Regards,

Dmitry.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#14 lore raw

At Mon, 4 Sep 2006 10:03:39 +0400,

Quoted 6 lines · Dmitry Baikov

Sorry for the delay.

Quoted 1 line · Takashi Iwai

Hm, could you compare the files installed between 1.0.11 and 1.0.12?

Quoted 7 lines

Only in alsa-1.0.12/lib/firmware: asihpi Only in alsa-1.0.11/lib/firmware/ea: loader_dsp.fw Only in alsa-1.0.12/lib/firmware: emu

I incorrectly stated problems with RME Multiface, it works with 1.0.12. Echo Indigo IO does not. And there's a new file in .12 - loader_dsp.fw. I suppose, echo firmware loading was changed.

loader_dsp.fw is an unused file, and I already got rid of it from ALSA HG tree. So, the rest isn't changed.

I guess the problem of firmware loading was fixed by 1.0.13rc1 package. There was a problem in configure script that it resets the kernel CONFIG_FW_LOADER* acciedentally, which results in the driver without firmware support.

Quoted 2 lines

As for multiface, patch did not help. I stiil have to replug cardbus if I power-cycle multiface box.

Hm, could you check whether a kernel message like "Hammerfall-DSP:
loading firmware" appears? This should be called when a PCM device is opened, or any new PCM action is done.

Quoted 3 lines

hdsploader still gives:
Upload firmware for card hw:0
Hwdep ioctl error on card hw:0 : Device or resource busy.

This isn't changed because it doesn't make sense if the auto-reloading works. As mentioned, the image is saved in the driver.

Takashi

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#15 lore raw
Quoted 4 lines · Takashi Iwai

I guess the problem of firmware loading was fixed by 1.0.13rc1 package. There was a problem in configure script that it resets the kernel CONFIG_FW_LOADER* acciedentally, which results in the driver without firmware support.

Not tested yet, will try to test today.

Quoted 3 lines

Hm, could you check whether a kernel message like "Hammerfall-DSP:
loading firmware" appears? This should be called when a PCM device is opened, or any new PCM action is done.

Thank you. Works great!.
One minor issue: if firmware was already uploaded, after reboot, firmware is not cached, since it's already present in the box. I suppose it is easy to fix.

Regards,

Dmitry.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#16 lore raw

At Tue, 5 Sep 2006 03:04:09 +0400,

Quoted 6 lines · Dmitry Baikov
Quoted 4 lines

Hm, could you check whether a kernel message like "Hammerfall-DSP:
loading firmware" appears? This should be called when a PCM device is opened, or any new PCM action is done.

Thank you. Works great!.

Good to hear. What didn't work at the last time, then? Just accessing the mixer? Acceess to proc file doesn't trigger the auto-loading but this is intentional behavior.

Quoted 3 lines

One minor issue: if firmware was already uploaded, after reboot, firmware is not cached, since it's already present in the box. I suppose it is easy to fix.

Will fix this soon later.

Thanks,

Takashi

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#17 lore raw

At Tue, 05 Sep 2006 11:10:48 +0200,

Quoted 6 lines · I wrote:
Quoted 4 lines

One minor issue: if firmware was already uploaded, after reboot, firmware is not cached, since it's already present in the box. I suppose it is easy to fix.

Will fix this soon later.

The newer patch is below.

Takashi

pci/rme9652/hdsp.c +38 -15
diff -r 63e58b008259 pci/rme9652/hdsp.c
@@ -726,22 +726,37 @@ static int hdsp_get_iobox_version (struc
 }
 
 
-static int hdsp_check_for_firmware (struct hdsp *hdsp, int show_err)
-{
-	if (hdsp->io_type == H9652 || hdsp->io_type == H9632) return 0;
+#ifdef HDSP_FW_LOADER
+static int __devinit hdsp_request_fw_loader(struct hdsp *hdsp);
+#endif
+
+static int hdsp_check_for_firmware (struct hdsp *hdsp, int load_on_demand)
+{
+	if (hdsp->io_type == H9652 || hdsp->io_type == H9632)
+		return 0;
 	if ((hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DllError) != 0) {
+		hdsp->state &= ~HDSP_FirmwareLoaded;
+		if (! load_on_demand)
+			return -EIO;
 		snd_printk(KERN_ERR "Hammerfall-DSP: firmware not present.\n");
-		hdsp->state &= ~HDSP_FirmwareLoaded;
-		if (! show_err)
+		/* try to load firmware */
+		if (! (hdsp->state & HDSP_FirmwareCached)) {
+#ifdef HDSP_FW_LOADER
+			err = hdsp_request_fw_loader(hdsp);
+			if (!err)
+				return 0;
+#endif
+			snd_printk(KERN_ERR
+				   "Hammerfall-DSP: No firmware loaded nor "
+				   "cached, please upload firmware.\n");
 			return -EIO;
-		/* try to load firmware */
-		if (hdsp->state & HDSP_FirmwareCached) {
-			if (snd_hdsp_load_firmware_from_cache(hdsp) != 0)
-				snd_printk(KERN_ERR "Hammerfall-DSP: Firmware loading from cache failed, please upload manually.\n");
-		} else {
-			snd_printk(KERN_ERR "Hammerfall-DSP: No firmware loaded nor cached, please upload firmware.\n");
 		}
-		return -EIO;
+		if (snd_hdsp_load_firmware_from_cache(hdsp) != 0) {
+			snd_printk(KERN_ERR
+				   "Hammerfall-DSP: Firmware loading from "
+				   "cache failed, please upload manually.\n");
+			return -EIO;
+		}
 	}
 	return 0;
 }
@@ -3181,8 +3196,16 @@ snd_hdsp_proc_read(struct snd_info_entry
 				return;
 			}
 		} else {
-			snd_iprintf(buffer, "No firmware loaded nor cached, please upload firmware.\n");
-			return;
+			int err = -EINVAL;
+#ifdef HDSP_FW_LOADER
+			err = hdsp_request_fw_loader(hdsp);
+#endif
+			if (err < 0) {
+				snd_iprintf(buffer,
+					    "No firmware loaded nor cached, "
+					    "please upload firmware.\n");
+				return;
+			}
 		}
 	}
 	
@@ -3851,7 +3874,7 @@ static int snd_hdsp_trigger(struct snd_p
 	if (hdsp_check_for_iobox (hdsp))
 		return -EIO;
 
-	if (hdsp_check_for_firmware(hdsp, 1))
+	if (hdsp_check_for_firmware(hdsp, 0)) /* no auto-loading in trigger */
 		return -EIO;
 
 	spin_lock(&hdsp->lock);

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#18 lore raw

At Tue, 05 Sep 2006 15:27:07 +0200,

Quoted 11 lines · I wrote:

At Tue, 05 Sep 2006 11:10:48 +0200,

Quoted 6 lines · I wrote:
Quoted 4 lines

One minor issue: if firmware was already uploaded, after reboot, firmware is not cached, since it's already present in the box. I suppose it is easy to fix.

Will fix this soon later.

The newer patch is below.

Grrr, a wrong patch. Use the below one instead.

Takashi

pci/rme9652/hdsp.c +37 -15
diff -r 63e58b008259 pci/rme9652/hdsp.c
@@ -726,22 +726,36 @@ static int hdsp_get_iobox_version (struc
 }
 
 
-static int hdsp_check_for_firmware (struct hdsp *hdsp, int show_err)
-{
-	if (hdsp->io_type == H9652 || hdsp->io_type == H9632) return 0;
+#ifdef HDSP_FW_LOADER
+static int __devinit hdsp_request_fw_loader(struct hdsp *hdsp);
+#endif
+
+static int hdsp_check_for_firmware (struct hdsp *hdsp, int load_on_demand)
+{
+	if (hdsp->io_type == H9652 || hdsp->io_type == H9632)
+		return 0;
 	if ((hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DllError) != 0) {
+		hdsp->state &= ~HDSP_FirmwareLoaded;
+		if (! load_on_demand)
+			return -EIO;
 		snd_printk(KERN_ERR "Hammerfall-DSP: firmware not present.\n");
-		hdsp->state &= ~HDSP_FirmwareLoaded;
-		if (! show_err)
+		/* try to load firmware */
+		if (! (hdsp->state & HDSP_FirmwareCached)) {
+#ifdef HDSP_FW_LOADER
+			if (! hdsp_request_fw_loader(hdsp))
+				return 0;
+#endif
+			snd_printk(KERN_ERR
+				   "Hammerfall-DSP: No firmware loaded nor "
+				   "cached, please upload firmware.\n");
 			return -EIO;
-		/* try to load firmware */
-		if (hdsp->state & HDSP_FirmwareCached) {
-			if (snd_hdsp_load_firmware_from_cache(hdsp) != 0)
-				snd_printk(KERN_ERR "Hammerfall-DSP: Firmware loading from cache failed, please upload manually.\n");
-		} else {
-			snd_printk(KERN_ERR "Hammerfall-DSP: No firmware loaded nor cached, please upload firmware.\n");
 		}
-		return -EIO;
+		if (snd_hdsp_load_firmware_from_cache(hdsp) != 0) {
+			snd_printk(KERN_ERR
+				   "Hammerfall-DSP: Firmware loading from "
+				   "cache failed, please upload manually.\n");
+			return -EIO;
+		}
 	}
 	return 0;
 }
@@ -3181,8 +3195,16 @@ snd_hdsp_proc_read(struct snd_info_entry
 				return;
 			}
 		} else {
-			snd_iprintf(buffer, "No firmware loaded nor cached, please upload firmware.\n");
-			return;
+			int err = -EINVAL;
+#ifdef HDSP_FW_LOADER
+			err = hdsp_request_fw_loader(hdsp);
+#endif
+			if (err < 0) {
+				snd_iprintf(buffer,
+					    "No firmware loaded nor cached, "
+					    "please upload firmware.\n");
+				return;
+			}
 		}
 	}
 	
@@ -3851,7 +3873,7 @@ static int snd_hdsp_trigger(struct snd_p
 	if (hdsp_check_for_iobox (hdsp))
 		return -EIO;
 
-	if (hdsp_check_for_firmware(hdsp, 1))
+	if (hdsp_check_for_firmware(hdsp, 0)) /* no auto-loading in trigger */
 		return -EIO;
 
 	spin_lock(&hdsp->lock);

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#19 lore raw
Quoted 2 lines · Takashi Iwai
Quoted 1 line

The newer patch is below.

Grrr, a wrong patch. Use the below one instead.

Works perfectly.

Thank you,

Dmitry.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#20 lore raw

At Wed, 6 Sep 2006 00:07:50 +0400,

Quoted 6 lines · Dmitry Baikov
Quoted 2 lines · Takashi Iwai
Quoted 1 line

The newer patch is below.

Grrr, a wrong patch. Use the below one instead.

Works perfectly.

Now it's on ALSA HG tree. Thanks for confirmation.

Takashi

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642