Nostromo boot noise
Add sound effects to the Linux boot sequence.
Let's go!
Alien (1979) is one of my favourite movies. At the beginning of the movie, the spaceship Nostromo's computer boots up in a burst of blinks and noise. Inspired by this Alien-themed Linux greeting card, I create a short clip of that boot noise that plays when sound becomes available during the Linux boot sequence!
Audio clip
Use yt-dlp to extract audio (requires ffmpeg
for WAV conversion) from this sound effects clip on YouTube.
$ yt-dlp --extract-audio --audio-format wav --audio-quality 0 --restrict-filenames https://youtu.be/2ywWFvjE-yU
Copy the first 25 seconds from the original WAV file (example: input.wav
) to make a new sound clip (example: bootsound.wav
) ...
$ ffmpeg -i input.wav -ss 00:00:01 -to 00:00:25 -c copy bootsound.wav
Save bootsound.wav
to /usr/local/share
.
Sound card
Identify the sound card(s). In this instance, my laptop shows a single card ...
$ cat /proc/asound/cards
0 [PCH ]: HDA-Intel - HDA Intel PCH
HDA Intel PCH at 0xf2530000 irq 32
Output the systemd device unit for this sound card ...
$ systemctl list-units | awk '/sound-card0/{print $1}'
sys-devices-pci0000:00-0000:00:1b.0-sound-card0-controlC0.device
Bootsound
Create a shell script (example: bootsound
) that plays the clip ...
#!/bin/sh
#
# bootsound - play sound at boot via bootsound.service
# card1 is '-c 1'
amixer -c 1 sset Master unmute
amixer -c 1 sset Master playback 100%
# card1 is 'plughw:1,0
/usr/bin/aplay -D plughw:0,0 /usr/local/share/bootsound.wav
Make the script executable, and save to /usr/local/bin
.
Systemd
Create a systemd unit file (example: /etc/systemd/system/bootsound.service
) to run the shell script as soon as the sound card becomes available ...
[Unit]
Description=Boot Sound
Requires=sys-devices-pci0000:00-0000:00:1b.0-sound-card1.device
After=sys-devices-pci0000:00-0000:00:1b.0-sound-card1.device
[Service]
Type=oneshot
RemainAfterExit=no
ExecStartPre=/usr/bin/sleep 8
ExecStart=/usr/local/bin/bootsound
[Install]
WantedBy=default.target
Enable unit file ...
$ sudo systemctl enable bootsound.service
Reboot and hear the glorious cacophony of a Nostromo boot!
» Next: Install Linux Mint 21.1 with custom LVM on LUKS
« Previous: Getting started with Git and GitLab