# Turn off beep from Pc-Speaker

## d4h0od

Im just wondering how i turn off that beep when i try to tab-complete a command and i didnt spell it correct ?

Can i turn off sound in bash or maybe even better can i somehow turn off pc-speaker totally in gentoo ?

I have looked in bios but cant find anything about pc-speaker in there...

----------

## gfunkmonk

you could use alsa-mixer to mute the pc speaker, I believe.

----------

## d4h0od

ok... i dont have any sound installed yet and no alsa stuff either

what packages do i have to emerge to get alsa-mixer ? i dont find any package name alsa-mixer or alsamixer...

----------

## Musashi

This is an easy thing to do without alsa installed.   Just type xset b off or you could control the volume of the beep with xset b [1-5 or whatever]. Man xset and you will learn all about it.  Hope that helped. 

Bobby C.

----------

## Musashi

Oops.  Forgot to add that this is reset after each login.  So to make it happen everytime you login just add it to your .bash_profile.  

Bobby C.

----------

## d4h0od

tnx m8.... will try it right away  :Wink: 

----------

## d4h0od

i got an error msg saying something like unable to open display "" ;(

----------

## dizzy

If you want system wide silence of that annoying pc speaker.. and who wouldn't,  :Wink:   you could try adding this line to /etc/inputrc.

```
set bell-style none
```

----------

## kirill

Ok I know how to mute the speaker in bash, but is there any way to mute it when I reboot? Windows doesn't make my pc beep when restarting (well, not always  :Wink: ), but linux does, always!

I was thinking of ripping the speaker of physically, but on the other hand I want to get some output from the pc if something goes wrong (one beep on startup == Nothing is broken   :Razz:  )

any ideas? maby BIOS? but again, I want to get informed in case something goes wrong  :Very Happy: 

----------

## dizzy

Try this.

```
setterm -blength 0
```

I put this line in /etc/conf.d/localstart on my system.

----------

## kirill

 *dizzy wrote:*   

> Try this.
> 
> ```
> setterm -blength 0
> ```
> ...

 

No, you misunderstoon my question completely  :Very Happy: 

 *kirill wrote:*   

> ...I know how to mute the speaker in bash
> 
> 

 

 *kirill wrote:*   

> ...is there any way to mute it when I reboot?

 

I mean the beep which comes right after you start the PC   :Cool: 

----------

## dizzy

kirill: Sorry man.. I didn't read your post properly. I don't know how to disable the beep right after you start the pc besides the obvious (disconnecting the wire from your pc speaker to the mainboard). But since you want the beep to for diagnostic then I can't see a way around this. Maybe someone here might know something..

BTW, my laptop does not make a beep wihen it starts but plays a llittle tune, then display the sony vaio logo. So it might be possible for a bios hack... maybe. It's a long shot though. You might want to look into it.

----------

## DMK

hi...

you could edit the kernel-source for this...

there are some patches flying around but i have none handy... but simply changing in drivers/char/vt.c 

the "#if blabla" before the kd_mksound function into "#if (blabla) && false" makes your speaker quiet without sideeffects...

you could also change it like so:

the #if before _kd_mksound in kernelsrc/drivers/vt.c from

```

#if defined(__i386__) || defined(__alpha__) || defined(CONFIG_PPC_ISATIMER) \

    || (defined(__mips__) && defined(CONFIG_ISA)) \

    || (defined(__arm__) && defined(CONFIG_HOST_FOOTBRIDGE)) \

    || defined(__x86_64__) 

```

into:

```

#if (  defined(__i386__) || defined(__alpha__) || defined(CONFIG_PPC_ISATIMER) \

    || (defined(__mips__) && defined(CONFIG_ISA)) \

    || (defined(__arm__) && defined(CONFIG_HOST_FOOTBRIDGE)) \

    || defined(__x86_64__) ) \

    && !defined(CONFIG_DISABLE_PC_SPEAKER)

```

and in arch/i386/config.in just before the last line at the bottom of the file:

```

if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then

   bool ' Disable the PC-Speaker' CONFIG_DISABLE_PC_SPEAKER

fi

source lib/Config.in

```

then

> make menuconfig 

and check 'Disable the PC-Speaker'

make dep && make bzImage 

and there you go

[update: 

here is one patch :

http://www.cs.helsinki.fi/linux/linux-kernel/2001-18/0837.html

but it is for an old kernel so you have perhaps to adapt it... i dont know if it is included into the current sourcetree... ]

----------

## mb4guns

or u just pull the plug  :Razz: 

----------

## BradN

I think what is happening is that when windows reboots, it leaves (or sets?) the flag in some special ram location indicating that the BIOS self-test has already completed, and probably skips the beep when it reboots.  Linux must not preserve this... perhaps a new kernel version does this, or there's a patch available?

----------

## plasmaroo

Unless it's a laptop, just RIP the thing out ! ! ! ! ! ! !

 :Laughing: 

----------

## de4d

ive even ripped it out of my notebook...

but now after DMKs research ill maybe put it in back ^^

(good work DMK *p* )

----------

## mb4guns

I left it in my notebook since I ofthen use it when I'm relax in garden or bed , then I wakeup on the beep  :Wink: 

----------

