tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

5.1 AUDIO_SETINFO



The 5.1 audio(4) manpage says, in part (of audio_info fields),

             blocksize sets the current audio blocksize.  [...]
              [...].  Upon return from an AUDIO_SETINFO call, the actual
             blocksize set is returned in this field.

This seems to me to mean that

 ioc(AUDIO_SETINFO,&ai);
 fprintf(stderr,"blocksize %u\n",ai.blocksize);
 ioc(AUDIO_GETBUFINFO,&ai);
 fprintf(stderr,"blocksize %u\n",ai.blocksize);

should always print the same value twice (ioc() supplies the
appropriate file descriptor and error checking).

That's not what I'm seeing.  My code sets ai.blocksize to 0 before the
AUDIO_SETINFO (this is documented, at the end of the paragraph I quoted
the beginning of above, as being the way to clear any already-set
blocksize and let the kernel auto-size), and I see

blocksize 0
blocksize 480

Kernel bug?  Doc bug?  Human expectation bug?  Depends on information I
haven't given?  Looking at the implementation, I see nothing that looks
as though it's even trying to implement the last-quoted sentence above,
but I have no way to tell whether that's because someone decided to
scrap it and didn't update the manpage, because someone rewrote some
code and lost that part, or because I missed something.

Here's my test program, as a uuencoded bzip2, and a sample run.  As
written, it uses /dev/audio1, but that's easy to change if it's not
right for you.

[NetBSD-51] 282> md5 audiotest.c
4a46a0f37e13ecf8967a5faee08eb926
[NetBSD-51] 283> bzip2 < audiotest.c | uuencode audiotest.c.bz2
begin 644 audiotest.c.bz2
M0EIH.3%!62936>0UDUP``,!?@&@06W_O'S^GGBZ_[__^4`.8U&T>R"@A)0F@
MIY)D/4:/4>HT#(:-#33U`T#3R@]0&FD:FC4R>E'E'I-`T```,@`-``2(BF:0
MH])F2:>H&F@`P@-&F(!ZCQ0XR9--,)D9`P(Q-&",(-&F``022"$VA3:9&0$U
M-/4PC(`,@&@T&B@@[:T[88P;!LRC!B8ELLZ2#;@B6#J48HEMMU;"*+$)"H)+
M2'R/U\X>UK]L'T/B.(3&R,NNL1UV00S!G3U?FM]B=.:CR-&IV<*GB:?$^YJ'
M&>Y7S^[.+C7*@(Y&@5`J@K3*E=YA`9S'A$N'%U<(RPHT"LQ4%Y<P'5PT5PA]
M/AO:&(SPD.M_E8%D$LDFD](X$7-RA0C(!&-),]%7`-TVD'.J%!,FZ&_7&G")
M'5FG)-E(<Y0'8@(MF"^MB5S?6?0@%ZY*8]5_T=A0")TW24TF$K9)!-":U,&B
MQULL$@P*B,3K8;K)DJ9VT,X,!>=N`9F]?:YS:HJKA?U&HG*&;P,U:)X6E1I[
MI;3GK=$(JY9CX(IR=I`;[2+GJ0/K&;)0UM9H/3%8*M^1C(]"LA&R!'"F^\9\
M&5[!/=&V95BD>'5!$]%YDA`2L<QHJRS6QYE27.-6CJ3EP%^=+5%7$9%.EAM.
M2#$0++YAORC$K1^-*?"%V*;2J%]RKGK'/R]&P_:C<#N\MF%`'),0BLP/1!!N
M8""H!18JFRA+;<,)69=EJDWFMG@0:[D&:@8U8:*8D#VF]W4'!-'?&?N*@UO[
MK<SA,X9`"UF2;WXE!(8-#;1S#I4A?*2"A=T5:01WG]#\ZD&BE!>%,K&35P<:
M[;WH*F(CTLHP22J6MY0@X!MR%<P>UD#QGZ;12`L)DS,9UR4&Y!<6`VG$5S`U
M*P&'(*ZXH("XC<^P+@O[14P098HD%F&&R7:CBU9$#BD!]I7_@'TD!S<J3@'H
M&!D(2E;D*K$4OL6!RJE0!X1<AC8=AA&I#*`$LB7V`@$[33*DHG3P'%)C(Y'!
M!!I2K"-ACL9SURE2"N>B(#U?H"H42%',V*D,3H-\J@>DR<`87L=QS"+,]ABL
M0^:P8:[-$WBFP0<"*8)N,8G2F%O("#![/@@<)MHS11>?@S&=!.@GUI;MI9>6
G["BJ`0#@.XX!#@SA7#SSN&\@T!9&T>QRI(4-?\7<D4X4)#D-9-<`
`
end
[NetBSD-51] 284> cc -o audiotest audiotest.c
[NetBSD-51] 285> ./audiotest > /dev/null
blocksize 0
blocksize 480
[65536][65536]^C
[NetBSD-51] 286> 

(I really hope this isn't another stupid "go read the manpage!" mistake
on my part....)

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML                mouse%rodents-montreal.org@localhost
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index