[nas] mpg123 on NAS questions
pgf at foxharp.boston.ma.us
Sat Jan 12 10:39:50 MST 2002
<big snip of my buffering and latency problems with mpg123-nas>
[ i'm also removing michael hipp from the cc: line -- haven't
heard from him, and there's no point filling his inbox with nas
jon -- thanks for giving me enough pointers to make some more
things are working better now, but still not quite right.
for instance, my "pause" problems have gone away now that i'm
using AuPausFlow and AuStartFlow to control nas. this works
i can also use AuStopFlow to interrupt the flow immediately when
jumping tracks, for instance.
i'm still having other problems when i jump tracks: i want
to stop the flow, discard anything in it, and then start it
again with new data: if i do an AuStopFlow, then close and
reopen the nas connection, it all works, but i get a small
snippet of extraneous noise from the previous track when the
next track starts. if i try various combinations of
AuStopFlow and AuFlush, i can't seem to get the next track
to play at all.
clearly i'm confused as to what i'm doing here, so let me ask some
basic questions about the NAS api.
i've always found the terms "sync" and "flush" to be
ambiguous (whether talking about caches, ttys, or audio
devices :-), and the man pages don't seem to help me. does
AuFlush discard outstanding samples? or does AuStop take
care of that? and what exactly does AuSync do?
and, after using one of these routines, do i need to loop
and wait for some condition to be true? mpg123 already has
an event handler that watches for some state events (like
AuStateStop), and sets some flags for itself when they
occur. but i'm not sure when i need to use that facility
and when i don't.
i need to be able to do several primitives:
- stop the flow immediately, so that it can be restarted. (this
seems to be AuPause followed by AuStart)
- wait for current outstanding data to drain to the sound device.
- stop the flow immediately, and discard anything remaining, so
that i can start a new flow.
any pointers to existing clients that do these operations "properly"
would be of great help. even a pointer to a discussion of how to
use the API more effectively would be good too -- the library.ps doc
doesn't quite cut it. :-) am i missing some other doc? (i think
i know the answer to that question... :-/ :-)
paul fox, pgf at foxharp.boston.ma.us (arlington, ma, where it's 37.6 degrees)
More information about the Nas