You are not logged in.
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
;;
esacHibernate 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)
Offline
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 restartThe 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
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 restartThe 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
:rolleyes:
Offline
This is a lot easier and you don't have to kill any processes ![]()
#!/bin/bash
case "$1" in
hibernate|suspend)
soundoff ;;
thaw|resume)
soundon ;;
*) ;;
esacOffline
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 againAppreciate 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
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
This is a lot easier and you don't have to kill any processes
#!/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
Sharpeee wrote:This is a lot easier and you don't have to kill any processes
#!/bin/bash case "$1" in hibernate|suspend) soundoff ;; thaw|resume) soundon ;; *) ;; esacWhat 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
And how do I know what number is correct?
Offline
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
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
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
I am using s2disk, not pm-suspend.
Offline
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
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
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
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
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
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
fiif [ "$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
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
Well, those are scripts executed upon resume. Why wouldn't it have nothing to do with hibernate?
Offline
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
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
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
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