Reduce RAM consumption by disabling your old sound drivers

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

Post Reply
arifd
Established Member
Posts: 65
Joined: Sun Nov 29, 2020 11:09 am

Reduce RAM consumption by disabling your old sound drivers

Post by arifd »

So your kernel came loaded up with a bunch of drivers for the built-in speakers of your computer.

Since we're PROS and don't care for that, heres a 1 liner that will prevent the built in speaker drivers from loading, thus freeing up resources, and improving the speed of your kernel (marginally).

blacklisting modules is safe for two reasons, 1) Even if you blacklist a module, but another that isn't blacklisted requests it, the kernel will load it anyway, 2) if it really does do something unwanted to your system, just delete the instruction to blacklist it, and following a reboot, everything will be as before.

'grep -v usb' excludes the usb audio driver from being blacklisted because I want my USB audio interface to work!

You may find MIDI doesn't work after, well just tweak the code or the created file.

run this as sudo:

Code: Select all

for driver in $(lsmod | awk '{print $1}' | grep -ie "snd\|sound\|spkr" | grep -v usb); do echo "blacklist $driver" | tee -a > /dev/null /etc/modprobe.d/default-audio-drivers-blacklist.conf; done
to completely reverse it:

Code: Select all

sudo rm /etc/modprobe.d/default-audio-drivers-blacklist.conf
On my system I went from using 123Mb of RAM after fully booting (including Pulseaudio and a graphical environment :D ) to 109Mb RAM usage.

My internal speaker makes a noise like it has just summoned the devil, for about 2 seconds the first time any sound is played through my system, but after that it does nothing.

Edit: I found the source of the demonic screeching. For some reason, once you blacklist everything, in my case, another module gets loaded: snd_pcsp you just have to add that to the list of blacklisted modules manually
Post Reply