Jump to content

ServerWMC Not Deleting Streams No Longer in Use


theniteow1
Go to solution Solved by theniteow1,

Recommended Posts

theniteow1

Yeah, good point.  The prime-time view window should be a way to combat streams being left open by emby, since outside this time window streams will be forced closed if they have run longer then the time you configure.    I'm confused... Are you saying it is working just the opposite?  Can you post logs for this?

 

Just curious: why do you have the settings set so that streams are never auto-closed late at night?   That's the opposite of the way I would expect.

 

LOL, yeah you'd think @@krustyreturns.  My wife likes to keep the TV on at night as kind of a night light. :/  That's why I set it during those times, so the stream doesn't shut off on her, then I have to hear her complain... lol  Here are the logs and a screen shot of ServerWMC.  As of right now, no one is watching television, but yet there are two streams running still.

 

56967fea7af9e_ServerWMC01132016.png

Link to comment
Share on other sites

krustyreturns

It looks like the stream killing method is not working for some reason.  Let me see what is going on, I'll get back to you.

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

krustyreturns

Wait a minute, haven't you just not waited long enough?  Your log only goes to:

2016/01/13 09:47:16.433 ...

 

But the auto-stream kill doesn't happen until after 10AM according to your settings. 

Link to comment
Share on other sites

theniteow1

Wait a minute, haven't you just not waited long enough?  Your log only goes to:

2016/01/13 09:47:16.433 ...

 

But the auto-stream kill doesn't happen until after 10AM according to your settings. 

 

Hey @@krustyreturns Sorry, that might be an old log, but maybe I spoke too soon.  It looks like the stream did delete at 10:27 am.  Would have expected sooner.  Sorry, if I wasted your time:

 

2016/01/13 10:27:16.453 MaintenanceTimer> Callback started...
2016/01/13 10:27:16.453 StopRemuxPastMaxRunLenth> PrimeTime: Enabled: True: Start: 11:00 PM, End: 10:00 AM, Current: 10:27 AM, IsPrimeTimeNow: False
2016/01/13 10:27:16.453 StopRemuxPastMaxRunLenth> Calling remux stop on stream 'Live-Remux space: Digital Cable  num: 9', MaxTime: 4 hrs, RunTime: 4.124 hrs
2016/01/13 10:27:16.453 Remux::Stop> stop remux requested
2016/01/13 10:27:16.458 WtvToPesDemuxer::Parse> Guid header detects stream end
2016/01/13 10:27:16.458 Pass Type: 'Remux':
2016/01/13 10:27:16.458  >  WtvToPesDemuxer::Parse> total guid headers processed: 8,104,627
2016/01/13 10:27:16.458  >  WtvToPesDemuxer::Parse> total data packets processed: 1,152,797
2016/01/13 10:27:16.988 Remux> ENDED, >>>>>>>>>> Run Time: 247.36 min <<<<<<<<<<
2016/01/13 10:27:16.993 PurgeInactiveClients> error: closing stream[KUSAHD-9:34229], client is not reading.
2016/01/13 10:27:16.993 LiveRemuxStream::Close> remux thread had already stopped
2016/01/13 10:27:16.993 warning: 2 ts files are streaming at remux shutdown
2016/01/13 10:27:17.043 DeleteTS> ts file size: 25,206,095,872
2016/01/13 10:27:17.608 DeleteTS> ts file deleted: E:\Recorded TV\TempSWMC\LiveTV_Emby^MCSERVER^6_Digital Cable_9_2016_01_13_06_19_51.ts
2016/01/13 10:27:17.658 DeleteTS> ts file size: 11,098,423,296
2016/01/13 10:27:18.443 DeleteTS> ts file deleted: E:\Recorded TV\TempSWMC\LiveTV_Emby^MCSERVER^10_Digital Cable_9_2016_01_13_08_37_47.ts
2016/01/13 10:27:18.443 LiveRemuxStream::Close> attempted to delete multiple ts files
2016/01/13 10:27:18.443 RecordToWTV::Close> isPassive is False => COM recorder will be stopped
2016/01/13 10:27:18.533 LiveRemuxStream::Close> wtv closed successfully
2016/01/13 10:27:18.583 LiveRemuxStream::Close> wtv file size: 25,031,344,128 (0x5D3FC0000)
2016/01/13 10:27:18.588 LiveRemuxStream::Close> wtv file deleted: E:\Recorded TV\TempSWMC\LiveTV_Emby^MCSERVER^6_Digital Cable_9_2016_01_13_06_19_51.wtv
2016/01/13 10:27:18.588 LiveRemuxStream::Close> closed in 1.60 sec
2016/01/13 10:27:18.588 RecordingCache_Refresh> [TimerMaintenance] Cache background refresh started.
2016/01/13 10:27:18.593 TimerCache_Refresh> [TimerMaintenance] Cache background refresh started.
2016/01/13 10:27:18.593 MaintenanceTimer> Callback completed in 2.14 sec.
Link to comment
Share on other sites

krustyreturns

No problem.  It waited until 10:27 because that was when the stream had passed 4 hours in length.  See this line:

 
2016/01/13 10:27:16.453 StopRemuxPastMaxRunLenth> Calling remux stop on stream 'Live-Remux space: Digital Cable  num: 9', MaxTime: 4 hrs, RunTime: 4.124 hrs
Link to comment
Share on other sites

theniteow1

 

No problem.  It waited until 10:27 because that was when the stream had passed 4 hours in length.  See this line:

 
2016/01/13 10:27:16.453 StopRemuxPastMaxRunLenth> Calling remux stop on stream 'Live-Remux space: Digital Cable  num: 9', MaxTime: 4 hrs, RunTime: 4.124 hrs

 

 

Ahh I see.  Ok, very good.  Thanks for your help.

Link to comment
Share on other sites

TheShanMan

Krusty, you may recall my thread (http://emby.media/community/index.php?/topic/29149-live-tv-streams-die-randomly) in which you suggested the problem was the emby android app, but theniteowl thought our problem was the same and told me that the new preview version fixes it.

 

In my case I am chromecasting from emby android (for some reason I get an error if I try to play live tv directly on my android device). Every single time I start casting live tv to my chromecast, 2 streams are opened and only 1 stream closes when I hit stop. I wish I could play directly on my android to see if the problem happens without casting, but hopefully this can get solved anyway.

Link to comment
Share on other sites

theniteow1

Krusty, you may recall my thread (http://emby.media/community/index.php?/topic/29149-live-tv-streams-die-randomly) in which you suggested the problem was the emby android app, but theniteowl thought our problem was the same and told me that the new preview version fixes it.

 

In my case I am chromecasting from emby android (for some reason I get an error if I try to play live tv directly on my android device). Every single time I start casting live tv to my chromecast, 2 streams are opened and only 1 stream closes when I hit stop. I wish I could play directly on my android to see if the problem happens without casting, but hopefully this can get solved anyway.

 

Have you changed ServerWMC to use HTTP instead for stream?  This is what I had to do to get it work.

 

569924feda315_HTTPServerWMC.png

Link to comment
Share on other sites

krustyreturns

@@TheShanMan,

 

It gets confusing because there are two problems that sound a lot a like.  This thread was about a problem that @@theniteow1 found where temporary files (TS files) were getting left locked by serverwmc so they would never deleted.  This happened because - even though emby was properly closing the stream - it was sometimes not closing the file handle that serverwmc had given it.  The fix in this preview release of serverwmc is that it now explicitly closes the file handle and doesn't wait for emby to do it.  That fixes this first problem.

 

There is another problem (which if I remember right, is what your thread was about) where Emby is not sending a close stream command even when the user closes a stream, so serverwmc thinks it needs to keep this stream going.  Its easy to differentiate between the two problems.  In the first problem serverwmc will stop showing the stream as open and close the tuner it was using.  In the second problem, the stream still shows as open and the tuner is still locked up.  This is the problem you are reporting right?

 

theniteowl1 is right that you should be using the http service.  And I use the android mobile app and I don't have a problem and I don't chrome cast (not even sure how this is done, lol).  Maybe the way to pursue your problem is to post the serverwmc log when you are trying to start an android live stream and NOT using chromecast.

Edited by krustyreturns
Link to comment
Share on other sites

TheShanMan

Niteowl, yes I use the http stream. Krusty, I'll try playing from android and capture the log.

 

Unfortunately you had me take my problem to the android forum for them to consider but I can't get anyone to help there. That's not your problem but it's pretty frustrating.

Link to comment
Share on other sites

krustyreturns

I know how it is.  I hate the silent treatment.  I can understand saying: I don't have time - not my problem - fix your shit first - I don't care , or anything really.  But just being ignored is not cool.

  • Like 1
Link to comment
Share on other sites

TheShanMan

Looks like Luke is starting to look at my problem! On a related note, any chance of providing a close stream option in the web interface? I typically won't have direct access to my htpc when a stream gets left open but I can hit the web interface on my phone (that's how I'm doing my testing).

Link to comment
Share on other sites

krustyreturns

Resetting the tuner in the web interface of emby will (eventually) close the stream.  Have you tried that?

Link to comment
Share on other sites

TheShanMan

Cool. Didn't realize that option was there. Immediately closing the stream would be better, but eventually closing is probably generally adequate. Thanks!

Link to comment
Share on other sites

TheShanMan

Maybe the way to pursue your problem is to post the serverwmc log when you are trying to start an android live stream and NOT using chromecast.

 

Sorry for the delay but I just restarted both emby server and serverwmc and tried to play live tv on my android device, resulting in the error message. It doesn't look like there is ANYTHING in the serverwmc log file relating to this as far as I can tell - only startup info. I'm not sure if I need to somehow enable debug logging or if this puts the issue squarely on the android and/or emby server side. FYI it was 2:22 when I tried to play live TV. And also FYI at 2:28 I tried chromecasting live TV using my android in order to capture logs for that problem, so basically anything before 2:25 relates to playing on my phone and anything after 2:25 relates to chromecasting from my phone to my tv. I will also be posting these logs in the android http://emby.media/community/index.php?/topic/29500-not-closing-live-tv-streams/thread for Luke to look into the chromecast problem. If after looking at these logs, you think the problem isn't with serverwmc, I'll take this problem to the android forum too. Thanks!

ServerWMC - Copy.log

server-63589069193 - Copy.txt

Link to comment
Share on other sites

krustyreturns

@@TheShanMan,

 

You are right there is nothing in the log file showing emby doing anything.  But I think that is because of this error in the  serverwmc log:

 

2016/01/22 14:20:55.939 SocketServer> exception: System.Net.Sockets.SocketException (0x80004005): An attempt was made to access a socket in a way forbidden by its access permissions
   at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Bind(EndPoint localEP)
   at ServerWMC.Worker.SocketServer.Start(Int32 port)
I have not seen this error before, but my guess is the port is getting blocked by anti-virus.  Is that possible? 
Link to comment
Share on other sites

TheShanMan

Could that even be the case if the same phone is able to cast live tv to my tv? And live tv works fine in the web browser too. Also note that the exception was before I tried to play TV on my phone so it's more of a startup issue I guess. But to answer your question, I'm pretty sure I don't have AV blocking this. What kind of troubleshooting steps would you like me to perform to diagnose this exception? I'm fairly well versed with networking so don't be afraid to get too technical with me. :)

 

Sounds like I should go ahead and take my inability to play live tv on my phone over to the android forum then?

Link to comment
Share on other sites

krustyreturns

Can you post the serverwmc log again after playing a live tv stream from a web browser?  Please make it a clean log by restarting serverwmc before you do the live stream.  Also it would be better if the web browser was running on a different machine.  Thanks.

Link to comment
Share on other sites

TheShanMan

I blew it last time I posted logs. I didn't realize there were separate log files for the app and for the service so I posted the wrong thing. So let's start over looking at these. I restarted both serverwmc and emby server and at 11:25 I started a web browser stream and ended it at 11:26. Then at 11:27 I tried to play tv on my phone (unsuccessfully as always). So you get 2 for 1 here. Hopefully it's helpful! And thanks for having a look!

server-63589144942 - Copy.txt

ServerWMC_Service - Copy.log

Link to comment
Share on other sites

krustyreturns

Yeah that makes a lot more sense.  Both streams opened fine on the serverwmc side, I can't see any problems.  I don't understand emby logs but there are errors a plenty there.  Hopefully you can get help from the android guys.  If I can help them/you debug something let me know.

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