OpenELEC / service.openelec.settings

service.openelec.settings - OpenELEC settings addon
Other
12 stars 35 forks source link

Openelec addon, power saving, hdd sleep #29

Closed Schnoogemetzger closed 11 years ago

Schnoogemetzger commented 11 years ago

The power saving settings for hdd sleep doesn't work as expected. At least for connected USB drives. If the power saving is enabled, the "sleep hard drive after" value isn't recognized. So, nothing happens (no sleep).

Up to version 3.0.6 only hdparm was used and this tool doesn't support usb drives. In 3.0.6 I compiled hd-idle from source, stored it under /storage and configured it in autostart.sh. Worked. Since 3.2 hd-idle is implemented and it should be able to set a usb drive into sleep, after I activated hdd standby in settings addon. As I wrote, nothing happens and I can't see a hd-idle process.

Additional info: If I start hd-idle via autostart.sh and hdd sleep isn't enabled in the power saving section, the hd-idle process will be terminated.

For more detailed information, please have a look at my forum post [1].

[1] http://openelec.tv/forum/110-update-openelec/67056-since-3-2-0-a-process-is-killed-after-autostart-sh

stefansaraev commented 11 years ago

hd-idle with settings addon is not intended to work with the drive you BOOT from. if you try that - this is not a bug. if you want hd-idle working for bootdrive - you can still copy the binary to /storage, rename it and use autostart.sh.

Schnoogemetzger commented 11 years ago

Sorry, I forgot that one: I use a raspberry Pi, so I boot from a SD Card. The USB drive is for my data.

stefansaraev commented 11 years ago

enable debugging in xbmc. reboot. wait 2 min. post xbmc debug log. EDIT: is /dev/sdaX mounted as /storage ?

Schnoogemetzger commented 11 years ago

EDIT: is /dev/sdaX mounted as /storage ?

Nope, the flashcard is mounted as /storage:

OpenELEC:~ # cat /proc/mounts 
rootfs / rootfs rw 0 0
devtmpfs /dev devtmpfs rw,relatime,size=189028k,nr_inodes=47257,mode=755 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
/dev/mmcblk0p1 /flash vfat ro,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/mmcblk0p2 /storage ext4 rw,noatime,data=ordered 0 0
/dev/loop0 / squashfs ro,relatime 0 0
devpts /dev/pts devpts rw,relatime,gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs rw,relatime,size=76392k 0 0
tmpfs /var tmpfs rw,relatime,size=10240k 0 0
debugfs /sys/kernel/debug debugfs rw,relatime 0 0
fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
/dev/sda1 /var/media/EFI vfat rw,nosuid,nodev,noexec,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/sda2 /var/media/sda2-usb-SAMSUNG_HD103UI_ hfsplus ro,nosuid,nodev,noexec,noatime,umask=22,uid=0,gid=0,nls=utf8 0 0

processes after xbmc start and 2 minutes wait time:

OpenELEC:~ # ps faux
PID   USER     TIME   COMMAND
    1 root       0:01 {init} /bin/sh /sbin/init
    2 root       0:00 [kthreadd]
    3 root       0:00 [ksoftirqd/0]
    5 root       0:00 [kworker/0:0H]
    6 root       0:00 [kworker/u2:0]
    7 root       0:01 [rcu_kthread]
    8 root       0:00 [khelper]
    9 root       0:00 [kdevtmpfs]
   10 root       0:00 [kworker/u2:1]
  277 root       0:00 [writeback]
  279 root       0:00 [bioset]
  281 root       0:00 [kblockd]
  293 root       0:00 [khubd]
  388 root       0:00 [rpciod]
  389 root       0:00 [kworker/0:1]
  401 root       0:00 [kswapd0]
  448 root       0:00 [fsnotify_mark]
  464 root       0:00 [nfsiod]
  469 root       0:00 [cifsiod]
  479 root       0:00 [jfsIO]
  480 root       0:00 [jfsCommit]
  481 root       0:00 [jfsSync]
  491 root       0:00 [xfsalloc]
  492 root       0:00 [xfs_mru_cache]
  494 root       0:00 [xfslogd]
  501 root       0:00 [bioset]
  509 root       0:00 [crypto]
  598 root       0:03 [VCHIQ-0]
  599 root       0:06 [VCHIQr-0]
  600 root       0:00 [VCHIQs-0]
  608 root       0:00 [iscsi_eh]
  615 root       0:00 [bcm2708_spi.0]
  626 root       0:00 [dwc_otg]
  630 root       0:00 [DWC Notificatio]
  694 root       0:00 [deferwq]
  697 root       0:00 [mmcqd/0]
  720 root       0:00 [jbd2/mmcblk0p2-]
  721 root       0:00 [ext4-dio-unwrit]
  729 root       0:00 [scsi_eh_0]
  730 root       0:00 [usb-storage]
  733 root       0:00 [kworker/0:2]
  739 root       0:00 [loop0]
  813 root       0:00 syslogd -L
  818 root       0:00 klogd
  819 root       0:00 crond -b
  820 root       0:00 /lib/systemd/systemd-udevd --daemon
  846 root       0:00 [kworker/0:1H]
  847 dbus       0:00 dbus-daemon --system
  863 root       0:00 {init} /bin/sh /sbin/init
  874 root       0:00 /usr/sbin/connmand -nr
  891 root       0:00 rpcbind
  892 root       0:00 /usr/lib/bluetooth/bluetoothd
  899 root       0:00 /usr/lib/bluetooth/obexd -r /storage/downloads/
  916 root       0:00 eventlircd --evmap=/etc/eventlircd.d --socket=/var/run/lirc/lircd --release=_UP
  934 root       0:00 /usr/sbin/lircd --driver=default --device=/dev/lirc0 --uinput --output=/var/run/lirc/lircd-lirc0 --pidfile=/var/r
  951 avahi      0:00 avahi-daemon: running [OpenELEC.local]
  973 root       0:00 /usr/sbin/sshd -o PasswordAuthentication no
  988 root       0:00 /usr/sbin/connman-vpnd -n
  990 root       0:00 /usr/bin/wpa_supplicant -u
  991 root       0:00 nmbd --daemon --configfile=/var/run/smb.conf
  992 root       0:00 smbd --daemon --configfile=/var/run/smb.conf
  993 root       4:12 /usr/lib/xbmc/xbmc.bin --standalone -fs --lircdev /var/run/lirc/lircd
 1006 root       0:00 [VCHIQka-0]
 1016 root       0:00 sshd: root@pts/0
 1018 root       0:00 -sh
 1037 root       0:00 [krfcommd]
 1082 root       0:00 ps faux

xbmc.log debug (loglevel 1): http://pastebin.com/T1WHY9yU

For the avoidance of doubt: HDD Power saving is on.

stefansaraev commented 11 years ago

this is not a debug log, unfortunately :)

EDIT: ok. add "debugging" to kernel parameters in cmdline.txt

EDIT: and please keep autostart.sh clean while testing.

Schnoogemetzger commented 11 years ago

this is not a debug log, unfortunately :)

Oh, sorry, I thought you only need xbmc.log with debug level. autostart.sh is empty.

I add debugging to the cmdline:

OpenELEC:~ # cat /flash/cmdline.txt 
boot=/dev/mmcblk0p1 disk=/dev/mmcblk0p2 ssh debugging

To play safe, what log file do you need? log/messages? Or is there a new file, if debugging is on and I overlooked it?

stefansaraev commented 11 years ago

I need /storage/.xbmc/temp/xbmc.log. with "debugging" in cmdline.txt and debug enabled in xbmc -> settings -> system -> debugging. (might work without debug in xbmc but better enable it, just in case)

Schnoogemetzger commented 11 years ago

Ok, I deliver it tomorrow. Thx so far.

stefansaraev commented 11 years ago

thanks for reporting. no need to send logs. I could reproduce it here. fix coming in next release

jchannon commented 10 years ago

I still have this issue. I'm running XBMC 12.2 and OpenElec 3.2.4

My xbmc log with debugging turned on is at https://gist.github.com/jchannon/70b8a6d6ce618a48505f

I mount it my external hdd with this in the autostart.sh file

 #!/bin/sh
 (sleep 30; \
 mkdir /media/ExternalHDD; \
 mount /dev/sda2 /media/ExternalHDD \
 )&
stefansaraev commented 10 years ago

this is normal, as your hdd is mounted AFTER hd-idle is started. you dont have to mount it manualy - openelec will automount it on boot up.