2013-06-04, 21:26
Hi,
for quite a long time I suffered from two issues within XBMC on OpenELEC after waking up from suspend:
There are several references on the forums and on the bug tracker regarding the first problem:
XBMC bug tracker:
http://trac.xbmc.org/ticket/13286
XBMC forum:
http://forum.xbmc.org/showthread.php?tid=157848
http://forum.xbmc.org/showthread.php?tid=155303
http://forum.xbmc.org/showthread.php?tid=74173
http://orum.xbmc.org/showthread.php?tid=152532
Not sure about references regarding the MySQL problem.
Anyway, I tried to fix both problems in a branch. It is based on 12.2 at the moment. I am not familiar with the XBMC code so not sure if I did it the "right" way. I am testing this since a week and it is working fine for me. SMB and MySQL are available are accessible right after wake up every time. If its done the wrong maybe just look at it as a "proof of concept" since I think at least it shows what the problems are.
The problem with SMB shares is like this:
It only happens on Linux (not on Windows) since Linux is using a different SMB code than on Windows. libsmbclient does not get deinitialized before going to sleep currently. So the lib goes mad after waking up having all its connections closed. The same is probably true for NFS but I did not touch it.
One pitfall is that python addons (for example Library Watchdog) are able to immediately re-init SMB (before XBMC actually goes to sleep) if I just deinit SMB in OnSleep. So I am stopping all python addons before deiniting SMB and restarting them after waking up. This addon-start-stop mechanism is configurable in advancedsettings.xml.
The problem with MySQL:
Right after wake up XBMC issues a library update but at that time the network interface is not up yet (at least for me). So I just added an option that makes XBMC wait for the NIC to come up after suspend before issueing the library update. For me XBMC delays for about 400 ms after wake up for this reason. Currently XBMC waits a maximum time of 10 seconds for the NIC.
The advancedconfig to enable these two options look like this:
The branch is here:
https://github.com/verybadsoldier/xbmc/c...ter-wakeup
I have no idea if you guys are interested in it or if I did it in a way guy can make use of at all. Also no idea if you need the patches applied to your master instead of the 12.2 tag. Please just let me know if you need anything changed/modified/whatever and I am happy to do it.
for quite a long time I suffered from two issues within XBMC on OpenELEC after waking up from suspend:
- SMB shares not accessible
- MySQL server not accessible
There are several references on the forums and on the bug tracker regarding the first problem:
XBMC bug tracker:
http://trac.xbmc.org/ticket/13286
XBMC forum:
http://forum.xbmc.org/showthread.php?tid=157848
http://forum.xbmc.org/showthread.php?tid=155303
http://forum.xbmc.org/showthread.php?tid=74173
http://orum.xbmc.org/showthread.php?tid=152532
Not sure about references regarding the MySQL problem.
Anyway, I tried to fix both problems in a branch. It is based on 12.2 at the moment. I am not familiar with the XBMC code so not sure if I did it the "right" way. I am testing this since a week and it is working fine for me. SMB and MySQL are available are accessible right after wake up every time. If its done the wrong maybe just look at it as a "proof of concept" since I think at least it shows what the problems are.
The problem with SMB shares is like this:
It only happens on Linux (not on Windows) since Linux is using a different SMB code than on Windows. libsmbclient does not get deinitialized before going to sleep currently. So the lib goes mad after waking up having all its connections closed. The same is probably true for NFS but I did not touch it.
One pitfall is that python addons (for example Library Watchdog) are able to immediately re-init SMB (before XBMC actually goes to sleep) if I just deinit SMB in OnSleep. So I am stopping all python addons before deiniting SMB and restarting them after waking up. This addon-start-stop mechanism is configurable in advancedsettings.xml.
The problem with MySQL:
Right after wake up XBMC issues a library update but at that time the network interface is not up yet (at least for me). So I just added an option that makes XBMC wait for the NIC to come up after suspend before issueing the library update. For me XBMC delays for about 400 ms after wake up for this reason. Currently XBMC waits a maximum time of 10 seconds for the NIC.
The advancedconfig to enable these two options look like this:
Code:
<suspend>
<waitfornetafterwakup>1</waitfornetafterwakup>
<stopservicesonsuspend>1</stopservicesonsuspend>
</suspend>
The branch is here:
https://github.com/verybadsoldier/xbmc/c...ter-wakeup
I have no idea if you guys are interested in it or if I did it in a way guy can make use of at all. Also no idea if you need the patches applied to your master instead of the 12.2 tag. Please just let me know if you need anything changed/modified/whatever and I am happy to do it.