mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pulse-server: increase buffer size
Because we keep everything in a ringbuffer and provide exactly the required amount of data, we can use 1/4 buffers. Also increase the buffer size. We don't want to limit the buffer size to the negotiated tlength because it can be increased later. Instead scale it to the max quantum size (8192) with a max resample rate of 32.
This commit is contained in:
		
							parent
							
								
									57dae3e2b3
								
							
						
					
					
						commit
						fd4ea442d9
					
				
					 2 changed files with 6 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -1005,12 +1005,11 @@ static const struct spa_pod *get_buffers_param(struct stream *s,
 | 
			
		|||
	blocks = 1;
 | 
			
		||||
	stride = s->frame_size;
 | 
			
		||||
 | 
			
		||||
	maxsize = 8192 * 32 * s->frame_size;
 | 
			
		||||
	if (s->direction == PW_DIRECTION_OUTPUT) {
 | 
			
		||||
		maxsize = attr->tlength * s->frame_size;
 | 
			
		||||
		size = attr->minreq * s->frame_size;
 | 
			
		||||
		size = attr->minreq;
 | 
			
		||||
	} else {
 | 
			
		||||
		size = attr->fragsize;
 | 
			
		||||
		maxsize = attr->fragsize * MAX_BUFFERS;
 | 
			
		||||
	}
 | 
			
		||||
	buffers = SPA_CLAMP(maxsize / size, MIN_BUFFERS, MAX_BUFFERS);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1019,7 +1018,8 @@ static const struct spa_pod *get_buffers_param(struct stream *s,
 | 
			
		|||
 | 
			
		||||
	param = spa_pod_builder_add_object(b,
 | 
			
		||||
			SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers,
 | 
			
		||||
			SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(buffers, MIN_BUFFERS, MAX_BUFFERS),
 | 
			
		||||
			SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(buffers,
 | 
			
		||||
				MIN_BUFFERS, MAX_BUFFERS),
 | 
			
		||||
			SPA_PARAM_BUFFERS_blocks,  SPA_POD_Int(blocks),
 | 
			
		||||
			SPA_PARAM_BUFFERS_size,    SPA_POD_CHOICE_RANGE_Int(
 | 
			
		||||
								size, size, maxsize),
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue