Xterm Beep problems?

Booting, installing, newbie
Post Reply
Message
Author
User avatar
James186282
Posts: 270
Joined: Tue 08 Sep 2009, 19:14
Location: Minnesota

Xterm Beep problems?

#1 Post by James186282 »

Hi everyone. I'm coming slowly up to speed on the C++ compiler and have written some routines to print text on the terminal in various colours and locations. One thing thats driving me mad is the inability to send the bell character (Control G) to the screen and get any sound. I can set the terminal to visual beep and get the screen to blink but no "blinking" sounds no matter what I do. Is there some dumb thing I'm doing wrong? I can play an MP3 with ALSA Player and I've looked at the mixer and think all the sliders are wide open for max volume.

I've also tried to compile a beep program that sends sound out via the sound card and thats just as silent.

Sorry for these new guy (idiot) questions.

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#2 Post by Pizzasgood »

Try modprobe pcspkr
(If the command runs successfully, there will be no output. It only outputs stuff when there is an error).

No idea if this will work, but I think the pcspkr module is a requirement at least. I tend to unload it (with rmmod) because it gets annoying having to listen to all the beep-beep-beeping when I hit too many backspaces or whatever.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
James186282
Posts: 270
Joined: Tue 08 Sep 2009, 19:14
Location: Minnesota

#3 Post by James186282 »

Thanks. I tried it but no go. My C program beeps through the sound card which worked for a while when I had just reloaded puppy 4.3 from scratch. (Partition) I can play an MP3 on Aqualung but....

On the same topic everytime I restart the computer the system defaults to all sounds muted. This is really annoying and I would love a solution to both of these problems.

THANKS!

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#4 Post by Pizzasgood »

You can save and restore the audio settings with these:

Code: Select all

alsactl store
alsactl restore
I don't know about Puppy 4.3, but in 4.1.2 Puppy automatically stores the settings when it shuts down and loads them when it boots.


As for the beeping, I just investigated a little. Try running alsamixer and scrolling over to the right to see if there's a "PC Speaker" slider. If so, fiddle with that. On my end, if I have that muted the buzzer on the motherboard (and thus the pcspkr) module is used. If I unmute it the real speakers are also used, unless I increase the volume beyond 70% or so, where they stop beeping. (You toggle the muted-ness with the 'm' key.)
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
James186282
Posts: 270
Joined: Tue 08 Sep 2009, 19:14
Location: Minnesota

Xterm Beep problems [SOLVED]

#5 Post by James186282 »

Whew... Scroll to the right?? I just sat looking at the first page of sliders in this mixer program. I had NO clue that there were more.... SIGH.....

I really REALLY appreciate your help. All my "BEEPING" software works fine now ;-) And one of the great hair pulling out sessions of all time is at an end at last. The only question left is this. Would I put this "restore" routine into what script? I see all the routines flash by until it gets to starting X but I am such a noob I don't know what file this is running from to check it and or add it to.

Mega - THANK YOU!!!!

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#6 Post by Pizzasgood »

Use /etc/rc.d/rc.local for things that should run on bootup. If you need something to run different code on both bootup and shutdown, you could instead made a script in /etc/init.d/. Every executable file in /etc/init.d/ is automatically run with the "start" parameter during bootup and the "stop" parameter during shutdown. So in your case, you could use something like this:

Code: Select all

#!/bin/sh
if [ "$1" = "start" ]; then
    alsactl restore
elif [ "$1" = "stop" ]; then
    alsactl store
fi
(Don't forget the spaces around the brackets or it will break, and don't forget to set the script executable.)


Another thing to know about alsamixer is that you can press the TAB key to toggle between 'input', 'capture', and 'all' modes.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

Post Reply