At Wed, 11 Sep 2002 16:14:19 -0400, Paul Davis wrote: > > >Is it possible to adjust a stop threshold or something to get my > >desired behaviour? > > i think you should have set the start mode to START_DATA and the start > threshold appropriately. then the device would have started as soon as > the buffer was full.
but this will make the driver to start the stream automatically. if you want to start explicitly by yourself, then it's not a concrete solution. the question is the behavior at the following situation: you are trying to write data greater than buffer size. the device is set up as blocking mode. how does write() behave? if the stream is running, it's blocked. ok, fine. meanwhile, on the current implementation, if the stream is prepared or paused, it returns -EPIPE. this is correct in a certain perspective: the file is not writable, and unless you change its state, data will be _never_ written. blocking the operation makes no sense, hence the driver returns an error. this argument is valid on a single thread program. however, if the program is multi-threaded the state can be changed in other thread, then the operation may start in background. hence, the driver should block. this is the case we faced now. the behavior of poll() is dependent on the behavior of write(). thus, in the former case, poll() should return POLLERR, while in the latter case it should block. i myself prefer to block the operation. it's more intuitive. if you don't like blocking, then you can open it in the non-blocking mode. i don't see any other drawbacks. anyway, i'd like to hear other opinions, too. ciao, Takashi ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Alsa-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-devel