From: Takashi Iwai Subject: Re: 1.0.12 breaks firmware loading Date: Wed, 30 Aug 2006 13:01:57 +0200 Message-ID: References: <70a871c80608281201u7675f14fxffba5558acb0038b@mail.gmail.com> <70a871c80608281301j6106ce6bn28edf2df00f64635@mail.gmail.com> <70a871c80608290606h2c16e1f6k5f92af642cddaf50@mail.gmail.com> <70a871c80608290657x3741a388t74a6848fcb86a173@mail.gmail.com> <70a871c80608291341q1853bb0fge45dcdbb168b0962@mail.gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <70a871c80608291341q1853bb0fge45dcdbb168b0962@mail.gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@lists.sourceforge.net Errors-To: alsa-devel-bounces@lists.sourceforge.net To: Dmitry Baikov Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Wed, 30 Aug 2006 00:41:45 +0400, Dmitry Baikov wrote: > > On 8/29/06, Takashi Iwai wrote: > > 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. So, the problem was alsa-firmware-1.0.12? > 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. 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 diff -r ffa4d40c5a96 pci/rme9652/hdsp.c --- a/pci/rme9652/hdsp.c Tue Aug 29 18:15:15 2006 +0200 +++ b/pci/rme9652/hdsp.c Wed Aug 30 13:00:25 2006 +0200 @@ -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