On Annoying Startup Chimes

I like my MacBook well enough, but it certainly does have its share of issues. One such bile-inspiring misfeature is that it sees fit to loudly blare its “I’m a Mac!” chime every time you turn the thing on. According to those in the know, this is actually a feature to let you know the computer started properly. Hmm, I see a big Apple logo, screen is on, I think it’s started. So, Mr. Computer, how about making the big ugly noise when you know it isn’t working instead, and save us the ear strain the other 99.9% of the time? Did they really think no one would want to use the laptop in, say, a library, or a classroom?

The bonus of this brain-o is that older Macs gave you the ability to hold down the mute key while booting to temporarily turn off the sound, a useful feature abandoned for the Intel Macs. Also, plugging something into the headphone jack doesn’t work, because “the headphone jack isn’t available at boot time.” (Why? I can still see it there!) Apple actually recommends, and I’m not making this up, that you “fix” it by remembering to mute your audio every time you shut down your computer. Some people have even written little daemon programs for OSX to do that for you. Amazing.

Of course, the fanboys rationalize this crazy behavior in predictably nonsensical ways: “You should always use sleep instead of turning off your computer” or “I like the sound because it lets people know I’m using a Mac.”

As it happens, the boot noise volume is configured by an NVRAM variable, which seems to be synced with the volume control at shutdown time. Setting it to 0x80 turns off the boot chime. Why 0x80, I do not know, but I stole this very useful information from some mailing list post and can attest that it works.

Here’s how I think this variable was born in Cupertino:

    Engineer 1: This noise is driving me mad, can't we turn it off?
    Engineer 2: Sure, we'll just put a switch in NVRAM.  That way, only the
                users have to deal with it.
    Marketing: Some users, probably miserable Windows lovers all, are whining
               about our awesome boot noise feature.  What should we tell them?
    Engineer 2: Just tell them to mute the audio when they turn it off.
                Heh heh.

So, here are some solutions: you can use the nvram program in OSX as in my previous link. And I’m sure you could, with proper EFI support in Linux (CONFIG_EFI_VARS), do a similar thing from Linux. But I am presently missing the EFI kit and I hate booting OSX, so here’s my other, much more insane way of fixing this problem.

You need:

  1. a Mac with rEFIt already installed
  2. a USB key with a [V]FAT partition

Procedure:

  1. Plug in the USB drive and turn on the machine.
  2. At the rEFIt boot screen, cursor down to the EFI shell. This will start a shell in the firmware reminiscent of the heydey of MS-DOS 3.0, when edlin was king of the text editors.
  3. Type ‘help -b’ to get your bearings.
  4. Get the current audio level via:
    Shell> dmpstore SystemAudioVolume
  5. Now, figure out where your FAT partition got mounted. Useful commands include ‘map’ and ‘ls’ (mine was on fs3):

    Shell> map -b
    Shell> ls fs3:
  6. Use dmpstore to save the NVRAM variable to a file.
  7. Shell> dmpstore SystemAudioVolume -s fs3:volume.txt

  8. Use the built-in hex editor to change the last byte from the value in step 4 to 0x80. Yes, rEFIt has a built-in hex editor!
  9. Shell> hexedit fs3:volume.txt

  10. Now load the new value, check it, and reboot.
  11. Shell> dmpstore SystemAudioVolume -l fs3:volume.txt
    Shell> dmpstore SystemAudioVolume
    Shell> reset

That’s it! It should be gone for good, until you somehow enable it again. When that happens, you can pop the key back in, and redo step 8 with the volume.txt file you remembered to not delete.

Hmm, on second thought, maybe it is easier to just use the sysfs files.