connection to TV service lost (1 Viewer)

mm1352000

Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    How does the ip and network matter? It's a single seat setup, so database, TV server and client are on the same machine.
    MediaPortal TV literally can't work without a network connection, even on a single-seat setup. This is because the connection between the client and server use remoting calls (I think on port 31456) which depend on a network connection being available and connected. Also, TV Server communicates with the database over TCP/IP and hosts the RTSP streaming server on port 554. TV Server won't start without a network connection...

    In addition I have to mention, that I switched to PowerScheduler++ just the night before and I never had a tv server loss all the time before. I will continue testing, if it's happening again. Until now, the problem was only a one timer.
    Okay.

    Is it possible that the database request was an old one, just before the PowerScheduler hibernated the system and after waking up, it was seen as expired?
    Unlikely I think.

    The best way forward is probably to see if the problem keeps occurring. If you can reproduce then we can check if there is a consistent error that might be causing this.

    mm
     

    alexirion

    MP Donator
  • Premium Supporter
  • February 8, 2010
    170
    12
    50
    St. Georgen im Schwarzwald
    Home Country
    Germany Germany
    Hi mm1352000,

    today a recording, scheduled for 2011-10-19 20.14 didn't work.
    Looking into tvserver_erorr.bak shows:

    (2011-10-19 20:14:21.527343 [scheduler thread(26)]: Exception :TvLibrary.TvException: Unable to start graph
    bei TvLibrary.Implementations.DVB.TvCardDvbBase.RunGraph(Int32 subChannel)
    bei TvLibrary.Implementations.DVB.TvCardDvbBase.DoTune(Int32 subChannelId, IChannel channel, Boolean ignorePMT)
    bei TvLibrary.Implementations.DVB.TvCardDVBS.Tune(Int32 subChannelId, IChannel channel)

    Right before there are follwing errors with the Sql database:

    2011-10-18 23:25:46.323242 [PowerScheduler poll thread(15)]: Exception :Error: DatabaseUnavailableUnclassified
    Gentle.Common.GentleException: The database backend (provider MySQL) could not be reached.
    Check the connection string: Server=mediapc;Database=MpTvDb;User ID=root;Password=MediaPortal;charset=utf8;Connection Timeout=30; ---> MySql.Data.MySqlClient.MySqlException: Reading from the stream has failed. ---> System.IO.IOException: Von der Übertragungsverbindung können keine Daten gelesen werden: Eine vorhandene Verbindung wurde vom Remotehost geschlossen. ---> System.Net.Sockets.SocketException: Eine vorhandene Verbindung wurde vom Remotehost geschlossen
    bei System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
    bei System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
    --- Ende der internen Ausnahmestapelüberwachung ---
    bei System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
    bei System.IO.BufferedStream.ReadByte()
    bei MySql.Data.MySqlClient.MySqlStream.LoadPacket()
    --- Ende der internen Ausnahmestapelüberwachung ---

    The normal PowerScheduler was used(not PS++) and I configured MP to use the network loopback device.

    Trying to go to LiveTV resulted in the well known "Unknown error" message box. After hibernating and resuming TV was working again.

    Can something be read out of the logs what has caused the recording not to work?

    Regards,
    --Alex

    How does the ip and network matter? It's a single seat setup, so database, TV server and client are on the same machine.
    MediaPortal TV literally can't work without a network connection, even on a single-seat setup. This is because the connection between the client and server use remoting calls (I think on port 31456) which depend on a network connection being available and connected. Also, TV Server communicates with the database over TCP/IP and hosts the RTSP streaming server on port 554. TV Server won't start without a network connection...

    In addition I have to mention, that I switched to PowerScheduler++ just the night before and I never had a tv server loss all the time before. I will continue testing, if it's happening again. Until now, the problem was only a one timer.
    Okay.

    Is it possible that the database request was an old one, just before the PowerScheduler hibernated the system and after waking up, it was seen as expired?
    Unlikely I think.

    The best way forward is probably to see if the problem keeps occurring. If you can reproduce then we can check if there is a consistent error that might be causing this.

    mm
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Hi again Alex

    Please take a look at the following log section for the failed recording:

    2011-10-19 01:25:03.550781 [PowerEventThread(9)]: PowerScheduler: Set wakeup timer to wakeup system in 1127,94550781333 minutes
    2011-10-19 20:13:20.503906 [PowerScheduler Waiter(4)]: PowerScheduler: OnResume
    2011-10-19 20:13:21.362304 [PowerEventThread(9)]: TV service PowerEventThread 30
    2011-10-19 20:13:21.362304 [PowerEventThread(9)]: TV service PowerEventThread 30
    2011-10-19 20:13:21.541015 [PowerEventThread(9)]: OnPowerEvent: PowerStatus: ResumeAutomatic
    2011-10-19 20:13:21.541015 [PowerEventThread(9)]: OnPowerEventHandler: PowerStatus: ResumeAutomatic
    2011-10-19 20:13:21.541992 [PowerEventThread(9)]: TvController.OnResume()
    2011-10-19 20:13:21.541992 [PowerEventThread(9)]: Controller: setup HeartBeat Monitor
    2011-10-19 20:13:21.560546 [HeartBeatMonitor(3)]: Controller: Heartbeat Monitor initiated, max timeout allowed is 30 sec.
    2011-10-19 20:13:21.561523 [PowerEventThread(9)]: Scheduler: started
    2011-10-19 20:13:22.343750 [WinController exit thread(10)]: WindowsController: ExitWindows performed, result: True
    2011-10-19 20:13:25.546875 [PowerEventThread(9)]: Scheduler: loaded 6 schedules
    2011-10-19 20:13:25.670898 [PowerEventThread(9)]: Scheduler: thread started.
    2011-10-19 20:13:25.680664 [PowerEventThread(9)]: DiskManagement: started
    2011-10-19 20:13:25.681640 [PowerEventThread(9)]: PowerScheduler: System has resumed automatically from standby
    2011-10-19 20:13:25.681640 [PowerEventThread(9)]: PowerScheduler: System changed from idle state to busy state
    2011-10-19 20:13:25.682617 [PowerEventThread(9)]: OnPowerEvent: PowerStatus: ResumeSuspend
    2011-10-19 20:13:25.682617 [PowerEventThread(9)]: OnPowerEventHandler: PowerStatus: ResumeSuspend
    2011-10-19 20:13:25.682617 [PowerEventThread(9)]: PowerScheduler: System has resumed from standby
    2011-10-19 20:14:11.229492 [scheduler thread(26)]: Scheduler: Time to record ZDF HD 20:14-21:55 Borgia (2/6)
    2011-10-19 20:14:11.230468 [scheduler thread(26)]: Controller: find free card for channel ZDF HD
    2011-10-19 20:14:11.230468 [scheduler thread(26)]: Controller: find card for channel ZDF HD
    2011-10-19 20:14:11.231445 [scheduler thread(26)]: Controller: got 1 tuning details for ZDF HD
    2011-10-19 20:14:11.231445 [scheduler thread(26)]: Controller: channel #1 DVBS:tv:ZDFvision ZDF HD Freq:11362000 ONID:1 TSID:1011 SID:11110 PMT:0x17D4 FTA:True LCN:795 SymbolRate:22000 Modulation:Mod8Psk Polarisation:LinearH InnerFecRate:Rate2_3 DisEqc:None band:Universal Pilot:On RollOff:ThirtyFive
    2011-10-19 20:14:11.232421 [scheduler thread(26)]: Controller: card:1 type:DvbIP cannot tune to channel
    2011-10-19 20:14:11.232421 [scheduler thread(26)]: Controller: card:4 type:RadioWebStream cannot tune to channel
    2011-10-19 20:14:11.232421 [scheduler thread(26)]: Controller: card:5 type:DvbS can tune to channel
    2011-10-19 20:14:11.233398 [scheduler thread(26)]: Controller: card:5 type:DvbS users: 0
    2011-10-19 20:14:11.233398 [scheduler thread(26)]: Controller: card:6 type:DvbS can tune to channel
    2011-10-19 20:14:11.234375 [scheduler thread(26)]: Controller: card:6 type:DvbS users: 0
    2011-10-19 20:14:11.234375 [scheduler thread(26)]: Controller: found 2 card(s) for channel
    2011-10-19 20:14:11.234375 [scheduler thread(26)]: AdvancedCardAllocation.GetAvailableCardsForChannel took 3 msec
    2011-10-19 20:14:11.234375 [scheduler thread(26)]: Controller: card:5 type:DvbS is available
    2011-10-19 20:14:11.235351 [scheduler thread(26)]: Controller: card:6 type:DvbS is available
    2011-10-19 20:14:11.235351 [scheduler thread(26)]: Controller: found 2 free card(s)
    2011-10-19 20:14:11.235351 [scheduler thread(26)]: AdvancedCardAllocation.GetFreeCardsForChannel took 5 msec
    2011-10-19 20:14:11.235351 [scheduler thread(26)]: scheduler: try max 2 of 2 FREE cards for recording
    2011-10-19 20:14:11.236328 [scheduler thread(26)]: Scheduler : record on recommended card:5 priority:2
    2011-10-19 20:14:11.236328 [scheduler thread(26)]: Scheduler : record, first tune to channel
    2011-10-19 20:14:11.237304 [scheduler thread(26)]: card: Tune 5 to ZDF HD
    2011-10-19 20:14:11.237304 [scheduler thread(26)]: card: user: scheduler301:5:-1 tune DVBS:tv:ZDFvision ZDF HD Freq:11362000 ONID:1 TSID:1011 SID:11110 PMT:0x17D4 FTA:True LCN:795 SymbolRate:22000 Modulation:Mod8Psk Polarisation:LinearH InnerFecRate:Rate2_3 DisEqc:None band:Universal Pilot:On RollOff:ThirtyFive
    2011-10-19 20:14:11.241211 [scheduler thread(26)]: TimeShifter.OnBeforeTune: resetting audio/video events
    2011-10-19 20:14:11.242187 [scheduler thread(26)]: dvbs: Tune:DVBS:tv:ZDFvision ZDF HD Freq:11362000 ONID:1 TSID:1011 SID:11110 PMT:0x17D4 FTA:True LCN:795 SymbolRate:22000 Modulation:Mod8Psk Polarisation:LinearH InnerFecRate:Rate2_3 DisEqc:None band:Universal Pilot:On RollOff:ThirtyFive
    2011-10-19 20:14:11.242187 [scheduler thread(26)]: dvbs: Tune:DVBS:tv:ZDFvision ZDF HD Freq:11362000 ONID:1 TSID:1011 SID:11110 PMT:0x17D4 FTA:True LCN:795 SymbolRate:22000 Modulation:Mod8Psk Polarisation:LinearH InnerFecRate:Rate2_3 DisEqc:None band:Universal Pilot:On RollOff:ThirtyFive
    2011-10-19 20:14:11.242187 [scheduler thread(26)]: dvb:GetNewSubChannel:0 #0
    2011-10-19 20:14:11.271484 [scheduler thread(26)]: TvDvbChannel ctor new subchIndex:0
    2011-10-19 20:14:11.271484 [scheduler thread(26)]: LNB low:9750 hi:10600 switch:11700
    2011-10-19 20:14:11.272461 [scheduler thread(26)]: dvbs:channel modulation is set to Mod8Psk
    2011-10-19 20:14:11.272461 [scheduler thread(26)]: dvbs:channel FECRate is set to Rate2_3
    2011-10-19 20:14:11.373046 [scheduler thread(26)]: dvb:confused:ubmiting tunerequest Channel:ZDF HD subChannel:0
    2011-10-19 20:14:11.373046 [scheduler thread(26)]: dvb:using existing subchannel:0
    2011-10-19 20:14:11.373046 [scheduler thread(26)]: dvb:confused:ubmit tunerequest size:1 new:0
    2011-10-19 20:14:11.374023 [scheduler thread(26)]: subch:0 OnBeforeTune
    2011-10-19 20:14:11.375000 [scheduler thread(26)]: dvb:confused:ubmit tunerequest calling put_TuneRequest
    2011-10-19 20:14:11.375976 [scheduler thread(26)]: dvb:confused:ubmit tunerequest done calling put_TuneRequest
    2011-10-19 20:14:11.376953 [scheduler thread(26)]: subch:0 OnAfterTune
    2011-10-19 20:14:11.376953 [scheduler thread(26)]: RunGraph
    2011-10-19 20:14:11.376953 [scheduler thread(26)]: subch:0 OnGraphStart
    2011-10-19 20:14:11.376953 [scheduler thread(26)]: dvb: RunGraph
    2011-10-19 20:14:15.055664 [PowerScheduler poll thread(14)]: ActiveSharesHandler: Share monitoring is disabled.
    2011-10-19 20:14:21.413086 [scheduler thread(26)]: dvb: RunGraph returns: 0x80070079

    I have highlighted a few things that you should take notice of. First, we see that the server is resuming from standby. Then see that TV Server tries to start recording the schedule only 45 seconds after resuming. That is *very* quick - it doesn't give much time for the tuner driver to re-initialise. We see after that that TV Server makes the tune request. The call to start the graph (dvb: RunGraph) takes much longer than it should, and eventually it fails with the 0x80070079 error code. This failure is a direct failure from the tuner driver, not TV Server. The error code means something like "semaphore timeout period has expired" - only the driver software engineers can tell you what that means for sure. I would guess that inside the driver there is a "lock" which must be acquired before a process (like TV Server) can use the tuner. This lock would prevent two or more processes trying to use the tuner at the same time. The error code is saying that the TV Server process failed to get control of the tuner within a reasonable time (in this case 10 seconds). I can't explain why the failure occurred - could be due to bugs in the driver, standby + resume cycles, driver not initialised... anything. The only advice I can give you is:

    1. Make sure you're using the latest driver for the card.
    2. Try enabling the option to restart TV Server on resume, and increase the delay before TV Server detects cards. This should ensure that the tuner driver has enough time to do what it needs to do after resume and that TV Server is starting fresh as well (the tuner graph will be rebuilt).

    If those things don't help, report the problem to Mystique support, explain the circumstances, and ask them what the error means and if it can be avoided somehow.

    mm
     

    alexirion

    MP Donator
  • Premium Supporter
  • February 8, 2010
    170
    12
    50
    St. Georgen im Schwarzwald
    Home Country
    Germany Germany
    AW: Re: connection to TV service lost

    Hi mm,

    thank you very much again for your analysis and explanation. One question: Why are the 45 seconds very quick?? When a user wakes up the system for watching TV, I don't think that he will wait 45 seconds until switching it on. Shouldn't driver intialization be in a range of a few seconds?

    Apparently the Mystique support is not very helpful. Newer drivers than the 1.0.28 lead to a complete system crash with a blue screen after watching TV for a few seconds. With the 1.0.28 at least there is no crash, when only one tuner is used. When I use both, I now also have these system freezes. Every tuner alone is working well.

    Another point, that I'm currently investigating: It really looks that the EPG grabber can cause a playing movie to stutter. Usually, with each movie I had this one times happening, and jumping back showed, that the stuttering does not occur at the same position again, so it is not a defect in the stream. When a stutterer happens, my receiver looses the audio connection and sometimes also the picture gets jerky and it happens, that audio is connecting and disconnecting repeatingly in a loop in a less than seconds interval. In such cases, jumping back in the movie fixes this problem. I had this with BluRay isos as well as with recorded tv. Now, I disabled the EPG grabber a few days ago and I didn't had that stutterers happen anymore. Now, the question is, if the system is sometimes blocked too long, by accessing the TV card for EPG grabbing or if the load in the database part is to high. My cpu load is usually less than 10% while playing a movie.

    Is there any way to find out, which part of EPG grabbing disturbs the movie playing? If it is the TV card or driver than it's clear that MediaPortal can not do for it, but if it would be caused by the database part, there might be potential for optimization.

    For testing, I would like that EPG grabbing does only takes place in the night, when no movie is playing. There is an option in the PowerScheduler to wake up for EPG grabbing, but apparently grabbing does not take place, when it is disabled for idle time. Would be good to have such an option.

    I'm also thinking to replace the Mystique TV card by a TBS 6981. Could be that all these points would be solved then...

    Kind regards,
    --Alex
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Re: AW: Re: connection to TV service lost

    Hi again Alex

    One question: Why are the 45 seconds very quick?? When a user wakes up the system for watching TV, I don't think that he will wait 45 seconds until switching it on. Shouldn't driver intialization be in a range of a few seconds?
    I guess it depends how many devices you have connected and what kind of standby you're using (suspend to RAM or hibernate to HDD). One driver may take a second or two by itself but other things have to load as well. You should see how long it takes my PC to start. ;)

    Apparently the Mystique support is not very helpful. Newer drivers than the 1.0.28 lead to a complete system crash with a blue screen after watching TV for a few seconds. With the 1.0.28 at least there is no crash, when only one tuner is used. When I use both, I now also have these system freezes. Every tuner alone is working well.
    Have you confirmed that this BSOD is not specific to MP?

    Another point, that I'm currently investigating: It really looks that the EPG grabber can cause a playing movie to stutter. Usually, with each movie I had this one times happening, and jumping back showed, that the stuttering does not occur at the same position again, so it is not a defect in the stream. When a stutterer happens, my receiver looses the audio connection and sometimes also the picture gets jerky and it happens, that audio is connecting and disconnecting repeatingly in a loop in a less than seconds interval. In such cases, jumping back in the movie fixes this problem. I had this with BluRay isos as well as with recorded tv. Now, I disabled the EPG grabber a few days ago and I didn't had that stutterers happen anymore. Now, the question is, if the system is sometimes blocked too long, by accessing the TV card for EPG grabbing or if the load in the database part is to high. My cpu load is usually less than 10% while playing a movie.

    Is there any way to find out, which part of EPG grabbing disturbs the movie playing? If it is the TV card or driver than it's clear that MediaPortal can not do for it, but if it would be caused by the database part, there might be potential for optimization.
    What makes you think it is specifically the EPG grabber? It could be anything HDD intensive like a virus scan etc. Anyhow, I think since this is a totally different problem you should start a new thread with new logs showing the issue. I'd be happy to look into it. :)

    For testing, I would like that EPG grabbing does only takes place in the night, when no movie is playing. There is an option in the PowerScheduler to wake up for EPG grabbing, but apparently grabbing does not take place, when it is disabled for idle time. Would be good to have such an option.
    You're not alone.
    https://forum.team-mediaportal.com/...rver-etc-325/timeslot-dvb-epg-grabbing-99507/
    ;)

    I'm also thinking to replace the Mystique TV card by a TBS 6981. Could be that all these points would be solved then...
    Maybe. You could also try the Digital Devices Cine S2 drivers - I think the cards are clones so the DD drivers should work (maybe only a few small changes required in the inf file so that Windows knows it can try to use the driver for your card).

    Have a great weekend!
    mm
    :)
     

    alexirion

    MP Donator
  • Premium Supporter
  • February 8, 2010
    170
    12
    50
    St. Georgen im Schwarzwald
    Home Country
    Germany Germany
    Re: AW: Re: connection to TV service lost

    Hello,

    yes, I confirmed that the crashes also appear with their dvb viewer application with the newer drivers.

    Since I disabled the EPG grabber I didn't had the dropouts during the last 5 movies that I watched and before I always had at least one dropout per movie. But I'm continuing testing to be sure. I don't have a virus scanner active. I will open another thread for this topic, when I have more information. Are the usual logs also helpful to find problems with such video/audio dropouts- then I could produce a log and give the time, when it happened?

    I will try the DD drivers. Normaly they won't work, but I will have a look in the inf files.

    Nice weekend for you, too
    --Alex


    Hi again Alex

    One question: Why are the 45 seconds very quick?? When a user wakes up the system for watching TV, I don't think that he will wait 45 seconds until switching it on. Shouldn't driver intialization be in a range of a few seconds?
    I guess it depends how many devices you have connected and what kind of standby you're using (suspend to RAM or hibernate to HDD). One driver may take a second or two by itself but other things have to load as well. You should see how long it takes my PC to start. ;)

    Apparently the Mystique support is not very helpful. Newer drivers than the 1.0.28 lead to a complete system crash with a blue screen after watching TV for a few seconds. With the 1.0.28 at least there is no crash, when only one tuner is used. When I use both, I now also have these system freezes. Every tuner alone is working well.
    Have you confirmed that this BSOD is not specific to MP?


    What makes you think it is specifically the EPG grabber? It could be anything HDD intensive like a virus scan etc. Anyhow, I think since this is a totally different problem you should start a new thread with new logs showing the issue. I'd be happy to look into it. :)

    For testing, I would like that EPG grabbing does only takes place in the night, when no movie is playing. There is an option in the PowerScheduler to wake up for EPG grabbing, but apparently grabbing does not take place, when it is disabled for idle time. Would be good to have such an option.
    You're not alone.
    https://forum.team-mediaportal.com/...rver-etc-325/timeslot-dvb-epg-grabbing-99507/
    ;)

    I'm also thinking to replace the Mystique TV card by a TBS 6981. Could be that all these points would be solved then...
    Maybe. You could also try the Digital Devices Cine S2 drivers - I think the cards are clones so the DD drivers should work (maybe only a few small changes required in the inf file so that Windows knows it can try to use the driver for your card).

    Have a great weekend!
    mm
    :)
     

    flow87

    Portal Pro
    January 15, 2009
    312
    3
    Germany
    Home Country
    Germany Germany
    I got the same Error Using Mediaportal 1.2.2 Multiseat on Windows 7 with a FireDTV. Any new solutions?
     

    Users who are viewing this thread

    Top Bottom