On Tue, 05.01.10 18:02, Kelly Anderson (kelly at silka.with-linux.com) wrote: > Here is a copy of the function in OpenAl 1.10.622 with a comment on > when and where the deadlock occurs. Hmm, and how does context_state_callback() look like? How does it call _signal()? > data->context = > ppa_context_new(ppa_threaded_mainloop_get_api(data->loop), > data->context_name); > if(!data->context) > { > AL_PRINT("pa_context_new() failed: %s\n", > ppa_strerror(ppa_context_errno(data->context))); This ppa_context_errno() invocation won't work. Because data->context will be NULL here. You should treat pa_context_new() failing as OOM. (but you still do need to handle this, because internally some SHM is allocated which can realistically fail, and hence needs a different handling than the usual malloc() returning NULL where aborting is a good idea.) > AL_PRINT("starting pa_context_connect()\n"); > if(ppa_context_connect(data->context, NULL, > PA_CONTEXT_NOAUTOSPAWN, NULL) < 0) > { Why do you pass PA_CONTEXT_NOAUTOSPAWN? Unless you have a really good reason to I can only recommend letting the user control autospawning and not overriding his wishes. If you set this flag then what the user configured in client.conf will be overriden, and that is probably not what you want. Otherwise the code looked fine though. Lennart -- Lennart Poettering Red Hat, Inc. lennart [at] poettering [dot] net http://0pointer.net/lennart/ GnuPG 0x1A015CC4