[pulseaudio-tickets] [Bug 103103] The client has not a chance to provide data, when absolute offset is used in a stream without prebuffering and underrun happend for long time

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Nov 7 12:17:03 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=103103

--- Comment #16 from Tanu Kaskinen <tanuk at iki.fi> ---
I found out why the overruns happen even in the "fixed" version. Adjusting the
write amount in write_samples() to compensate for the jump doesn't help,
because pa_stream_write() subtracts only the write length from the internal
requested_bytes variable. The jump is not taken into account, so
pa_stream_writable_size() will keep returning non-zero values even though in
reality the buffer has been filled completely.

pa_stream_write() actually has a comment about this:

    /* This is obviously wrong since we ignore the seeking index . But
     * that's OK, the server side applies the same error */
    s->requested_bytes -= (seek == PA_SEEK_RELATIVE ? offset : 0) + (int64_t)
length;

I don't know why Lennart didn't bother fixing this properly in
https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=373b5efe51238b0ad34cb9a9d8fc61b973afdad8

So in conclusion: the requested_bytes tracking needs to be fixed at the client
side, and judging from the comment, apparently there's a similar problem at the
server side.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-bugs/attachments/20171107/10daeb1a/attachment.html>


More information about the pulseaudio-bugs mailing list