mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	Fix CPU hog with combination of rate plugin
Fix CPU hog with some apps (e.g. artsd) when rate plugin is used together with dmix (or possible hw).
This commit is contained in:
		
							parent
							
								
									56b3974439
								
							
						
					
					
						commit
						467d69c5bc
					
				
					 3 changed files with 55 additions and 69 deletions
				
			
		| 
						 | 
				
			
			@ -447,7 +447,7 @@ int snd_pcm_direct_poll_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned in
 | 
			
		|||
	events = pfds[0].revents;
 | 
			
		||||
	if (events & POLLIN) {
 | 
			
		||||
		snd_pcm_uframes_t avail;
 | 
			
		||||
		int empty = 0;
 | 
			
		||||
		int empty;
 | 
			
		||||
		snd_pcm_avail_update(pcm);
 | 
			
		||||
		if (pcm->stream == SND_PCM_STREAM_PLAYBACK) {
 | 
			
		||||
			events |= POLLOUT;
 | 
			
		||||
| 
						 | 
				
			
			@ -457,10 +457,10 @@ int snd_pcm_direct_poll_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned in
 | 
			
		|||
			avail = snd_pcm_mmap_capture_avail(pcm);
 | 
			
		||||
		}
 | 
			
		||||
		empty = avail < pcm->avail_min;
 | 
			
		||||
		if (empty)
 | 
			
		||||
		if (empty) {
 | 
			
		||||
			snd_pcm_direct_clear_timer_queue(dmix);
 | 
			
		||||
		if (empty)
 | 
			
		||||
			events &= ~(POLLOUT|POLLIN);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	switch (snd_pcm_state(dmix->spcm)) {
 | 
			
		||||
	case SND_PCM_STATE_XRUN:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue