Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Sep 1997 13:53:43 -0700
From:      John-Mark Gurney <gurney_j@efn.org>
To:        Luigi Rizzo <luigi@labinfo.iet.unipi.it>
Cc:        multimedia@FreeBSD.ORG
Subject:   Re: snd970904.tgz
Message-ID:  <19970906135343.02473@hydrogen.nike.efn.org>
In-Reply-To: <199709061313.PAA13572@labinfo.iet.unipi.it>; from Luigi Rizzo on Sat, Sep 06, 1997 at 03:13:37PM %2B0200
References:  <19970906044626.20461@hydrogen.nike.efn.org> <199709061313.PAA13572@labinfo.iet.unipi.it>

next in thread | previous in thread | raw e-mail | index | archive | help
Luigi Rizzo scribbled this message on Sep 6:
> > I've found a MAJOR problem.. your code assume the recmask that is
> > passed in on a MIXER_WRITE(SOUND_MIXER_RECSRC) only sets one of the
> > bits... instead of setting multiple bits.. this causes your code to
> > fall over...  and there is no fix for it when you use the default
> > mixer command...
> 
> Sorry but the problem is in the "mixer" command, not in the driver.

ahh.. ok..  sounds good...

> The Voxware driver only allowed one source on many boards, and
> would default to using the MIC only in case of a non-supported
> configuration. My driver follows the same approach, which seems
> reasonable (since there is no way to choose in case multiple bits
> are set).
> 
> The mixer command is broken in that it only allows you to add/remove
> sources, not to set them, and as you notice it fails. I have updated it
> long ago to support the command "=rec source" which sets a single
> source.
> 
> > I finally started looking at the code and it scared me... so I have
> > rewriten it.. and I have it fully functioning... I don't think I've
> 
> do you have patches/sources ? Please submit a PR so that it gets fixed.

well.. I was thinking of commiting 'em soon..  they work nicely over
hear, and I've done as much testing as I can do... if people want to
test it more.. I can put the patches up for d/l...

> > for the open reading problem.. I haven't looked at the code, but I think
> > what might be happening is that you are counting an open reader when
> > I do something like cp /dev/audio0 > /dev/null (my pcm is pcm1 and I
> > don't have a pcm0) and /dev/audio0 is invalid, and returns it, but the
> > open count never gets decremented..
> 
> no, probably I forgot to clear the 'reader active' flag.

well...  I looked at the code briefly... and notice that in mss_open
you set the flag on the device for what it trying to open, and then
you test to see if the card is busy... then if the card is busy, you
just leave without clearing the flag...  I'm not sure if this would
cause the bug or not...  (ad1848.c:274)...

my other comment is the in sndopen (sound.c:366) that you first clear
out the pid and flags info from the data struct that you got even before
checking that the actual open successeds...  I'm not sure if this is a
problem or not.. but it just struck me as being out of place...

other than that.. I have to say that I like the structure of the new
code...  

> Thanks for the very detailed info

no problem...  I don't quite remeber the sequence of events as I was
just trying to break the code... :)

-- 
  John-Mark Gurney                          Modem/FAX: +1 541 683 6954
  Cu Networking

  Live in Peace, destroy Micro$oft, support free software, run FreeBSD



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19970906135343.02473>