Comment 3 for bug 897561

Revision history for this message
William Good (bkgood) wrote :

The only way to get PortAudio to rescan devices is call Pa_Terminate and Pa_Initialize, which has the side-effect of killing any currently-playing streams. The calls can be stacked (i.e. you can Pa_Initialize Pa_Initialize Pa_Initialize Pa_Terminate Pa_Terminate Pa_Terminate) but the internal structures don't appear to be affected by this. I just hacked SoundManager up a bit to call Pa_Initialize, dump all the device names to the terminal and then call Pa_Terminate on a button press. The playing stream wasn't affected, but the output didn't change when I plugged in a new device. A solution is probably contingent on the PortAudio hotplugging API they're currently working on (see PA ml, trac, etc).