[PATCH] emu10k1 driver

From: Michael Bacarella (mbac@nyct.net)
Date: Thu Jun 22 2000 - 17:45:15 EST


Arrr,

        The problem here is that the emu10k driver let me set
SNDCTL_DSP_SPEED to 0 because the check is:
        if (val >= 0)
                set value = val
        else
                get value = val;
                return rate

        Who would want to set the sample rate to 0? I thought setting it
to zero implies that I want the value returned in the variable I
passed. Instead, it set the rate to this value and from this point, enter
divide-by-zero fault.

Patch follows:

--- audio.c_old Thu Jun 22 18:33:00 2000
+++ audio.c Thu Jun 22 18:33:22 2000
@@ -368,7 +368,7 @@
                get_user_ret(val, (int *) arg, -EFAULT);
                DPD(2, "val is %d\n", val);

- if (val >= 0) {
+ if (val > 0) {
                        if (file->f_mode & FMODE_READ) {
                                struct wave_format format;

Driver is:
Creative EMU10K1 PCI Audio Driver, version 0.6

Cheerio!

-MB

PS. I ran a quick check against the latest snapshot to see if this had
been changed. It still remains. My reasoning here is that if you're going
to allow the user to set the sample rate to 0, you should at least not
divide by zero. But since it doesn't make sense to set the sample rate
to 0, I suspect that this is just an oversight -hence patch.

On Thu, 22 Jun 2000, Michael Bacarella wrote:

>
> Sigh.
>
> Reading my own attachment shows that the sample rate was set or at least
> reported as 0 kHz/s. That could explain why the divide by zero error. I'll
> wrap my brain around it some more and get back to ya'll.
>
> /* ----------
> Michael Bacarella( mbac@nyct.net ) | (212) 293-2620
> Administration / Development / Support | http://nyct.net/
> [ N e w Y o r k C o n n e c t . N E T ] | info@nyct.net
> Bringing New York The Internet Service It Deserves!
> --------- */
>
> On Thu, 22 Jun 2000, Michael Bacarella wrote:
>
> >
> > Howdy,
> >
> > I would guess that this is a bug in the driver, provided by creative, but
> > it could be a general kernel problem, so I feel I should let ya'll know
> > that I ran into it anyway.
> >
> > The sound card is SB PCI 512 (which the emu10k driver is allegedly
> > compatible with).
> >
> > I was basically pulling frames off of an audio cd by CDROMREADAUDIO ioctl
> > (MSF addresses) and then feeding them to the program in the attachment.
> >
> > The attached text file should include enough relevant data for whoever is
> > interested in this to take it up. I'd be happy to work with said persons
> > towards a solution, if any.
> >
> > The filenames are a bit misleading. I call them .pcm even though they're
> > actually just data pulled straight off the cd. Just looking to avoid
> > confusion in case there really is a format called PCM.
> >
> >
> > /* ----------
> > Michael Bacarella( mbac@nyct.net ) | (212) 293-2620
> > Administration / Development / Support | http://nyct.net/
> > [ N e w Y o r k C o n n e c t . N E T ] | info@nyct.net
> > Bringing New York The Internet Service It Deserves!
> > --------- */
> >
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.rutgers.edu
> Please read the FAQ at http://www.tux.org/lkml/
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jun 23 2000 - 21:00:24 EST