From nobody  Sun Jan  3 02:17:24 1999
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.8/8.8.8) id CAA05683;
          Sun, 3 Jan 1999 02:17:24 -0800 (PST)
          (envelope-from nobody)
Message-Id: <199901031017.CAA05683@hub.freebsd.org>
Date: Sun, 3 Jan 1999 02:17:24 -0800 (PST)
From: runge@rostock.zgdv.de
To: freebsd-gnats-submit@freebsd.org
Subject: ioctl(SNDCTL_DSP_SETFMT) on /dev/audio (pcm) returns wrong value when sampling
X-Send-Pr-Version: www-1.0

>Number:         9283
>Category:       i386
>Synopsis:       ioctl(SNDCTL_DSP_SETFMT) on /dev/audio (pcm) returns wrong value when sampling
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan  3 02:20:00 PST 1999
>Closed-Date:    Fri Oct 8 09:50:50 PDT 1999
>Last-Modified:  Fri Oct  8 09:52:59 PDT 1999
>Originator:     Thomas Runge
>Release:        3.0 RELEASE
>Organization:
>Environment:
FreeBSD fietje 3.0-RELEASE FreeBSD 3.0-RELEASE #15: Sat Jan  2 17:28:59 CET 1999     coto@fietje:/usr/src/sys/compile/FIETJE  i386

>Description:
if you configure the audio device (luigis pcm driver) for sampling and
set the format via SNDCTL_DSP_SETFMT, the driver returns the wrong
format, even if it's set to the right value.
This bug even can be found in -current, guessing, it's in all previous
versions as well.
>How-To-Repeat:
open device read-only and try changing the sample format. Check the
return value and compare to input.
>Fix:
in /usr/src/sys/i386/isa/snd/sound.c change this:

        if (ask_init(d))
            *(int *)arg = d->play_fmt ;

in line 992 (source of 3.0 RELEASE)

to:
        if (ask_init(d))
        {
         if (d->play_fmt)
            *(int *)arg = d->play_fmt ;
         if (d->rec_fmt) 
            *(int *)arg = d->rec_fmt ;
        }
 
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: roger 
State-Changed-When: Fri Oct 8 09:50:50 PDT 1999 
State-Changed-Why:  
Patch applied to 3.x-stable. 
The pcm sound card driver in 4.x-current has been rewritten and called 
newpcm so this problem no longer applies to 4.x-current 
>Unformatted:
