View previous topic :: View next topic |
Author |
Message |
josephg l33t
Joined: 10 Jan 2016 Posts: 783 Location: usually offline
|
Posted: Wed Sep 21, 2016 6:57 pm Post subject: i want to beep [solved] |
|
|
i can't beep.. i want to beep! i've gone through the wiki, and done those things.. i still can't beep
does not give me any sound.
i don't see any obvious errors anywhere, except when i run beep.
Code: | $ beep
Could not open /dev/tty0 or /dev/vc/0 for writing
open: No such file or directory |
no idea what this means
my user is a member of audio, video, wheel groups. sound and video play just fine online and offline in x.
[update] although not quite the pcspkr (or snd-pcsp) beep i wanted, a digital beep is an acceptable workaround.
[update] i've got the speaker beeping in x and tty. no more need for digital beep. _________________ "Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey
Last edited by josephg on Sun Oct 09, 2016 1:11 pm; edited 4 times in total |
|
Back to top |
|
|
Zucca Moderator
Joined: 14 Jun 2007 Posts: 3339 Location: Rasi, Finland
|
Posted: Wed Sep 21, 2016 9:32 pm Post subject: pcspkr |
|
|
Try: run as root: | modprobe pcspkr | ... and try again.
If it does not work, you may have to emulate the pc-speaker trough your normal speakers or headphones. _________________ ..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote: | I am NaN! I am a man! |
|
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54216 Location: 56N 3W
|
Posted: Wed Sep 21, 2016 10:01 pm Post subject: |
|
|
josephg
What does uname -a show? _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
mv Watchman
Joined: 20 Apr 2005 Posts: 6747
|
Posted: Thu Sep 22, 2016 5:19 am Post subject: Re: i want to beep |
|
|
josephg wrote: | Code: | $ beep
Could not open /dev/tty0 or /dev/vc/0 for writing
open: No such file or directory |
no idea what this means |
Try as root |
|
Back to top |
|
|
fturco Veteran
Joined: 08 Dec 2010 Posts: 1181 Location: Italy
|
Posted: Thu Sep 22, 2016 11:06 am Post subject: Re: i want to beep |
|
|
josephg wrote: | Code: | $ beep
Could not open /dev/tty0 or /dev/vc/0 for writing
open: No such file or directory |
no idea what this means |
You probably need to enable the "suid" USE flag (not globally, just for app-misc/beep) |
|
Back to top |
|
|
josephg l33t
Joined: 10 Jan 2016 Posts: 783 Location: usually offline
|
Posted: Thu Sep 22, 2016 1:40 pm Post subject: Re: pcspkr |
|
|
Zucca wrote: | Try: run as root: | modprobe pcspkr | ... and try again. |
it's already there. should i keep trying modprobe till it beeps?
Code: | $ lsmod | grep sp
pcspkr 1395 0 |
Zucca wrote: | If it does not work, you may have to emulate the pc-speaker trough your normal speakers or headphones. |
i don't usually wear headphones. how would i emulate beep through speakers? and is that a better or more efficient way than this? _________________ "Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey
Last edited by josephg on Thu Sep 22, 2016 2:09 pm; edited 3 times in total |
|
Back to top |
|
|
josephg l33t
Joined: 10 Jan 2016 Posts: 783 Location: usually offline
|
Posted: Thu Sep 22, 2016 1:43 pm Post subject: |
|
|
NeddySeagoon wrote: | What does uname -a show? |
Code: | uname -a
Linux hostname 4.7.4-gentoo-josephg #3 SMP Wed Sep 21 19:13:33 BST 2016 i686 Intel(R) Core(TM)2 Duo CPU T5870 @ 2.00GHz GenuineIntel GNU/Linux |
_________________ "Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey |
|
Back to top |
|
|
josephg l33t
Joined: 10 Jan 2016 Posts: 783 Location: usually offline
|
Posted: Thu Sep 22, 2016 1:44 pm Post subject: Re: i want to beep |
|
|
mv wrote: | josephg wrote: | Code: | $ beep
Could not open /dev/tty0 or /dev/vc/0 for writing
open: No such file or directory |
no idea what this means |
Try as root |
that works but no beeps
strange that only root should beep _________________ "Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey
Last edited by josephg on Thu Sep 22, 2016 1:48 pm; edited 1 time in total |
|
Back to top |
|
|
josephg l33t
Joined: 10 Jan 2016 Posts: 783 Location: usually offline
|
Posted: Thu Sep 22, 2016 1:47 pm Post subject: Re: i want to beep |
|
|
fturco wrote: | josephg wrote: | Code: | $ beep
Could not open /dev/tty0 or /dev/vc/0 for writing
open: No such file or directory |
no idea what this means |
You probably need to enable the "suid" USE flag (not globally, just for app-misc/beep) |
i had no idea beep would need suid
i recompiled with suid. works, no errors. but no beep either.. yet _________________ "Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey |
|
Back to top |
|
|
fturco Veteran
Joined: 08 Dec 2010 Posts: 1181 Location: Italy
|
Posted: Thu Sep 22, 2016 2:00 pm Post subject: |
|
|
You may find this question on Stack Exchange useful. |
|
Back to top |
|
|
Zucca Moderator
Joined: 14 Jun 2007 Posts: 3339 Location: Rasi, Finland
|
Posted: Thu Sep 22, 2016 3:31 pm Post subject: Emulating PC-speaker |
|
|
Do you have the buzzer on your motherboard?
To be able to get the actual PC-speaker working... You may need to disable the emulation of PC-speaker.
Post on bbs.archlinux.org wrote: | You will have to disable the ALSA PC speaker emulation. If modprobe -r snd-pcsp doesn't do it, then you will have to deselect PC speaker in the sound cards/ALSA section of your kernel configuration, but make sure it is enabled under "Input device support"/"Miscellaneous devices" and re-compile. |
However, if you don't have a buzzer on your motherboard, then you need to emulate the PC-speaker, by loading the module: Run as root: | modprobe snd-pcsp | ... and if you don't have that module, you need to build that module for your kernel. _________________ ..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote: | I am NaN! I am a man! |
|
|
Back to top |
|
|
josephg l33t
Joined: 10 Jan 2016 Posts: 783 Location: usually offline
|
Posted: Thu Sep 22, 2016 5:22 pm Post subject: Re: Emulating PC-speaker |
|
|
Zucca wrote: | Do you have the buzzer on your motherboard? |
i don't know what you mean by buzzer. how do i find out? this is a laptop.
Zucca wrote: | To be able to get the actual PC-speaker working... You may need to disable the emulation of PC-speaker. |
i had initially thought about that conflict, so i made sure to remove it from my kernel config.
Zucca wrote: | Post on bbs.archlinux.org wrote: | You will have to disable the ALSA PC speaker emulation. If modprobe -r snd-pcsp doesn't do it, then you will have to deselect PC speaker in the sound cards/ALSA section of your kernel configuration, but make sure it is enabled under "Input device support"/"Miscellaneous devices" and re-compile. |
|
snd-pcsp is not loaded, not built either.
Code: | $ lsmod | grep snd-pcsp
$ sudo modprobe -r snd-pcsp
modprobe: FATAL: Module snd-pcsp not found.
$ sudo modprobe snd-pcsp
modprobe: FATAL: Module snd-pcsp not found in directory /lib/modules/4.7.4-gentoo-josephg |
Zucca wrote: | However, if you don't have a buzzer on your motherboard, then you need to emulate the PC-speaker, by loading the module: Run as root: | modprobe snd-pcsp | ... and if you don't have that module, you need to build that module for your kernel. |
thank you for that research link. i have the same reasons as that op for wanting beeps.
i will go have another look at my kernel config as per your link, recompile again, and get back to you. _________________ "Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey |
|
Back to top |
|
|
josephg l33t
Joined: 10 Jan 2016 Posts: 783 Location: usually offline
|
Posted: Thu Sep 22, 2016 5:57 pm Post subject: |
|
|
thank you Zucca indeed i have that digital beep selected, but at a different location from your referred link.
-> Device Drivers -> Sound Card Support -> Advanced Linux Sound Architecture -> HD-AUDIO -> Support digital beep via input layer (SND_HDA_INPUT_BEEP)
i have unselected it now. snd-pcsp is still unselected. now to compile, install and reboot.. _________________ "Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey
Last edited by josephg on Thu Sep 22, 2016 7:30 pm; edited 1 time in total |
|
Back to top |
|
|
Zucca Moderator
Joined: 14 Jun 2007 Posts: 3339 Location: Rasi, Finland
|
Posted: Thu Sep 22, 2016 6:15 pm Post subject: |
|
|
josephg wrote: | i have unselected it now. snd-pcsp is still unselected. now to compile, install and reboot.. | But you propably need it... And even if you don't, you can just unload or blacklist it. When I said you may need to disable it I didn't meant you should completely remove the feature from your kernel. It's better to have it.
Laptops nowdays don't propably have PC-speaker/buzzer. Although there can be hardware emulation of PC-speaker (outputs from laptop's integrated speakers instead).
Anyway compile those as modules (if possible) so that you can load and unload then at runtime. _________________ ..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote: | I am NaN! I am a man! |
|
|
Back to top |
|
|
josephg l33t
Joined: 10 Jan 2016 Posts: 783 Location: usually offline
|
Posted: Thu Sep 22, 2016 7:26 pm Post subject: |
|
|
Zucca wrote: | Anyway compile those as modules (if possible) so that you can load and unload then at runtime. |
ok, so i went back and set both pcspkr and snd-pcsp as modules. compile/install kernel, and reboot. i find that i can only load one at a time. and neither gives me a beep
on that link, the op said "After that in alsamixer, there is no PC Beep volume control and internal buzzer works as it should be in the first place."
i find my alsamixer still has that "Beep" control and i can manipulate it up or down, whether or not i have either of those modules.
that thread is from 2009. i wonder if things have changed. _________________ "Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey |
|
Back to top |
|
|
fturco Veteran
Joined: 08 Dec 2010 Posts: 1181 Location: Italy
|
Posted: Thu Sep 22, 2016 7:34 pm Post subject: |
|
|
You may need to unmute the beep channel in alsamixer or increase its volume. |
|
Back to top |
|
|
josephg l33t
Joined: 10 Jan 2016 Posts: 783 Location: usually offline
|
Posted: Thu Sep 22, 2016 8:56 pm Post subject: |
|
|
in alsamixer, i've increased all controls to 100%. still no beep in either situation below.
if i load snd-pcsp, alsamixer shows an additional card called pcsp, with three controls - Master, Beep, and BaseFRQ. Master and Beep don't show any levels to increase or change. i am able to mute/unmute them though. BaseFRQ can be changed to 18643 or 37286.
if i load pcspkr, alsamixer only shows one card called "HDA Intel", where i have increased Beep to 100%. _________________ "Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey |
|
Back to top |
|
|
josephg l33t
Joined: 10 Jan 2016 Posts: 783 Location: usually offline
|
Posted: Thu Sep 22, 2016 9:20 pm Post subject: |
|
|
the following are with snd-pcsp module loaded.
Code: | $ lsmod | grep pcsp
snd_pcsp 5693 0
snd_pcm 50522 4 snd_hda_codec,snd_hda_intel,snd_pcsp,snd_hda_core
snd 36344 7 snd_hwdep,snd_timer,snd_pcm,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel,snd_pcsp |
Code: | $ amixer set Beep 100%
Simple mixer control 'Beep',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 12
Mono:
Front Left: Playback 12 [100%] [0.00dB] [on]
Front Right: Playback 12 [100%] [0.00dB] [on] |
Code: | $ xset b 100
$ set bell-style audible
$ setterm --blength 2000
setterm: terminal screen-256color does not support --blength |
i was a bit concerned about that last command, and tried two other xterminals - qterminal and sakura respectively below.
Code: | $ setterm --blength 2000
setterm: terminal xterm does not support --blength |
Code: | $ setterm --blength 2000
setterm: terminal xterm-256color does not support --blength |
_________________ "Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey |
|
Back to top |
|
|
josephg l33t
Joined: 10 Jan 2016 Posts: 783 Location: usually offline
|
Posted: Thu Sep 22, 2016 9:24 pm Post subject: |
|
|
ok setterm only seems to work on a tty, and not in x. i can't beep on a tty either. _________________ "Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey |
|
Back to top |
|
|
josephg l33t
Joined: 10 Jan 2016 Posts: 783 Location: usually offline
|
Posted: Thu Sep 22, 2016 11:36 pm Post subject: |
|
|
i have just discovered something very interesting. i know that my sound card is working, as i can play music, watch movies with sound, etc. volume control also works with various apps.
i wanted to do the alsa speaker-test just to satisfy myself. it works as expected. all tests successful.
however, what is most interesting is that while speaker-test runs in a terminal, i can get beeps from other terminals.
so i tested this further, and i get a beep every single time, while speaker-test is running. i tested with each module - pcspkr and snd-pcsp. i get a beep with each, every single time, while speaker-test is running. i can change the beep volume level in alsamixer, and the beep volume reflects that.
no beep, if neither module is loaded.
no beep, if speaker-test not running. _________________ "Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey
Last edited by josephg on Fri Sep 23, 2016 3:54 am; edited 1 time in total |
|
Back to top |
|
|
Fitzcarraldo Advocate
Joined: 30 Aug 2008 Posts: 2034 Location: United Kingdom
|
Posted: Fri Sep 23, 2016 3:38 am Post subject: |
|
|
On the basis that virtually every audio problem I've experienced over the past years has been due to PulseAudio, I wonder if PulseAudio's X11-bell module is the root cause of your problem?
https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modules/#index30h3
https://wiki.archlinux.org/index.php/PulseAudio#X11_Bell_Events
Code: | $ pactl upload-sample /usr/share/sounds/freedesktop/stereo/bell.oga x11-bell
$ pactl load-module module-x11-bell sample=x11-bell display=$DISPLAY |
You should also be able to edit /etc/pulse/default.pa to contain something along the following lines:
https://bugzilla.redhat.com/show_bug.cgi?id=607393#c15
Code: | load-sample-lazy x11-bell /usr/share/sounds/freedesktop/stereo/bell.oga
load-module module-x11-bell sample=x11-bell |
(As the PA source code has the module named as module-X11-bell, perhaps you need to use an uppercase 'X'. I'm not sure.) _________________ Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC udev elogind & KDE on both.
Fitzcarraldo's blog |
|
Back to top |
|
|
josephg l33t
Joined: 10 Jan 2016 Posts: 783 Location: usually offline
|
Posted: Fri Sep 23, 2016 4:05 am Post subject: |
|
|
not interested in pulseaudio (or related lot)
not installed any of that
Code: | $ eix -I pulse audio
No matches found |
i wonder if any bits of pulseaudio sneaked in somehow. i'm still a gentoo newbie. is there a better way to check? _________________ "Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey |
|
Back to top |
|
|
Fitzcarraldo Advocate
Joined: 30 Aug 2008 Posts: 2034 Location: United Kingdom
|
Posted: Fri Sep 23, 2016 8:07 am Post subject: |
|
|
If eix does not show it as installed after eix-update then you won't have any of PulseAudio running, but you can double-check:
Code: | $ ps -ef | grep pulse
$ pactl list |
Out of curiosity, what is your current kernel setting for the following parameter?
CONFIG_SND_HDA_INPUT_BEEP_MODE _________________ Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC udev elogind & KDE on both.
Fitzcarraldo's blog |
|
Back to top |
|
|
josephg l33t
Joined: 10 Jan 2016 Posts: 783 Location: usually offline
|
Posted: Fri Sep 23, 2016 10:11 am Post subject: |
|
|
Fitzcarraldo wrote: | If eix does not show it as installed after eix-update then you won't have any of PulseAudio running, but you can double-check:
Code: | $ ps -ef | grep pulse
$ pactl list |
|
thanks, that confirms no pulse here
Fitzcarraldo wrote: | Out of curiosity, what is your current kernel setting for the following parameter?
CONFIG_SND_HDA_INPUT_BEEP_MODE |
up above in this thread history, on this post, i removed CONFIG_SND_HDA_INPUT_BEEP itself from my kernel config. before that it was
CONFIG_SND_HDA_INPUT_BEEP_MODE=1
apparently, as per another referred link, the digital beep was hijacking the pc speaker beep. that thread was in 2009. i wonder if things have moved on, and digital audio might perhaps work?
i had it on before, and i wasn't hearing any beeps. is there anything additional to be done, to hear that beep? i don't want beeps only through headphones.
i can actually hear my speaker beep, but in a rather strange conundrum, only when speaker-test runs. i can still beep for a few seconds more after i terminate speaker-test. it seems like speaker-test releases something holding back beeps. _________________ "Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey |
|
Back to top |
|
|
Fitzcarraldo Advocate
Joined: 30 Aug 2008 Posts: 2034 Location: United Kingdom
|
Posted: Fri Sep 23, 2016 10:36 am Post subject: |
|
|
CONFIG_INPUT_PCSPKR is for a standard PC speaker connected to the motherboard (i.e. not connected to a sound card) and is only intended for bell/beep sounds:
https://www.cateee.net/lkddb/web-lkddb/INPUT_PCSPKR.html
Quote: | Say Y here if you want the standard PC Speaker to be used for bells and whistles.
If unsure, say Y.
To compile this driver as a module, choose M here: the module will be called pcspkr. |
CONFIG_SND_PCSP is also for a standard PC speaker connected to the motherboard (i.e. not connected a sound card):
https://www.cateee.net/lkddb/web-lkddb/SND_PCSP.html
Quote: | If you don't have a sound card in your computer, you can include a driver for the PC speaker which allows it to act like a primitive sound card. This driver also replaces the pcspkr driver for beeps.
You can compile this as a module which will be called snd-pcsp.
WARNING: if you already have a soundcard, enabling this driver may lead to a problem. Namely, it may get loaded before the other sound driver of yours, making the pc-speaker a default sound device. Which is likely not what you want. To make this driver play nicely with other sound driver, you can add this in a configuration file under /etc/modprobe.d/ directory: options snd-pcsp index=2
You don't need this driver if you only want your pc-speaker to beep. You don't need this driver if you have a tablet piezo beeper in your PC instead of the real speaker.
Say N if you have a sound card. Say M if you don't. Say Y only if you really know what you do. |
So, if you have a laptop which has a soundcard and does not have a buzzer or speaker connected directly to the laptop's motherboard (the laptop's internal speakers are connected to the soundcard), then the above two modules don't really apply if I understand correctly. I have always had them both disabled.
Now, in my case I am using KDE Plasma 5, and I discovered that I too cannot hear any beep/bell in Konsole and Yakuake. Then I came across the following KDE bug report which has been outstanding since 2008 (amazing!):
https://bugs.kde.org/show_bug.cgi?id=177861
I also found the following post on the Super User site by a user who has a laptop without a standard PC speaker (but obviously a soundcard with internal speakers connected) and needed a software-only solution. That post pointed me to a solution in my case (in X windows, at least):
http://superuser.com/questions/22767/enable-system-beep-in-ubuntu/44865#44865
I installed xkbevd:
I already had vorbis-tools installed, but if not I would have installed that package too:
Code: | emerge vorbis-tools |
I created the file /home/fitzcarraldo/.config/autostart/xkbevd.desktop
Code: | [Desktop Entry]
Comment[en_GB]=Software terminal bell
Comment=Software terminal bell
Exec=xkbevd -bg
GenericName[en_GB]=XKB Event Daemon
GenericName=XKB Event Daemon
Icon=system-run
MimeType=
Name[en_GB]=XKB Event Daemon
Name=XKB Event Daemon
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=none
X-KDE-SubstituteUID=false
X-KDE-Username=fitzcarraldo |
and changed its permissions:
Code: | $ chmod 755 /home/fitzcarraldo/.config/autostart/xkbevd.desktop |
I created the file /home/fitzcarraldo/.xkb/xkbevd.cf containing:
Code: | soundDirectory="/usr/share/sounds/"
soundCmd="ogg123 -q"
Bell() "freedesktop/stereo/bell.oga" |
(If you don't have freedesktop/stereo/bell.oga then just copy a sound file of your choice into /usr/share/sounds/ or use one of the existing sound files already in that directory, and specify just the filename).
Then, because of the bug in KDE Konsole/Yakuake, I installed another X Windows terminal to see if the bell would work in that:
Lo and behold, the command echo -e "\a" creates a beep (bell.oga) in xterm, but not in Konsole/Yakuake due to the aforementioned bug.
By the way, I'm using Gentoo Stable and hence Plasma 5.6.5, and it has a bug: 'System Settings' > 'Autostart' > 'Add Program...' does not save all the entries I make via the GUI to the .desktop file, and does not set the permissions correctly either. I don't know if that is an upstream bug or a bug in the Gentoo implementation. Anyway, that is why I manually created xkbevd.desktop and manually set the permissions.
EDIT: By the way (again), my kernel has:
Code: | $ grep CONFIG_SND_HDA_INPUT_BEEP /usr/src/linux/.config
CONFIG_SND_HDA_INPUT_BEEP=y
CONFIG_SND_HDA_INPUT_BEEP_MODE=1 |
And, for those who do use PulseAudio, I have applied the edit to /etc/pulse/default.pa that I mentioned in my first post in this thread. _________________ Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC udev elogind & KDE on both.
Fitzcarraldo's blog |
|
Back to top |
|
|
|