Author Topic: Suspend When Closing Display  (Read 3305 times)

daniel3000

  • Hero Member
  • *****
  • Posts: 1003
    • View Profile
    • http://
Suspend When Closing Display
« on: August 30, 2006, 12:57:13 pm »
Hello,

when I close the zaurus, it does not suspend (pdaXrom 1.1.0beta3).
How can this be configured?
I'd like it to suspend when closing, except when mplayer or xmms are running.
Is this possible?

Thanks a lot
daniel
SL-C3200 with weeXpc, based on pdaXrom 1.1.0beta3
HP 200LX with MS-DOS 5.0

fiferboy

  • Newbie
  • *
  • Posts: 38
    • View Profile
Suspend When Closing Display
« Reply #1 on: August 30, 2006, 02:59:15 pm »
I would like to know this as well, along with how to make it so it will not auto-suspend when connected to the network.  All these features are available in Cacko/Sharp ROMs, does anybody know how they are achieved?

desertrat

  • Hero Member
  • *****
  • Posts: 743
    • View Profile
    • http://
Suspend When Closing Display
« Reply #2 on: August 30, 2006, 03:35:23 pm »
Quote
when I close the zaurus, it does not suspend (pdaXrom 1.1.0beta3).
How can this be configured?
There is a tiny switch on the hinge recess, this gets depressed when the screen/lid is closed (both in landscape and portrait mode). The keycode for this switch (on c3100) is 110, you'll just have to map it to do something useful.
SL-C3100 / Ambicon WL1100C-CF / pdaXrom 1.1.0beta3 / IceWM

fiferboy

  • Newbie
  • *
  • Posts: 38
    • View Profile
Suspend When Closing Display
« Reply #3 on: August 30, 2006, 03:54:52 pm »
Okay, I figured out the suspend when closed part.  Edit /etc/sysconfig/clamshell/closed.d/100x11scr (on my C1000) and change the line AFTER

Code: [Select]
closed() { (line 13 on my C1000)

to

Code: [Select]
/usr/bin/apm -s
This worked for me, and I haven't had any problems yet (although I haven't tested it yet.

Let me know if it works for you.  Also, if anybody knows how to disable suspend on network connect, let me know.

Thanks.

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Suspend When Closing Display
« Reply #4 on: August 31, 2006, 03:27:10 am »
Quote
Okay, I figured out the suspend when closed part.  Edit /etc/sysconfig/clamshell/closed.d/100x11scr (on my C1000) and change the line AFTER

Code: [Select]
closed() { (line 13 on my C1000)

to

Code: [Select]
/usr/bin/apm -s
[div align=\"right\"][a href=\"index.php?act=findpost&pid=140235\"][{POST_SNAPBACK}][/a][/div]

Do you mean adding this line or replacing "/usr/X11R6/bin/xset s activate" by this line? Just want to make sure first to avoid any undesirable results. Thanks!  

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

daniel3000

  • Hero Member
  • *****
  • Posts: 1003
    • View Profile
    • http://
Suspend When Closing Display
« Reply #5 on: August 31, 2006, 03:56:32 am »
Quote
Do you mean adding this line or replacing "/usr/X11R6/bin/xset s activate" by this line? Just want to make sure first to avoid any undesirable results. Thanks! 
[div align=\"right\"][a href=\"index.php?act=findpost&pid=140278\"][{POST_SNAPBACK}][/a][/div]

Well, I guess the xset command should be removed.
xset s activate is the command to activate the screensaver.
On the Zaurus it switches off the backlight (try it!)
Indeed, when closing the Z the screen goes off, but the Z stays active.

So if you keep the xset line, the screen would probably be switched off after you resumed the machine, which is not what you want.

daniel
« Last Edit: August 31, 2006, 03:56:53 am by daniel3000 »
SL-C3200 with weeXpc, based on pdaXrom 1.1.0beta3
HP 200LX with MS-DOS 5.0

daniel3000

  • Hero Member
  • *****
  • Posts: 1003
    • View Profile
    • http://
Suspend When Closing Display
« Reply #6 on: August 31, 2006, 04:02:02 am »
Now how can we check in that scipt, if some music player or network action is running so

xset s activate

is executed instead of apm -s in such situations?

A simple ps | grep xmms is too weak, as when a player is running it does not mean it is playing...

Checking audio / network device locks?
Checking for data streams over these devices?

Any ideas?

Maybe we could even enhance that mode by letting the HDD LED blink when the lid is closed but the Z does not suspend. Can this be achieved in some way?

daniel
« Last Edit: August 31, 2006, 04:04:03 am by daniel3000 »
SL-C3200 with weeXpc, based on pdaXrom 1.1.0beta3
HP 200LX with MS-DOS 5.0

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Suspend When Closing Display
« Reply #7 on: August 31, 2006, 04:33:13 am »
Quote
Quote
Do you mean adding this line or replacing "/usr/X11R6/bin/xset s activate" by this line? Just want to make sure first to avoid any undesirable results. Thanks! 
[div align=\"right\"][a href=\"index.php?act=findpost&pid=140278\"][{POST_SNAPBACK}][/a][/div]

Well, I guess the xset command should be removed.
xset s activate is the command to activate the screensaver.
On the Zaurus it switches off the backlight (try it!)
Indeed, when closing the Z the screen goes off, but the Z stays active.

So if you keep the xset line, the screen would probably be switched off after you resumed the machine, which is not what you want.

daniel
[div align=\"right\"][a href=\"index.php?act=findpost&pid=140287\"][{POST_SNAPBACK}][/a][/div]

Hmm. Just tried that tweak. Nothing happened. Screen doesn't go off when closed (w/ and w/o AC supply). Any hint?

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

daniel3000

  • Hero Member
  • *****
  • Posts: 1003
    • View Profile
    • http://
Suspend When Closing Display
« Reply #8 on: August 31, 2006, 04:36:40 am »
Quote
Hmm. Just tried that tweak. Nothing happened. Screen doesn't go off when closed (w/ and w/o AC supply). Any hint?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=140292\"][{POST_SNAPBACK}][/a][/div]

Different result here:

Without the tweak, screen goes off when closed and on again when opened (instantly! No delay when opening, so it is not obvious that the screen was off when you open it).

With the tweak, the Z really suspends when I close it.
However, when I open it and press On/Off or any other key, nothing happens.
I cannot turn it on anymore.  
Also a connected USB hub doesn't show light on its LED, so the Z is really still off, not only its screen.

Any hint?  

daniel
SL-C3200 with weeXpc, based on pdaXrom 1.1.0beta3
HP 200LX with MS-DOS 5.0

fiferboy

  • Newbie
  • *
  • Posts: 38
    • View Profile
Suspend When Closing Display
« Reply #9 on: August 31, 2006, 07:46:08 am »
Quote
Quote
Hmm. Just tried that tweak. Nothing happened. Screen doesn't go off when closed (w/ and w/o AC supply). Any hint?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=140292\"][{POST_SNAPBACK}][/a][/div]

Different result here:

Without the tweak, screen goes off when closed and on again when opened (instantly! No delay when opening, so it is not obvious that the screen was off when you open it).

With the tweak, the Z really suspends when I close it.
However, when I open it and press On/Off or any other key, nothing happens.
I cannot turn it on anymore.  
Also a connected USB hub doesn't show light on its LED, so the Z is really still off, not only its screen.

Any hint?  

daniel
[div align=\"right\"][a href=\"index.php?act=findpost&pid=140293\"][{POST_SNAPBACK}][/a][/div]


When I close the Zaurus, it takes a few seconds (~10) to fully suspend.  If I wait for this to fully happen before turning the power on, it generally works without problems.  If I try interrupting this, it is very hard to actaully get to turn on (although I have had it happen once after trying several cycle of on/off).  Try waiting for the full suspend before powering up.

daniel3000

  • Hero Member
  • *****
  • Posts: 1003
    • View Profile
    • http://
Suspend When Closing Display
« Reply #10 on: August 31, 2006, 11:28:19 am »
Quote
When I close the Zaurus, it takes a few seconds (~10) to fully suspend.  If I wait for this to fully happen before turning the power on, it generally works without problems.  If I try interrupting this, it is very hard to actaully get to turn on (although I have had it happen once after trying several cycle of on/off).  Try waiting for the full suspend before powering up.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=140315\"][{POST_SNAPBACK}][/a][/div]


Ah, now I seem to have found the problem:
I have waited long enough.
But: This happens only when I have the USB hub with RF mouse connected during suspend and resume. So maybe it is a power issue.
Only strange that it doesn't happen when I hit OnOff instead of closing / opening the lid.

However, although I have commented out the xset s activate line, the screen goes blank once after I switch the Z on after the suspend.
Does this happen to you, too?

I think I wil go back to the xset -s variant, as this one works reliably, keeps players going, and it is only a small step to do a suspend in addition: Just hit the OnOff button while closing the lid.
Something I can get used to without any problem.
And should I forget: No big deal, as if the backlight is switched off, power drain is minimal and battery should last for many hours.  And auto-suspend should suspend it anyway after some minutes.

daniel
SL-C3200 with weeXpc, based on pdaXrom 1.1.0beta3
HP 200LX with MS-DOS 5.0