On Sat, Sep 11, 2010 at 08:01:17PM -0600, Jacob Meuser wrote: > CVSROOT: /cvs > Module name: src > Changes by: [email protected] 2010/09/11 20:01:17 > > Modified files: > sys/dev : audio.c audiovar.h > > Log message: > DVACT_{QUIESCE,RESUME} for audio(4) > DVACT_QUIESCE: > 1) waits until ringbuffer current position wraps back to the start of > the buffer > 2) stops playback and/or recording by way of the hardware drivers' "halt" > audio_hw_if method > 3) blocks userland access to audio device
3 is done so applications don't spin or get confused because ... > 4) saves the current state of the master mute, then mutes it > DVACT_RESUME: > 1) reprogram hardware stream parameters for playback or recording > if they were active at DVACT_QUIESCE by way of hardware drivers' > "set_params" audio_hw_if method > 2) start playback or recording if they were active at DVACT_QUIESCE > by way of hardware drivers' "trigger" or "start" audio_hw_if method > 3) restores master mute state as it was at DVACT_QUIESCE > 4) wakes up blocked userland processes accessing the hardware 2, 3, and 4 are delayed to avoid starting up while splhigh() is still in effect and other things are resuming, which could cause looping or other audio oddities. drivers using these methods should not produce noise while suspending/ resuming and should resume audio streams exactly where they left off at suspend. this should also make suspend/resume support for most audio drivers nearly trivial. -- [email protected] SDF Public Access UNIX System - http://sdf.lonestar.org
