mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	
				Method on_stream_process can be called multiple times with the same pwt.delay and pwt.now values. Its a case, when snd_pcm_pipewire_process returns less then b->requested frames. For example, if requested is 2048 and alsa period size is 512, then on_stream_process is called 4 times in a row with the same pwt.delay and pwt.now values. Store number of transferred frames for this "session" in separate variable so its incremented each time the on_stream_process is called. Number of transferred frames is cleared when a new "session" starts. Introduce also number of buffered frames, which is number of frames read from alsa but not sent to pipewire yet. This is the case when period is not align with the quantum size. For example alsa period is 480, but quantum is 512. on_stream_process is called 2 times for the first quantum, 512 frames is sent to pipewire and 448 frames are cached for the next round. These 448 frames needs to be included in delay computation in the next on_stream_process. Signed-off-by: Martin Geier <martin.geier@streamunlimited.com>  | 
			||
|---|---|---|
| .. | ||
| alsa-plugins | ||
| conf | ||
| tests | ||