[mythtv] ringbuffer.cpp

Jonas Arndt jonas.arndt at thearndtfamily.com
Tue Feb 18 04:22:10 UTC 2014


On 02/16/2014 06:58 PM, Jonas Arndt wrote:
>
> On 02/15/2014 08:05 PM, Jean-Yves Avenard wrote:
>> On 16 February 2014 09:36, Warpme <warpme at o2.pl> wrote:
>>
>>> This is also how I understand things. I think there is somewhere bug.
>>> But we don't know yet in which part of data path it is.
>>> That's why I propose to start with simplest possible data path as it 
>>> has
>>> lower number of variables to check.
>> downgraded to 3.2 original 12.04 kernel; using your sysconf values and
>> the issue occurred again in liveTV; another 20+ seconds lock in the
>> ringbuffer trying to read the data.
>>
>> iperf on the dedicated internel link ; I get 993Mbit/s between the
>> backend machine and the NFS server.
>>
>> Using dd if=/dev/zero of=/path/to/nfs bs=4k count=1M; I get 104MB/s
>>
>> Using a little unit test with 4 simultaneous TFW; I get 75MB/s on 
>> that drive...
>>
>> I don't see how their could be a bottleneck occurring watching a
>> single 12Mbit/s DVB-T stream...
> I had an interesting observation over the weekend. I installed a 
> replica of my configuration for a friend. He only has a single 
> front-end though. Ubuntu 12.04 on both back-end and front-end. The 
> front-end runs on a ZBox ID11 (just like my front-ends). For some 
> reason my friend had freezes occurring every 5-10 minutes and the 
> front-end mostly couldn't recover. I had even put JY's patch on the 
> back-end but that did not help. I started doing some network pinging 
> to the back-end and other machines on the network. Whenever the 
> back-end was streaming Live TV I got some network latency. From the 
> back-end I would mostly have around 0.100 ms replies but then every 
> couple of seconds I would get 7-8 ms replies. This weird behavior 
> would stop once I stopped watching live tv (ping would be rock solid 
> again). This would not happen on my system at home where I would have 
> 0 latency even when watching live TV. After some troubleshooting it 
> turns out that his server only had a 100 Mbps NIC while mine had a 1 
> Gbps. I installed a 1 Gbps card in his server and the problem is gone. 
> It still freezes up a second or so between shows, but I have that as 
> well.
>
> Now why on earth would I need 1 Gbps to run watch liveTV? No issues 
> with recorded shows on the 100 Mbit NIC. I don't know much about the 
> Myth streaming protocol but it seems there is stuff going on there for 
> LiveTV that would require a much larger bandwidth then one would expect.
>
> Cheers,
>
> // Jonas
>
Thanks to Mark and Gary for your answers and suggestions. I did prepare 
a reply with some more data on the 100 Mbps card and the switch but then 
my friend called and talked about more freezes watching live TV. Looking 
at the back-end logs a lot of Waited 0.2 seconds for data 
#012#011#011#011to.... Then a
Feb 17 13:54:20 howarddvr mythbackend: mythbackend[1306]: W 
ProcessRequest ringbuffer.cpp:1035 (WaitForReadsAllowed) 
RingBuf(/data1/Recordings/2761_20140217203957.mpg): Taking too long to 
be allowed to read..

Just when that happened the front-end started a lot of:
Feb 17 13:54:21 zbox mythfrontend.real: mythfrontend[5912]: N 
CoreContext mythplayer.cpp:2130 (PrebufferEnoughFrames) Player(0): 
Waited 103ms for video buffer
.... with increasing number to stop with:
Feb 17 13:54:35 zbox mythfrontend.real: mythfrontend[5912]: N 
CoreContext mythplayer.cpp:2130 (PrebufferEnoughFrames) Player(0): 
Waited 13619ms for video buffers AAAdAdDLAAAAAA

That is 13.6 seconds. After that the stop/back was pushed.

This is with JY's patch applied. For my system JY's patch continues to 
work without an issue. I barely ever get the 0.2 second error, but 
sometime the same error with larger numbers (1.0<).

I did look at the hard drives. My friend has a separate one for 
recordings and I had put that in the default storage group. This guy is 
a fairly new HP drive (500 GB) and smartctl says everything is great. 
Still, I read somewhere that moving LiveTV to another drive could 
improve things, so I did. LiveTV is now on the root disk. I still get a 
lot of "Waited for 0.2 seconds" on the backend. The front-end is 
throwing up stuff like Waited 1351ms for video buffers AAAAAAAAAADDdL 
but has so far recovered.

So in summary the freezes are much less frequent after the move to 
gigabit NIC, but they still happen with JY's patch (Layer 2/3 managed 
switch).

I am struggling with what to do next. I am running out of ideas.

Cheers,

// Jonas



More information about the mythtv-dev mailing list