From pantzer@skalman.campus.luth.se Sun Oct 17 08:01:48 1999
Return-Path: <pantzer@skalman.campus.luth.se>
Received: from skalman.campus.luth.se (skalman.campus.luth.se [130.240.197.52])
	by hub.freebsd.org (Postfix) with ESMTP id 45CCC14A03
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 17 Oct 1999 08:01:40 -0700 (PDT)
	(envelope-from pantzer@skalman.campus.luth.se)
Received: (from pantzer@localhost)
	by skalman.campus.luth.se (8.9.3/8.8.8) id RAA00509;
	Sun, 17 Oct 1999 17:01:39 +0200 (CEST)
	(envelope-from pantzer)
Message-Id: <199910171501.RAA00509@skalman.campus.luth.se>
Date: Sun, 17 Oct 1999 17:01:39 +0200 (CEST)
From: pantzer@ludd.luth.se
Sender: pantzer@skalman.campus.luth.se
Reply-To: pantzer@ludd.luth.se
To: FreeBSD-gnats-submit@freebsd.org
Subject: The audio ioctl SNDCTL_DSP_SETFMT affects the stereo setting
X-Send-Pr-Version: 3.2

>Number:         14372
>Category:       i386
>Synopsis:       The audio ioctl SNDCTL_DSP_SETFMT affects the stereo setting
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 17 08:10:01 PDT 1999
>Closed-Date:    Sat Nov 6 20:27:14 PST 1999
>Last-Modified:  Sat Nov  6 20:27:32 PST 1999
>Originator:     Mattias Pantzare
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
>Environment:

FreeBSD-current from 991017.
Soundcad supported by pcm.

>Description:

splay plays mp3 at low speed. The problem is that it tries to set stereo 
but gets mono.

SNDCTL_DSP_SETFMT now resets the AFMT_STERO bit. This was not the case in earlier kernels (from 990901 for example)

>How-To-Repeat:

Run splay.

>Fix:
Index: dsp.c
===================================================================
RCS file: /host/queeg.ludd/FreeBSD-mirror/anoncvs/cvs//src/sys/dev/pcm/dsp.c,v
retrieving revision 1.5
diff -c -r1.5 dsp.c
*** dsp.c       1999/09/28 21:43:35     1.5
--- dsp.c       1999/10/17 14:58:18
***************
*** 387,395 ****
  
        case SNDCTL_DSP_SETFMT: /* sets _one_ format */
                splx(s);
!               if (wrch) chn_setformat(wrch, *arg_i);
!               if (rdch) chn_setformat(rdch, *arg_i);
!               *arg_i = wrch? wrch->format : rdch->format;
                break;
  
        case SNDCTL_DSP_SUBDIVIDE:
--- 387,395 ----
  
        case SNDCTL_DSP_SETFMT: /* sets _one_ format */
                splx(s);
!               if (wrch) chn_setformat(wrch, (*arg_i) | (wrch->format & AFMT_STEREO));
!               if (rdch) chn_setformat(rdch, (*arg_i) | (rdch->format & AFMT_STEREO));
!               *arg_i = wrch? (wrch->format & ~AFMT_STEREO) : (rdch->format & ~AFMT_STEREO);
                break;
  
        case SNDCTL_DSP_SUBDIVIDE:


>Release-Note:
>Audit-Trail:

From: "Kenneth D. Merry" <ken@kdm.org>
To: pantzer@ludd.luth.se
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: i386/14372: The audio ioctl SNDCTL_DSP_SETFMT affects the stereo setting
Date: Sat, 6 Nov 1999 14:18:57 -0700 (MST)

 pantzer@ludd.luth.se wrote...
 > 
 > >Number:         14372
 > >Category:       i386
 > >Synopsis:       The audio ioctl SNDCTL_DSP_SETFMT affects the stereo setting
 > >Confidential:   no
 > >Severity:       serious
 > >Priority:       medium
 > >Responsible:    freebsd-bugs
 > >State:          open
 > >Quarter:        
 > >Keywords:       
 > >Date-Required:
 > >Class:          sw-bug
 > >Submitter-Id:   current-users
 > >Arrival-Date:   Sun Oct 17 08:10:01 PDT 1999
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     Mattias Pantzare
 > >Release:        FreeBSD 4.0-CURRENT i386
 > >Organization:
 > >Environment:
 > 
 > FreeBSD-current from 991017.
 > Soundcad supported by pcm.
 > 
 > >Description:
 > 
 > splay plays mp3 at low speed. The problem is that it tries to set stereo 
 > but gets mono.
 > 
 > SNDCTL_DSP_SETFMT now resets the AFMT_STERO bit. This was not the case in earlier kernels (from 990901 for example)
 > 
 
 For the record, this fixes a problem I had with my GUS PnP Pro and
 pcmplay(1), which comes with tosha.  It set stereo before setting the
 format, and the result was what sounded like low speed.
 
 Ken
 -- 
 Kenneth Merry
 ken@kdm.org
 
State-Changed-From-To: open->closed 
State-Changed-By: tanimura 
State-Changed-When: Sat Nov 6 20:27:14 PST 1999 
State-Changed-Why:  
Fixed in rev 1.6(with a monor change). 
>Unformatted:
