mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	pcm: direct: Fix deadlock in poll_descriptors
The recent change in PCM direct plugins to check XRUN in
poll_descriptors callback caused a regression; as consequence, the
whole playback hangs up.
The culprit is a mutex dead lock by the call in snd_pcm_state() inside
the new snd_pcm_direct_poll_descriptors().  The poll_descriptors code
path is protected with pcm mutex, thus an unlocked version
(__snd_pcm_state()) has to be used inside the callback instead.
Fixes: 789ee39727 ("pcm: direct: check state before enter poll on timer")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
			
			
This commit is contained in:
		
							parent
							
								
									360c976aaa
								
							
						
					
					
						commit
						24e63b7527
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -676,7 +676,8 @@ int snd_pcm_direct_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds,
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
	/* this will also evaluate slave state and enter xrun if necessary */
 | 
			
		||||
	switch (snd_pcm_state(pcm)) {
 | 
			
		||||
	/* using __snd_pcm_state() since this function is called inside lock */
 | 
			
		||||
	switch (__snd_pcm_state(pcm)) {
 | 
			
		||||
	case SND_PCM_STATE_XRUN:
 | 
			
		||||
		return -EPIPE;
 | 
			
		||||
	default:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue