While the stutter occurs I have observed the following in the enigma2 log:
[eFilePushThreadRecorder] Warning: All write buffers busy [eDVBRecordFileThread] cancelling [eDVBRecordStreamThread] failed to cancel, killing all waiting IO [eDVBRecordFileThread] poll: aio_return returned failure: Interrupted system call [eDVBRecordFileThread] poll: aio_return returned failure: Interrupted system call [eDVBRecordFileThread] poll: aio_return returned failure: Interrupted system call [eDVBRecordFileThread] Waiting for I/O to complete
And when the streaming is aborted:
[eDVBRecordFileThread] buffer usage histogram (4 buffers of 188 kB) 1: 165 2: 137 3: 2 4: 2
The above can be observed while e.g. streaming from a client on the network using the following command:
wget http://vuultimo:8001...:E080000:0:0:0: -O - > /dev/null
The warnings do not appear if the stream is collected locally on the ultimo host.
I suspect that network issues as well as client performance make the send buffers overflow while streaming. Note that recording the same channels work fine without stutter on playback even if recorded to a nas attached to the network.
Notice that it appears as if only 4 buffers are used. What is the reason for this?
Looking at the sources of demux.cpp I notices that the calculation/use of number of buffers differ if the stream is saved to file (while recording) and when streamed.
While recording the amount is determined by the amount of available memory. For the ultimo this appears to be 20 buffers. But when streamed the amount is hardcoded to be 4.
Would it make sense to modify the code in demux.cpp to use the same number of buffers as while recording or at least have it default to a higher number?