mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	pcm - Limit the avail_min minimum size
Fix avail_min if it's less than period_size. The too small avail_min is simply useless and the cause of CPU hog with rate plugin.
This commit is contained in:
		
							parent
							
								
									1cf37d72c4
								
							
						
					
					
						commit
						b0b7d0280f
					
				
					 1 changed files with 6 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -5577,6 +5577,12 @@ int snd_pcm_sw_params_set_avail_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params,
 | 
			
		|||
#endif
 | 
			
		||||
{
 | 
			
		||||
	assert(pcm && params);
 | 
			
		||||
	/* Fix avail_min if it's below period size.  The period_size
 | 
			
		||||
	 * defines the minimal wake-up timing accuracy, so it doesn't
 | 
			
		||||
	 * make sense to set below that.
 | 
			
		||||
	 */
 | 
			
		||||
	if (val < pcm->period_size)
 | 
			
		||||
		val = pcm->period_size;
 | 
			
		||||
	params->avail_min = val;
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue