IPTV recording: CC errors
Added by Peter Bouthoorn almost 4 years ago
I've been using Tvheadend for IPTV recording for a couple of years now and for all that time I've been experiencing the infamous Continuity Counter errors. Until now I blamed the Banana Pi that I was using. I recently upgraded to an Odroid H2, thinking it would offer more performance. It does, but the CC errors are still there, even though there’s not much load.
– OS: Odroid HC2 running Armbian Stretch, kernel 4.14.111
– Tvheadend version: latest, 4.3-1793~gbc769bfa9-dirty (self built)
In order to pinpoint the problem I tested a couple of different scenarios. Can’t find the problem so far, but some results seem interesting. The basic setup of the tests is this:
– 3x IPTV recording to sata HDD (WD Red 4TB)
– each stream is 12Mbps
– load is about 30%
– when increasing the number of recordings to 5, the load rises to about 50%
Also, I optimized the network udp buffers as following:
net.core.rmem_max = 67108864
net.core.rmem_default = 67108864
net.ipv4.udp_mem=262144 327680 393216
In the first test setup I’m using 2 VLANS: one for my home LAN and the other for the IPTV streams.
Setup 1 – 2 VLANs on eth0 – results:
– lots of CC errors
– lots of UDP drops
In the second setup I’m using a USB-ethernet adapter. This adapter supports USB 3.0, but unfortunately the HC2 USB-port is USB 2.0. Still, it can handle the throughput easily.
Setup 2 – IPTV on seperate eth device (USB-ethernet adapter) – results:
– occasional CC errors
– no UDP drops
Interestingly I saw the same behaviour on the Banana Pi: lots of CC errors when using VLANs and only occasional error when using a USB-ethernet adapter.
I’ve got no clue why there are so much CC errors when using VLANs. I checked with the Odroid forum, but alas.
Also, how come there are no UDP drops and Tvheadend is still getting CC errors? This can hardly be a performance problem. As said, the load produced by the 3 recordings is about 30% and there’s not much else going on on the system.
As a last resort I tried increasing IPTV_BUF_SIZE (in src/input/mpegts/iptv/iptv_private.h). Changed it from 300*188 to 3000*188. Still testing, but so far I’ve already seen 2 errors (again, not accompanied UDP drops).
OK, this story is getting fairly long. Hope I didn’t bore you :-).
RE: IPTV recording: CC errors - Added by saen acro almost 4 years ago
net.core.rmem_max = 16777216 net.core.wmem_max = 16777216 net.ipv4.udp_mem = 8388608 12582912 16777216 net.ipv4.tcp_rmem = 4096 87380 8388608 net.ipv4.tcp_wmem = 4096 65536 8388608 net.core.wmem_default = 16777216 net.core.rmem_default = 16777216 net.ipv4.tcp_tw_recycle = 0
change eth1 with your Ethernet port name
ethtool -g eth1
ethtool -G eth1 rx 2048
ip -s -s link show eth1
RE: IPTV recording: CC errors - Added by Peter Bouthoorn almost 4 years ago
Uhm...I already changed the UDP (receive) buffer settings. I'm using even larger buffers than you suggested. BTW, changing the tcp buffers does nothing for IPTV (= RTP = UDP multicast).
I'm not sure it's just a network of buffer problem: as I said, in the setup where I use a USB-ethernet device I'm getting CC errors, but there are no accompanying network drops. And the system load is just the load produced by Tvheadend (around 30% CPU usage).