Ubuntu: Why can't I hear audible pings?



Question:

The ping manual says that ping -a will generate audible pings, but when I try this no sound is made.

What am I doing wrong?


Solution:1

From looking at the source, ping produces a bell by printing the ASCII bell char '\a', which is doing nothing, probably because the system beep is disabled.

You can manually try to produce the bell with:

echo -e "\a"  


Solution:2

compiz "eats" the sound and this is a reported bug, so it won't work in the graphical interface in standard compiz ubuntu sessions. (see this bug report, thanks to Dylan McCall comment for the URL).

If you really need the functionality, you could run your ping from a physical console (Ctrl+Alt+F1). But don't forget:

sudo modprobe pcspkr  

As module pcspkr isn't loaded at boot time and actually drives the old PC speaker you should have in your computer.

You can add it to /etc/modules if you think you'll need it at a regular basis as this will have the effect to tell the system to load it at boot time.

Note: as it's a compiz issue, if you are using gnome-fallback session you shouldn't experience the issue. If this is the case, check your terminal program for options related to console bell.


Solution:3

1 says it's missing a sound file. You can add it with the following command:

  pactl upload-sample /usr/share/sounds/gnome/default/alerts/glass.ogg bell.ogg  

For a permanent solution add the command to ~/.xprofile


Solution:4

Because the question is not specified for Unity only, I'll make a little hint about KDEs Konsole. You just should specify a sound for a "Bell in Visible Session" which is under Settings -> Configure Notifications. For example I'm using sounds from /usr/share/sounds/ section. I don't remember is there such an option in Ubuntu's Unity terminal.


Solution:5

In my case, audible bell was disabled because of xset -b in my ~/.xsession file and could be re-enabled with xset b.


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