Disable all sound permanently

I've got a lab for high school students, and I'd like to disable audio altogether on the lab computers.

Any suggestions? I've been looking at alsa force-unload, but that only kills processes that are currently using the sound card. When I reload the browser and hit YouTube, sound comes back.

Basically, I want to unload sound from the kernel ...but easier than that.


Solution 1:

All right, so blacklisting the sound related modules worked. Thanks to this post:

http://www.pc-freak.net/blog/disabling-sound-kernel-modules-debian-ubuntu-gnu-linux-servers/

The details of the fix:

edit /etc/modprobe.d/snd-blacklist.conf and add these entries (from a Dell standalone pc with 18.04)

blacklist soundcore
blacklist snd
blacklist snd_pcm
blacklist snd_hda_codec_hdmi
blacklist snd_hda_codec_realtek
blacklist snd_hda_codec_generic
blacklist snd_hda_intel
blacklist snd_hda_codec
blacklist snd_hda_core
blacklist snd_hwdep
blacklist snd_timer

Solution 2:

A hardware solution: insert a mini-jack connector in the sound output port, but only a connector, without any wire or speaker on it. This has worked for me since the 80's to silence the Mac's otherwise beautiful power-on ding.

Solution 3:

A simple solution would be removing the alsa drivers, i.e.:

sudo apt-get remove --purge alsa

Solution 4:

This seems to work. Edit the file /etc/pulse/client.conf

Change the line:

; autospawn = yes

to

autospawn = no

And

; daemon-binary = /usr/bin/pulseaudio

to

daemon-binary = /usr/bin/pulseaudio

Reboot.