rewritten to minimize user interaction and handling of pulseaudio.