Ubuntu: How can I break my computer's audio?



Question:

For reasons I won't get into, I need to ensure that my computer:

  • Cannot play audio
  • Can only be made to play audio again by re-installing the operating system (per a commenter's suggestion: re-installing Ubuntu from a live USB)
  • Can otherwise function completely normally

I'm running Ubuntu GNOME 16.04.


Solution:1

If you want to do this properly, you need a hardware solution. You can't break Ubuntu this way without either making it trivial to undo, or breaking it too much.

Remove the sound card, put hot glue in the jacks, desolder the built-in speakers. And obviously do the same for USB plugs to stop somebody plugging in a USB sound card/speaker. And remove any Bluetooth hardware for the same reason.

If this sounds unacceptable, you might want to give some of these reasons you "won't get into" so we can see what you're actually trying to do. At the moment it just sounds like you're trying to break somebody else's computer.


Or you could just blacklist the snd module. That'll stop any ALSA drivers loading, which means PulseAudio won't have anything to play to (locally).

echo 'blacklist snd' | sudo tee /etc/modprobe.d/blacklist-snd.conf  

And reboot. It's fairly trivial to fix though, if you know what you're doing.


Solution:2

Plan A: on boot look into BIOS, most BIOSes have possibility to disable PCI (onboard) devices. If you disable audio there, it requires deeper knowledge (or another question in askubuntu ;) to enable it again.


Solution:3

Chai T. Rex pointed that it can't be achieved, because any steps described here will always be possible to revert and get sound again. This is true.

Anyway, you could blacklist the sound kernel modules (drivers). I used cat /proc/modules | grep snd to find out which were my modules. Then I added them to /etc/modprobe.d/blacklist.conf to blacklist them. Add blacklist {module_name} per each module. Then reboot.

As a result, when I try to run MOC, I get:

  myusr@myhost:~$ mocp  Running the server...  Trying JACK...  Trying ALSA...  Trying OSS...    FATAL_ERROR: No valid sound driver!      FATAL_ERROR: Server exited!  

Also, to take it a bit further, remove linux-sound-base: sudo apt-get remove linux-sound-base.

If you take away the user's ability to install new packages, then he won't be able to reinstall it. Create a new user and remove him from sudoers or just allow him to sudo on certain commands.


Solution:4

If you are dead set on exactly what you've specified in your question, then this is essentially impossible.

It would require tons of modifications to the OS and kernel.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »