LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (http://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   beep(1) not working on ThinkPad X230 (http://www.linuxquestions.org/questions/linux-hardware-18/beep-1-not-working-on-thinkpad-x230-4175427118/)

tarverator 09-13-2012 02:58 PM

beep(1) not working on ThinkPad X230
 
beep(1), that formerly trusty little program that beeps the pc speaker, isn't working on my ThinkPad X230.

The modules "pcspkr" and "snd_pcsp" are blacklisted by default in Linux Mint Mate Maya. I un-blacklisted both, rebooted even, and still no joy.

Is this a hardware rather than a Linux Mint issue? GRUB beeps at boot time.

suttiwit 09-15-2012 08:50 AM

I heard there is a simpler way to do it in the command-line but I couldn't remember so, as far as i know... there is another way to beep. You will need a C compiler (gcc), /usr/include/stdio.h and nano. (These are already in Mint 13).
We are going to use the Bell escape code technique, Follow these steps:
1. Open up terminal.
2. Type "nano test.c" and paste this code in to the text editor.
Code:

#include <stdio.h>

int main()
{
puts("\a");
return 0;
}

3. Press CTRL+O and Enter and CTRL+X (CTRL = Control Key).
4. Type this in terminal:
Code:

gcc test.c
If things went well, you should see nothing.
5. Type this in terminal:
Code:

./a.out
Please quote my post whether you hear a beep or not.

tarverator 09-15-2012 09:03 AM

I added this step:
Code:

chmod +x a.out
It compiled and ran fine, but there was no sound. I even added some debug code to make completely sure it was running:
Code:

#include <stdio.h>

int main()
{
puts("\a");
printf("Beep, damn it!\n");
return 0;
}


tarverator 09-15-2012 09:15 AM

This is interesting... I un-blacklisted pcspkr and got this when I tried to load it:
Code:

thinx ~ # modprobe pcspkr
FATAL: Error inserting pcspkr (/lib/modules/3.2.0-30-generic/kernel/drivers/input/misc/pcspkr.ko): Device or resource busy

This is after loading snd_pcsp.

tarverator 09-15-2012 09:52 PM

If not beep(1), what is the "normal" way to make a sound from within a script running as root?

cvlc at least works as a normal user, notwithstanding that it takes ctrl-c to get the prompt back; but it refuses to run as root.

paplay doesn't work (as expected at least) at all.
Code:

tarver ~/Audio/Sounds $ paplay b-tone.mp3
Failed to open audio file.
tarver ~/Audio/Sounds $ cvlc b-tone.mp3
VLC media player 2.0.3 Twoflower (revision 2.0.2-93-g77aa89e)
[0x95c01c8] dummy interface: using the dummy interface module...
^Ctarver ~/Audio/Sounds $


suttiwit 09-15-2012 11:48 PM

Let me confirm this: Did GRUB really beep the internal Speaker?

tarverator 09-16-2012 06:14 AM

I wish I knew. Something beeps long before the OS is loaded.

suttiwit 09-16-2012 09:26 AM

Hey, dude. I know what beeped before the OS... It's your BIOS! BIOS = Basic Input Output System.
It runs everytime you boot. Most computers have BIOS. The beeps from BIOS mean something too! :)
If it beeps weirdly then it means your computer has a problem, etc.
If it beeps like what you hear everyday, your computer is OK.

Also, On some modern laptops. The Internal PC Speaker isn't installed. So, You just can't get it to beep because there is no speaker... :D

tarverator 09-16-2012 05:30 PM

The official X230 manual talks about the usual IBM/Lenovo beep codes that go back more than half way to the dawn of computing. What I don't know is if there is a separate tiny little buzzer tucked away somewhere, or if BIOS has a way of activating the same speakers that an OS later uses for routine sound. Either way, both BIOS at POST (power on self test) time and GRUB at boot time evidently have some way of activating something that vibrates and makes a sound.

What I am trying to figure out is what to call in a script running as root in a Linux environment, that does something similar. Specifically -- since beep(1) appears not to be supported -- I am broadening my question to ask, what would be the usual way to get root to send an audible signal in Linux Mint Mate 13 Maya? Getting such a script to su to a non-root user to run a complex media codec just strikes me as weirdly over-complicated. Is there a simple "normal" way to do this?

suttiwit 09-17-2012 06:58 AM

I guess you have to learn lots and lots of science about sound, sound, etc. And also learn how to impliment that in to a computer.

tarverator 09-17-2012 07:03 AM

Frankly, I would prefer if "beep" just beeped.

suttiwit 09-17-2012 07:05 AM

I think the beep command asked something in the computer to translate it to vibrations. Maybe the 'something' doesn't like taking orders.

jamesf 09-17-2012 07:20 AM

Quote:

Originally Posted by tarverator (Post 4782223)
Frankly, I would prefer if "beep" just beeped.

Someone was just talking about the visible bell over in the Slackware forum.

Have you configured your bell to be visible or audible? Also, here's the link:
http://www.linuxquestions.org/questi...le-4175427273/


All times are GMT -5. The time now is 05:38 AM.