Audible bell not working

Questions about codecs, DVD playback, web plugins...
Forum rules
Before you post please read how to get help
Post Reply
spencerjpeterson
Level 1
Level 1
Posts: 2
Joined: Sat Jun 29, 2013 10:11 pm

Audible bell not working

Post by spencerjpeterson » Sat Jun 29, 2013 10:20 pm

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

User avatar
xenopeek
Level 24
Level 24
Posts: 22926
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Audible bell not working

Post by xenopeek » Sun Jun 30, 2013 4:48 am

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
Level 1
Level 1
Posts: 2
Joined: Sat Jun 29, 2013 10:11 pm

Re: Audible bell not working

Post by spencerjpeterson » Sun Jun 30, 2013 12:32 pm

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 24
Level 24
Posts: 22926
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Audible bell not working

Post by xenopeek » Sun Jun 30, 2013 1:17 pm

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: 7
Joined: Thu Jan 18, 2018 4:43 pm

Re: Audible bell not working

Post by Perette » Thu Jan 18, 2018 4:54 pm

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.

Post Reply

Return to “Sound, Multimedia, & Codecs”