qemu-patch-raspberry4/audio
Gerd Hoffmann 6315633b25 pulseaudio: process 1/4 buffer max at once
Limit the size of data pieces processed by the pulseaudio worker
threads.  Never ever process more than 1/4 of the buffer at once.

Background: The buffer area currently processed by the pulseaudio thread
is blocked, i.e. the main thread (or iothread) can't fill in more data
there.  The buffer processing time is roughly real-time due to the
pa_simple_write() call blocking when the output queue to the pulse
server is full.  Thus processing big chunks at once means blocking
a large part of the buffer for a long time.  This brings high latency
and can lead to dropouts.

When processing the buffer in smaller chunks the rpos handling becomes a
problem though.  The thread reads hw->rpos without knowing whenever
qpa_run_out has already seen the last (small) chunk processed and
updated rpos accordingly.  There is no point in reading hw->rpos though,
pa->rpos can be used instead.  We just need to take care to initialize
pa->rpos before kicking the thread.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
2011-01-25 19:56:35 +03:00
..
alsaaudio.c audio: split sample conversion and volume mixing 2011-01-12 18:36:22 +03:00
audio.c audio: split sample conversion and volume mixing 2011-01-12 18:36:22 +03:00
audio.h Use GCC_FMT_ATTR (format checking) 2010-10-03 06:34:51 +00:00
audio_int.h audio: split sample conversion and volume mixing 2011-01-12 18:36:22 +03:00
audio_pt_int.c audio: Use GCC_FMT_ATTR (format checking) 2010-12-04 20:51:18 +00:00
audio_pt_int.h pthreads-based audio and miscellaneous audio clean-up (malc). 2008-01-14 04:24:29 +00:00
audio_template.h audio: Fix memory size for resampling buffer in DAC case 2010-09-28 08:56:59 +04:00
audio_win_int.c Windows Waveform Audio driver (no ADC support yet) 2009-10-10 01:18:24 +04:00
audio_win_int.h Windows Waveform Audio driver (no ADC support yet) 2009-10-10 01:18:24 +04:00
coreaudio.c audio: internal API change 2009-09-18 14:04:36 +04:00
dsound_template.h Fix NAME2/FIELD2 warnings 2009-01-22 22:09:55 +00:00
dsoundaudio.c audio: split sample conversion and volume mixing 2011-01-12 18:36:22 +03:00
esdaudio.c audio: split sample conversion and volume mixing 2011-01-12 18:36:22 +03:00
fmodaudio.c audio: split sample conversion and volume mixing 2011-01-12 18:36:22 +03:00
mixeng.c audio: split sample conversion and volume mixing 2011-01-12 18:36:22 +03:00
mixeng.h audio: split sample conversion and volume mixing 2011-01-12 18:36:22 +03:00
mixeng_template.h audio: split sample conversion and volume mixing 2011-01-12 18:36:22 +03:00
noaudio.c noaudio: correctly account acquired samples 2011-01-04 03:53:47 +03:00
ossaudio.c audio: split sample conversion and volume mixing 2011-01-12 18:36:22 +03:00
paaudio.c pulseaudio: process 1/4 buffer max at once 2011-01-25 19:56:35 +03:00
rate_template.h Make audio violate POSIX less 2008-12-03 22:48:44 +00:00
sdlaudio.c audio/sdl: return on error 2010-08-07 20:04:24 +04:00
spiceaudio.c audio: split sample conversion and volume mixing 2011-01-12 18:36:22 +03:00
wavaudio.c audio: internal API change 2009-09-18 14:04:36 +04:00
wavcapture.c Remove any pretense that there can be more than one AudioState 2009-05-14 03:20:43 +04:00
winwaveaudio.c audio: split sample conversion and volume mixing 2011-01-12 18:36:22 +03:00