where's the busy wait ? the code blocks on poll for two types on events
- /dev/dsp becomes writable (some new fragments can be written)
So, what do you think happens when /dev/dsp is *always* writable (due to insufficient data from the app)? Then it'll never block.
you just need to change the condition in poll for the number of fd:s to be looked upon and use 2 only when playing and some wavehdr have been queued but not sent yet to OSS
A+