Jump to content


Photo

LiveTv Pause/Glitches in Seek Mode - Not Present in Direct Stream LiveTv

LiveTv Pauses AndroidTv

  • Please log in to reply
114 replies to this topic

#1 bungee91 OFFLINE  

bungee91

    Advanced Member

  • Members
  • 288 posts
  • Local time: 08:38 AM

Posted 22 December 2018 - 12:49 AM

This has been happening for a LONG time, so app/server/Shield Tv software info isn't likely too relevant for diagnosing but included here (Shield Tv (newest version; 7.2.1 or something like that), ATV Beta 1.6.7, Stable server 3.5.3 (Linux/UnRAID Docker), Emby built in Live Tv with HDHR both OTA and CC, all local playback on same network).

Issue: If I tune a LiveTv stream on my shield set for surround sound (runs into receiver, D.D. playback) I get random little audio/video pauses.
They will continue to happen throughout the playback, likely within 30-60 seconds or so, and continue indefinitely.
Sometimes it's just audio dropout, other times it is both video and audio.

Things that resolve the issue:
Enable direct play of LiveTv completely solves the issue.
Pausing the live stream for a couple of seconds and resuming it resolves the issue (IDK, it is like I force a small buffer to be present, then all is well).

Troubleshooting that made it worse, or no change:
Use MPV for LiveTv - This had audio sync issues, plus the same issue.
Deselect allow stream copy - No change, same issue.
Force a full transcode - lower the stream to 3.0 Mbit still had the exact same issue.

Things to note: Recorded Tv files, and all local video files playback just fine without issue.

I'm not sure what logs will show, but can send an app log/server log to help diagnose this better.
Resources on the server/network shouldn't be an issue here, and I have no issue such as this with the HDHR app, or even with direct stream Live Tv selected.

I do not notice this same issue on my other shield Tv set for downmix to stereo hooked directly to a Tv. I cannot recall if this issue is resolved forcing the problematic Shield Tv to downmix to stereo or not, but that certainly wouldn't be a very good solution long term.

I've tried changing settings in the Android Tv settings (surround sound auto or always, processor max performance or optimize) with no change to this issue.
No clue what is causing this. but been meaning to post about it for some time. Tired of pausing for ~5 seconds every time I tune to a channel to mitigate this from occurring.

Edit: Attached ffmpeg logs, and Server Log. In my testing: user Home on ShieldTv, tuning channel CNN.

Attached Files


Edited by bungee91, 23 January 2019 - 01:06 PM.


#2 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 127151 posts
  • Local time: 09:38 AM

Posted 22 December 2018 - 01:34 PM

I would suggest trying this again with the next release of Emby Server. Thanks !



#3 bungee91 OFFLINE  

bungee91

    Advanced Member

  • Members
  • 288 posts
  • Local time: 08:38 AM

Posted 22 December 2018 - 06:48 PM

Beta or stable?.. I ask because I may switch to beta for now as I'm impatient (and can test if this is resolved)... LOL. I'll then likely switch back to stable once 3.6 is released. Thanks.

#4 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 127151 posts
  • Local time: 09:38 AM

Posted 22 December 2018 - 10:39 PM

3.6 has not gone stable yet, so that means you'd have to jump on the beta.



#5 bungee91 OFFLINE  

bungee91

    Advanced Member

  • Members
  • 288 posts
  • Local time: 08:38 AM

Posted 02 January 2019 - 03:18 PM

3.6 has not gone stable yet, so that means you'd have to jump on the beta.

 

Understood, and what I meant..

 

 

Anyhow, this is still present for me in 3.6.0.82 with no changes to the issue whatsoever.

I have logs in the OP from 3.5.3 if it'd be of help, if not I can get new logs just with this condition, and also send one from the app as well. Let me know, as it is super annoying (and no idea why I seem to be the only one with the issue).

Thanks.



#6 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 127151 posts
  • Local time: 09:38 AM

Posted 02 January 2019 - 03:27 PM

Yes please, thanks.



#7 bungee91 OFFLINE  

bungee91

    Advanced Member

  • Members
  • 288 posts
  • Local time: 08:38 AM

Posted 02 January 2019 - 10:20 PM

Yes please, thanks.

 

Attached, logs sent from ATV app at ~8:10PM CST, user Home.

Server was restarted to have clean logs, I also enabled debug logging for this testing just in case.

 

I'll say this in my limited testing here. I tuned 4 channels, two Cable Card and two OTA (both Emby built in DVR/HDHR setup).

ALL channels within ~10 seconds of starting the stream glitched initially, then continued on, potentially glitching at least once more, but seemed better..

If this is a logged condition, the issue was the worst on my last tuned channel WFLDDT Fox OTA station, which continued to glitch/pause every 20-30 seconds.

All streams were only ran for a couple of minutes at most.

 

 

I'm not sure what it could be, but again, enabling direct stream OR pausing it for a couple of seconds resolves this issue completely.

Thanks for your help in fixing this obnoxious issue I've been fighting with for many many months now!



#8 ebr OFFLINE  

ebr

    Chief Bottle Washer

  • Administrators
  • 44232 posts
  • Local time: 09:38 AM

Posted 03 January 2019 - 02:36 PM

It sounds to me like the delivery of the live stream when passed through ffmpeg is just not quite fast enough to keep up so it has to wait on it every now and then.

 

I'm not sure why it is limited to your environment though as I play pretty much all of my live TV this way and frequently watch entire football games without seeing this.



#9 bungee91 OFFLINE  

bungee91

    Advanced Member

  • Members
  • 288 posts
  • Local time: 08:38 AM

Posted 03 January 2019 - 03:01 PM

It sounds to me like the delivery of the live stream when passed through ffmpeg is just not quite fast enough to keep up so it has to wait on it every now and then.

 

I'm not sure why it is limited to your environment though as I play pretty much all of my live TV this way and frequently watch entire football games without seeing this.

 

I'd agree with your assumption here, as that symptom would explain my issue...

However, the server is complete overkill for this setup, so it is shocking to me that resources/computing would be the issue.

I'm not saying my setup is anything special, but not too much else running on the server, and it's a Xeon e3-1230v6 4-core 8 thread setup with a CPUMark of 9,600 with 32GB ram available, and very often it is just me watching a live stream.

 

Maybe a CPU governor/idle state is affecting this, and adding enough latency to cause the issue?

I'd also think the UnRAID is a pretty popular setup, and no one else is experiencing this either (I don't see others complaining/etc...).

Any thoughts on what could I do to try and diagnose/troubleshoot this issue?

 

As always I appreciate your help. 


Edited by bungee91, 03 January 2019 - 03:03 PM.


#10 ebr OFFLINE  

ebr

    Chief Bottle Washer

  • Administrators
  • 44232 posts
  • Local time: 09:38 AM

Posted 03 January 2019 - 06:22 PM

Sorry if you've already indicated, but what is your network connection?  If wired, you could try switching to wireless.



#11 bungee91 OFFLINE  

bungee91

    Advanced Member

  • Members
  • 288 posts
  • Local time: 08:38 AM

Posted 03 January 2019 - 06:49 PM

It's wired on a Nvidia Shield Tv...

I do recall talk of issues with the Shields wired connection, not sure if that was still an issue or what. However I still don't quite get this..

Playing a local file = perfect

Playing a recorded Tv file = perfect

Playing a live stream without timeshifitng (directplay selected in app) = perfect

Playing a live stream with timeshifting = glitchy

 

I'd really not preferred wireless long term, but am all for testing with it to compare to see if it is better.

When looking at the ffmpeg logs, it looks like the speed is initially like 9x, and then throttles down to ~1x speed.

I have no idea what I'm looking at (so please correct me on my assumption), but doesn't that mean that it could process at that speed, however throttles down to what is needed which would be 1X speed?

 

In case this is CPU bound, and for some reason ffmpeg really prefers Core 0 of the CPU, I moved my VM from Core 0 in order to remove the most likely competing process. Will test and see if that helps.


Edited by bungee91, 03 January 2019 - 06:50 PM.


#12 bungee91 OFFLINE  

bungee91

    Advanced Member

  • Members
  • 288 posts
  • Local time: 08:38 AM

Posted 03 January 2019 - 09:59 PM

More info/testing.

Switching to WiFi made no difference, and while higher bitrate stuff may glitch a bit more often (1080 OTA, WiFi or LAN), both it and 720p have the same issues.

However, I strongly feel this is an issue with the Emby ATV app, or I suppose my shield.
If I select to use an external player for Livetv, it is defaulting to Kodi.
Selecting the same channel in the guide and having it playback in Kodi is absolutely perfect, glitch free. I can also still pause/timeshift.
Clearly this isn't what I want to do by default (having to exit Kodi after stream stop, and in general external app not preferred), but it is interesting that negates this issue completely.

#13 bungee91 OFFLINE  

bungee91

    Advanced Member

  • Members
  • 288 posts
  • Local time: 08:38 AM

Posted 03 January 2019 - 10:03 PM

One more thing/bandaid fix.
If I just pause the stream start initially for a couple of seconds this is completely resolved. I've also watched my CPU usage during my testing, and it is completely negligible.

So... (I can already hear the groans) is there anyway to force a delayed start of the stream in order to build that couple of seconds buffer, and in doing so will mitigate this issue for me? I have no idea why this is only happening for me, but it's been there for a LONG time.
Thanks.

#14 cayars OFFLINE  

cayars

    Advanced Member

  • Alpha Testers
  • 2853 posts
  • Local time: 09:38 AM

Posted 03 January 2019 - 10:53 PM

Where are you storing your recorded files?  Is it a raid disk, single hdd, sdd?

 

My bet would be to look at this area of the system.



#15 bungee91 OFFLINE  

bungee91

    Advanced Member

  • Members
  • 288 posts
  • Local time: 08:38 AM

Posted 03 January 2019 - 11:00 PM

Single HDD outside of array, mounted exclusively for temp/swap usage.
I can test with the temp/swap drive set as default (would default to SSD used as cache/app storage) and see if it resolves the issue. I had this setup as default for a long while prior to my current setup, and am pretty sure it was the same issue. However, certainly worth testing to make certain.

#16 cayars OFFLINE  

cayars

    Advanced Member

  • Alpha Testers
  • 2853 posts
  • Local time: 09:38 AM

Posted 03 January 2019 - 11:10 PM

I do all my recording to SSD as well as have the temp transcode running from SSD.  This is used for direct streaming as it has to remux the stream.

So it would be worth setting the transcode to use the SSD as well.



#17 bungee91 OFFLINE  

bungee91

    Advanced Member

  • Members
  • 288 posts
  • Local time: 08:38 AM

Posted 03 January 2019 - 11:30 PM

I'll certainly test it out, it just seemed wasteful considering the amount of writes for temp usage.
That, and my SSD is the same used for all Dockers/Emby location, so it seemed like a good idea to separate it.
Also, it just seems absurd that a single live stream on a HDD without any other IO couldn't handle it without any glitch/issues.
Again, I'm all for testing/ruling it out, and I really do appreciate the input to look at that as the cause of the issue.. It just seems like a HDD without any other issues should work well in this use case. However, we shall see soon enough when I test it out. =P

#18 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 127151 posts
  • Local time: 09:38 AM

Posted 04 January 2019 - 03:01 AM

Let us know how you get on.



#19 ebr OFFLINE  

ebr

    Chief Bottle Washer

  • Administrators
  • 44232 posts
  • Local time: 09:38 AM

Posted 04 January 2019 - 03:30 PM

However I still don't quite get this..

Playing a local file = perfect

Playing a recorded Tv file = perfect

Playing a live stream without timeshifitng (directplay selected in app) = perfect

Playing a live stream with timeshifting = glitchy

 

The difference there is the availability of the source data.  In all the instances where it is "perfect" it is either not doing any processing with ffmpeg or the source data is immediately available at whatever data rate the server can read it.

 

The one that is giving you problems is the only situation where we have a stream that can only be delivered at a max rate of its broadcast AND is being run through another process (ffmpeg).  I still don't know why this wouldn't be a more widespread issue though if there is a basic bottleneck there...



#20 bungee91 OFFLINE  

bungee91

    Advanced Member

  • Members
  • 288 posts
  • Local time: 08:38 AM

Posted 04 January 2019 - 04:07 PM

The difference there is the availability of the source data.  In all the instances where it is "perfect" it is either not doing any processing with ffmpeg or the source data is immediately available at whatever data rate the server can read it.

 

The one that is giving you problems is the only situation where we have a stream that can only be delivered at a max rate of its broadcast AND is being run through another process (ffmpeg).  I still don't know why this wouldn't be a more widespread issue though if there is a basic bottleneck there...

 

Appreciate the explanation, and it makes sense given any potential bottleneck would cause the delay in this use case.

I will test with this back to the cache SSD drive this weekend and see if it is resolved.

I've also ordered a 500GB NVMe SSD that will be dedicated to this task from here on out (I think of it as using a jackhammer when a sledge hammer would suffice..  :P) If it's not fixed after all that, well then this pleasant discussion will continue... More to come, thanks to all.


  • cayars likes this





Also tagged with one or more of these keywords: LiveTv, Pauses, AndroidTv

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users