Author Topic: (Solved) Wakealarm via rtc, can it be done?  (Read 3878 times)

Offline MBantz

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1317
(Solved) Wakealarm via rtc, can it be done?
« on: June 11, 2009, 04:19:39 AM »
I'm having issues with configuring wakealarm via rtc - the wakeup acpi funktion, I posted a general post about it, but I'm moving along and are looking into the kernel config and now things are getting advanced :-)

I have used Mythbuntu with the same machine, and it worked fine - just reinstalled it to run 2009.1 and now I'm stuck when reading the values back to me from /proc/driver/rtc

This is what I normally do:

1. Disable the time writeback to cmos when shutting down.

2. I need to write the time two times in a row before I can read the value again from wakealarm:
Code: [Select]
#Initiate write to wakealarm
echo 0 > /sys/class/rtc/rtc0/wakealarm
#Store same value twice
echo `date '+%s' -d '+ 5 minutes'` > /sys/class/rtc/rtc0/wakealarm
echo `date '+%s' -d '+ 5 minutes'` > /sys/class/rtc/rtc0/wakealarm
This code should set the wakealarm to set off in 5 minutes

I can read the epoc value from /sys/class/rtc/rtc0/wakealarm

But when investigating the wakeupalarm I look in:

cat /proc/driver/rtc

but it does not exist. Can it be created somehow? The machine does not restart again after 5 minutes.

With a working setup on Mythbuntu on the exact same machine, I followed these instructions: http://www.mythtv.org/wiki/ACPI_Wakeup#Using_.2Fsys.2Fclass.2Frtc.2Frtc0.2Fwakealarm

any help appreciated! :-)

cheers
MBantz
« Last Edit: June 16, 2009, 06:35:52 PM by MBantz »

Offline MBantz

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1317
Re: Wakealarm via rtc, can it be done?
« Reply #1 on: June 13, 2009, 03:23:25 PM »
Ok, searched and found out that support for /proc/drivers/rtc is configured in the kernel:

http://docs.blackfin.uclinux.org/doku.php?id=rtc

and on three PCLos2009's, this folder does not exist. I can write to wakealarm and get a result back - but can't read /proc/drivers/rtc - and the systems does not wakeup. Is a kernel compilation needed?

I'll try and install Mythbuntu again and compare .config files to find out more. Any hints appreciated on this :-)

Offline MBantz

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1317
Re: Wakealarm via rtc, can it be done?
« Reply #2 on: June 14, 2009, 06:33:56 AM »
Getting closer! It appears that:

From Mythtv guide:  http://www.mythtv.org/wiki/ACPI_Wakeup
The solution is to rebuild your kernel with the above two options excluded (find them under Drivers -> Character Devices) and the various RTC interfaces (found under Drivers -> Real Time Clock) included. From a .config point of view CONFIG_RTC and CONFIG_GEN_RTC must be unset and, at a minimum, RTC_INTF_SYSFS must be set.

and RTC_INT_SYSFS is not set in 2.26.8.tex3 (can't be found in .config) - I assume this is the reason?

cheers
MBantz

Offline MBantz

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1317
Re: Wakealarm via rtc, can it be done?
« Reply #3 on: June 14, 2009, 02:31:46 PM »
Ok, last question before I give up......

found a fine description on building kernels from the current kernels at hack http://hackmy.pclosbe.org/index.php?topic=121.0 and found kernel-2.6.27.13.tex1-1-1pclos2007.nosrc.rpm in SRPMS that I would like to try out - it's not a regular srpm. Is this a .src.rpm that need to be renamed? It's only a few MB in size. My aim is to produce an rpm to install and test on two other machines - and if I get RTC to wakeup I guess it is possible to make a "kernel-request" somehow...,

cheers

Offline gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3801
Re: Wakealarm via rtc, can it be done?
« Reply #4 on: June 14, 2009, 03:40:04 PM »
I'm sorry, no one has responded to this thread. Is rtc the same real-time that used to be included in one of the special kernels? If it is, I would like to see it come back. Otherwise, at this point, I don't know nothin' about building no kernels.  :o

Galen

Offline MBantz

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1317
Re: Wakealarm via rtc, can it be done?
« Reply #5 on: June 14, 2009, 04:32:55 PM »
Ah, don't be sorry, I'm not :-) If it's a tough question it is fine it takes some time.. on the other hand, there is a chance that it is a complete noobquestion so noone bothers ;-)

Well, I think it is quite relevant to be able to use automatic wakeup, for all the users that use Myth in PCLinux. Right now I'm downloading kernel sources and make sure the relevant rtc parameters are set and see if this is the reason why PCLinux currently has no wakeup functionality. If all turns out well I'll post my findings,

cheers,
Martin

Offline MBantz

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1317
Re: Wakealarm via rtc, can it be done?
« Reply #6 on: June 16, 2009, 06:35:17 PM »
Yes, it can be done :-)

I needed to do two things. To investigate anything on wakeup it is necessary to be able to see the contents of the timer, á lá cat /proc/driver/rtc

After going through the entire .config for the kernels 2.6.26 and 2.6.27 (this took a while, but was -very- interesting), the /proc/driver/rtc in Device drivers->Real time clock is not enabled (with an asterisk). Enabling this and building the kernel gave access to /proc/driver/rtc.

On this one system (will check more systems) I also had to disable the HPET to make the wakeup work. I did this with a boot cheat-code: hpet=disable And now everything works as expected.

My wish now is just to have the /proc/driver/rtc enabled in future kernels (.27 hopefully:-) to enable/diagnose wakeup via rtc :-)

cheers
MBantz

Offline gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3801
Re: (Solved) Wakealarm via rtc, can it be done?
« Reply #7 on: June 16, 2009, 06:54:09 PM »
I too hope the rtc is enabled. Sounds like we have a new kernel hacker in training. :D
Galen