Johannes Lorenz wrote: > the C++ app I am working on uses ALSA and usually works. However, when I s2ram > my computer while an ALSA connection is active, and the computer starts again, > the connection is broken (snd_pcm_writei returns < 0). In that case, I'd like > to reopen the connection. This raises up questions: > > * Do the calls of snd_pcm_... have to match per thread? I.e. can you call > snd_pcm_open() with one thread and then call snd_pcm_close() with another > one? Is there a portable answer, i.e. one that's true for all systems? You can use one device from multiple threads, but all function calls must be serialized. > * Do you need to init the hardware parameters again? No. When you get -ESTRPIPE, the stream was suspended, and all you have to do is to reinitialize it with snd_pcm_prepare() or snd_pcm_recover(). Regards, Clemens ------------------------------------------------------------------------------ _______________________________________________ Alsa-user mailing list Alsa-user@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/alsa-user