You are not logged in.

#1 2008-12-23 18:13:10

uastasi
Member
From: Salento - Italy
Registered: 2007-11-27
Posts: 247

OSS and hibernate

I've recently switched to OSS but, as written in the wiki, it doesn't work with suspend (and hibernate). So I've made a custom hook called 48oss and placed into /etc/pm/sleep.d

#!/bin/bash
case $1 in
    hibernate)
        /etc/rc.d/oss stop
        ;;
    suspend)
        /etc/rc.d/oss stop
        ;;
    thaw)
        /etc/rc.d/oss start
        ;;
    resume)
        /etc/rc.d/oss start
        ;;
esac

Hibernate seems to work fine except for OSS, infact pm-suspend.log displays this error:

:: Stopping Open Sound System    [BUSY] 
Some applications are still using OSS - cannot unload

5919 /usr/lib/gnome-applets/mixer_applet2 --oaf-activate-iid=OAFIID:GNOME_MixerApplet_Factory --oaf-ior-fd=25
5919 /usr/lib/gnome-applets/mixer_applet2 --oaf-activate-iid=OAFIID:GNOME_MixerApplet_Factory --oaf-ior-fd=25

Please stop these applications and run soundoff again  [FAIL]

The only way to make mixer applet not use OSS is to kill it, but I'll have to add it to the panel everytime I resume my desktop.
Is there another way to solve?

Last edited by uastasi (2008-12-23 18:15:59)


Till the last battle, till the last bottle.
aur - twitter

Offline

#2 2009-01-01 02:41:35

jayanath
Member
Registered: 2008-08-16
Posts: 30

Re: OSS and hibernate

After every suspend, I'm using the following small script to restart OSS.

#!/bin/sh
processes=`sudo /etc/rc.d/oss restart | grep ^[0-9] | gawk '{print $1}'`
for process in ${processes[@]}
do
    echo `ps  $process`
    kill $process
done

echo "restarting the oss process"
sudo /etc/rc.d/oss restart

The mixer applet throws a message , so its just run the script and hit the reload button of the pop up.
Hope this helps.:)
Good luck !


Cheers,
Jayanath

"There is LIFE beyond the 8x8 cubicle"

Offline

#3 2009-01-02 18:36:08

uastasi
Member
From: Salento - Italy
Registered: 2007-11-27
Posts: 247

Re: OSS and hibernate

jayanath wrote:

After every suspend, I'm using the following small script to restart OSS.

#!/bin/sh
processes=`sudo /etc/rc.d/oss restart | grep ^[0-9] | gawk '{print $1}'`
for process in ${processes[@]}
do
    echo `ps  $process`
    kill $process
done

echo "restarting the oss process"
sudo /etc/rc.d/oss restart

The mixer applet throws a message , so its just run the script and hit the reload button of the pop up.
Hope this helps.:)
Good luck !

Thank you for your useful script jayanath!
It really does what I want but there's still a boring message when killing (and reloading) mixer_applet2 that asks me to reload/not reload the panel object. I've made a search and it seems there's not solution for that..
I'm seriously thinking to switch to ossxmix, but it's not so gnome-ish as my whole desktop roll:rolleyes:


Till the last battle, till the last bottle.
aur - twitter

Offline

#4 2009-01-12 23:34:28

Sharpeee
Member
From: Denmark
Registered: 2008-10-19
Posts: 59

Re: OSS and hibernate

This is a lot easier and you don't have to kill any processes smile

#!/bin/bash

case "$1" in
        hibernate|suspend)
                soundoff ;;
        thaw|resume)
                soundon ;;
        *) ;;
esac

Offline

#5 2009-01-13 00:42:36

jayanath
Member
Registered: 2008-08-16
Posts: 30

Re: OSS and hibernate

Hi Sharpee,
In my case "soundoff" simply throws the following message.

[amare@breeze local]$ sudo soundoff

Some applications are still using OSS - cannot unload

5521 /usr/lib/gnome-applets/mixer_applet2 --oaf-activate-iid=OAFIID:GNOME_MixerApplet_Factory --oaf-ior-fd=22
5544 firefox
5544 firefox
5544 firefox
5544 firefox
5544 firefox
5544 firefox
5521 /usr/lib/gnome-applets/mixer_applet2 --oaf-activate-iid=OAFIID:GNOME_MixerApplet_Factory --oaf-ior-fd=22
5544 firefox

Please stop these applications and run soundoff again

Appreciate any thoughts on this.
It would be great if I can eliminate the need of killing the processes every time.:)


Cheers,
Jayanath

"There is LIFE beyond the 8x8 cubicle"

Offline

#6 2009-08-11 14:14:52

Gen2ly
Member
From: Sevierville, TN
Registered: 2009-03-06
Posts: 1,529
Website

Re: OSS and hibernate

nm, this script ran ok at first, but probably shouldn't have, deleting because misleading.

Last edited by Gen2ly (2009-08-19 04:39:17)


Setting Up a Scripting Environment | Proud donor to wikipedia - link

Offline

#7 2010-04-04 09:24:02

Lockheed
Member
Registered: 2010-03-16
Posts: 1,550

Re: OSS and hibernate

Sharpeee wrote:

This is a lot easier and you don't have to kill any processes smile

#!/bin/bash

case "$1" in
        hibernate|suspend)
                soundoff ;;
        thaw|resume)
                soundon ;;
        *) ;;
esac

What does it actually do? Adds some commands to suspend/resume scrip list? I can't figure it out but when I run it I get no errors nor verbose messages.

Offline

#8 2010-04-04 23:24:18

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,362

Re: OSS and hibernate

Lockheed wrote:
Sharpeee wrote:

This is a lot easier and you don't have to kill any processes smile

#!/bin/bash

case "$1" in
        hibernate|suspend)
                soundoff ;;
        thaw|resume)
                soundon ;;
        *) ;;
esac

What does it actually do? Adds some commands to suspend/resume scrip list? I can't figure it out but when I run it I get no errors nor verbose messages.

It's a pm-utils script, put it in /etc/pm/sleep.d with correct numbering.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#9 2010-04-04 23:54:54

Lockheed
Member
Registered: 2010-03-16
Posts: 1,550

Re: OSS and hibernate

And how do I know what number is correct?

Offline

#10 2010-04-05 00:56:53

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,362

Re: OSS and hibernate

Lockheed wrote:

And how do I know what number is correct?

man pm-suspend

Please read documentation before asking questions.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#11 2010-04-05 16:44:22

Lockheed
Member
Registered: 2010-03-16
Posts: 1,550

Re: OSS and hibernate

Well, it did not tell me much so I named it "98-ossrestart" but it makes no difference.
There is no sound on resume.

Offline

#12 2010-04-06 00:39:55

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,362

Re: OSS and hibernate

http://www.linuxcertif.com/man/8/pm-suspend/en/

SLEEP HOOK ORDERING CONVENTION

00 - 49

User and most package supplied hooks. If a hook assumes that all of the usual services and userspace infrastructure is still running, it should be here.

50 - 74

Service handling hooks. Hooks that start or stop a service belong in this range. At or before 50, hooks can assume that all services are still enabled.

75 - 89

Module and non-core hardware handling. If a hook needs to load/unload a module, or if it needs to place non-video hardware that would otherwise break suspend or hibernate into a safe state, it belongs in this range. At or before 75, hooks can assume all modules are still loaded.

90 - 99

Reserved for critical suspend hooks.

Which one sounds like OSS? I'd put it probably in 50-74. Then try pm-suspend manually and check the log to see what fails/doesn't.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#13 2010-04-06 07:31:50

Lockheed
Member
Registered: 2010-03-16
Posts: 1,550

Re: OSS and hibernate

I am using s2disk, not pm-suspend.

Offline

#14 2010-04-06 08:41:28

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,362

Re: OSS and hibernate

Which works totally differently and doesn't use those scripts..... hibernate-scripts has its own scripts in /etc/hibernate I think.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#15 2010-04-06 09:18:25

Lockheed
Member
Registered: 2010-03-16
Posts: 1,550

Re: OSS and hibernate

I have no such file/folder.

What you are saying is that I should put exactly the same script, with no modifications, into s2disk /s2ram script folder?
And should the script be executed at suspend/hibernate or on resume?

I am using ubuntu, in case that makes a difference.

Last edited by Lockheed (2010-04-06 09:22:01)

Offline

#16 2010-04-06 23:35:28

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,362

Re: OSS and hibernate

I suggest you test it out yourself and read documentation. I do not use hibernate-scripts anymore, and furthermore I have no idea what if anything ubuntu does with it.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#17 2010-04-08 22:57:10

Lockheed
Member
Registered: 2010-03-16
Posts: 1,550

Re: OSS and hibernate

Well, I tried putting the script in folder where resume scripts are (and I know other scripts from this folder are working fine) but it made no difference whatsoever - I still have no sound after resume.

Offline

#18 2010-04-09 01:47:33

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,362

Re: OSS and hibernate

Is it executable? Are the other scripts of the same form and syntax?


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#19 2010-04-09 08:08:09

Lockheed
Member
Registered: 2010-03-16
Posts: 1,550

Re: OSS and hibernate

Yes, it is executable. This is an example of another script from /etc/acpi/resume.d :

#! /bin/sh
#
# This script adjusts hard drive APM settings using hdparm. The hardware
# defaults (usually hdparm -B 128) cause excessive head load/unload cycles
# on many modern hard drives. We therefore set hdparm -B 254 while on AC
# power. On battery we set hdparm -B 128, because the head parking is
# very useful for shock protection.
#

. /usr/share/acpi-support/power-funcs

DO_HDPARM=y
if [ -e /usr/sbin/laptop_mode ] ; then
  LMT_CONTROL_HD_POWERMGMT=$(. /etc/laptop-mode/laptop-mode.conf && echo "$CONTROL_HD_POWERMGMT")
  if [ "$LMT_CONTROL_HD_POWERMGMT" != 0 ] \
     && [ -e /var/run/laptop-mode-tools/enabled ]
  then
    # Laptop mode controls hdparm -B settings, we don't.
    DO_HDPARM=n
  fi
fi

if [ "$DO_HDPARM" = y ] ; then
  # Get the power state into STATE
  getState;
 
  for dev in /dev/sd? /dev/hd? ; do
    if [ -b $dev ] ; then
      # Check for APM support; discard errors since not all drives
      # support HDIO_GET_IDENTITY (-i).   
      if hdparm -i $dev 2> /dev/null | grep -q 'AdvancedPM=yes' ; then
    if [ "$STATE" = "BATTERY" ] ; then
      hdparm -B 128 $dev
    else
      hdparm -B 254 $dev
    fi
      fi
    fi
  done
fi

Should the oss script be in /etc/acpi/resume.d or /etc/acpi/suspend.d ?

Last edited by Lockheed (2010-04-09 08:09:11)

Offline

#20 2010-04-09 10:50:01

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,362

Re: OSS and hibernate

I think that's totally the wrong place, nothing to do with hibernate scripts at all.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#21 2010-04-09 11:55:30

Lockheed
Member
Registered: 2010-03-16
Posts: 1,550

Re: OSS and hibernate

Well, those are scripts executed upon resume. Why wouldn't it have nothing to do with hibernate?

Offline

#22 2010-04-10 00:25:10

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,362

Re: OSS and hibernate

Because those are ACPI related scripts. You need to go and google hibernate-scripts, read their website/documentation/man-page, or similar. I will not respond further until that is done.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#23 2010-04-13 08:24:37

Lockheed
Member
Registered: 2010-03-16
Posts: 1,550

Re: OSS and hibernate

Ok, I read some docs, including this one: http://wiki.archlinux.org/index.php/Sus … rnate.conf
but that did not get me far. I am not clear whether hibernate-script cooperate with s2disk. I assumed it does BUT I do not have "/etc/hibernate/" folder nor can I install "hibernate-script"  as it does not seem present the repository.

Offline

#24 2010-04-13 13:41:38

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,362

Re: OSS and hibernate

Lockheed wrote:

Ok, I read some docs, including this one: http://wiki.archlinux.org/index.php/Sus … rnate.conf
but that did not get me far. I am not clear whether hibernate-script cooperate with s2disk. I assumed it does BUT I do not have "/etc/hibernate/" folder nor can I install "hibernate-script"  as it does not seem present the repository.

Your primary problem is that, as an Ubuntu user, you're expecting to use Arch resources. Which is fine, assuming you know the differences well, which it seems you don't (nothing wrong with that, neither do I).

Ask in the ubuntu forums. You wouldn't ask your vet how to treat your baby's colic.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#25 2010-04-13 16:34:49

Lockheed
Member
Registered: 2010-03-16
Posts: 1,550

Re: OSS and hibernate

The only reason I am asking here is that is seems like the only place to get some help with OSS. Ubuntu forums are soaked with Pulse/ALSA and OSS forum people don't seem to recognize importance of supporting hibernation.

Offline

Board footer

Powered by FluxBB