Page 1 of 1

[Solved] Terminal bell not working

Posted: Wed Jan 14, 2015 11:43 am
by Rigrigrig
I can't seem to get the terminal beep to work under Cinnamon:

When I open an xterm (or gnome-terminal) window,

Code: Select all

$ echo $'\a'
should produce a bell sound, but it doesn't.

Things I've tried:
  • unmuted beep in alsa-mixer
  • uncommented

    Code: Select all

    load-sample-lazy x11-bell /usr/share/sounds/freedesktop/stereo/bell.oga
    and

    Code: Select all

    load-module module-x11-bell sample=bell-windowing-system
    in /etc/pulse/default.pa
  • enabled audible-bell, disabled visual-bell in dconf-editor:

    Code: Select all

    $ dconf read /org/cinnamon/desktop/wm/preferences/audible-bell
    true
    $ dconf read /org/cinnamon/desktop/wm/preferences/visual-bell
    false
  • checked the pcspkr module is loaded:

    Code: Select all

    $ lsmod |fgrep pcspkr
    pcspkr                 12595  0
  • installed beep] and ran

    Code: Select all

    $ sudo chmod +s /usr/bin/beep
    to get it to work
Stuff that (after that) does make sound:
  • listening to files in VLC Media Player
  • running

    Code: Select all

    $ beep
  • running

    Code: Select all

    $ xkbbell -force
    (doesn't make sound when omitting the -force flag)
  • switching to a different virtual console with ALT-CTRL-F1, then running

    Code: Select all

    $ echo $'\a'
I tried all those commands in a local xterm window, but my goal is to get bell sounds from a ssh session, so using e.g. the beep command is not a valid alternative.

System info:

Code: Select all

richard@vimes ~ $ inxi -Fxz
System:    Host: vimes Kernel: 3.11-2-amd64 x86_64 (64 bit, gcc: 4.8.1) 
           Desktop: Cinnamon 2.0.14 (Gtk 3.8.4) Distro: LinuxMint 1 debian
Machine:   System: LENOVO product: 20217 version: Lenovo IdeaPad Y510P
           Mobo: LENOVO model: VIQY0Y1 version: 31900003STD Bios: LENOVO version: 74CN41WW(V2.07) date: 08/22/2013
CPU:       Quad core Intel Core i7-4700MQ CPU (-HT-MCP-) cache: 6144 KB flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 19157.9 
           Clock Speeds: 1: 800.00 MHz 2: 800.00 MHz 3: 800.00 MHz 4: 800.00 MHz 5: 800.00 MHz 6: 800.00 MHz 7: 800.00 MHz 8: 800.00 MHz
Graphics:  Card-1: Intel 4th Gen Core Processor Integrated Graphics Controller bus-ID: 00:02.0 
           Card-2: NVIDIA GK107M [GeForce GT 750M] bus-ID: 01:00.0 
           X.Org: 1.14.3 drivers: intel (unloaded: fbdev,vesa) Resolution: 1920x1080@59.9hz 
           GLX Renderer: Mesa DRI Intel Haswell Mobile GLX Version: 3.0 Mesa 9.2.2 Direct Rendering: Yes
Audio:     Card-1: Intel 8 Series/C220 Series High Definition Audio Controller driver: snd_hda_intel bus-ID: 00:1b.0 
           Card-2: Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller driver: snd_hda_intel bus-ID: 00:03.0 
           Sound: Advanced Linux Sound Architecture ver: k3.11-2-amd64
Network:   Card-1: Qualcomm Atheros QCA8171 Gigabit Ethernet driver: alx port: 3000 bus-ID: 08:00.0
           IF: eth0 state: down mac: <filter>
           Card-2: Intel Centrino Wireless-N 2230 driver: iwlwifi ver: in-tree: bus-ID: 09:00.0
           IF: wlan0 state: up mac: <filter>
Drives:    HDD Total Size: 1024.2GB (57.3% used) 1: id: /dev/sda model: LITEONIT_LSS size: 24.0GB temp: 0C 
           2: id: /dev/sdb model: ST1000LM024_HN size: 1000.2GB temp: 36C 
Partition: ID: / size: 9.8G used: 7.2G (78%) fs: ext4 ID: /home size: 4.8G used: 2.8G (62%) fs: ext4 
Sensors:   System Temperatures: cpu: 49.0C mobo: N/A 
           Fan Speeds (in rpm): cpu: N/A 
Info:      Processes: 238 Uptime: 22:53 Memory: 2148.4/7726.9MB Runlevel: 2 Gcc sys: 4.8.2 
           Client: Shell (bash 4.3.25) inxi: 1.9.14 
Any advice would be much appreciated.

Edit:
Lots of fiddling with Preferences>Sound>Output:Play sound through, alsamixer, pavucontrol, and /etc/pulse/default.pa resulted in getting it to work.
I can't seem to figure out what did the trick though, as everything I try changing now results in either no sound at all, or working sound+working bell.

Re: Terminal bell not working

Posted: Sat Jan 17, 2015 1:18 pm
by darethehair
An interesting challenge!

Through a bit of Googling, there is a way to make a 'beep' sound in the local terminal, or (via ssh) on a remote terminal -- but what I think you are looking for is a way to beep the *local* terminal while connected to a remote one? I have not found a way to do this :(

Local terminal (requires root permission!):

Code: Select all

sudo sh -c "echo -e '\a' > /dev/console"
Remote terminal also requires root access (or for you to sign on as root):

Code: Select all

ssh root@remoteserver "echo -e '\a' > /dev/console"
It baffles me why a simple "echo -e '\a'" doesn't work without root permission.

Credits to places like this for the answer:

http://superuser.com/questions/47564/re ... in-speaker

Re: Terminal bell not working

Posted: Sat Jan 17, 2015 2:05 pm
by Rigrigrig
darethehair wrote:

Code: Select all

sudo sh -c "echo -e '\a' > /dev/console"
It baffles me why a simple "echo -e '\a'" doesn't work without root permission.
/dev/console is the system console, so it makes sense that you'd need root permission.

/dev/tty is the current console, so this doesn't error:

Code: Select all

echo -e '\a' > /dev/tty
I noticed that If I enable the Visual Bell in xterm by ctrl-middle clicking, the window does flash when I do that, only the sound never happens.

Starting to suspect that Cinnamon might be eating the bell-sound requests.

Re: Terminal bell not working

Posted: Sat Jan 17, 2015 2:08 pm
by darethehair
Rigrigrig wrote:/dev/tty is the current console, so this doesn't error:

Code: Select all

echo -e '\a' > /dev/tty
True, it doesn't error, but (on my machine) I get no beep sound either :/

Not sure what other advise I can offer -- I can appreciate the desire to be able to do something like this, but (surprisingly) I have not run across a clear-cut solution yet...