If a stream is shorter than prebuf, and the stream is started in the corked state, its audio will get discarded when uncorking. I'll attach a program that reproduces the issue, and a fix for the bug. The fix is a quick hack, and probably not suitable as the final solution. I haven't investigated the root cause myself that deeply yet, but I was told that the audio gets discarded during rewinding, so the proper fix probably involves modifying the rewinding code. How to compile test.c: gcc test.c -std=c99 $(pkg-config --cflags --libs libpulse) -lm -o test
Created attachment 78933 [details] Test program for reproducing the bug The test program does the following: * creates a stream with PA_STREAM_START_CORKED and 400 ms prebuf * writes 200 ms long sine wave * calls pa_stream_drain() (the operation doesn't complete before uncorking) * waits 10 seconds * uncorks the stream
Created attachment 78934 [details] [review] Quick hack to fix (or work around) the bug
I will try to come up with a cleaner fix.
Patch sent to the mailing list: http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/16918
Fixed: http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=1e42a289d40af1c656bb606ec6d7152e212c284b
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.