Sep 9 2009

Shut up your macbook

Annoyed by the !BONG! noise that macbooks make when you power them on?

Apparently if you turn the volume down in Mac OS it saves a similar volume as an nvram setting in the EFI. So if you’re dual-booting or somesuch, you can just turn the volume down.

But what about those of us who wiped out the legacy OS in the first few minutes of owning the thing and never looked back?
Well only a few years later 🙂 with the help of the mactel-linux-user list I can now turn off that blasted noise.

With new improved silence!

With new improved silence!

It goes like this:
#Boot EFI shell (from rEFIt, I don’t have rEFIt installed so i used a CD)
#spend 30 minutes finding the paginate switch for help 🙂
Shell>help -b

#cd to a writable partition (fs0 was the rEFIt CD, so fs1 was the 100MB fat/efi partition)
Shell>fs1:
fs1:\>

#dump the nvram variable
fs1:\>dmpstore SystemAudioVolume -s sav.txt

#edit the the dumped variable with a hexeditor (probably wiser to keep
the original dump and edit a copy)
fs1:\>hexedit sav.txt

#load the new nvram variable
fs1:\>dmpstore SystemAudioVolume -l sav.txt

#exit to refit and reboot
fs1:\>exit

Enjoy the BONGless restart.

So for a while it wasn’t apparent what value to change with the
hexeditor, and tbh, not being familiar with any hexeditor, I’m not sure
I got it right. Further experimentation indicates I may have just borked
it, but apparently that also serves to make it shut up.

The dmpstore’d files (now back in Debian) look like this:

$ cat SystemAudioVolume.txt
$SystemAudioVolume(and some illegible characters with no new line)

$ hexdump -C SystemAudioVolume.txt
00000000  24 00 00 00 53 00 79 00  73 00 74 00 65 00 6d 00  |$...S.y.s.t.e.m.|
00000010  41 00 75 00 64 00 69 00  6f 00 56 00 6f 00 6c 00  |A.u.d.i.o.V.o.l.|
00000020  75 00 6d 00 65 00 00 00  10 61 43 7c 2a ab bb 4b  |u.m.e....aC|*..K|
00000030  a8 80 fe 41 99 5c 9f 82  07 00 00 00 01 00 00 00  |...A.\..........|
00000040  71                                                |q|
00000041

(In hexedit.efi the 00000041 line did not appear.)

Since running dmpstore SystemAudioValume by itself returned output
something like:
00000: 71 “q”
I took a guess and replaced the 71 with 80 (as suggested on the mailing list.) getting:

$ hexdump -C SystemAudioVolume80.txt
00000000  24 00 00 00 53 00 79 00  73 00 74 00 65 00 6d 00  |$...S.y.s.t.e.m.|
00000010  41 00 75 00 64 00 69 00  6f 00 56 00 6f 00 6c 00  |A.u.d.i.o.V.o.l.|
00000020  75 00 6d 00 65 00 00 00  10 61 43 7c 2a ab bb 4b  |u.m.e....aC|*..K|
00000030  a8 80 fe 41 99 5c 9f 82  07 00 00 00 01 00 00 00  |...A.\..........|
00000040  80                                                |.|
00000041

Which turned off the bong and I’m happy. But for kicks I also tried 32
(for 25% more BONG)

$ hexdump -C sav.txt
00000000  24 00 00 00 53 00 79 00  73 00 74 00 65 00 6d 00  |$...S.y.s.t.e.m.|
00000010  41 00 75 00 64 00 69 00  6f 00 56 00 6f 00 6c 00  |A.u.d.i.o.V.o.l.|
00000020  75 00 6d 00 65 00 00 00  10 61 43 7c 2a ab bb 4b  |u.m.e....aC|*..K|
00000030  a8 80 fe 41 99 5c 9f 82  07 00 00 00 01 00 00 00  |...A.\..........|
00000040  32                                                |2|
00000041

But that also gave me silence, so I think I’m doing it ‘wrong.’
However reloading the original (71) file did bring back the bonging. So
I don’t think any of this is particularly dangerous for those who may
want to here the noise again someday. 🙂