View Issue Details

IDProjectCategoryView StatusLast Update
0037997FPCRTLpublic2020-10-28 07:36
ReporterMark Morgan Lloyd Assigned ToSven Barth  
Status resolvedResolutionwon't fix 
Product Version3.2.1 
Summary0037997: FPC on Linux has no beep facility
DescriptionWhile the standard Windows API includes an entry point to make a simple noise, such a thing does not exist for Linux or the standard widgetsets. However ALSA is widely installed and generally speaking can be used to beep either from a character mode or GUI (Lazarus/LCL) program.

This might be subject to having an additional distro-level package such as asoundlib-dev installed in order to set up a symlink, but this type of problem has also afflicted database libraries for a long time.
Additional InformationPlease consider incorporating the dynamic-linking library and the simpler waveform generator from the .zip attached into the RTL for Linux. Tested on x86_64, believed OK for x86, probably others.
TagsNo tags attached.
Fixed in Revision
Attached Files


Mark Morgan Lloyd

2020-10-27 16:44

reporter (118,728 bytes)

Anton Kavalenka

2020-10-27 17:43

reporter   ~0126586

I bet on won't fix.
Use whichever you want:
fcl-sound (open /dev/dsp and play waveform)
beep.pas (22 bytes)   
beep.pas (22 bytes)   

Mark Morgan Lloyd

2020-10-27 21:00

reporter   ~0126587

This has been done to death in the forums. Writing a bell character only works if a program has been started by a shell and is "close" to a terminal manager that knows about such things (Konsole on KDE, as one example). /dev/dsp is OSS hence obsolete (there's approximate equivalents in /dev/snd but at that point but no immediate indication of which is the best or default device). Any form of player program is highly undesirable.

ALSA is the basic sound handler, elements of which are integrated with the kernel. It's been a long slog from various people, but the .zip includes a cut-down interface to the standard ALSA library which avoids the version-specific issues that challenge more complete implementations.

My preference would be to use XDG (and/or D-Bus etc.) facilities to do this, since this would allow notifications to be tailored by the desktop environment's thematicisation. So far neither I nor anybody else has found a way of doing this.

Anton Kavalenka

2020-10-27 21:27

reporter   ~0126588

XDG - means Desktop environment bound API.
Here is GNOME XDG sound theme handling:

KDE has its own whistles.

Sven Barth

2020-10-28 07:36

manager   ~0126599

As I've said on the Forum, the RTL will not get a dependency on something like that just to get a beep out. If you want it, create a separate, self contained unit that can be added as a package unit and that adjusts OnBeep inside its initialization.

Issue History

Date Modified Username Field Change
2020-10-27 16:44 Mark Morgan Lloyd New Issue
2020-10-27 16:44 Mark Morgan Lloyd File Added:
2020-10-27 17:43 Anton Kavalenka Note Added: 0126586
2020-10-27 17:43 Anton Kavalenka File Added: beep.pas
2020-10-27 21:00 Mark Morgan Lloyd Note Added: 0126587
2020-10-27 21:27 Anton Kavalenka Note Added: 0126588
2020-10-28 07:36 Sven Barth Assigned To => Sven Barth
2020-10-28 07:36 Sven Barth Status new => resolved
2020-10-28 07:36 Sven Barth Resolution open => won't fix
2020-10-28 07:36 Sven Barth FPCTarget => -
2020-10-28 07:36 Sven Barth Note Added: 0126599