Audible bell not working

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
spencerjpeterson

Audible bell not working

Post by spencerjpeterson »

Hi, I have a strange problem.
My audible bell in the terminal doesn't work. Beep doesn't work either. I've googled all over but haven't found a fix. I've checked my terminal settings to make sure it's turned on. I tried running cmus, and it worked. All of my sound works, but the audible bell doesn't. Help!

Linux Mint Olivia, iMac 8,1
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 29597
Joined: Wed Jul 06, 2011 3:58 am

Re: Audible bell not working

Post by xenopeek »

The PC speaker driver (pcspkr) by default is blacklisted and not loaded. Loading it won't help most likely, as I think many laptops don't have a PC speaker. In any case, PulseAudio captures the bell event and plays a sample through your sound card for it and doesn't pass it on to the PC speaker. So the issue here is that there is no sample loaded, which is the case by default. This can be remedied easily.

You didn't mention which edition of Linux Mint you are using (Cinnamon, MATE, Xfce, or KDE) so I can only give you the commands to do this from the terminal.

Here goes. You'll need to edit the file /etc/pulse/default.pa as root. Do that with the command:

Code: Select all

sudo nano /etc/pulse/default.pa
Scroll to the very end of the file (it's a long file) and append these two lines:

Code: Select all

load-sample-lazy bell /usr/share/sounds/freedesktop/stereo/bell.oga
load-module module-x11-bell sample=bell
You can then save and close this file (Ctrl+O, Enter, Ctrl+X). Then restart PulseAudio and wait till your volume control icon reappears (this can take some seconds):

Code: Select all

pulseaudio -k
Now running either of the following commands should give you a sound for the bell:

Code: Select all

xkbbell

Code: Select all

echo $'\a'
The sample I'm using for the bell, /usr/share/sounds/freedesktop/stereo/bell.oga, is installed on your system by default so I'm just using this one as it is convenient. You may of course use another sample for the bell if you so prefer. Any sample that you can play with the paplay command would be suitable.
Image
spencerjpeterson

Re: Audible bell not working

Post by spencerjpeterson »

Awesome! My terminal bell works great now. Thank you so much!
Beep still doesn't do anything though. I looked at my devices with amixer and noticed I had a mixer control labeled 'Beep' so I unmuted it and turned its volume all the way up. Still nothing.
Any idea? (I'm running the cinnamon edition, although I use i3 as my WM more.)
User avatar
xenopeek
Level 25
Level 25
Posts: 29597
Joined: Wed Jul 06, 2011 3:58 am

Re: Audible bell not working

Post by xenopeek »

I'm not familiar with the beep command, just figured out how to make the audible bell working after reading your post and starting wondering about it :) I tried installing beep and enabling pcspkr (`sudo modprobe pcspkr`) but can't get any sound with `beep`. Perhaps somebody else will know, but from what I've read while investigating this I didn't find anything for this except the below.

One trick you can use is create an alias for the beep command. For example with the command:

Code: Select all

alias beep='paplay /usr/share/sounds/freedesktop/stereo/bell.oga'
You can then run the `beep` command and it will play the same sample as for the audible bell. To make this stick:
- open your file manager;
- press Ctrl+H to display hidden files;
- edit or create the file .bashrc;
- add the above line to it.
Image
Perette
Level 1
Level 1
Posts: 14
Joined: Thu Jan 18, 2018 4:43 pm

Re: Audible bell not working

Post by Perette »

Adjusting default.pa as described above partially worked. Note in LinuxMint 18.3, the necessary lines are already in the file and point to a supplied bell file; they just needed uncommenting.

Additionally, in GNOME Terminal, Edit->Profile Preferences and make sure "Terminal bell" checkbox is enabled.

xfce-terminal won't ring my bell, and I can't find a setting.

I'm not sure about other terminals.
Locked

Return to “Sound”