unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Ding doing nothing
@ 2015-01-09 18:38 Marcin Borkowski
  0 siblings, 0 replies; 7+ messages in thread
From: Marcin Borkowski @ 2015-01-09 18:38 UTC (permalink / raw)
  To: Help Gnu Emacs mailing list

Hello,

M-: (ding) does not make any sound (I use Ubuntu Linux and did not mess
around with sound setting).  I can hear no sound in the graphical Emacs
interface as well as in the terminal (both a terminal program under
X and the text mode).  What might be the cause?  Visible bell works just
right (if I turn it on, that is.)  Of course, I did my checks with
emacs -Q.

TIA,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Ding doing nothing
       [not found] <mailman.17554.1420828751.1147.help-gnu-emacs@gnu.org>
@ 2015-01-09 19:26 ` Sven Joachim
  2015-01-09 19:45   ` Marcin Borkowski
  0 siblings, 1 reply; 7+ messages in thread
From: Sven Joachim @ 2015-01-09 19:26 UTC (permalink / raw)
  To: help-gnu-emacs

On 2015-01-09 19:38 +0100, Marcin Borkowski wrote:

> M-: (ding) does not make any sound (I use Ubuntu Linux and did not mess
> around with sound setting).  I can hear no sound in the graphical Emacs
> interface as well as in the terminal (both a terminal program under
> X and the text mode).  What might be the cause?  Visible bell works just
> right (if I turn it on, that is.)  Of course, I did my checks with
> emacs -Q.

Probably that's because (ding) uses the PC speaker, and Ubuntu disables
it by default.  If you run "sudo modprobe pcspkr", does the bell work?

To enable the PC speaker permanently, comment out the line with
"blacklist pcspkr" in /etc/modprobe.d/blacklist.conf.

Cheers,
       Sven


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Ding doing nothing
  2015-01-09 19:26 ` Sven Joachim
@ 2015-01-09 19:45   ` Marcin Borkowski
  2015-01-09 21:08     ` Marcin Borkowski
  0 siblings, 1 reply; 7+ messages in thread
From: Marcin Borkowski @ 2015-01-09 19:45 UTC (permalink / raw)
  To: help-gnu-emacs


On 2015-01-09, at 20:26, Sven Joachim <svenjoac@gmx.de> wrote:

> On 2015-01-09 19:38 +0100, Marcin Borkowski wrote:
>
>> M-: (ding) does not make any sound (I use Ubuntu Linux and did not mess
>> around with sound setting).  I can hear no sound in the graphical Emacs
>> interface as well as in the terminal (both a terminal program under
>> X and the text mode).  What might be the cause?  Visible bell works just
>> right (if I turn it on, that is.)  Of course, I did my checks with
>> emacs -Q.
>
> Probably that's because (ding) uses the PC speaker, and Ubuntu disables
> it by default.  If you run "sudo modprobe pcspkr", does the bell work?

Nope.  Stupid Ubuntu.  It's making me more and more angry.  I though it
is me (the owner of the machine) who should decide what is turned on and
what is turned off.  Of course, in the "system settings" dialog there
was no suitable option.  Why bother using Ubuntu over, say, Arch, if
I have to hunt for text config files in /etc anyway?

> To enable the PC speaker permanently, comment out the line with
> "blacklist pcspkr" in /etc/modprobe.d/blacklist.conf.

Thanks a lot!  I guess I'll restart my computer /only/ to check whether
this works.

> Cheers,
>        Sven

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Ding doing nothing
  2015-01-09 19:45   ` Marcin Borkowski
@ 2015-01-09 21:08     ` Marcin Borkowski
  2015-01-09 21:47       ` Bob Proulx
  0 siblings, 1 reply; 7+ messages in thread
From: Marcin Borkowski @ 2015-01-09 21:08 UTC (permalink / raw)
  To: help-gnu-emacs


On 2015-01-09, at 20:45, Marcin Borkowski <mbork@wmi.amu.edu.pl> wrote:

> On 2015-01-09, at 20:26, Sven Joachim <svenjoac@gmx.de> wrote:
>
>> On 2015-01-09 19:38 +0100, Marcin Borkowski wrote:
>>
>>> M-: (ding) does not make any sound (I use Ubuntu Linux and did not mess
>>> around with sound setting).  I can hear no sound in the graphical Emacs
>>> interface as well as in the terminal (both a terminal program under
>>> X and the text mode).  What might be the cause?  Visible bell works just
>>> right (if I turn it on, that is.)  Of course, I did my checks with
>>> emacs -Q.
>>
>> Probably that's because (ding) uses the PC speaker, and Ubuntu disables
>> it by default.  If you run "sudo modprobe pcspkr", does the bell work?
>
> Nope.  Stupid Ubuntu.  It's making me more and more angry.  I though it
> is me (the owner of the machine) who should decide what is turned on and
> what is turned off.  Of course, in the "system settings" dialog there
> was no suitable option.  Why bother using Ubuntu over, say, Arch, if
> I have to hunt for text config files in /etc anyway?
>
>> To enable the PC speaker permanently, comment out the line with
>> "blacklist pcspkr" in /etc/modprobe.d/blacklist.conf.
>
> Thanks a lot!  I guess I'll restart my computer /only/ to check whether
> this works.

Well, it does not...  Maybe I should just live with it (and turn the
"visual bell" on).

>> Cheers,
>>        Sven
>
> Best,

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Ding doing nothing
  2015-01-09 21:08     ` Marcin Borkowski
@ 2015-01-09 21:47       ` Bob Proulx
  2015-01-11 13:27         ` Marcin Borkowski
  0 siblings, 1 reply; 7+ messages in thread
From: Bob Proulx @ 2015-01-09 21:47 UTC (permalink / raw)
  To: help-gnu-emacs

Marcin Borkowski wrote:
> Well, it does not...  Maybe I should just live with it (and turn the
> "visual bell" on).

There are a lot of reasons why the tty bell might not ring on modern
computer systems.  Sven already noted that it uses the PC speaker.
Usually that has really harsh binary output audio suitable only for
very limited noise making.  A lot of modern computers don't even have
a PC speaker these days.  It is considered obsolescent hardware having
been replaced by a sound card with speakers.  On several of my
computers there isn't any PC speaker present.  Therefore on those
systems there can't be a traditional tty bell that rings through the
PC speaker.

In addition to the older Linux kernel module pcspkr there is a newer
module that uses snd_pcsp.  On my system in order to prevent the tty
bell I have to blacklist both of those kernel modules.

On my Debian Sid system the tty bell is routed through the sound card
speakers.  This uses ALSA.  There is an alsa mixer control for Beep.
In the alsa control it may be muted or unmuted.  Try looking for that
control.

  amixer scontrols
  amixer get Beep
  amixer set Beep 50% unmute

It is possible that you have PulseAudio installed which will override
all of the audio controls.  I won't say anything more other than on my
system in order to get a working sound system I need to remove PA.  YMMV.

So first I would really check that your system has the hardware
capability for ringing the terminal bell.  It might not.

On a system with a working terminal bell the following will ring the
bell in a simple and automatable way.  It basically emits ASCII
character 7 the BEL character.  In Emacs every C-g (control-g is the
ascii 0x7 BEL character) rings the bell.  But this can be done in a
loop while testing and debugging.

  printf "\a"
  while sleep 1; do printf "Ding! \a\n"; done

As for looking at the bell configuration if you are running X then
check 'xset q' for bell information.  It might be disabled in X.
On my system:

  $ xset q | grep bell
    bell percent:  50    bell pitch:  400    bell duration:  100

You mentioned visual bell.  If you are using screen then it also
interprets the BEL character too.  If you are using ssh to a remote
system and screen there then it is still the local terminal that
handles the tty bell, if it receives the ASCII BEL 7 character.

I have seen BIOS configurations that allow for enabling and disabling
the PC Speaker.

There are so many ways for it to be blocked that it is hard to have a
single cookbook way of controlling every possibilty.  All I can do is
suggest to get to the lowest level available for debugging and then to
wish you good luck.

Good Luck!
Bob



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Ding doing nothing
  2015-01-09 21:47       ` Bob Proulx
@ 2015-01-11 13:27         ` Marcin Borkowski
  2015-01-12 21:31           ` Michael Heerdegen
  0 siblings, 1 reply; 7+ messages in thread
From: Marcin Borkowski @ 2015-01-11 13:27 UTC (permalink / raw)
  To: help-gnu-emacs


On 2015-01-09, at 22:47, Bob Proulx <bob@proulx.com> wrote:

> Marcin Borkowski wrote:
>> Well, it does not...  Maybe I should just live with it (and turn the
>> "visual bell" on).
>
> There are a lot of reasons why the tty bell might not ring on modern
> computer systems.  Sven already noted that it uses the PC speaker.
> Usually that has really harsh binary output audio suitable only for
> very limited noise making.  A lot of modern computers don't even have
> a PC speaker these days.  It is considered obsolescent hardware having
> been replaced by a sound card with speakers.  On several of my
> computers there isn't any PC speaker present.  Therefore on those
> systems there can't be a traditional tty bell that rings through the
> PC speaker.
>
> In addition to the older Linux kernel module pcspkr there is a newer
> module that uses snd_pcsp.  On my system in order to prevent the tty
> bell I have to blacklist both of those kernel modules.
>
> On my Debian Sid system the tty bell is routed through the sound card
> speakers.  This uses ALSA.  There is an alsa mixer control for Beep.
> In the alsa control it may be muted or unmuted.  Try looking for that
> control.
>
>   amixer scontrols
>   amixer get Beep
>   amixer set Beep 50% unmute
>
> It is possible that you have PulseAudio installed which will override
> all of the audio controls.  I won't say anything more other than on my
> system in order to get a working sound system I need to remove PA.  YMMV.
>
> So first I would really check that your system has the hardware
> capability for ringing the terminal bell.  It might not.
>
> On a system with a working terminal bell the following will ring the
> bell in a simple and automatable way.  It basically emits ASCII
> character 7 the BEL character.  In Emacs every C-g (control-g is the
> ascii 0x7 BEL character) rings the bell.  But this can be done in a
> loop while testing and debugging.
>
>   printf "\a"
>   while sleep 1; do printf "Ding! \a\n"; done
>
> As for looking at the bell configuration if you are running X then
> check 'xset q' for bell information.  It might be disabled in X.
> On my system:
>
>   $ xset q | grep bell
>     bell percent:  50    bell pitch:  400    bell duration:  100
>
> You mentioned visual bell.  If you are using screen then it also
> interprets the BEL character too.  If you are using ssh to a remote
> system and screen there then it is still the local terminal that
> handles the tty bell, if it receives the ASCII BEL 7 character.
>
> I have seen BIOS configurations that allow for enabling and disabling
> the PC Speaker.
>
> There are so many ways for it to be blocked that it is hard to have a
> single cookbook way of controlling every possibilty.  All I can do is
> suggest to get to the lowest level available for debugging and then to
> wish you good luck.
>
> Good Luck!
> Bob

Thanks for your input!

Somehow it started to work.  Strange.

Anyway, would it be a good idea to redefine (ding) to e.g. fire aplay
with some wav file?  I mean: would this work?  I guess that if some code
invokes (ding), it would; but what if that code is byte-compiled, for
instance?  Should it then be compiled again?

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Ding doing nothing
  2015-01-11 13:27         ` Marcin Borkowski
@ 2015-01-12 21:31           ` Michael Heerdegen
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Heerdegen @ 2015-01-12 21:31 UTC (permalink / raw)
  To: help-gnu-emacs

Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:

> Anyway, would it be a good idea to redefine (ding) [...]

You might want to try setting `ring-bell-function'.


Michael.




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-01-12 21:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-09 18:38 Ding doing nothing Marcin Borkowski
     [not found] <mailman.17554.1420828751.1147.help-gnu-emacs@gnu.org>
2015-01-09 19:26 ` Sven Joachim
2015-01-09 19:45   ` Marcin Borkowski
2015-01-09 21:08     ` Marcin Borkowski
2015-01-09 21:47       ` Bob Proulx
2015-01-11 13:27         ` Marcin Borkowski
2015-01-12 21:31           ` Michael Heerdegen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).