[Solved, partially] TVheadend - help with buffering on Live TV

Stick in side USB port of Vero2

Bad on SD, impossible for HD streams. I can take a video of the television with my phone to show how bad the stream is.
Not sure if the rear USB port is better but the IR dongle is in that.

if you chuck the stick on the laptop, but stream it to the Vero 2, the playback is OK?

Yes, so far. With the July update it was bearable, with the August update it’s nearly perfect to the point I was able to watch an HD channel yesterday! At the moment I have the laptop sitting in front of the television screen with the Sundtek stick in one of it’s USB ports.
The laptop is running the latest 4.0.9 TVH server from their APT repos.

To me it’s a USB issue - either the Sundtek driver configuration, the TVH client configuration or the Vero USB setup or a combination of all three is the issue.

Okay, so it looks like playback is relatively resolved on the whole, and as you say, we may have some USB issues. I’ll see how this can be improved. Working on it one step at a time :slight_smile:

It would be interesting if you could test the dongle in the rear port, but I suspect presently you won’t see miracles.

Sam

I remember trying it in the rear port in June/July but not much better and I read somewhere here that the IR dongle should go in the rear port.

Only other thing I’ve noticed is that when I removed the DVB stick and the TV stream kept on playing for about 30 seconds - so the Vero2 was playing the stream from a cache. I’d equate it to watching a highdef YouTube clip when the internet speed is not fast enough or the cache size is not large enough.

Another thing I can test is playing back the stream on the Android TVH Client app from TVH Server on the Vero2 when the stick is plugged into the Vero2.
If it’s a good stream then this would point to an issue with something in the OSMC software/client, no ?

Yes, if you can watch it from a client sans issue, it’s probably a combination of the dongle and playback causing issue. I suspect you will see similar issues though.

Sam

Got around to testing this with the Sept 2016 update:

Side port: still buffering (see below for a log)
Rear port: worse than side port.
Android TVH Client: plays the stream via VLC on Android but the same ‘buffering’ as with the side USB port exists.

Whenever the TV signal breaks up, the following appears in the log, i.e “TS Sync byte not aligned…”

2016-10-09 16:35:08 [1459] Setting Frequency: 191625000
2016-10-09 16:35:08 [1459] Tuning DVB-T frequency: 191625000
2016-10-09 16:35:09 [1459] Checking lock
2016-10-09 16:35:09 [1459] Frontend has locked
2016-10-09 16:35:09 [1459] Resetting TS Port FE1 (1)
2016-10-09 16:35:09 [1459] TS Sync byte not aligned, realigning stream (13160 // 168)
2016-10-09 16:35:09 [1459] TS Sync byte not aligned, realigning stream (13397 // 168)
2016-10-09 16:35:09 [1459] TS Sync byte not aligned, realigning stream (13692 // 168)
2016-10-09 16:36:46 [1459] Resetting TS Port FE1 (1)
2016-10-09 16:36:46 [1459] TS Sync byte not aligned, realigning stream (0 // 20)
2016-10-09 16:36:46 [1459] TS Sync byte not aligned, realigning stream (216 // 20)
2016-10-09 16:37:04 [1459] Resetting TS Port FE1 (1)
2016-10-09 16:37:04 [1459] TS Sync byte not aligned, realigning stream (0 // 184)
2016-10-09 16:37:30 [1459] Resetting TS Port FE1 (1)
2016-10-09 16:37:30 [1459] TS Sync byte not aligned, realigning stream (0 // 4)
2016-10-09 16:37:44 [1459] Resetting TS Port FE1 (1)
2016-10-09 16:37:44 [1459] TS Sync byte not aligned, realigning stream (0 // 112)
2016-10-09 16:37:48 [1459] Resetting TS Port FE1 (1)
2016-10-09 16:37:48 [1459] TS Sync byte not aligned, realigning stream (0 // 96)

With the dongle plugged into laptop as described in previous posts, SD and HD transmissions are near perfect, this is with the stream from TVH on the laptop being transferred over the LAN to the Vero2.

So, it seems to me to be a Vero2 - USB - Sundtek stick issue? Any ideas?

Would add that the ‘buffering’ seems to be two different types:

  • signal breaks up, goes pixellated with various random parts of the transmission around the time of the stoppage showing. After the pixellation, the stream speeds up to catch up with the live transmission.
  • screen/transmission completely pauses without pixellation, the osmc chrome then appears on the screen including the progress bar, show title and the pause icon in the lower left.

Both types happen about once every 10 to 30 seconds.

Sam,

Sundtek has suggested:

  • The scheduler is running as ondemand, possibly make it “performance”
  • I’ll try increasing the buffers in their drive
  • Running a later kernel as it’s possible the USB system is not fast enough to read the USB data from the controller.

What’s the downside of running under “performance” and is there the possibility of a later kernel for the Vero2 ?

Thanks
James

You can try this.

The Vero 2’s recent updates have good thermal governing which should allow you to run at performance constantly. The reason we don’t do this is longevity, and to reduce heat and power consumption.

I’m not sure that’s quite the case, as that’s dependent on the USB block which will vary per device. The USB may certainly not be fast enough for some isochronous transactions, evidenced by SD being better than HD. But bumping the kernel won’t fix this. Our SoC provider ships a 3.10 kernel for the chip, and we have since been maintaining this with LTS improvements from kernel.org. I’d be reluctant to change the kernel anyway, as that could give us other problems, and at this time we don’t have enough users willing to test this (particularly on a device they just want to work).

I will see if there’s any more low hanging fruit to improve USB performance.

A few things I noticed using livetv although I’m using rpi3 not sure if its related.

Some HD channels work fine while others have green pixelation.

The HD channels that are pixelated have very high MB/s throughput. If a channel goes over 7 or 8Mb/s pixelation occurs.

HD channels below that seem fine. So not sure if this means the USB 2.0 cable isn’t fast enough for high HD streams.

Just my 2 cents although the issue may not be this atall.

Hi Sam

Thanks for your feedback.

I’ve semi solved this, I had a Mac Mini 2012 sitting around not doing much other than groaning under the latest Apple updates, so I dual booted it with the latest KDE Neon as TVH is nigh on impossible to install under OSX (was easier to dual boot it). The Mac has 8CPUs and 4GB of RAM.

The Sundtek stick is connect to the Mac (via a USB Extension cable) and /opt/bin/mediaclient --cpucheck shows “powersave” as the current scheduler. I tweaked the Vero2 to pull the HTSP stream from the Mac’s IP address via the client settings and uninstalled the TVH server from the Vero2 so that process is not running.
Both the Mac and the Vero2 are connected to the same network access point via Gigabit ethernet.

With this setup I can watch HD streams without pixellation buffering or audio skips, over the local network, on both the Vero2 and the Android TVHClient. Sweet.

So the Mac now works as a PVR via the TVH server as well and I can use the Vero2 to play other network streams connected to the network.

Unfortunately, it’s just too difficult for me to debug the USB issues when the Sundtek stick is connected directly to the Vero2. I idly wondered whether it would be easier (on your part) to add a test/verified TV card to a future “Vero3” that works. Maybe you could talk with the Sundtek people?
That said, it is nice to split it up and have my TV server in one part of the house and the main big screen tv client in the other!

Regards
James

Hi James

That’s not the resolution I had wanted, but I am glad this solution at least works for you for now. I am still working on improving the USB performance

Sam

Yep, not mine either but it’s worked out well, at least the Mac has found use.
I can still plug the stick back into the Vero2 when USB improvements come along.