Jump to content
kingargyle

Serenity for Android with Emby Server Support

Recommended Posts

CBers

@@kingargyle - This is in the server log when I the app tries to get a list of users:

 

2018-12-15 12:40:05.788 Info HttpServer: HTTP GET http://192.168.1.150:8988/system/Info/Public. UserAgent: Mozilla/5.0 (Windows NT; Windows NT 10.0; en-GB) WindowsPowerShell/5.1.17134.407
2018-12-15 12:40:05.788 Info HttpServer: HTTP Response 200 to 192.168.1.150. Time: 0ms. http://192.168.1.150:8988/system/Info/Public
2018-12-15 12:40:07.890 Info HttpServer: HTTP POST http://192.168.1.150:8988/Users/AuthenticateByName?format=json. UserAgent: Mozilla/5.0 (Windows NT; Windows NT 10.0; en-GB) WindowsPowerShell/5.1.17134.407
2018-12-15 12:40:07.891 Error UserManager: Error authenticating with provider Default
*** Error Report ***
Version: 3.6.0.77
Command line: C:\Users\Media\AppData\Roaming\Emby-Server\system\EmbyServer.dll -noautorunwebapp
Operating system: Microsoft Windows NT 6.2.9200.0
64-Bit OS: True
64-Bit Process: True
User Interactive: True
Processor count: 4
Program data path: C:\Users\Media\AppData\Roaming\Emby-Server
Application directory: C:\Users\Media\AppData\Roaming\Emby-Server\system
System.Exception: System.Exception: Invalid username or password
   at Emby.Server.Implementations.Library.DefaultAuthenticationProvider.Authenticate(String username, String password, User resolvedUser)
   at Emby.Server.Implementations.Library.UserManager.AuthenticateWithProvider(IAuthenticationProvider provider, String username, String password, User resolvedUser)
Source: Emby.Server.Implementations
TargetSite: System.Threading.Tasks.Task`1[MediaBrowser.Controller.Authentication.ProviderAuthenticationResult] Authenticate(System.String, System.String, MediaBrowser.Controller.Entities.User)
   at Emby.Server.Implementations.Library.DefaultAuthenticationProvider.Authenticate(String username, String password, User resolvedUser)
   at Emby.Server.Implementations.Library.UserManager.AuthenticateWithProvider(IAuthenticationProvider provider, String username, String password, User resolvedUser)

2018-12-15 12:40:07.892 Info UserManager: Authentication request for Master has succeeded.
2018-12-15 12:40:07.892 Info SessionManager: Reissuing access token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2018-12-15 12:40:07.893 Info HttpServer: HTTP Response 200 to 192.168.1.150. Time: 2ms. http://192.168.1.150:8988/Users/AuthenticateByName?format=json
2018-12-15 12:40:07.931 Info HttpServer: HTTP GET http://192.168.1.150:8988/emby/users. UserAgent: Mozilla/5.0 (Windows NT; Windows NT 10.0; en-GB) WindowsPowerShell/5.1.17134.407
2018-12-15 12:40:07.931 Info HttpServer: HTTP Response 200 to 192.168.1.150. Time: 1ms. http://192.168.1.150:8988/emby/users
2018-12-15 12:40:08.074 Info HttpServer: HTTP GET http://192.168.1.150:8988/emby/Users/633f85ef4e0e4f45879c7e88469d0ff5/items?Fields=Tags&Recursive=true&SortBy=SortName&SortOrder=Ascending&IncludeItemTypes=Series. UserAgent: Mozilla/5.0 (Windows NT; Windows NT 10.0; en-GB) WindowsPowerShell/5.1.17134.407
2018-12-15 12:40:08.085 Info HttpServer: HTTP Response 200 to 192.168.1.150. Time: 11ms. http://192.168.1.150:8988/emby/Users/633f85ef4e0e4f45879c7e88469d0ff5/items?Fields=Tags&Recursive=true&SortBy=SortName&SortOrder=Ascending&IncludeItemTypes=Series
2018-12-15 12:40:08.983 Info HttpServer: HTTP GET http://192.168.1.150:8988/emby/Users/633f85ef4e0e4f45879c7e88469d0ff5/items?Recursive=true&SortBy=SeriesName,ParentIndexNumber,IndexNumber&SortOrder=Ascending&IncludeItemTypes=Episode&IsMissing=False&Filters=IsPlayed&MinDateLastSavedForUser=2018-12-08T12:40:08Z. UserAgent: Mozilla/5.0 (Windows NT; Windows NT 10.0; en-GB) WindowsPowerShell/5.1.17134.407
2018-12-15 12:40:08.984 Info HttpServer: HTTP Response 200 to 192.168.1.150. Time: 2ms. http://192.168.1.150:8988/emby/Users/633f85ef4e0e4f45879c7e88469d0ff5/items?Recursive=true&SortBy=SeriesName,ParentIndexNumber,IndexNumber&SortOrder=Ascending&IncludeItemTypes=Episode&IsMissing=False&Filters=IsPlayed&MinDateLastSavedForUser=2018-12-08T12:40:08Z
2018-12-15 12:40:09.171 Info HttpServer: HTTP GET http://192.168.1.150:8988/emby/Users/a08711a48b194896b8cc7961d7d28bae/items?Fields=Tags&Recursive=true&SortBy=SortName&SortOrder=Ascending&IncludeItemTypes=Series. UserAgent: Mozilla/5.0 (Windows NT; Windows NT 10.0; en-GB) WindowsPowerShell/5.1.17134.407
2018-12-15 12:40:09.216 Info HttpServer: HTTP Response 200 to 192.168.1.150. Time: 45ms. http://192.168.1.150:8988/emby/Users/a08711a48b194896b8cc7961d7d28bae/items?Fields=Tags&Recursive=true&SortBy=SortName&SortOrder=Ascending&IncludeItemTypes=Series
2018-12-15 12:40:09.929 Info HttpServer: HTTP GET http://192.168.1.150:8988/emby/Users/a08711a48b194896b8cc7961d7d28bae/items?Recursive=true&SortBy=SeriesName,ParentIndexNumber,IndexNumber&SortOrder=Ascending&IncludeItemTypes=Episode&IsMissing=False&Filters=IsPlayed&MinDateLastSavedForUser=2018-12-08T12:40:09Z. UserAgent: Mozilla/5.0 (Windows NT; Windows NT 10.0; en-GB) WindowsPowerShell/5.1.17134.407
2018-12-15 12:40:09.933 Info HttpServer: HTTP Response 200 to 192.168.1.150. Time: 4ms. http://192.168.1.150:8988/emby/Users/a08711a48b194896b8cc7961d7d28bae/items?Recursive=true&SortBy=SeriesName,ParentIndexNumber,IndexNumber&SortOrder=Ascending&IncludeItemTypes=Episode&IsMissing=False&Filters=IsPlayed&MinDateLastSavedForUser=2018-12-08T12:40:09Z
2018-12-15 12:47:59.554 Info App: Udp message sent to 192.168.1.246:47032
2018-12-15 12:47:59.554 Info App: Udp message sent to 192.168.1.246:47032
2018-12-15 12:47:59.555 Info App: Udp message sent to 192.168.1.246:47032
2018-12-15 12:47:59.555 Info App: Udp message sent to 192.168.1.246:47032

The Spinning Circle doesn't time out.

 

I can't get it to connect to my Plex server either.

Share this post


Link to post
Share on other sites
kingargyle

@@kingargyle - This is in the server log when I the app tries to get a list of users:

 

2018-12-15 12:40:05.788 Info HttpServer: HTTP GET http://192.168.1.150:8988/system/Info/Public. UserAgent: Mozilla/5.0 (Windows NT; Windows NT 10.0; en-GB) WindowsPowerShell/5.1.17134.407
2018-12-15 12:40:05.788 Info HttpServer: HTTP Response 200 to 192.168.1.150. Time: 0ms. http://192.168.1.150:8988/system/Info/Public
2018-12-15 12:40:07.890 Info HttpServer: HTTP POST http://192.168.1.150:8988/Users/AuthenticateByName?format=json. UserAgent: Mozilla/5.0 (Windows NT; Windows NT 10.0; en-GB) WindowsPowerShell/5.1.17134.407
2018-12-15 12:40:07.891 Error UserManager: Error authenticating with provider Default
*** Error Report ***
Version: 3.6.0.77
Command line: C:\Users\Media\AppData\Roaming\Emby-Server\system\EmbyServer.dll -noautorunwebapp
Operating system: Microsoft Windows NT 6.2.9200.0
64-Bit OS: True
64-Bit Process: True
User Interactive: True
Processor count: 4
Program data path: C:\Users\Media\AppData\Roaming\Emby-Server
Application directory: C:\Users\Media\AppData\Roaming\Emby-Server\system
System.Exception: System.Exception: Invalid username or password
   at Emby.Server.Implementations.Library.DefaultAuthenticationProvider.Authenticate(String username, String password, User resolvedUser)
   at Emby.Server.Implementations.Library.UserManager.AuthenticateWithProvider(IAuthenticationProvider provider, String username, String password, User resolvedUser)
Source: Emby.Server.Implementations
TargetSite: System.Threading.Tasks.Task`1[MediaBrowser.Controller.Authentication.ProviderAuthenticationResult] Authenticate(System.String, System.String, MediaBrowser.Controller.Entities.User)
   at Emby.Server.Implementations.Library.DefaultAuthenticationProvider.Authenticate(String username, String password, User resolvedUser)
   at Emby.Server.Implementations.Library.UserManager.AuthenticateWithProvider(IAuthenticationProvider provider, String username, String password, User resolvedUser)

2018-12-15 12:40:07.892 Info UserManager: Authentication request for Master has succeeded.
2018-12-15 12:40:07.892 Info SessionManager: Reissuing access token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2018-12-15 12:40:07.893 Info HttpServer: HTTP Response 200 to 192.168.1.150. Time: 2ms. http://192.168.1.150:8988/Users/AuthenticateByName?format=json
2018-12-15 12:40:07.931 Info HttpServer: HTTP GET http://192.168.1.150:8988/emby/users. UserAgent: Mozilla/5.0 (Windows NT; Windows NT 10.0; en-GB) WindowsPowerShell/5.1.17134.407
2018-12-15 12:40:07.931 Info HttpServer: HTTP Response 200 to 192.168.1.150. Time: 1ms. http://192.168.1.150:8988/emby/users
2018-12-15 12:40:08.074 Info HttpServer: HTTP GET http://192.168.1.150:8988/emby/Users/633f85ef4e0e4f45879c7e88469d0ff5/items?Fields=Tags&Recursive=true&SortBy=SortName&SortOrder=Ascending&IncludeItemTypes=Series. UserAgent: Mozilla/5.0 (Windows NT; Windows NT 10.0; en-GB) WindowsPowerShell/5.1.17134.407
2018-12-15 12:40:08.085 Info HttpServer: HTTP Response 200 to 192.168.1.150. Time: 11ms. http://192.168.1.150:8988/emby/Users/633f85ef4e0e4f45879c7e88469d0ff5/items?Fields=Tags&Recursive=true&SortBy=SortName&SortOrder=Ascending&IncludeItemTypes=Series
2018-12-15 12:40:08.983 Info HttpServer: HTTP GET http://192.168.1.150:8988/emby/Users/633f85ef4e0e4f45879c7e88469d0ff5/items?Recursive=true&SortBy=SeriesName,ParentIndexNumber,IndexNumber&SortOrder=Ascending&IncludeItemTypes=Episode&IsMissing=False&Filters=IsPlayed&MinDateLastSavedForUser=2018-12-08T12:40:08Z. UserAgent: Mozilla/5.0 (Windows NT; Windows NT 10.0; en-GB) WindowsPowerShell/5.1.17134.407
2018-12-15 12:40:08.984 Info HttpServer: HTTP Response 200 to 192.168.1.150. Time: 2ms. http://192.168.1.150:8988/emby/Users/633f85ef4e0e4f45879c7e88469d0ff5/items?Recursive=true&SortBy=SeriesName,ParentIndexNumber,IndexNumber&SortOrder=Ascending&IncludeItemTypes=Episode&IsMissing=False&Filters=IsPlayed&MinDateLastSavedForUser=2018-12-08T12:40:08Z
2018-12-15 12:40:09.171 Info HttpServer: HTTP GET http://192.168.1.150:8988/emby/Users/a08711a48b194896b8cc7961d7d28bae/items?Fields=Tags&Recursive=true&SortBy=SortName&SortOrder=Ascending&IncludeItemTypes=Series. UserAgent: Mozilla/5.0 (Windows NT; Windows NT 10.0; en-GB) WindowsPowerShell/5.1.17134.407
2018-12-15 12:40:09.216 Info HttpServer: HTTP Response 200 to 192.168.1.150. Time: 45ms. http://192.168.1.150:8988/emby/Users/a08711a48b194896b8cc7961d7d28bae/items?Fields=Tags&Recursive=true&SortBy=SortName&SortOrder=Ascending&IncludeItemTypes=Series
2018-12-15 12:40:09.929 Info HttpServer: HTTP GET http://192.168.1.150:8988/emby/Users/a08711a48b194896b8cc7961d7d28bae/items?Recursive=true&SortBy=SeriesName,ParentIndexNumber,IndexNumber&SortOrder=Ascending&IncludeItemTypes=Episode&IsMissing=False&Filters=IsPlayed&MinDateLastSavedForUser=2018-12-08T12:40:09Z. UserAgent: Mozilla/5.0 (Windows NT; Windows NT 10.0; en-GB) WindowsPowerShell/5.1.17134.407
2018-12-15 12:40:09.933 Info HttpServer: HTTP Response 200 to 192.168.1.150. Time: 4ms. http://192.168.1.150:8988/emby/Users/a08711a48b194896b8cc7961d7d28bae/items?Recursive=true&SortBy=SeriesName,ParentIndexNumber,IndexNumber&SortOrder=Ascending&IncludeItemTypes=Episode&IsMissing=False&Filters=IsPlayed&MinDateLastSavedForUser=2018-12-08T12:40:09Z
2018-12-15 12:47:59.554 Info App: Udp message sent to 192.168.1.246:47032
2018-12-15 12:47:59.554 Info App: Udp message sent to 192.168.1.246:47032
2018-12-15 12:47:59.555 Info App: Udp message sent to 192.168.1.246:47032
2018-12-15 12:47:59.555 Info App: Udp message sent to 192.168.1.246:47032

The Spinning Circle doesn't time out.

 

I can't get it to connect to my Plex server either.

 

 

For Plex you'll need to disable HTTPS and multi-user support.  If you have Plex Pass it will have issues connecting as well.   Unfortunately, there isn't really a good documented API on Plex so I had to reverse engineer a lot of things.

 

 

On Emby do you have it setup to require a PIN or Password for user profile authentication?   Also it looks like instead of port 8096, you have your Emby running on 8988.   I know that right now, the emby client is only looking for things on 8096 by default.   If you can try with emby server on port 8096 that will help in figuring things out.

 

Also, if you could, please open a bug on the project's site, we can try to work it out and get a fix in the next maintenance release.

 

https://github.com/NineWorlds/serenity-android/issues/new

Edited by kingargyle

Share this post


Link to post
Share on other sites
CBers

OK, I'll get an issue raised.

 

Yes, I use port 8988. Why does the app ask for a port if you're ignoring it?

 

I'll change to 8096 as a test and update the issue once raised.

 

The app seems to find the servers OK, just doesn't return the user list to select from. My users don't have passwords or Pins.

Share this post


Link to post
Share on other sites
Luke

What params are you passing to login?

Share this post


Link to post
Share on other sites
CBers

What params are you passing to login?

 

I assume that's to @@kingargyle ?

 

For the record, I am running Emby Beta server, v3.6.0.77.

Share this post


Link to post
Share on other sites
Luke

Yes that's to him.

Share this post


Link to post
Share on other sites
kingargyle

What params are you passing to login?

 

@@Luke

 

The issue appears to be in retrieving the list of users if I'm understanding the issue correctly.

 

I do a fetch of All Public Users:

 

@@get("/emby/Users/Public")

fun allPublicUsers(): Call<List<PublicUserInfo>>

 

Then use the list returned to display the users.

 

Once a list of users is available and a user profile is selected, I authenticate by passing in an empty string for the MD5 Hash, and the user name.  Both password fields are filled with an Empty String as well.

 

This works with my 3.3.0 server version.  I need to install a development server and test with the latest version in case things have changed.

Share this post


Link to post
Share on other sites
kingargyle

OK, I'll get an issue raised.

 

Yes, I use port 8988. Why does the app ask for a port if you're ignoring it?

 

I'll change to 8096 as a test and update the issue once raised.

 

The app seems to find the servers OK, just doesn't return the user list to select from. My users don't have passwords or Pins.

 

I'm making a change to correctly configure the server port based on the information that is found during the server discovery.   I just never had a user that had the server on a different port besides 32400 for plex, or 8096 for Emby.  I'll try and get a test APK for you to try in the next day or so.

  • Like 1

Share this post


Link to post
Share on other sites
kingargyle

I'm able to replicate the issue on Emby Server 3.6.x...  I'm getting a date deserialization issue when retrieving the users.

 

The date format is coming in as:  2018-12-16T00:44:01.1498328+00:00

 

Where as in past Emby Servers it was coming in as: yyyy-MM-dd'T'HH:mm:ss.SSSSSSS'Z'

Share this post


Link to post
Share on other sites
CBers

Thanks for the update @@kingargyle.

 

Luke - are you able to assist above?

Share this post


Link to post
Share on other sites
kingargyle

Thanks for the update @@kingargyle.

 

Luke - are you able to assist above?

 

I actually made a change in Serenity to handle both date formats.   I'll have a new test build up in a bit.

  • Like 1

Share this post


Link to post
Share on other sites
FrostByte

Will this app trigger HDR when playing reencoded 4K video with the black bars cropped?  There appears to be a problem with ATV and a height of anything < 2160 pixels 

Edited by FrostByte

Share this post


Link to post
Share on other sites
CBers

Will this app trigger HDR when playing reencoded 4K video with the black bars cropped? There appears to be a problem with ATV and a height of anything < 2160 pixels

That is why I wanted to use Serenity, to test.

 

Having playback issues of 4K currently, but the dev is working on it.

  • Like 2

Share this post


Link to post
Share on other sites
CBers

Need to hide/manage trailers when in Movie view, as there are always 2 of the same name.

 

Perhaps there needs to be an intermediate "Details" page where trailers etc are listed?

Share this post


Link to post
Share on other sites
Luke

Try using a pw param with plain text. You can drop the hashed param.

Share this post


Link to post
Share on other sites
kingargyle

Need to hide/manage trailers when in Movie view, as there are always 2 of the same name.

 

Perhaps there needs to be an intermediate "Details" page where trailers etc are listed?

 

Yeah, right now I just list items that are type Movie... Unfortunately on my dev system I currently don't have Trailers enabled.   Please open a bug on the projects site so I can schedule this work.

Share this post


Link to post
Share on other sites
kingargyle

Try using a pw param with plain text. You can drop the hashed param.

 

The issue was just that the Date format had changed from 3.3.0 to a different format at least as of 3.6.0.   It looks like the serialization of the ISO date format was corrected in later server versions.  I just made it so the client will handle either date format.

Share this post


Link to post
Share on other sites
kingargyle

Will this app trigger HDR when playing reencoded 4K video with the black bars cropped?  There appears to be a problem with ATV and a height of anything < 2160 pixels 

 

Currently Serenity will run into the same issue as the official Emby app, as we both use the same internal video player, and ExoPlayer itself is having some issues with these files.  Once Exoplayer fixes things on their end we'll get the same benefit in both Serenity and Emby.    Also, Serenity right now is taking a to agressive approach to files that it thinks can't be direct played on the device.   I need to do some work around that and have an open issue on that.  Probably will be a little while before I get to it with the Holidays coming up.

  • Like 1

Share this post


Link to post
Share on other sites
kingargyle

For those having problems playing 4k content with Serenity, I should now be able to debug those issues, as I have an NVidia Shield Android TV device.  Depending on time I should hopefully have it addressed in a 2.1 Milestone build.  Keep an eye out here for links to the downloads.

  • Like 1

Share this post


Link to post
Share on other sites
kingargyle

Finally got some time to address some of the playback issues.   Next release should have the following improvements:

 

1.  Better detection of whether a device will support direct streaming or if transcoding is needed.

2.  If you button mash on the Movie view, you'll be able to move through the videos faster.   This mainly affects Android TV devices that do not have a FF and REW button.  If you have an Amazon Fire TV you can use FF and REW buttons to move faster through the list.

3. If you have a Plex Server and and Emby Server, the app should be able to correctly and more reliabley switch back and forth between the two servers.

 

I still need to test this out on the NVidia Shield... and I should be receiving an Android TV ADT2 from Google at some point.

 

Still need to run it through more tests before putting up a new build.

  • Like 1

Share this post


Link to post
Share on other sites

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...