Bug 64284 - Shorter-than-prebuf streams are silent if started corked
Summary: Shorter-than-prebuf streams are silent if started corked
Status: RESOLVED FIXED
Alias: None
Product: PulseAudio
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Tanu Kaskinen
QA Contact: pulseaudio-bugs
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2013-05-06 15:52 UTC by Tanu Kaskinen
Modified: 2013-06-11 10:51 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Test program for reproducing the bug (5.36 KB, text/plain)
2013-05-06 15:56 UTC, Tanu Kaskinen
Details
Quick hack to fix (or work around) the bug (2.28 KB, patch)
2013-05-06 15:57 UTC, Tanu Kaskinen
Details | Splinter Review

Description Tanu Kaskinen 2013-05-06 15:52:04 UTC
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
Comment 1 Tanu Kaskinen 2013-05-06 15:56:18 UTC
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
Comment 2 Tanu Kaskinen 2013-05-06 15:57:49 UTC
Created attachment 78934 [details] [review]
Quick hack to fix (or work around) the bug
Comment 3 Tanu Kaskinen 2013-05-06 16:01:57 UTC
I will try to come up with a cleaner fix.
Comment 4 Tanu Kaskinen 2013-05-07 15:14:38 UTC
Patch sent to the mailing list: http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/16918


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.