Subject: kern/1051: audio driver doesn't return good indication of audio playback mode
To: None <gnats-admin@sun-lamp.cs.berkeley.edu>
From: John Kohl <jtk@kolvir.blrc.ma.us>
List: netbsd-bugs
Date: 05/15/1995 16:05:06
>Number:         1051
>Category:       kern
>Synopsis:       /sys/dev/audio.c should return both record & play info if full duplex
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon May 15 16:05:03 1995
>Originator:     John Kohl
>Organization:
NetBSD Kernel Hackers `R` Us
>Release:        1.0A (-current)
>Environment:
	
System: NetBSD kolvir 1.0A NetBSD 1.0A (KOLVIR) #336: Sat May 13 23:54:35 EDT 1995 jtk@kolvir:/u1/NetBSD-current/src/sys/arch/i386/compile/KOLVIR i386


>Description:
The AUDIO_GETINFO ioctl() only returns either AUDIO_PLAY or AUDIO_RECORD
as the current mode.  It should instead return a bitmask indicating
which of {PLAY, RECORD} is in use.

>How-To-Repeat:
ioctl(fd, AUDIO_GETINFO, &info)
look at info.mode

>Fix:
===================================================================
RCS file: RCS/audio.c,v
retrieving revision 1.1
diff -c -r1.1 audio.c
*** 1.1	1995/05/15 22:31:12
--- audio.c	1995/05/15 22:31:29
***************
*** 1626,1632 ****
  	ai->hiwat = sc->sc_hiwat;
  	ai->lowat = sc->sc_lowat;
  	ai->backlog = sc->sc_backlog;
! 	ai->mode = (sc->sc_mode & (1<<AUMODE_PLAY))?AUMODE_PLAY:AUMODE_RECORD;
  
  	return (0);
  }
--- 1626,1632 ----
  	ai->hiwat = sc->sc_hiwat;
  	ai->lowat = sc->sc_lowat;
  	ai->backlog = sc->sc_backlog;
! 	ai->mode = sc->sc_mode;
  
  	return (0);
  }

>Audit-Trail:
>Unformatted: