[Bug 774819] alsasink: do wait in write() only if really needed

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Mon Nov 21 23:40:11 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=774819

--- Comment #2 from Petr Kulhavy <brain at jikos.cz> ---
Created attachment 340480
  --> https://bugzilla.gnome.org/attachment.cgi?id=340480&action=edit
Patch to do wait only on -EAGAIN

Here is the patch. 

I hope it makes sense what I'm saying. I haven't done any comparative
performance test of the two approaches but it seems plausible to me. In a good
case it would be just 1x write (ioctl), in a bad case it would be 1x wait
(poll) and 2x write (ioctl) - but it would have to wait anyway...

The bad case happens when the audio chunk arrives too early or the buffer is
overrunning (i.e. the decoder clock is slower than the encoder).

The other approach would be to use blocking mode. That would actually save
syscalls (the wait would be eliminated). What was the reason to use
non-blocking?

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list