fetzerch/xbmc-pvr-addons — pull request #98 by fetzerch (2013-03-02 17:06:12+00:00)
Title: Align buffers

@janbar: Hi jean-luc!

I continued our work on aligning the tcp buffer sizes to 128000.
Our old change was reverted because it was stuttering.
Hopefully this time, it works.

This resolves the issue, that when debugging on Windows, I often got socket errors and the backend reported: "writeStringList: Error, No data written on writeBlock".
I was hoping that this could as well fix/improve the issue of increasing backend cpu load, that users in the forum are reporting.

One interesting finding:
The old code reseted tcp_buflen to the value returned by getsockopt(SO_RCVBUF).
That value is however depending on the platform. Linux systems double the value since
they reserve half of the buffer for metadata. Other systems don't do this and since that value is reused as input for setsockopt when starting playback, we create buffers of the doubled size. I added debug output as well so that we can see how big the buffers are that we're requesting.

Can you please test this and see if it causes any stuttering? I'd be interested especially if it works on your power lan.

Thanks,
Christian