[alsa-devel] Alsa-lib 'cancelability'

Alan Horstmann gineera at aspect135.co.uk
Mon Aug 22 18:41:21 CEST 2016


Hi,

I am wondering if there is a policy on the thread 'cancelability' / 
'cancellability' of the functions in Alsa-lib?

We are dissecting an issue on the Portaudio list which has appeared with the 
'Locking API' version 1.1.2, when using the Portaudio callback API.  The 
callback runs in it's own thread; when a user requests 'AbortStream' a thread 
cancel is requested.  Sometimes it seems this can take effect during 
snd_pcm_mmap_commit(), so the function never completes and a lock is not 
released.  Then, during the cleanup, snd_pcm_drop() attempts to aquire the 
lock, which is already held, and a lock-up occurs.

Is it up to the application to ensure each Alsa function completes, eg by 
disabling cancelability on the thread for those periods, or is it reasonable 
to expect the functions to ensure they complete adequately?

Any comment would be appreciated.

Regards

Alan


More information about the Alsa-devel mailing list