[PATCH 1/2] pacat: Synchronize STDIN and "write stream ready" events

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2016-11-22 at 22:16 +0200, Ahmed S. Darwish wrote:
> Users reported pacat crashes when playing certain multi-channel
> audio. For example:
> 
>   pacat --channels=2 /dev/zero    works
>   pacat --channels=3 /dev/zero    pa_stream_write() failed: EINVAL
>   pacat --channels=4 /dev/zero    works
>   pacat --channels=5 /dev/zero    pa_stream_write() failed: EINVAL
> 
> pacat audio playback is pipe-like, from STDIN to PA write stream.
> Meanwhile STDIN "ready to read" events got regularly triggered
> before the write stream was even created, or at moments where the
> stream could not accept any more audio.
> 
> In these out-of-sync cases, the write stream could not report the
> appropriate buffer lengths it accepts, thus a default of 4K bytes
> was chosen -- compatible by luck with some channel counts and
> incompatible with others.
> 
> Instead of choosing a faulty default in these scenarios, mute the
> the STDIN events until the write stream is available & queriable.
> 
> BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=98475
> Reported-by: Tanu Kaskinen <tanuk at iki.fi>
> Signed-off-by: Ahmed S. Darwish <darwish.07 at gmail.com>
> ---
>  src/utils/pacat.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)

Thanks a lot for helping with the release blockers! This patch looks
good, I'll push it soon.

-- 
Tanu

https://www.patreon.com/tanuk


[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux