mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	alsa: Disable timer-scheduling for PCMs with the BATCH flag
PCM Devices which have the BATCH flag set update the PCM pointer only with period size granularity. Using timer based scheduling does not have any advantage in this mode. For one devices which have that flag set usually update the position pointer in software after getting the period interrupt. So disabling the period interrupt is not possible for this kind of devices. Furthermore writing to or reading from the buffer slice for the current period is not possible since the position inside the buffer is not known. On the other hand the tsched algorithm seems to get easily confused for this kind of hardware, which results in garbled audio output. This typically means that timer based scheduling needs to be manually disabled on systems with such devices. Auto disabling tsched in this case allows these systems to run with the default configuration. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
		
							parent
							
								
									c00ba036dc
								
							
						
					
					
						commit
						826c8f69d3
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
					@ -245,6 +245,10 @@ int pa_alsa_set_hw_params(
 | 
				
			||||||
    if (!pa_alsa_pcm_is_hw(pcm_handle))
 | 
					    if (!pa_alsa_pcm_is_hw(pcm_handle))
 | 
				
			||||||
        _use_tsched = false;
 | 
					        _use_tsched = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* The PCM pointer is only updated with period granularity */
 | 
				
			||||||
 | 
					    if (snd_pcm_hw_params_is_batch(hwparams))
 | 
				
			||||||
 | 
					        _use_tsched = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if (SND_LIB_VERSION >= ((1<<16)|(0<<8)|24)) /* API additions in 1.0.24 */
 | 
					#if (SND_LIB_VERSION >= ((1<<16)|(0<<8)|24)) /* API additions in 1.0.24 */
 | 
				
			||||||
    if (_use_tsched) {
 | 
					    if (_use_tsched) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue