Tuesday 20 June 2017

Disabling the PC speaker / beep sound with CentOS 7 / Core

One of the not so common issues I encountered with the Core edition of CentOS was the pc speaker - - the vast majority of the time sound means little when the machine has been virtualised.

I quickly realised that the relevant alsa tools are (expectantly) not provided  and need to be installed.

Doing a quick search for alsamixer with yum brings up the 'alsa-utils' package:

sudo yum provides alsamixer

sudo yum -y install alsa-utils

We can then use the alsamixer utility to adjust the speaker volume:

alsamixer

or if we prefer to do it via command line we can issue:

amixer set <sound-card-name> Mute | Unmute

(Use the 'axmixer' command on it's own to view available sound devices.)

To ensure the changes persist across reboot we should issue:

alsactl store

Unfortunately the system beeps (which will quickly drive you mad when working from the console) persisted  - this can be done either by using the setterm utility:

setterm -blength 0

or we can simply disable the speaker module all together with:

rmmod -v pcspkr

and to ensure the changes persist we should add this module to the blacklist:

echo 'blacklist pcspkr' >> /etc/modprobe.d/blacklist

I realise there are alternative methods to do this - however this was the easiest and most efficient for myself.

0 comments:

Post a Comment