NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/50613: unpausing audio(4) causes already written data to be dropped
The following reply was made to PR kern/50613; it has been noted by GNATS.
From: Kamil Rytarowski <n54%gmx.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: kern/50613: unpausing audio(4) causes already written data to be
dropped
Date: Mon, 4 Jan 2016 22:57:33 +0100
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 04.01.2016 22:50, Onno van der Linden wrote:
> The following reply was made to PR kern/50613; it has been noted
> by GNATS.
>
> From: Onno van der Linden <o.vd.linden%quicknet.nl@localhost> To:
> gnats-bugs%NetBSD.org@localhost Cc: Subject: Re: kern/50613: unpausing
> audio(4) causes already written data to be dropped Date: Mon, 4
> Jan 2016 21:27:26 +0100
>
> And a test case
>
> #include <sys/audioio.h> #include <stdio.h> #include <fcntl.h>
> #include <string.h>
>
> main() { int fd; char buf[1024]; unsigned long wseek;
> audio_offset_t ao; struct audio_info ai;
>
> memset(buf,'\0',sizeof buf); AUDIO_INITINFO(&ai);
> fd=open("/dev/audio",O_WRONLY,0); ai.play.pause=1;
> ai.blocksize=1024; ioctl(fd, AUDIO_SETINFO, &ai); ioctl(fd,
> AUDIO_GETOOFFS, &ao); printf("After open/pause samples=%u
> deltablks=%u offset=%u\n",ao.samples,ao.deltablks, ao.offset);
> write(fd,buf,sizeof buf); ioctl(fd, AUDIO_GETOOFFS, &ao);
> printf("After write samples=%u deltablks=%u
> offset=%u\n",ao.samples,ao.deltablks, ao.offset);
> AUDIO_INITINFO(&ai); ai.play.pause=0; ioctl(fd, AUDIO_SETINFO,
> &ai); ioctl(fd, AUDIO_GETOOFFS, &ao); printf("After unpause
> samples=%u deltablks=%u offset=%u\n",ao.samples,ao.deltablks,
> ao.offset); write(fd,buf,sizeof buf); ioctl(fd, AUDIO_DRAIN);
> ioctl(fd, AUDIO_GETOOFFS, &ao); printf("After write samples=%u
> deltablks=%u offset=%u\n",ao.samples,ao.deltablks, ao.offset);
> close(fd); }
>
> Run straight after booting an unpatched kernel:
>
> After open/pause samples=0 deltablks=0 offset=1024 After write
> samples=1024 deltablks=1 offset=2048 After unpause samples=0
> deltablks=0 offset=2048 After write samples=1024 deltablks=1
> offset=3072
>
>
> Run straight after booting a kernel with the patch: After
> open/pause samples=0 deltablks=0 offset=1024 After write
> samples=1024 deltablks=1 offset=2048 After unpause samples=1024
> deltablks=0 offset=2048 After write samples=2048 deltablks=1
> offset=3072
>
> samples=0 after unpause vs. samples=1024 after unpause
>
>
Thank you. If that's not too much. Can you try to write a new test or
set of tests to ensure it works and will work in the future for everybod
y?
This patch makes sense.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAEBCAAGBQJWiurLAAoJEEuzCOmwLnZsnn8QAMM5REaue6Mu0brWL8j9Yk51
K5aPxO3eyFKtYI54YgX2KOowG0PPdrjAMsR8HGrQlhD2ego50k7m9E8rxxQ0I3fc
36V8HIcouG6U4MgK4JN3e5FqlHH9fniEwVkkZ+EW09zVXkB+FEy/2/JyZh7V9fwo
VSsN7yK71q8zev7mVjkoxnd6jNW9MoP/VKMyxg/ffaNkeqZqmuJ4q8A2JiGoiR81
3kxrodD5JkBeSqjD1N52iptf0aFviCsGq8cfxIG+xtrfPUP6L9z/y+iDoy3a8ReD
DhcRrYVsUozHFBlaIhTGjh2UVOX0zWNl0ReXdJGeyyo+c/44xkZIpsN+5dGFPiFP
YIcY7BdMca989Mva0EI7qIE8kfueP2ItiMQa1TknVyD1QnDruJ+xPgP1emkO8CGi
RGkNfWeM5ng2/YhxDKRUYlVSsbDTGoTxeCrwbLMgcnNDGtSOq4IiyelV8LC5b4kG
I1jTb8fkOJd0JqnwMDEi3NVBZ8LtMhadMejiMwUWV94AHSFoRZuJ7gQ4JyBp5noh
14CiQRDbbYuybAAMWQUNbGwt8x3Hd5KY/FYWqLbMI2lEERLiTy8Xg6LWzqQsey7i
BJTRBoL/xiIEE6ZF+rUNsBGvJYVnEH1luHjcpC7kbmPCDzOD+uNRiVxH2erfv/JL
SKLXKgZTYSnLReur41Qq
=fZra
-----END PGP SIGNATURE-----
Home |
Main Index |
Thread Index |
Old Index