Jump to content

Multi-Cast Support


Theodore

Recommended Posts

chef
On 7/22/2020 at 4:25 AM, neik said:

 

I have also been wondering how big the Emby Team acutally is, as there is no evidence at all available on any page.
At least, I didn't find anything...
Would be nice to know how many people are working on/for Emby.

I think... in most cases ...  if a user post to the fourm with a "delevoper" or "administratior" tag under their name, then that user is part of the team. However, there are quite a few people who have spent alot of time here and have been an integral part of the development of Emby. 😃

Edited by chef
  • Like 1
Link to comment
Share on other sites

lastelement21

Ok, the prototype is working!  I'm relatively awful at coding and have never done frontend at all, so I'm sure plenty of things could be done better, but it works.  It's meant to be run by an emby server owner, as it requires a server api key.  It essentially reads the room leader's location, jumps room members to 10-ish seconds ahead of the room leader, and finally unpauses on queue.

I tested it with 4 web clients and the android client all following my Chromecast within a couple seconds at once (total of 6 sessions).  Clients may join any existing room, or create a new room.  If a room does not have a leader when a client joins, it automatically becomes the leader.  This can be overridden at any time.  Only the client's own sessions are visible.

If any client falls out of sync/halts playback, it resyncs immediately.  You must log out of Emby Sync, or "leave room" to stop syncing.  Sessions offline for more than 10 minutes will automatically stop syncing.  To force a resync, rewind a bit on the out of sync follower.

Emby clients only update the server with status info every second or so, so sync is only possible within a couple seconds in either direction. (Close enough for watching with friends online for sure!)  CHROMECAST CANNOT ACT AS FOLLOWER FOR NOW, however, it can lead.  You can also set the device casting to the chromecast to follow, as a workaround.  You must use Incognito tabs if you want to test multiple players in the same browser.  Running more than one player in the same browser in normal mode has unpredictable results, since the clients in the same browser share session id (same reason the dashboard is unreliable in this state).

To try it out: Easiest is to just fire up the container and point your browser at https://127.0.0.1:5000 and log in using your Emby Connect username. (The Emby password is not stored, it is used against the emby API for auth only)  Sorry, no local only emby accounts or emby email as logins right now.  Only your clients which have been active within the last five minutes will be visible, if you don't see any clients to select, make sure the client is open, logged in, and recently interacted with.

docker run --name emby-sync -e EMBY_SERVER='<emby_url>' -e SECRET_KEY='<emby_server_api_key>' -p 5000:5000 lastelement21/emby-sync:latest

I've set it up in Docker Hub here: https://hub.docker.com/repository/docker/lastelement21/emby-sync

It's on Github here: https://github.com/cameronurnes/emby-sync

 

Todo:  Local user support, unpause when room leader unpauses instead of waiting/resyncing, test more clients, Chromecast as follower,  adjust session cleanup task, try out using session info from api for unpause during sync instead of timers, consider using stored user access keys instead of API key

suCU09k.png

Edited by lastelement21
  • Like 4
Link to comment
Share on other sites

chef
On 8/17/2020 at 5:12 AM, lastelement21 said:

Ok, the prototype is working!  I'm relatively awful at coding and have never done frontend at all, so I'm sure plenty of things could be done better, but it works.  It's meant to be run by an emby server owner, as it requires a server api key.  It essentially reads the room leader's location, jumps room members to 10-ish seconds ahead of the room leader, and finally unpauses on queue.

I tested it with 4 web clients and the android client all following my Chromecast within a couple seconds at once (total of 6 sessions).  Clients may join any existing room, or create a new room.  If a room does not have a leader when a client joins, it automatically becomes the leader.  This can be overridden at any time.  Only the client's own sessions are visible.

If any client falls out of sync/halts playback, it resyncs immediately.  You must log out of Emby Sync, or "leave room" to stop syncing.  Sessions offline for more than 10 minutes will automatically stop syncing.  To force a resync, rewind a bit on the out of sync follower.

Emby clients only update the server with status info every second or so, so sync is only possible within a couple seconds in either direction. (Close enough for watching with friends online for sure!)  CHROMECAST CANNOT ACT AS FOLLOWER FOR NOW, however, it can lead.  You can also set the device casting to the chromecast to follow, as a workaround.  You must use Incognito tabs if you want to test multiple players in the same browser.  Running more than one player in the same browser in normal mode has unpredictable results, since the clients in the same browser share session id (same reason the dashboard is unreliable in this state).

To try it out: Easiest is to just fire up the container and point your browser at https://127.0.0.1:5000 and log in using your Emby Connect username. (The Emby password is not stored, it is used against the emby API for auth only)  Sorry, no local only emby accounts or emby email as logins right now.  Only your clients which have been active within the last five minutes will be visible, if you don't see any clients to select, make sure the client is open, logged in, and recently interacted with.

docker run --name emby-sync -e EMBY_SERVER='<emby_url>' -e SECRET_KEY='<emby_server_api_key>' -p 5000:5000 lastelement21/emby-sync:latest

I've set it up in Docker Hub here: https://hub.docker.com/repository/docker/lastelement21/emby-sync

It's on Github here: https://github.com/cameronurnes/emby-sync

 

Todo:  Local user support, unpause when room leader unpauses instead of waiting/resyncing, test more clients, Chromecast as follower,  adjust session cleanup task, try out using session info from api for unpause during sync instead of timers, consider using stored user access keys instead of API key

suCU09k.png

This is very interesting.

Link to comment
Share on other sites

Has anyone tested this with Roku? 

The Roku will refuse to accept incoming requests for DIAL/ECP on remote connections due to Roku firmware changes since 8.0. The Roku and Emby server must be on the same local network for DIAL/ECP to correctly function.

Link to comment
Share on other sites

lastelement21

@speechles Not that I know of, yet!  Would love to hear if it works or not on those.  Took a break to hang out with a couple friends for a day, when I get home later I'll pester my friend with a Roku to try it.

Link to comment
Share on other sites

I haven't read the whole thread but know the concept pretty well.  I've got a "few" clients I could use to help test if needed including Web, Roku, Xbox, Chrome cast, Fire TV, Android TV on different devices, Android Mobile, Theater, Samsung, Kodi and probably something else I didn't think of.

Hit me up if needed.

On 8/16/2020 at 12:30 PM, chef said:

I think... in most cases ...  if a user post to the fourm with a "delevoper" or "administratior" tag under their name, then that user is part of the team. However, there are quite a few people who have spent alot of time here and have been an integral part of the development of Emby. 😃

There are other titles as well such as "Moderator" & "Support" <sniff, sniff> :),  but there are others that are key to many things as well without any of those tags and if you didn't know better would never know if you didn't read specific sections of the forums.  Wouldn't be a bad thing to have a "Team Emby" type thing for anyone involved as part of Emby or a different color (if possible) or something like that.

  • Like 2
Link to comment
Share on other sites

Garbui85
On 17/08/2020 at 19:12, lastelement21 said:

Ok, the prototype is working!  I'm relatively awful at coding and have never done frontend at all, so I'm sure plenty of things could be done better, but it works.  It's meant to be run by an emby server owner, as it requires a server api key.  It essentially reads the room leader's location, jumps room members to 10-ish seconds ahead of the room leader, and finally unpauses on queue.

I tested it with 4 web clients and the android client all following my Chromecast within a couple seconds at once (total of 6 sessions).  Clients may join any existing room, or create a new room.  If a room does not have a leader when a client joins, it automatically becomes the leader.  This can be overridden at any time.  Only the client's own sessions are visible.

If any client falls out of sync/halts playback, it resyncs immediately.  You must log out of Emby Sync, or "leave room" to stop syncing.  Sessions offline for more than 10 minutes will automatically stop syncing.  To force a resync, rewind a bit on the out of sync follower.

Emby clients only update the server with status info every second or so, so sync is only possible within a couple seconds in either direction. (Close enough for watching with friends online for sure!)  CHROMECAST CANNOT ACT AS FOLLOWER FOR NOW, however, it can lead.  You can also set the device casting to the chromecast to follow, as a workaround.  You must use Incognito tabs if you want to test multiple players in the same browser.  Running more than one player in the same browser in normal mode has unpredictable results, since the clients in the same browser share session id (same reason the dashboard is unreliable in this state).

To try it out: Easiest is to just fire up the container and point your browser at https://127.0.0.1:5000 and log in using your Emby Connect username. (The Emby password is not stored, it is used against the emby API for auth only)  Sorry, no local only emby accounts or emby email as logins right now.  Only your clients which have been active within the last five minutes will be visible, if you don't see any clients to select, make sure the client is open, logged in, and recently interacted with.

docker run --name emby-sync -e EMBY_SERVER='<emby_url>' -e SECRET_KEY='<emby_server_api_key>' -p 5000:5000 lastelement21/emby-sync:latest

I've set it up in Docker Hub here: https://hub.docker.com/repository/docker/lastelement21/emby-sync

It's on Github here: https://github.com/cameronurnes/emby-sync

 

Todo:  Local user support, unpause when room leader unpauses instead of waiting/resyncing, test more clients, Chromecast as follower,  adjust session cleanup task, try out using session info from api for unpause during sync instead of timers, consider using stored user access keys instead of API key

suCU09k.png

@lastelement21 Just spun up a docker on Unraid, as far as I can tell install was successful and I can access the WebUI. However, login is unsuccessful and returns a internal user error. Emby Server shows a login from emby-sync. Docker logs only show:

2020-08-26 11:53:41,582] ERROR in app: Exception on /login

Any thoughts or options to debug, really keen to test further. 

Garath

Link to comment
Share on other sites

lastelement21
9 hours ago, Garbui85 said:

@lastelement21 Just spun up a docker on Unraid, as far as I can tell install was successful and I can access the WebUI. However, login is unsuccessful and returns a internal user error. Emby Server shows a login from emby-sync. Docker logs only show:

2020-08-26 11:53:41,582] ERROR in app: Exception on /login

Any thoughts or options to debug, really keen to test further. 

Garath

Hey there, are you logging in using the emby connect username/password combo?  Local usernames and emby connect email addresses won't allow you to log in right now.

Link to comment
Share on other sites

Garbui85
On 27/08/2020 at 07:21, lastelement21 said:

Hey there, are you logging in using the emby connect username/password combo?  Local usernames and emby connect email addresses won't allow you to log in right now.

Hi

Yes I was, however realised the connect account was not active against the user. Once this link was active everything has worked, and is really working well. So far I've tried with an android phone (note10)and browser, multiple browsers and thrown in iPad and Fire tablet and all working as indicated. 

My intended use case is for multiroom viewing so the few seconds of delay every now and then isnt an issue for me at all, and I see diminishing returns in trying to get a perfect sync IMHO. 

If you want to create a new thread more than happy to talk in detail about a few things I would recommend after my testing if its helpful? Would really love to see the Devs input as well and roll into a premier feature, well done!

Garath

Link to comment
Share on other sites

lastelement21
1 hour ago, Garbui85 said:

Hi

Yes I was, however realised the connect account was not active against the user. Once this link was active everything has worked, and is really working well. So far I've tried with an android phone (note10)and browser, multiple browsers and thrown in iPad and Fire tablet and all working as indicated. 

My intended use case is for multiroom viewing so the few seconds of delay every now and then isnt an issue for me at all, and I see diminishing returns in trying to get a perfect sync IMHO. 

If you want to create a new thread more than happy to talk in detail about a few things I would recommend after my testing if its helpful? Would really love to see the Devs input as well and roll into a premier feature, well done!

Garath

Great to hear that it works on those devices too!  Sure feedback is great.  A new thread is fine, or can just do it here.  Have been busy with all kinds of other stuff so haven't poked at it in a week or so, but I def have some things I'd like to add/change, and I'd love feedback.

Link to comment
Share on other sites

lastelement21

Things that I deifnitely need to add:  room member list/status either visible to everyone or at least visible to room leader.  Nice to see that everyone is set before pressing play.

Link to comment
Share on other sites

Garbui85
1 hour ago, lastelement21 said:

Things that I deifnitely need to add:  room member list/status either visible to everyone or at least visible to room leader.  Nice to see that everyone is set before pressing play.

A couple of things I have found so far:

- the list of available players doesnt seem to refresh when new players are active, a both in to force a refresh player list would be useful. 

- sync seems to stay at 10sec delay on Android tv, where as other players start to catch up. Resuming from pause hasn't worked well on Android tv player, it stops and reloads seemingly to restart playback. 

Some things which would be useful:

- use the emby server notifications to notify of when a player is added or removed from a room. 

- a quick dashboard or similiar showing active rooms and players synced to that room. 

- ability for any player to request or control transport controls. Ie. Play/pause. Or hand control to maybe?

- show the player name that is leader, not the user. Or if that can't be done, show user 'X' on player 'Y' as leader. 

- I couldnt connect to a player with active content, this may be by design but would be ideal to select an active player, it pauses, becomes the leader, other players are added to a room with it and then playback commences. 

Thoughts for development:

- I know its early dev, but as it progresses dont think that the UI has to be ridiculously complex (ie. synclounge) the simple actions you have works well. You dont have a heap of steps to get a result which is great. 

- my use case is multiroom, for playback with friends and family I have the "other X media server" which is what they use (mainly as its SSO means I can integrate a bunch of other related apps ;) ).Its invite process is ok, but clumsy. I know you mentioned it above but thinking about how that might best be used will be important I think. 

- I would be keen to try with a proxy server and FQDN, I use letsencrypt in docker. 

- Somewhere down the track a REST api or otherwise so that integration with Home Assustant could be used with a UI card. Grouping players and controlling them as zoned media endpoints from a single UI is the goal for me. 

Again, great work, cheers. 

Link to comment
Share on other sites

Hi. You should probably create a topic for your tool in our Tools and Utilities user section.

Thanks.

  • Like 1
Link to comment
Share on other sites

lastelement21
On 8/28/2020 at 5:14 AM, ebr said:

Hi. You should probably create a topic for your tool in our Tools and Utilities user section.

Thanks.


Ok, anyone helping me out with this, I have a dedicated thread here: 

 

  • Like 1
Link to comment
Share on other sites

  • 3 months later...
yaksplat

Well, here's another vote for multicast support to multiple clients.  This would open up an implementation for whole house audio.  You could have a client per zone (headless) and be able to push audio to multiple zones from a single phone client.  

In theory, I could create a headless raspberry pi emby client for each zone. This array of a dozen emby client pi's would act as individual inputs to a 12 zone amp.  The array could sit right with the amplifier in the server room.  At that point, bridging zones could be taken care of by the emby server doing multicast.

Link to comment
Share on other sites

  • 1 month later...
MBSki

@Luke Any chance we can get this in the next major release? I'm using Plex right now, but it just isn't as reliable as Emby. I'd love to use Emby to watch movies with my family given we're not getting the vaccine anytime soon. At least not in the US.

  • Like 1
Link to comment
Share on other sites

1 hour ago, mbarylski said:

given we're not getting the vaccine anytime soon. At least not in the US.

Don't want to side track the thread but, first shot on 1/3 and 2nd shot on 2/1.
Have you checked with your doctor,VA or local hospital to see if they have it available yet?

Link to comment
Share on other sites

MBSki
1 minute ago, cayars said:

Don't want to side track the thread but, first shot on 1/3 and 2nd shot on 2/1.
Have you checked with your doctor,VA or local hospital to see if they have it available yet?

LOL, yea, your lucky. Definitely a sidetrack, but yea, tough to get it in my county at the moment and even if I did, still nothing for my kids so Grandparents aren't coming to visit anytime soon.

  • Like 1
Link to comment
Share on other sites

  • 7 months later...
BillOatman

If people are looking for how it might work in Emby, apparently Jellyfin has something called SyncPlay that is supposed to do this,  I don't have Jellyfin installed anywhere so I have no idea how well this feature works, but since Jellyfin itself started from old Emby code, implementing it the same way might be possible.

Link to comment
Share on other sites

quackpipe
33 minutes ago, BillOatman said:

If people are looking for how it might work in Emby, apparently Jellyfin has something called SyncPlay that is supposed to do this,  I don't have Jellyfin installed anywhere so I have no idea how well this feature works, but since Jellyfin itself started from old Emby code, implementing it the same way might be possible.

Thanks for this. I've not used Jellyfin either but I'm messing with the demo now. The interface seems so similar to Emby its almost like they're built on the same software. 

Link to comment
Share on other sites

On 9/17/2021 at 3:56 PM, quackpipe said:

Thanks for this. I've not used Jellyfin either but I'm messing with the demo now. The interface seems so similar to Emby its almost like they're built on the same software. 

That's because Jellyfin is port of an older version of Emby!

Link to comment
Share on other sites

yaksplat

Sync play is similar to multicast, but not quite.  Sync play could be off by milliseconds or even seconds and no one would really know, whereas multicast needs to be broadcast 100% dead on or it's disasterous between zones.

Link to comment
Share on other sites

lastelement21
14 minutes ago, yaksplat said:

Sync play is similar to multicast, but not quite.  Sync play could be off by milliseconds or even seconds and no one would really know, whereas multicast needs to be broadcast 100% dead on or it's disasterous between zones.

That's similar to what my multi-user sync (thread linked above) does.  Isn't *perfectly* in sync, but a second or two off is fine for watching together online.

  • Like 1
Link to comment
Share on other sites

castillo92
17 hours ago, lastelement21 said:

That's similar to what my multi-user sync (thread linked above) does.  Isn't *perfectly* in sync, but a second or two off is fine for watching together online.

I agree with you, Sync Play is enough for see a show with family or friends.

I tried this week this function and works great

Link to comment
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...