Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'd like to get the terminal bell playing through my speakers, but so far I haven't had any luck. I've tried the suggestions in this question as well as a number of other sources, but I haven't had any luck.

I've also gone the route of un-blacklisting pcspkr in modprobe, but that only works for the beep command, not the terminal bell, echo -e '\a', ping -a, etc. I don't have a "PC Beep" option in alsamixer

share|improve this question

3 Answers 3

up vote 12 down vote accepted

To fix this problem persistently:

  • Run gconf-editor and if the desktop | gnome | peripherals | keyboard | bell_mode setting is present then change it from off to on
  • Run dconf-editor and if the org | gnome | settings-daemon | peripherals | keyboard | bell-mode setting is present then change it from off to on
  • Add pactl upload-sample /usr/share/sounds/gnome/default/alerts/glass.ogg bell.ogg to the file ~/.xprofile
  • Add [ "$DISPLAY" ] && xset b 100 to the file ~/.bashrc

The simplest way to activate this solution is to reboot.

Further, to implement this solution immediately for a terminal window that is already open, run the pactl command and run the xset command in the terminal window in question.

share|improve this answer
    
I put the pactl upload-sample command in a shell script, but your method is more organized. Thanks! –  JoBu1324 Dec 12 '12 at 16:54
    
If you put the pactl command in ~/.xprofile it gets executed at the start of the GUI session. –  jdthood Dec 12 '12 at 18:32
    
The dconf-editor version of the bell-mode setting seems to be org.gnome.settings-daemon.peripherals.keyboard. –  lgarzo Jun 21 '13 at 8:59
    
@lgarzo: Thanks for the tip. I will update the answer. –  jdthood Jun 21 '13 at 9:22
    
Does not work with Ubuntu 12.04 –  Hibou57 Jul 9 at 9:25

I finally found a solution, which doesn't require alsamixer to have a PC Beep option. I think I remember all my changes:

uncomment the following in /etc/pulse/default.pa:

  • load-sample-lazy x11-bell /usr/share/sounds/ubuntu/stereo/bell.ogg
  • load-module module-x11-bell sample=bell-windowing-system

per this bug, run pactl upload-sample /usr/share/sounds/ubuntu/stereo/bell.ogg bell.ogg

share|improve this answer
    
Tried this, pactl gave me Connection failure: Connection refused pa_context_connect() failed: Connection refused. –  YodaDaCoda Dec 11 '12 at 23:33
    
Maybe this thread will help - if you've ever run pulseaudio as root. –  JoBu1324 Dec 11 '12 at 23:49
    
I'm having a different problem, actually. Pulseaudio throws Failed to open module "module-esound-protocol-unix": file not found. Probably not worth discussing here since I'm running 13.04, though I would love to be able to verify your solution. –  YodaDaCoda Dec 12 '12 at 0:05

I've encountered this problem before. From what I remember, the problem is that the terminal bell tries to ring an internal computer speaker (as in an old-school desktop) but laptops and some newer computers are missing such a thing.

The only solution I found at the time was to sudo apt-get install sox and

play -n synth <duration in seconds> sine <freq in hz> vol <volume (0-1)>

e.g.

 play -n synth 0.1 sine 800 vol 0.5
share|improve this answer
    
try my solution - I'd love to know if it works for you! –  JoBu1324 Dec 11 '12 at 23:10
    
you may use speaker-test for this too –  Janus Troelsen Jun 11 at 9:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.