mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	pcm: dmix: Fix hwptr updates at status call
In the commit38a2d2eda8("pcm: dmix: Do not discard slave reported delay in status result"), the PCM dmix hwptr update code was rewritten to follow the slave PCM hwptr update. This is based on the similar change in PCM dshare, the commitfaf53c197c. There was a bug in the commit38a2d2eda8regarding the PCM state change, and it was addressed in commit3752e6b873("pcm: dmix: Fix the inconsistent PCM state"). However, we've hit yet another bug in this commit. Namely, the hwptr update was forgotten in the snd_pcm_dmix_sync_ptr0() function. So the hwptr value passed from snd_pcm_dmix_status() isn't properly stored, and it screws up at some long run occasionally. This patch covers the bug by replacing with the right value. Fixes:38a2d2eda8("pcm: dmix: Do not discard slave reported delay in status result") Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200013 Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
		
							parent
							
								
									e6754783f7
								
							
						
					
					
						commit
						6f134a822a
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -398,7 +398,7 @@ static int snd_pcm_dmix_sync_ptr0(snd_pcm_t *pcm, snd_pcm_uframes_t slave_hw_ptr
 | 
				
			||||||
	snd_pcm_sframes_t diff;
 | 
						snd_pcm_sframes_t diff;
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	old_slave_hw_ptr = dmix->slave_hw_ptr;
 | 
						old_slave_hw_ptr = dmix->slave_hw_ptr;
 | 
				
			||||||
	dmix->slave_hw_ptr = *dmix->spcm->hw.ptr;
 | 
						dmix->slave_hw_ptr = slave_hw_ptr;
 | 
				
			||||||
	diff = slave_hw_ptr - old_slave_hw_ptr;
 | 
						diff = slave_hw_ptr - old_slave_hw_ptr;
 | 
				
			||||||
	if (diff == 0)		/* fast path */
 | 
						if (diff == 0)		/* fast path */
 | 
				
			||||||
		return 0;
 | 
							return 0;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue