theothernt / AerialViews

A screensaver for Android TV devices including Nvidia Shield, Fire TV, and Chromecast with Google TV. Inspired by Apple TV's video screensaver.
GNU General Public License v3.0
469 stars 35 forks source link

Videos take ~20s to load, stop playing after 1s #18

Closed ghost closed 2 years ago

ghost commented 3 years ago

As mentioned in #14 my issue persists with all kinds of videos hosted via smb.

theothernt commented 3 years ago

Thanks, I had a quick look into this and I'm guessing there are two outcomes...

  1. The router has an odd or old implementation of SMB that doesn't work properly with SMBJ (the library I use) or jCIFS/ng
  2. The router has odd defaults that can be changed or I can add options to the app to change the SMB network settings

Obviously, I don't have your router so is there a manual for it online so I can see if there are any options to try?

Also, with the SMB share, does it play video ok on a) PC or Mac b) Android/iPhone app?

I will probably setup a Raspi with SMB support to see if I can replicate this issue.

ghost commented 3 years ago

https://www.manualslib.com/manual/1324803/Fritz-Box-7590.html

This is the router, there are not a lot of option, but it only works with user credentials. Enabling smb1 also changes nothing.

I use the Nas function daily on numerous android devices and a pc without issue.

theothernt commented 3 years ago

The library I use for SMB access doesn't support SMB1 so it's probably not that, but it also doesn't have too many options I can configure.

You say your NAS works fine on PC and Android - is that for playing videos? on Android, what apps play video from the NAS without issue?

ghost commented 3 years ago

Yes, playing videos from nas work flawlessly, also the apple videos themselves work with other apps. Apps that work are nova video player, MX player and vlc.

theothernt commented 3 years ago

Just to double check, does Nova Player work over SMB for you? a lot of the player is open source so I could try the SMB library they are using...

ghost commented 3 years ago

Yes, works flawlessly for me

theothernt commented 3 years ago

Ok, I'm not sure which release it'll be in just yet so what I can create a separate branch and make a special build if you're ok with testing it?

ghost commented 3 years ago

I'll gladly help!

Devviinnn commented 2 years ago

Also having this issue. Videos hosted on a Windows PC. Using a Linksys EA8300 router. Videos play locally but not with SMB, even though the test finds the files (weirdly not all of them though). Have tried Android TV on my Tv and on a TiVo Stream 4k. I have my router set up with NextDNS, but I'm not sure if that's the issue.

theothernt commented 2 years ago

Also having this issue. Videos hosted on a Windows PC. Using a Linksys EA8300 router. Videos play locally but not with SMB, even though the test finds the files (weirdly not all of them though). Have tried Android TV on my Tv and on a TiVo Stream 4k. I have my router set up with NextDNS, but I'm not sure if that's the issue.

The solution I hope to have, in maybe a few weeks, is a version of the app that uses a different SMB libraries that seems to have fewer issues than the one I currently use. I'll post an update here when it's nearly ready.

Devviinnn commented 2 years ago

Ended up moving my videos from a PC to a NAS and got it to work after removing smb://hostname/ from the share name. The smb:// was added automatically before. Everything seems good now! Not sure if that will help others. Thanks for the help and love the app!

theothernt commented 2 years ago

Ended up moving my videos from a PC to a NAS and got it to work after removing smb://hostname/ from the share name. The smb:// was added automatically before. Everything seems good now! Not sure if that will help others. Thanks for the help and love the app!

Just to confirm, even when you moved the files to a NAS, the issue persisted until you removed "smb://" from the hostname?

Devviinnn commented 2 years ago

I removed it from the Share Name field. I Can't remember if I ever had it on the Hostname field. Though I do believe "smb://" was added to the Share Name field by the app and not myself. Currently my settings in credentials are: Hostname="MyNAS" , Share Name="/Rootfolder/Videofolder".

theothernt commented 2 years ago

I removed it from the Share Name field. I Can't remember if I ever had it on the Hostname field. Though I do believe "smb://" was added to the Share Name field by the app and not myself. Currently my settings in credentials are: Hostname="MyNAS" , Share Name="/Rootfolder/Videofolder".

The app doesn't add anything to the text you enter, it only removes extra slashes if found - maybe it was the keyboard auto-suggest? ... either way, I'll add code to remove extra 'smb://' if found.

(internally, all the parts like hostname, username, etc are combined to create a valid SMB URI starting with smb:// but that's never saved, only passed into the ExoPlayer for playback)

theothernt commented 2 years ago

@jaqarll I haven't forgotten about this issue :)

I'd like to try a few config changes with the current SMB library before looking at anything else. If I send over a build with a few options, are you able to send logs using adb logcat or the Android developer tools? If not, I might be able to add a feature to send the logs via email from inside the app.

ghost commented 2 years ago

I did that a year ago for another app, but I'd need to set it up from scratch. I don't have a lot of time at the moment, but if a logging feature was implemented I could certainly test a build.

wshuman3 commented 2 years ago

I could capture the logs from adb for you

theothernt commented 2 years ago

I could capture the logs from adb for you

Are you having issues with video playback when using the Samba/SMB feature like the others in this thread?

wshuman3 commented 2 years ago

I could capture the logs from adb for you

Are you having issues with video playback when using the Samba/SMB feature like the others in this thread?

Yes, the videos are located, but fail to play.

theothernt commented 2 years ago

I've just released v1.1 beta 2 if you'd like to give the new SMB settings a try...

https://github.com/theothernt/AerialViews/releases/tag/1.1-beta2

Look in Settings > Performance & Debug, Select SMB dialects > then try enabling only 1 of the earlier versions?

Encryption is off by default so that probably won't do anything to help.

ghost commented 2 years ago

Tried to test it now, but after inputting my credentials it just says there's no videos. Not sure if it's really connected because I can apparently just type in whatever and it always says connected.

Edit: got it to work now and the beta helps. Going through the different versions of smb only 3.1.1 exhibits the issue, the others work fine!

theothernt commented 2 years ago

Tried to test it now, but after inputting my credentials it just says there's no videos. Not sure if it's really connected because I can apparently just type in whatever and it always says connected.

Edit: got it to work now and the beta helps. Going through the different versions of smb only 3.1.1 exhibits the issue, the others work fine!

That's great to hear!

About the test feature, currently it suppresses all exceptions/crashes so it'll always say "connected" - it was only supposed to be a quick test to see if any files could be found or not. I'll re-write it soon to include a lot more info!

ghost commented 2 years ago

That'd be great to have some info on what seems to be the issue. But thanks for fixing the smb feature, I haven't used your app in months, but now it's back in business!

theothernt commented 2 years ago

Yes, the videos are located, but fail to play.

Has the v1.1 Beta 2 fixed any issues for you @wshuman3 ?

wshuman3 commented 2 years ago

Has the v1.1 Beta 2 fixed any issues for you @wshuman3 ?

Unfortunately no it did not. I'm still getting a blank screen. I'll look at the logs later on today. Any specific tag I should filter by?

theothernt commented 2 years ago

Unfortunately no it did not. I'm still getting a blank screen. I'll look at the logs later on today. Any specific tag I should filter by?

You can try filtering by... AerialViews, SmbDataSource or NetworkVideoProvider

wshuman3 commented 2 years ago

This is what I see in the logs. I see the same thing even when only enabling dialect, and I tried it with each one. log.txt

theothernt commented 2 years ago

This is what I see in the logs. I see the same thing even when only enabling dialect, and I tried it with each one. log.txt

Thanks for the logs. I have a few questions...

  1. What Android TV or device are you using?
  2. What kind of server, NAS, etc is hosting the videos and are there SMB options that can be changed?

Would it be possible to move those videos into another folder temporarily, then download a lower resolution video and try that?

wshuman3 commented 2 years ago
  1. Nvidia Shield (2016)
  2. I have a Synology DS920+, and yes I can adjust some settings for SMB. (https://kb.synology.com/en-global/DSM/help/DSM/AdminCenter/file_winmacnfs_win?version=7)

I can try to download the lower res files, but those files worked fine when accessed over USB.

theothernt commented 2 years ago
  1. Nvidia Shield (2016)
  2. I have a Synology DS920+, and yes I can adjust some settings for SMB. (https://kb.synology.com/en-global/DSM/help/DSM/AdminCenter/file_winmacnfs_win?version=7)

Thanks, I have a Synology as well. I did make a few changes a while back for my Mac + Time Machine but nothing too complex. My settings inside Control Panel > File Services > SMB > Advanced Settings are...

Screenshot 2022-02-14 at 09 36 09
theothernt commented 2 years ago

@wshuman3 also, I should have asked - have you changed any of the default SMB settings on your Synology? (if you haven't then it means other Synology users might have the same issue)

Also, do you use a) encryption or b) anonymous login/access ?

wshuman3 commented 2 years ago

@wshuman3 also, I should have asked - have you changed any of the default SMB settings on your Synology? (if you haven't then it means other Synology users might have the same issue)

Also, do you use a) encryption or b) anonymous login/access ?

I haven't changed any of the SMB settings and I have not enabled encryption or anonymous login. I downloaded all the 1080 videos and I get the same behavior. I've tried this out on a Chromecast with Google TV device as well and I get the same behavior with that device. Files are located but just a black screen when it tries to play the video.

theothernt commented 2 years ago

I haven't changed any of the SMB settings and I have not enabled encryption or anonymous login. I downloaded all the 1080 videos and I get the same behavior. I've tried this out on a Chromecast with Google TV device as well and I get the same behavior with that device. Files are located but just a black screen when it tries to play the video.

Thanks for that. I will be releasing a new beta (v1.1 Beta 3) in the next day or two with a completely new 'test connection' feature which should provide a lot more info.

Just a couple more questions. I assume you're able to access that video share from Windows or a Mac? Also, does the folder contain videos only or other files + folders?

wshuman3 commented 2 years ago

Just a couple more questions. I assume you're able to access that video share from Windows or a Mac? Also, does the folder contain videos only or other files + folders?

The folder only contains videos. I don't have a Windows or Mac machine, but I can access it and play videos through the SMB protocol on my Linux devices.

theothernt commented 2 years ago

Thanks for confirming that, just wanted to make sure. I've decided to put the new 'test connection' feature in v1.1 so it should be out in a couple of days.

theothernt commented 2 years ago

@wshuman3 v1.1 is out there and in the Play Store, let me know if 'test connection' feature throws up any issues when you have time.

wshuman3 commented 2 years ago

It doesn't report any issues, just that it found all the videos. But it still exhibits the same behavior on both of my devices.

theothernt commented 2 years ago

@wshuman3 v1.2.1 is up on GitHub, should be in the Play Store later in the week or weekend if you'd like to give it a try.

There are a couple of updates regarding SMB...

  1. The SMBJ library itself was updated - that may or may not fix something
  2. If the SMB playback continues to have an issue, it shouldn't crash the player hopefully. It should show an exception in the logs which may narrow things down.
wshuman3 commented 2 years ago

Interesting, it seems like a login failure when trying to open the file. Not sure why though, the same uri works from my machine just fine. log.txt

wshuman3 commented 2 years ago

On the Synology device I am seeing the connection: User [***] from [(192.168.1.8)] via [CIFS(SMB3)] accessed shared folder [media].

theothernt commented 2 years ago

Interesting, it seems like a login failure when trying to open the file. Not sure why though, the same uri works from my machine just fine. log.txt

Thanks for the logs, that narrows things down a lot.

So I don't need to know any personal info - passwords, etc - but does your username or password contain a space or any special characters?

wshuman3 commented 2 years ago

I just created another user with an alpha only password and it works. Either something isn't being escaped or something is escaping improperly.

theothernt commented 2 years ago

I just created another user with an alpha only password and it works. Either something isn't being escaped or something is escaping improperly.

Yes, that's why I'm thinking. With the 'test connection' feature in Settings, nothing is encoded - I just use the text you entered directly.

Later, when the list of videos are created, a URI is created for each type of video (loca, network, remote). These are then parsed later by the player.

Although I don't specifically encode username, password, path, - the URI class must not do that automatically when I create it. I should have a fix in the next day or two. I'll test both usernames + password using all the special characters.

theothernt commented 2 years ago

v1.2.2 has been released which contains a fix for this issue (finally!). Let me know how you get on...