HawkXP71 112 Posted March 15, 2025 Posted March 15, 2025 I have someone who uses a ROKU SG to watch videos. unfortunately, he often watches TV shows but when the show goes to credits, he turns of the TV. The issue is, the Roku seems to pause the show not stop it. Then the user will sit there int he now playing state for hours (sometimes days) till he watches the next episode. Is there any setting, to say "stop sessions that are idle for over XXX minutes" ?
Gilgamesh_48 1240 Posted March 15, 2025 Posted March 15, 2025 This has been asked for in various forms for quite a while but, so far, Emby has apparently done nothing toward fixing the problem. From what I understand there are a few different clients that produce the problem but they all leave active sessions that do not easily go away. Yours is the first report I have seen that says the phantom sessions go away after the misbehaving client plays something else. One thing: When my TV is turned off my Roku acts exactly like the home key is pressed. That is it exits directly from the Emby app without Emby knowing that the exit is happening. The home remote button is supposed to override everything an app is doing and get out as quickly as possible. I doubt that Emby has any control of the nature of the exit or any way of knowing an exit has happened so your idea of a timer of some kind is, probably, the best answer. But there is a problem with that in that some people will intentionally leave programs paused for a very long time. On the Roku this is handled by the fact that Roku requires Emby to exit after about a hour or so of inactivity. But not all clients do that and many, maybe most and maybe all, Android clients can stay pause as long as there is power. I see many many problems with the idea of a time out but i also see few other solutions except for a "kill switch" implemented at the server that would disconnect any sessions if the admin tells it to. But that has problems as well. I believe the "best' solution would be an admin configurable time out on the server that can be set anywhere from 30 mins. to infinity. Even that has potential problems but I think it would be workable, maybe.
Luke 42078 Posted March 15, 2025 Posted March 15, 2025 HI there, can we please look at a specific example? How to Report a Problem Thanks !
HawkXP71 112 Posted March 15, 2025 Author Posted March 15, 2025 Wasnt sure if it was a bug.. As you can see from the screen shot, the the user watched the episode yesterday at 1040pm, finished later, but the session is still open 24 hours later. I also attached both yesterdays and todays log. Thanks ~Scott embyserver_0313.txt embyserver_0314.txt
HawkXP71 112 Posted March 15, 2025 Author Posted March 15, 2025 (edited) 4 hours ago, Gilgamesh_48 said: This has been asked for in various forms for quite a while but, so far, Emby has apparently done nothing toward fixing the problem. From what I understand there are a few different clients that produce the problem but they all leave active sessions that do not easily go away. Yours is the first report I have seen that says the phantom sessions go away after the misbehaving client plays something else. One thing: When my TV is turned off my Roku acts exactly like the home key is pressed. That is it exits directly from the Emby app without Emby knowing that the exit is happening. The home remote button is supposed to override everything an app is doing and get out as quickly as possible. I doubt that Emby has any control of the nature of the exit or any way of knowing an exit has happened so your idea of a timer of some kind is, probably, the best answer. But there is a problem with that in that some people will intentionally leave programs paused for a very long time. On the Roku this is handled by the fact that Roku requires Emby to exit after about a hour or so of inactivity. But not all clients do that and many, maybe most and maybe all, Android clients can stay pause as long as there is power. I see many many problems with the idea of a time out but i also see few other solutions except for a "kill switch" implemented at the server that would disconnect any sessions if the admin tells it to. But that has problems as well. I believe the "best' solution would be an admin configurable time out on the server that can be set anywhere from 30 mins. to infinity. Even that has potential problems but I think it would be workable, maybe. If someone has paused for 30 minutes. Disconnecting the playback and popping a message to the user returning them to the media's page saying "Due to exceeding the timeout, playback was stopped please hit continue button" to me wouldnt be a problem, in fact I think netflix does the same thing (or used to) Edited March 15, 2025 by HawkXP71
Gilgamesh_48 1240 Posted March 15, 2025 Posted March 15, 2025 7 hours ago, HawkXP71 said: If someone has paused for 30 minutes. Disconnecting the playback and popping a message to the user returning them to the media's page saying "Due to exceeding the timeout, playback was stopped please hit continue button" to me wouldnt be a problem, in fact I think netflix does the same thing (or used to) If netflix does it then there is probably something wrong with it. However I know of at least two people that routinely leave media paused for well over 30 minutes. They listen to a number of audiobooks and extended pauses are not either unusual or unexpected and since they listen without screen interaction forcing and forcing an exit would be very inconvenient as they would have to get to a TV and turn it on and then navigate to the proper book before they could restart the book. They do not use Rokus for that as Roku forces any app to exit after a time of inactivity. But Android devices do not do that so they can listen through their whole house audio system and pause and restart the playback from anywhere in their house. They have, often, left a book paused overnight and they simply resume playback when they awaken. An automatic exit would be unnecessarily intrusive. However if it were an optional setting it would be good but if it were forced on everybody it would be pretty horrible. I do the same as my friends for my audiobooks except i do not use Emby but rather i use MediaMonkey for all audio playback. That solution will not work for all people as it requires some technical maintenance that is beyond many folk's abilities. I believe a configurable time out for inactivity would be good but a forced one would be very bad. It has forced a number of people to abandon Roku.
pwhodges 2012 Posted March 15, 2025 Posted March 15, 2025 I don't see why there can't be a keep-alive handshake between the server and the client every few minutes while the server thinks the client is playing. Then the server can trivially tell that the client has gone away, not merely paused. Paul 3
HawkXP71 112 Posted March 15, 2025 Author Posted March 15, 2025 3 hours ago, Gilgamesh_48 said: If netflix does it then there is probably something wrong with it. However I know of at least two people that routinely leave media paused for well over 30 minutes. They listen to a number of audiobooks and extended pauses are not either unusual or unexpected and since they listen without screen interaction forcing and forcing an exit would be very inconvenient as they would have to get to a TV and turn it on and then navigate to the proper book before they could restart the book. They do not use Rokus for that as Roku forces any app to exit after a time of inactivity. But Android devices do not do that so they can listen through their whole house audio system and pause and restart the playback from anywhere in their house. They have, often, left a book paused overnight and they simply resume playback when they awaken. An automatic exit would be unnecessarily intrusive. However if it were an optional setting it would be good but if it were forced on everybody it would be pretty horrible. I do the same as my friends for my audiobooks except i do not use Emby but rather i use MediaMonkey for all audio playback. That solution will not work for all people as it requires some technical maintenance that is beyond many folk's abilities. I believe a configurable time out for inactivity would be good but a forced one would be very bad. It has forced a number of people to abandon Roku. My friend is using a TCL TV with roku. And using the roku emby app. But, in even in the audio book case, pausing the playback for over 30 minutes, to me the app should be put to sleep. Whatever the os does to wake sleeping apps should occur when you go back to it. Audio book or video....
HawkXP71 112 Posted March 15, 2025 Author Posted March 15, 2025 Some more data. The client is using a TCL TV with built in roku. Installing roku from the Emby store. When the show is over, he shuts the TV off. He doesn't pause the show at all. This definately seems like a bug in the Emby client app on roku
ebr 16184 Posted March 15, 2025 Posted March 15, 2025 2 hours ago, pwhodges said: I don't see why there can't be a keep-alive handshake between the server and the client every few minutes while the server thinks the client is playing. Then the server can trivially tell that the client has gone away, not merely paused. Paul There is. 41 minutes ago, HawkXP71 said: The client is using a TCL TV with built in roku. Installing roku from the Emby store. When the show is over, he shuts the TV off. He doesn't pause the show at all. This definately seems like a bug in the Emby client app on roku When you kill the power to the TV the app is not given any opportunity to do anything - it is just terminated abruptly. The same thing will happen if you press the "home" button on the remote while playing something. This is just the way the Roku system is designed due to the fact that it is not multi-task oriented - meaning only one app can run at once. Therefore, it is up to the server to determine that the app has "disappeared" after some period of time. It has logic to do this but, suffice it to say, that Emby is a very complex system that has to take a lot of different scenarios into account and there are obviously still some holes in this logic in some edge situations. 1
HawkXP71 112 Posted March 15, 2025 Author Posted March 15, 2025 16 minutes ago, ebr said: There is. When you kill the power to the TV the app is not given any opportunity to do anything - it is just terminated abruptly. The same thing will happen if you press the "home" button on the remote while playing something. This is just the way the Roku system is designed due to the fact that it is not multi-task oriented - meaning only one app can run at once. Therefore, it is up to the server to determine that the app has "disappeared" after some period of time. It has logic to do this but, suffice it to say, that Emby is a very complex system that has to take a lot of different scenarios into account and there are obviously still some holes in this logic in some edge situations. To clarify he is not cutting power, he is turning off the TV. Im not sure what the tv tells roku of course.
Gilgamesh_48 1240 Posted March 15, 2025 Posted March 15, 2025 42 minutes ago, HawkXP71 said: To clarify he is not cutting power, he is turning off the TV. Im not sure what the tv tells roku of course. Turning the TV off is, for anything connected to the HDMI, exactly like killing the power with the exception that the power part of HDMI stays active. the TV does nothing so the server never gets notified that the client is gone. I do NOT want any automatic disconnect no matter how long the idle period is unless it is configurable by the admin of the server. I almost stopped using Rokus because of their stupid requirement of requiring an exit if an app is idle for some time. But I dislike the Android interface and devices so much that I have mostly stayed with Roku. To me a user that does not at least press home or back after a show ends is undeserving of using a server that they do not own. I would tell that user that if the bad/stupid behavior continues they would lose access. Inconsiderate users is one of the many reasons I do not allow any access to my server except locally. 1
HawkXP71 112 Posted March 15, 2025 Author Posted March 15, 2025 4 minutes ago, Gilgamesh_48 said: Turning the TV off is, for anything connected to the HDMI, exactly like killing the power with the exception that the power part of HDMI stays active. the TV does nothing so the server never gets notified that the client is gone. I do NOT want any automatic disconnect no matter how long the idle period is unless it is configurable by the admin of the server. I almost stopped using Rokus because of their stupid requirement of requiring an exit if an app is idle for some time. But I dislike the Android interface and devices so much that I have mostly stayed with Roku. To me a user that does not at least press home or back after a show ends is undeserving of using a server that they do not own. I would tell that user that if the bad/stupid behavior continues they would lose access. Inconsiderate users is one of the many reasons I do not allow any access to my server except locally. I'm not as authoritarian with the use. I just turn the TV off. And it disconnects as it should. If the TV is turned off you have disconnected. There is no hdmi here though. It's a roku TV, I could see you saying the TV the roku is playing on via hdmi shouldn't disconnect. But the appliance is the TV not a roku box.
Gilgamesh_48 1240 Posted March 15, 2025 Posted March 15, 2025 I am done fighting about this. I have my views and users that misbehave as you describe are undeserving of being allowed access. Also the signal the TV gets is just like connected via HDMI so Roku does not and cannot know what the status of the rest of the TV is. Automatic disconnects, without admin action, are just something I detest and will avoid if at all possible. If this gets implemented i REALLY hope Emby makes it a choice instead of forcing it on anybody's server. I, for one, have no interest at all in automatic disconnects. But, as an admin, I think i should be able to kill any user session I want.
speechles 2055 Posted March 15, 2025 Posted March 15, 2025 (edited) 1 hour ago, Gilgamesh_48 said: Also the signal the TV gets is just like connected via HDMI so Roku does not and cannot know what the status of the rest of the TV is. When a Roku is connected via HDMI and the TV is turned off (or the tuner is used to change channels or switch inputs) the app knows this occured. The app can tell it is no longer the active source. There is no stranded playback when this happens. The playback will end. The server is notified you have stopped playback. There is no issue. All of this assumes HDMI-CEC is behaving correctly and the HDMI chain is all detected accurately. If HDMI-CEC is disabled on the TV or the TV does not support HDMI-CEC the app cannot detect the active source has changed. A RokuTV is like a TV/VCR combo unit. When you turn off the RokuTV it turns off the Roku. Playback ends because the app is forcefully killed as the TV turns off itself and the Roku. But the app never signaled to the server what was happening. It has now stranded the playback. If this is using ffmpeg it will also strand the ffmpeg process. If you turn off the RokuTV during playback or when the user of any Roku model uses the home button during playback the issue occurs. The session is stranded and the server needs to then intervene. The server does understand when a user has paused it is different than a stranded session. When a user pauses and then exits their session by turning off the RokuTV it might be an issue. The server has the session in a paused state instead of playing. Edited March 15, 2025 by speechles 1
Gilgamesh_48 1240 Posted March 15, 2025 Posted March 15, 2025 5 minutes ago, speechles said: When a Roku is connected via HDMI and the TV is turned off (or the tuner is used to change channels or switch inputs) the app knows this occured. The app can tell it is no longer the active source. There is no stranded playback when this happens. The playback will end. The server is notified you have stopped playback. There is no issue. A RokuTV is like a TV/VCR combo unit. When you turn off the RokuTV it turns off the Roku. Playback ends because the app is forcefully killed as the TV turns off itself and the Roku. But the app never signaled to the server what was happening. It has now stranded the playback. If this is using ffmpeg it will also strand the ffmpeg process. If you turn off the RokuTV during playback or when the user of any Roku model uses the home button during playback the issue occurs. The session is stranded and the server needs to then intervene. The server does understand when a user has paused it is different than a stranded session. When a user pauses and then exits their session by turning off the RokuTV it might be an issue. The server has the session in a paused state instead of playing. I stand corrected. I did not know that Roku TVs behaved so stupidly. This points to yet another reason why "Smart" TVs are so stupid. 1
yocker 1248 Posted March 15, 2025 Posted March 15, 2025 From some limited testing i just did. For me browsers that idle gets their connection terminated after one minute. Emby apps gets terminated after 4 minutes. There are situations where clients don't get terminated, it's seems to mostly happen when people just turn off the TV or change input away from the client without stopping it first. If they pause the video everything works as it should. When they hang it's specially annoying when the client was transcoding as the transcoding just keeps on going and even when all has been transcoded the GPU will not go back to power save mode. I had a little plugin that i made at one point that would terminate idle/stuck clients, sadly never got it to work very reliably, specially video stuck with active transcoding were a problem. Bet some competent coder (i suck at it ) could make a better plugin relatively fast.
Luke 42078 Posted March 16, 2025 Posted March 16, 2025 On 3/15/2025 at 2:11 AM, HawkXP71 said: Wasnt sure if it was a bug.. As you can see from the screen shot, the the user watched the episode yesterday at 1040pm, finished later, but the session is still open 24 hours later. I also attached both yesterdays and todays log. Thanks ~Scott embyserver_0313.txt 1.91 MB · 0 downloads embyserver_0314.txt 1.91 MB · 0 downloads Hi, please try removing these plugins: 2025-03-11 20:51:23.845 Info App: Loading AutoCollections, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null from C:\Emby-Server\programdata\plugins\AutoCollections.dll 2025-03-11 20:51:23.845 Info App: Loading DiskSpace, Version=1.0.6.4, Culture=neutral, PublicKeyToken=null from C:\Emby-Server\programdata\plugins\DiskSpace.dll 2025-03-11 20:51:23.845 Info App: Loading Emby.DataExplorer2, Version=4.8.2.0, Culture=neutral, PublicKeyToken=null from C:\Emby-Server\programdata\plugins\Emby.DataExplorer2.dll 2025-03-11 20:51:23.845 Info App: Loading Emby.DiagnosticsPlugin, Version=4.8.0.80, Culture=neutral, PublicKeyToken=null from C:\Emby-Server\programdata\plugins\Emby.DiagnosticsPlugin.dll 2025-03-11 20:51:23.845 Info App: Loading playback_reporting, Version=2.1.0.5, Culture=neutral, PublicKeyToken=null from C:\Emby-Server\programdata\plugins\playback_reporting.dll 2025-03-11 20:51:23.845 Info App: Loading statistics, Version=3.4.1.0, Culture=neutral, PublicKeyToken=null from C:\Emby-Server\programdata\plugins\Statistics.dll Then restart the server and see how things compare. Thanks.
ebr 16184 Posted March 16, 2025 Posted March 16, 2025 19 hours ago, HawkXP71 said: To clarify he is not cutting power, he is turning off the TV. Hi. I believe this has already been explained but, in your case, the Roku is IN the TV so turning off the TV is turning off the Roku. The app gets no warning. It is just abruptly terminated - the same as if you had yanked the cord from the wall. Still, the server should be able to discover and handle this situation properly...
HawkXP71 112 Posted March 17, 2025 Author Posted March 17, 2025 11 hours ago, ebr said: Hi. I believe this has already been explained but, in your case, the Roku is IN the TV so turning off the TV is turning off the Roku. The app gets no warning. It is just abruptly terminated - the same as if you had yanked the cord from the wall. Still, the server should be able to discover and handle this situation properly... While that may be true, and I will admit I havent tested the theory. I'm not convinced it's true for every TV. Only reason I say that, is I have turned off my Sony Android TV, and then turned it back in to the exact spot, and the app seemed to come out of sleep. Maybe it was android vs roku. Or just the TV. But since most TVs only go into standby mode who knows.
yocker 1248 Posted March 17, 2025 Posted March 17, 2025 2 hours ago, HawkXP71 said: While that may be true, and I will admit I havent tested the theory. I'm not convinced it's true for every TV. Only reason I say that, is I have turned off my Sony Android TV, and then turned it back in to the exact spot, and the app seemed to come out of sleep. Maybe it was android vs roku. Or just the TV. But since most TVs only go into standby mode who knows. I can sort of back you up. If i turn off my Android TV with the Emby app running playing a video theres a small chance that the sound will just keep going while the TV should be and normally is turned off. 1
ebr 16184 Posted March 17, 2025 Posted March 17, 2025 11 hours ago, HawkXP71 said: I have turned off my Sony Android TV, Android is designed as a multi-tasking OS. Multiple apps can run in the background and, therefore, there are mechanisms built in that will notify an app when it is being asked to either shut down or move to the background. Roku OS has none of this.
HawkXP71 112 Posted March 17, 2025 Author Posted March 17, 2025 1 hour ago, ebr said: Android is designed as a multi-tasking OS. Multiple apps can run in the background and, therefore, there are mechanisms built in that will notify an app when it is being asked to either shut down or move to the background. Roku OS has none of this. Understood. My only concern here is the difference between an external roku, and a roku TV. However I'm feeling that there needs to be some sort of keep alive/still alive polling by the server to some clients.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now