Arun thank you very much for this! It works perfectly, it only means one thing, our program is buggy. We are using a thread also (pthread), i am not sure why, but PulseAudio stop at pa_mutex_lock. We cannot finish our thread before PulseAudio finish his. Any advice is more than welcome. Pat