Linux Why XBMC disables network during suspend.
#1
Hi,

Recently I wanted to implement TV power off function as a part of XBMC shutdown (suspend) procedure.
So I've added new scrip in /etc/pm/sleep.d which is first checking "TV On" sensor (by connecting over network to TV status sensor) and if TV is on, it sends power off IR signal to TV.
I've tested the script alone - it worked fine. When I place the script in /etc/pm/sleep.d and then used command:
pm-suspend
Computer is suspended and script worked fine(TV got powered off before suspend).

However when I use suspend option of XBMC or let XBMC to suspend due to inactivity timeout, it doesn't work - script is executed, however I've noticed that it can't query sensor, because network is already down.
Do you have any ideas why (and how) XBMC disables network, when suspend option is selected in XBMC?

Piotr
Reply
#2
XBMC does not disable the network, the OS is doing that. Xbmc just calls suspend.
Reply
#3
What function/command XBMC uses to suspend? Because if I use pm-suspend command from commandline, it works fine - I mean it goes thorough suspend scripts and network is disabled by one of the scripts. In XBMC it seems that network is disabled immediately:-(
Reply
#4
Ive also noticed this; youre not crazy.

First lines of : pm-suspend log an 'ip link show'.

When I execute pm-suspend script eth0 is UP.

When I execute suspend via xbmc eth0 is DOWN.

This confirms that something else is happening between the xbmc suspend function and pm-suspend.

EDIT:

xbmc.log:

23:35:30 T:3037456128 NOTICE: OnSleep: Running sleep jobs <--- sure would like to know what this is
23:35:30 T:3037456128 NOTICE: OnSleep: Stopping lirc
23:35:31 T:3037456128 NOTICE: OnWake: Running resume jobs
23:35:31 T:3037456128 NOTICE: OnWake: Restarting lirc
23:35:31 T:3037456128 NOTICE: OnWake: Restarting lcd
Reply
#5
Just a quick update on this, XBMCbuntu does come with and use NetworkManager for suspend specifically requesting a lan disconnect prior to suspsend..

May 29 23:44:25 localhost NetworkManager[1085]: <info> sleep requested (sleeping: no enabled: yes)
May 29 23:44:25 localhost NetworkManager[1085]: <info> sleeping or disabling...
May 29 23:44:25 localhost NetworkManager[1085]: <info> (wlan0): now unmanaged
May 29 23:44:25 localhost NetworkManager[1085]: <info> (wlan0): device state change: disconnected -> unmanaged (reason 'sleeping') [30 10 37]
May 29 23:44:25 localhost NetworkManager[1085]: <info> (wlan0): cleaning up...
May 29 23:44:25 localhost NetworkManager[1085]: <info> (wlan0): taking down device.
May 29 23:44:26 localhost NetworkManager[1085]: <info> (eth0): now unmanaged
May 29 23:44:26 localhost NetworkManager[1085]: <info> (eth0): device state change: activated -> unmanaged (reason 'sleeping') [100 10 37]
May 29 23:44:26 localhost NetworkManager[1085]: <info> (eth0): deactivating device (reason 'sleeping') [37]
May 29 23:44:26 localhost NetworkManager[1085]: <info> (eth0): canceled DHCP transaction, DHCP client pid 29021
Reply
#6
It is possible this could be better implemented in the XBMCbuntu Ubuntu setup.
Reply

Logout Mark Read Team Forum Stats Members Help
Why XBMC disables network during suspend.0