Jump to content

Strange playback issue only on Android tv


Go to solution Solved by thynan,

Recommended Posts

Posted (edited)

Hey all, for the last few weeks I have strange playback issues ONLY on Android TV devices. Playback randomly pauses, sometimes for a few seconds, sometimes for a minute or more. 

Here's the weird thing: it's only on Android TV devices, and I am absolutely certain it's not a bandwidth issue! I am really stumped what could cause this. I have tested extensively over the last week's, and here's what I know:

- It happens only on Android TV devices. 

- It happens over WLAN (very strong signal) and also over Ethernet (plugged directly into the router)

- It happens with big files often, but also sometimes with smaller files.

- When I test the exact same movie that just had playback pauses on Android TV, and play it on other devices , it plays with zero issues. Tested on browser, 3 different Android phones and Android tablet. Zero issues with the same movies. Tested with multiple different movies and episodes of different qualities, and it's always the same: playback pauses on Android TV, and plays perfectly fine on all other devices.

- It's always direct play, so no transcoding issue. I even disabled transcoding completely to rule this out.

- The issue happens on my Shield (Android TV OS) connected to my TV, and also on the native Android TV OS of my TV.

- It happens both with latest version of the emby Android app as well as the latest version of the emby for Android TV app.

- I factory reset both the shield as well as Android TV on my TV. Same issue remains.

I am running out of ideas. Like I said, it's definitely not a bandwidth issue, as I can play completely fine from multiple other devices  connected to the same network. Only happens on android TV.

Here is something curious that I discovered today that might help to debug this:

It seems Android TV at some point simply stops "preloading" the video stream. Or it stops requesting new chunks... I don't know what's the correct term to describe it. 

I can see this when I watch the network traffic on my router while playing the movie. When I play on my browser for example, the traffic goes up to 70-100 mbps for a few seconds, then drops to almost nothing for 2-3 seconds, then jumps up to 70-100 mbps again, then drops again to almost nothing and so fourth.

This goes on until the movie ends or I stop playback manually. The movie plays perfectly without any pauses. I assume what I see here is simply emby requesting a small chunk of the video, which gets loaded very fast, then requesting the next chunk when playback caught up after a while and so on.

Now on Android TV I see the same behaviour, with one difference: at some point during playback, the network traffic simply stays at almost nothing. And shortly afterwards playback pauses. It is as if the emby client simply stopped requesting new "chunks". The bandwidth is there, but it's just not being used. 

Anyone experiencing similar issues? I am out of ideas what to try, after switching from WLAN to Ethernet, factory reset, switching emby apps etc 

Edited by thynan
Added more info
GrimReaper
Posted

Which client app you're using, AndroidTV app or Universal Android app? 

Assuming it's the former, download Emby for Android app from the store (search for "Emb"), see how does it compare. 

Posted

Hey, I tested with both on both Android TV devices. Same issue every time.

Posted

Server Logs would be helpful, otherwise we are guessing 🤔

Posted

Yes, I will upload logs asap. Was on the road while typing this, that's why I couldn't get new ones. I checked the logs previously however, and saw nothing unusual, but maybe some of you can see something.

Posted (edited)

Ok, here are some logs. They should be pretty clean - no other users on the server but me, fresh restart of the server before I started playing the file. Here's some relevant timestamps:

08:51:3X -> started playing the video

08:52:1X -> saw in the router that traffic dropped and stayed low, at a few kb/s. Down from around 50-80 mb/s before.

08:52:5X -> Video paused, since no new data was coming in, and the built up buffer was used up

08:53:2X -> Traffic on the router picked back up, and video resumed

I cannot see anything unusual here unfortunately. Maybe someone else can make something of this.

 

 

 

 

embyserver (4).txt

Edited by GrimReaper
Log reattached
Posted (edited)

Here i played the same video, with the same issue but I enabled debug logging this time.

09:04:5X -> started playing the video

09:05:1X -> saw in the router that traffic dropped and stayed low, at a few kb/s. Down from around 50-80 mb/s before.

09:05:5X -> Video paused, since no new data was coming in, and the built up buffer was used up

09:06:2X -> Traffic on the router picked back up, and video resumed

 

embyserver (5)-2.txt

Edited by GrimReaper
Log reattached
  • Solution
Posted (edited)

OK, I'm not 100% sure yet, but I think I solved it. It had to do with my traefik reverse proxy setup. Took me hours to narrow it down, since I was looking at a 100 other places before. I did not expect traefik to be the issue, since it only affected AndroidTV - so I thought it would be some App settings that are the culprint. But apparently other apps and devices are just a little bit more resilient to the issue that traefik introduced - who knows.

I verified that it's traefik by opening the emby http-port on the host, and connecting directly from my Android TV to the emby docker container, therefore bypassing traefik. Afterwards I could not reproduce the issue anymore. (fingers crossed).

Then I tried to find out what the exact issue was with traefik, since I don't want to remove it. I use it for many other applications on the server as well, and I don't want to bypass it for Emby. However I never found out the real root cause in traefik. In the end I stumbled on the solution pretty randomly: I tried installing traefik directly on the host, instead of in a docker container. All other settings completely identical, apart from that.

This immediately solved the issue, and now I have Emby behind traefik again, and everything works fine. I even noticed some other improvements with laggy UI in the app and so on, but need more time to verify that, since the issues are pretty flaky.

TL;DR: Issue came from traefik in docker container. Traefik with same configuration but installed on host solved the issue. Maybe this helps someone else too. :)

 

Edited by thynan
spelling
  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...