NetBSD Problem Report #7661
Received: (qmail 17443 invoked from network); 28 May 1999 20:55:14 -0000
Message-Id: <199905282054.WAA04264@vader.runit.sintef.no>
Date: Fri, 28 May 1999 22:54:38 +0200 (MEST)
From: Havard.Eidnes@runit.sintef.no
Reply-To: Havard.Eidnes@runit.sintef.no
To: gnats-bugs@gnats.netbsd.org
Subject: successive AUDIO_GETINFO / AUDIO_SETINFO combination fails
X-Send-Pr-Version: 3.95
>Number: 7661
>Category: kern
>Synopsis: successive AUDIO_GETINFO / AUDIO_SETINFO combination fails
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri May 28 14:05:01 +0000 1999
>Closed-Date: Sun May 30 00:28:20 +0000 1999
>Last-Modified: Sun May 30 00:29:50 +0000 1999
>Originator: Havard Eidnes
>Release: NetBSD 1.4
>Organization:
RUNIT AS
>Environment:
System: NetBSD vader.runit.sintef.no 1.3I NetBSD 1.3I (VADER) #0: Sat Jan 9 18:53:46 MET 1999 he@hugin.runit.sintef.no:/usr/src/sys/arch/i386/compile/VADER i386
>Description:
Fetching info with AUDIO_GETINFO and just using the returned
info in an AUDIO_SETINFO ioctl appears to fail (!).
>How-To-Repeat:
Run this program, and watch it exit in err(1, "AUDIO_SETINFO"):
#include <sys/types.h>
#include <sys/audioio.h>
#include <sys/ioctl.h>
#include <fcntl.h>
int
main(argc, argv)
int argc;
char **argv;
{
int fd, sts;
audio_info_t info;
fd = open("/dev/audio", O_RDWR);
if (fd < 0)
err(1, "open");
sts = ioctl(fd, AUDIO_GETINFO, &info);
if (sts != 0)
err(1, "AUDIO_GETINFO");
sts = ioctl(fd, AUDIO_SETINFO, &info);
if (sts != 0)
err(1, "AUDIO_SETINFO");
return (0);
}
A debugger session:
$ gdb a.out
GNU gdb 4.17
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386--netbsd"...
(gdb) b main
Breakpoint 1 at 0x180a: file /tmp/t.c, line 14.
(gdb) run
Starting program: /local/store/store/vever/vat-c/src-4.0b2-386netbsd/a.out
Breakpoint 1, main (argc=1, argv=0xefbfd754) at /tmp/t.c:14
14 fd = open("/dev/audio", O_RDWR);
(gdb) n
15 if (fd < 0)
(gdb) n
18 sts = ioctl(fd, AUDIO_GETINFO, &info);
(gdb) n
19 if (sts != 0)
(gdb) n
22 sts = ioctl(fd, AUDIO_SETINFO, &info);
(gdb) p info
$1 = {play = {sample_rate = 8000, channels = 1, precision = 8, encoding = 1,
gain = 0, port = 0, seek = 0, avail_ports = 0, buffer_size = 65536,
_ispare = {0}, samples = 0, eof = 0, pause = 0 '\000', error = 0 '\000',
waiting = 0 '\000', balance = 32 ' ', cspare = "\000", open = 1 '\001',
active = 0 '\000'}, record = {sample_rate = 8000, channels = 1,
precision = 8, encoding = 1, gain = 0, port = 1, seek = 0,
avail_ports = 5, buffer_size = 65536, _ispare = {0}, samples = 0, eof = 0,
pause = 0 '\000', error = 0 '\000', waiting = 0 '\000', balance = 32 ' ',
cspare = "\000", open = 1 '\001', active = 0 '\000'}, monitor_gain = 0,
blocksize = 400, hiwat = 163, lowat = 122, _ispare1 = 0, mode = 5}
(gdb) n
23 if (sts != 0)
(gdb) n
24 err(1, "AUDIO_SETINFO");
(gdb) n
a.out: AUDIO_SETINFO: Invalid argument
Program exited with code 01.
(gdb) quit
$
This is with the following audio hardware:
wss0 at isapnp0 port 0x534/4,0x388/4,0x220/16 irq 5 drq 1,0
wss0: CS4236B WSS/SB: CS4236/CS4236B
audio0 at wss0: full duplex
>Fix:
Sorry, I do not have the foggiest at the moment...
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: nathanw
State-Changed-When: Sat May 29 17:28:20 PDT 1999
State-Changed-Why:
Fixe. Thanks!
(note that the bug only affected certain audio drivers with monitor mixer
controls)
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.