Ubuntu

Shutdown sound is truncated

Reported by Matt Zimmerman on 2006-09-20
22
Affects Status Importance Assigned to Milestone
ubuntu-sounds (Ubuntu)
Medium
Frank Schoep

Bug Description

It seems that Ubuntu now shuts down too quickly, and the shutdown sound is truncated (presumably by the sound device being muted).

Some ideas for how to handle this:

- Try for a shutdown sound which sounds OK even if it doesn't play all the way through
- Change the ALSA shutdown to fade the mixer down before muting it
- Wait for the sound to finish playing (ugh)
- Use a shorter shutdown sound and hope it's short enough again (ugh)

Matt Zimmerman (mdz) wrote :

Art Team: I tried to subscribe Peter Savage, but he doesn't seem to have a Launchpad account. Please see that he's aware of this issue.

description: updated
Daniel Holbach (dholbach) wrote :

Isn't that a dup of bug 60092?

On Wed, Sep 20, 2006 at 09:07:48PM -0000, Daniel Holbach wrote:
> Isn't that a dup of bug 60092?

Same issue, thanks. I've marked that one as a duplicate of this one,
though, since I think we should consider a more general solution than just
truncating the sound.

--
 - mdz

Frank Schoep (frank-ffnn) wrote :

I see Scott has this bug right now, if we're going for the shorter sound route I can assign it to me. I'm contacting Peter Savage on the issue and hope to resolve it quickly.

After playing for a little bit, I've decided that I have a moral objection to delaying the shutdown sequence just for some sound...

We _can_ fade the sound out, but the only length of fade that didn't sound like a mute was 2s or so -- FAR TOO LONG

Matt Zimmerman (mdz) wrote :

After further discussion and consideration, I agree. Scott, please provide Frank with a maximum length for the sound where we can be sure the shutdown will take at least that long before muting the mixer and then pass the bug to him

Frank Schoep (frank-ffnn) wrote :

I think the maximal safe length is 0 seconds as we can't really be certain that the shutdown action will take at least a certain amount of time. This might even be the reason that Apple decided to not include a shutdown sound since OS X shuts down very fast as well. The best route to take might be to create a very short sound, like a single chord / interval and have it fade out quickly. I'll try to get something like that produced quickly.

Matt Zimmerman (mdz) wrote :

On Thu, Sep 21, 2006 at 09:47:15PM -0000, Frank Schoep wrote:
> I think the maximal safe length is 0 seconds as we can't really be
> certain that the shutdown action will take at least a certain amount of
> time. This might even be the reason that Apple decided to not include a
> shutdown sound since OS X shuts down very fast as well. The best route
> to take might be to create a very short sound, like a single chord /
> interval and have it fade out quickly. I'll try to get something like
> that produced quickly.

Our shutdown process, while very fast, contains some steps which are of a
minimum, nonzero duration.

--
 - mdz

I'm afraid that's not true Matt.

The only sleep statement, or even non-zero duration, in our shutdown sequence is between sending the TERM and KILL signals now; and that sleep statement is by far the longest period within the entire sequence.

A fast machine is able to reach the point at which the sound card is muted in well under a second.

I would say that we should keep the sound short and simple

Matt Zimmerman (mdz) wrote :

On Fri, Sep 22, 2006 at 07:41:11AM -0000, Scott James Remnant wrote:
> I'm afraid that's not true Matt.
>
> The only sleep statement, or even non-zero duration, in our shutdown
> sequence is between sending the TERM and KILL signals now; and that
> sleep statement is by far the longest period within the entire sequence.

It happens that those run in the same script, but this does of course put a
lower bound on the shutdown speed.

> A fast machine is able to reach the point at which the sound card is
> muted in well under a second.

I have never seen such a machine, but any sound shorter than 1 second is
pointless.

--
 - mdz

The script that sends the TERM and KILL signals is run after the sound card has muted.

Really? My laptop takes only just over 1s to reach the sendsigs script (admittedly, I don't have much other than the default installed) and my desktop gets there in too short a time for usplash to complete its vt switch

Matt Zimmerman (mdz) wrote :

On Fri, Sep 29, 2006 at 07:38:49AM -0000, Scott James Remnant wrote:
> The script that sends the TERM and KILL signals is run after the sound
> card has muted.

Currently, yes. :-)

> Really? My laptop takes only just over 1s to reach the sendsigs script
> (admittedly, I don't have much other than the default installed) and my
> desktop gets there in too short a time for usplash to complete its vt
> switch

I don't suppose upstart-logd logs shutdown...

--
 - mdz

It can do, just comment out the "stop on shutdown" from the /etc/event.d/logd file; of course, you have to reboot with init=/bin/sh to get a chance to rescue the log file ;)

Matt Zimmerman (mdz) wrote :

On Mon, Oct 02, 2006 at 10:08:26AM -0000, Scott James Remnant wrote:
> It can do, just comment out the "stop on shutdown" from the
> /etc/event.d/logd file; of course, you have to reboot with init=/bin/sh
> to get a chance to rescue the log file ;)

Can't it rotate it so that the file from the last startup/shutdown is always
available?

--
 - mdz

Filesystem might be unmounted...
...and is mounted read-only anyway

aka, no.

Matt Zimmerman (mdz) wrote :

On Mon, Oct 02, 2006 at 05:35:31PM -0000, Scott James Remnant wrote:
> Filesystem might be unmounted...
> ...and is mounted read-only anyway
>
> aka, no.

On my system at least, sendsigs runs before any unmounting scripts, and a
read-write filesystem isn't required for playing a sound, but I think we
already agree that this wouldn't be an ideal solution.

If we can't guarantee a useful length of time for a shutdown sound, then we
either need to make space for one, or forego the shutdown sound entirely.
The latter is unlikely to go over well.

--
 - mdz

That was about the logging daemon :)

We could move the mute to after the sendsigs ... but then the TERM signal would kill the program playing the sound anyway

Frank Schoep (frank-ffnn) wrote :

I think removing the shutdown sound is not that big of a problem - Mac OS X hasn't got one and instead of being let down by the absence of a sound, I'm glad it shuts down as fast as possible. If we already have machines shutting down within a few seconds of selecting the option, there aren't much solutions left.

Although my personal opinion doesn't count for anything, I predict that most users will welcome fast shutdown and not care too much about removing the shutdown sound.

z_diver (chuck-lagunadata) wrote :

While I love a quick shutdown I wonder if it's possible to find an "optimal" shutdown time instead of just as fast as possible. We may not be there yet but if we could manage the shutdown time and, for the sake of argument, make it near 10 seconds on any machine, and 4 of those were listening to a nice chime at least I would be happier than with 6 'more' seconds of silence(except for the inevitable quiet pop).

** The numbers above have been arbitrarily inserted.

Sorry, but that's absolutely fruity loopy!

The entire point of shutting down the machine is that the user doesn't want it anymore -- spending several seconds playing them nice music instead of getting on with the job is going to seriously piss off most people.

Especially when they realise that it's ONLY playing the shutdown sound!

Frank Schoep (frank-ffnn) wrote :

I'm with Scott on this one - artificially limiting the speed at which something is executed is contrary to my beliefs of good architecture in this case, especially since this is a purely cosmetical aspect. I contacted Peter Savage, the sound engineer and he's cool with leaving out the shutdown sound because of these technical reasons.

Leaving out the shutdown sound is probably the best and only way to go, but that's only a good sign for the distribution.

Matthew Nuzum (newz) wrote :

Sound or no sound, there needs to be some positive feedback indicating that the shutdown happened normally.

As a user, I would freak out if I hit the shutdown button and then 300ms later the screen went black.

A short sound could be useful, something like the counterpoint to the "rattle" you hear when the login box is shown.

I think that, if it is necessary, making efforts to ensure the shutdown takes at least 1500ms is not insane. The worst thing you can do is make it look or sound like something unusal just happened.

1500ms is insanely long, 150ms is more than amble for a simple "click"/"beep" confirmation sound -- if that's what you want.

Frank Schoep (frank-ffnn) wrote :

Shall I try to work with Peter Savage on creating a really short (< 500 ms) shutdown sound? I'm pretty sure my fast machine doesn't stop ALSA within half a second and creating a sound that lasts half a second is more doable than 150 ms (I know it's just a random number).

I think there's a sleep inside usplash you can rely on, so yes, 500ms should be fine

Frank Schoep (frank-ffnn) wrote :

OK, I'm assigning this bug to me and setting it to "In Progress". I'm expecting to meet up with Peter Savage soon and I'll work with him to provide a new and short shutdown sound.

Changed in ubuntu-sounds:
assignee: keybuk → frank-ffnn
status: Confirmed → In Progress
anime4christ (anime4christ) wrote :

The point of starting up and shutting down sounds and pretty visual pictures is to entertain and to show that something is actually going on while the person is waiting. It was made because the computer was incapable of just turning on and off in a few milliseconds. Some PDAs don't have any starting up thingy because they load fast enough. When you've got the computer working this fast, it's only logical to remove the sound or make it shorter. The ideas to lengthen the shutdown sequence just for the sound are a steb backward, IMHO.

z_diver (chuck-lagunadata) wrote :

I can't argue with that. I don't think that the majority of machines are going to shut down that fast though. On a 1.4 ghz p4 I have it still takes over 20 seconds to shutdown and the entire logout sound plays before leaving me staring at a blank screen for 5 or 10 seconds. Only then do the speakers pop and the screen shut off completely.

Ruben Romero (huayra) wrote :

As a user I am down with a short (<50 ms) sound as part of the shut down sequence.

As stated above, I "expect" the computer to "say" byebye... Usplash does the trick visually, but, for those user that have the capability of hearing only for example, a short sound would be welcomed as an announce of finishing the maxhine session.

In my machine with edgy I enjoy the shutdown sound, but with a shutdown time of 5 and up to 10 seconds It seems unnecesary to have such a long sound as the none we use now.

Looking forward to "hopefully" hear a new sound :-)

Frank Schoep (frank-ffnn) wrote :

Today I finished a short sound with Peter Savage. It should be in Edgy soon so we can get feedback on the new length.

Changed in ubuntu-sounds:
status: In Progress → Fix Committed
Paul Williams (pwill) wrote :

w00t!
The bug is squashed after the latest update!

Frank Schoep (frank-ffnn) wrote :

I think the updated sound that fixes the bug should be available to everyone using Edgy now. Setting the status to Fix Released.

Changed in ubuntu-sounds:
status: Fix Committed → Fix Released
Jacob Winski (winski) wrote :

Available and is *much* better. Thank you Peter Savage, Frank Schoep and everyone else.

One question: was the startup sound changed?

Paul Williams (pwill) wrote :

@AgenT
It was. It is now about half as long.

Jacob Winski (winski) wrote :

Using a stopwatch, the startup sound was about 7 seconds. Does this sound correct?

Also, there is a difference between using the GNOME shutdown menu button and using the button the my computer. Shutdown via menu button is about 17 seconds total (and had the problem of truncating the old sound), while via button it is 14. This button seems to shutdown in a similar way to shutdown -h now, which does not even give the sound system a chance to play a file. Maybe this is something to take into consideration as it means that it should be possible to shorten the shutdown time even more.

Jacob Winski (winski) wrote :

Actually, it should not be a plain shutdown -h now. Instead, gnome-power-manager should be handling the shutdown (which is faster and lacks the sound) according to the /etc/acpi/powerbtn.sh script:
# If gnome-power-manager, kpowersave or klaptopdaemon are running, let
# them handle policy This is effectively the same as 'acpi-support's
# '/usr/share/acpi-support/policy-funcs' file.

if pidof gnome-power-manager kpowersave > /dev/null ||
  (pidof dcopserver > /dev/null && test -x /usr/bin/dcop && /usr/bin/dcop kded k
ded loadedModules | grep -q klaptopdaemon) ; then
    exit
fi
[truncated kde script]
# If all else failed, just initiate a plain shutdown.
/sbin/shutdown -h now "Power button pressed"

But for some reason, using the power button is faster by a few seconds. Just for informational purposes. :)

Alexander Rødseth (alexanro) wrote :

A creative suggestion:
How about logging how long the machine takes to shut down and select a shutdown-sound accordingly after the first shutdown.
The sound doesn't even have to be a .wav, it could be the syntesized sound of an organ, a plucked guitar-string or three (with the karplus-strong algorithm).

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers