NetBSD Problem Report #35171
From www@NetBSD.org Sat Dec 2 22:51:10 2006
Return-Path: <www@NetBSD.org>
Received: by narn.NetBSD.org (Postfix, from userid 31301)
id 2F9AD63B90D; Sat, 2 Dec 2006 22:51:10 +0000 (UTC)
Message-Id: <20061202225110.2F9AD63B90D@narn.NetBSD.org>
Date: Sat, 2 Dec 2006 22:51:10 +0000 (UTC)
From: svs@ropnet.ru
Reply-To: svs@ropnet.ru
To: gnats-bugs@NetBSD.org
Subject: AUDIO_WSEEK ioctl implementation conflicts with documentation
X-Send-Pr-Version: www-1.0
>Number: 35171
>Category: kern
>Synopsis: AUDIO_WSEEK ioctl implementation conflicts with documentation
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: kent
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Dec 02 22:55:00 +0000 2006
>Closed-Date: Sat Mar 10 14:37:48 +0000 2007
>Last-Modified: Sat Mar 10 14:37:48 +0000 2007
>Originator: Sergey Svishchev
>Release: 3.0.2_PATCH
>Organization:
>Environment:
>Description:
man page:
AUDIO_WSEEK (int)
This command fetches the count of samples that are queued ahead
of the first sample in the most recent sample block written into
its integer argument.
sys/dev/audio.c (both 3.0 and -current):
/*
* How many bytes will elapse until mike hears the first
* sample of what we write next?
*/
case AUDIO_WSEEK:
*(u_long *)addr = audio_stream_get_used(sc->sc_rustream);
But isn't sc->sc_rustream the 'recording' stream, not the 'playing' one?..
>How-To-Repeat:
Run this code. 'wseek' is always 0, but should be equal to 'play.seek', I think.
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <err.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/audioio.h>
main()
{
int fd, rc, wseek = -1;
struct audio_info ai;
fd = open("/dev/audioctl", O_RDONLY);
if (fd < 0) {
perror("open /dev/audioctl");
err(1, NULL);
}
rc = ioctl(fd, AUDIO_WSEEK, &wseek);
if (rc < 0) {
perror("ioctl AUDIO_WSEEK");
}
rc = ioctl(fd, AUDIO_GETINFO, &ai);
if (rc < 0) {
perror("ioctl AUDIO_GETINFO");
}
printf ("wseek %d play.seek %d play.samples %d\n",
wseek, ai.play.seek, ai.play.samples);
return 0;
}
>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: kern-bug-people->kent
Responsible-Changed-By: kent@netbsd.org
Responsible-Changed-When: Tue, 06 Mar 2007 18:14:06 +0000
Responsible-Changed-Why:
I'll handle this.
State-Changed-From-To: open->analyzed
State-Changed-By: kent@netbsd.org
State-Changed-When: Tue, 06 Mar 2007 18:14:06 +0000
State-Changed-Why:
It seems the problem was introduced in audio.c rev 1.52 (9 years ago!)
From: TAMURA Kent <kent@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: PR/35171 CVS commit: src/sys/dev
Date: Fri, 9 Mar 2007 13:20:13 +0000 (UTC)
Module Name: src
Committed By: kent
Date: Fri Mar 9 13:20:13 UTC 2007
Modified Files:
src/sys/dev: audio.c
Log Message:
return information about playing buffer, not recording bufer,
for AUDIO_WSEEK.
PR#35171
To generate a diff of this commit:
cvs rdiff -r1.220 -r1.221 src/sys/dev/audio.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: Manuel Bouyer <bouyer@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: PR/35171 CVS commit: [netbsd-3] src/sys/dev
Date: Sat, 10 Mar 2007 11:46:53 +0000 (UTC)
Module Name: src
Committed By: bouyer
Date: Sat Mar 10 11:46:53 UTC 2007
Modified Files:
src/sys/dev [netbsd-3]: audio.c
Log Message:
Pull up following revision(s) (requested by kent in ticket #1678):
sys/dev/audio.c: revision 1.221
return information about playing buffer, not recording bufer,
for AUDIO_WSEEK.
PR#35171
To generate a diff of this commit:
cvs rdiff -r1.192.4.5 -r1.192.4.6 src/sys/dev/audio.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: Manuel Bouyer <bouyer@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: PR/35171 CVS commit: [netbsd-3-0] src/sys/dev
Date: Sat, 10 Mar 2007 11:50:05 +0000 (UTC)
Module Name: src
Committed By: bouyer
Date: Sat Mar 10 11:50:05 UTC 2007
Modified Files:
src/sys/dev [netbsd-3-0]: audio.c
Log Message:
Pull up following revision(s) (requested by kent in ticket #1678):
sys/dev/audio.c: revision 1.221
return information about playing buffer, not recording bufer,
for AUDIO_WSEEK.
PR#35171
To generate a diff of this commit:
cvs rdiff -r1.192.4.2.2.2 -r1.192.4.2.2.3 src/sys/dev/audio.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: Manuel Bouyer <bouyer@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: PR/35171 CVS commit: [netbsd-3-1] src/sys/dev
Date: Sat, 10 Mar 2007 11:50:54 +0000 (UTC)
Module Name: src
Committed By: bouyer
Date: Sat Mar 10 11:50:54 UTC 2007
Modified Files:
src/sys/dev [netbsd-3-1]: audio.c
Log Message:
Pull up following revision(s) (requested by kent in ticket #1678):
sys/dev/audio.c: revision 1.221
return information about playing buffer, not recording bufer,
for AUDIO_WSEEK.
PR#35171
To generate a diff of this commit:
cvs rdiff -r1.192.4.5 -r1.192.4.5.2.1 src/sys/dev/audio.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: Manuel Bouyer <bouyer@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: PR/35171 CVS commit: [netbsd-4] src/sys/dev
Date: Sat, 10 Mar 2007 12:06:13 +0000 (UTC)
Module Name: src
Committed By: bouyer
Date: Sat Mar 10 12:06:13 UTC 2007
Modified Files:
src/sys/dev [netbsd-4]: audio.c
Log Message:
Pull up following revision(s) (requested by kent in ticket #499):
sys/dev/audio.c: revision 1.221
return information about playing buffer, not recording bufer,
for AUDIO_WSEEK.
PR#35171
To generate a diff of this commit:
cvs rdiff -r1.215 -r1.215.2.1 src/sys/dev/audio.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: analyzed->closed
State-Changed-By: kent@netbsd.org
State-Changed-When: Sat, 10 Mar 2007 14:37:48 +0000
State-Changed-Why:
fixed
>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.