N7SD logo

HOME      INDEX

OpenAL Ada App openal_info #2 Manual Build


 

A basic application to run first after installing OpenAL.
The Coreland OpenAL package includes openal_info.ads and openal_info.adb with a simple application.
By confirming its operation, you can verify that OpenAL has been installed correctly.

Date: Aug 18 2025

Confirmed versions:
Ubuntu: 24.04.3 LTS, Gnat: 13.3.0
PC: OMEN 17-ck2095cl, i9-13900HX, RTX-4080

Application Output

Application Output

Build this project manually without using Alire or GnatStudio

~/ada/oal$ mkdir al_info_m

~/ada/oal$ cd al_info_m

This application is based on openal_info_main.adb in the OpenAL files.

~/ada/oal/al_info_m$ mkdir src

Setup Source file: src/al_info_m.adb

with OpenAL_Info;

procedure Al_Info_M is
begin
   OpenAL_Info.Run;
end Al_Info_M;


Setup project file: ./al_info_m.gpr

project Al_Info_M is

   for Source_Dirs use ("src", "../../../../../usr/local/include/coreland/openal-ada");
   for Object_Dir use "obj/";
   for Create_Missing_Dirs use "True";
   for Exec_Dir use "bin";
   for Main use ("al_info_m.adb");

   package Compiler is
   end Compiler;

   package Binder is
      for Switches ("Ada") use ("-Es"); --  Symbolic traceback
   end Binder;

   package Install is
      for Artifacts (".") use ("share");
   end Install;

   for Source_List_File use "sourcefiles.txt";
      package Linker is
      for Switches ("ada") use ("-lopenal", "-lalut");
   end Linker;

end Al_Info_M;



Create the following text file in the working directory

Source list file: ./sourcefiles.txt

al_info_m.adb
openal.ads
openal-alc_thin.ads
openal-buffer.adb
openal-buffer.ads
openal-context.adb
openal-context.ads
openal-context-capture.adb
openal-context-capture.ads
openal-context-error.adb
openal-context-error.ads
openal-error.adb
openal-error.ads
openal-extension.ads
openal-extension-efx.adb
openal-extension-efx.ads
openal-extension-efx_thin.adb
openal-extension-efx_thin.ads
openal-extension-float32.adb
openal-extension-float32.ads
openal-extension-float32_thin.ads
openal-global.adb
openal-global.ads
openal_info.adb
openal_info.ads
openal_info_main.adb
openal-list.adb
openal-list.ads
openal-listener.adb
openal-listener.ads
openal-load.adb
openal-load.ads
openal-source.adb
openal-source.ads
openal-thin.ads
openal-types.ads

NOTE: The top line is this application and project file name.



Build Project

~/ada/oal/al_info_m$ gprbuild -d -P/home/mm/ada/oal/al_info_m/al_info_m.gpr -XADAFLAGS=

Compile
   [Ada]          al_info_m.adb
completed 1 out of 2 (50%)...
   [Ada]          openal_info.adb
completed 2 out of 6 (33%)...
   [Ada]          openal.ads
completed 3 out of 6 (50%)...
   [Ada]          openal-context.adb
completed 4 out of 8 (50%)...
   [Ada]          openal-global.adb
completed 5 out of 9 (55%)...
   [Ada]          openal-list.adb
completed 6 out of 9 (66%)...
   [Ada]          openal-alc_thin.ads
completed 7 out of 9 (77%)...
   [Ada]          openal-types.ads
completed 8 out of 9 (88%)...
   [Ada]          openal-thin.ads
completed 9 out of 9 (100%)...
Bind
   [gprbind]      al_info_m.bexch
   [Ada]          al_info_m.ali
Link
   [link]         al_info_m.adb

Execution file was created in bin/ directory

~/ada/oal/al_info_m/bin$ ls -al

-rwxrwxr-x 1 mm mm 219728 Aug 17 16:40 al_info_m


Note:
The indentation must use 3 spaces. Since OpenAL uses 2 spaces consistently, numerous warnings will be displayed for OpenAL files when building the application for the first time, but these can be ignored. From the second build onward, those warnings will not be displayed.

Also, you must insert 2 spaces after — (dash, dash, space, space, which represents comments), otherwise an error will occur.

Execution

When running, the following messages are displayed in my environment.

~/ada/oal/al_info_m/bin$ ./al_info_m

Playback devices :
  OpenAL Soft
Capture devices  :
  sof-hda-dsp Digital Microphone
  sof-hda-dsp Headphones Stereo Microphone
  Monitor of HDA NVidia Digital Stereo (HDMI)
  Monitor of sof-hda-dsp Speaker + Headphones
  Monitor of sof-hda-dsp HDMI / DisplayPort 2 Output
  Monitor of sof-hda-dsp HDMI / DisplayPort 1 Output
  Monitor of sof-hda-dsp HDMI / DisplayPort 3 Output
Default playback  : OpenAL Soft
Default capture   : sof-hda-dsp Digital Microphone
ALC major version : 1
ALC minor version : 1
ALC extensions    : ALC_ENUMERATE_ALL_EXT ALC_ENUMERATION_EXT ALC_EXT_CAPTURE ALC_EXT_DEDICATED ALC_EXT_disconnect ALC_EXT_EFX ALC_EXT_thread_local_context ALC_SOFT_device_clock ALC_SOFT_HRTF ALC_SOFT_loopback ALC_SOFT_loopback_bformat ALC_SOFT_output_limiter ALC_SOFT_output_mode ALC_SOFT_pause_device ALC_SOFT_reopen_device
AL vendor         : OpenAL Community
AL renderer       : OpenAL Soft
AL version        : 1.1 ALSOFT 1.23.1
AL extensions     : AL_EXT_ALAW AL_EXT_BFORMAT AL_EXT_DOUBLE AL_EXT_EXPONENT_DISTANCE AL_EXT_FLOAT32 AL_EXT_IMA4 AL_EXT_LINEAR_DISTANCE AL_EXT_MCFORMATS AL_EXT_MULAW AL_EXT_MULAW_BFORMAT AL_EXT_MULAW_MCFORMATS AL_EXT_OFFSET AL_EXT_source_distance_model AL_EXT_SOURCE_RADIUS AL_EXT_STATIC_BUFFER AL_EXT_STEREO_ANGLES AL_LOKI_quadriphonic AL_SOFT_bformat_ex AL_SOFTX_bformat_hoa AL_SOFT_block_alignment AL_SOFT_buffer_length_query AL_SOFT_callback_buffer AL_SOFTX_convolution_reverb AL_SOFT_deferred_updates AL_SOFT_direct_channels AL_SOFT_direct_channels_remix AL_SOFT_effect_target AL_SOFT_events AL_SOFT_gain_clamp_ex AL_SOFTX_hold_on_disconnect AL_SOFT_loop_points AL_SOFTX_map_buffer AL_SOFT_MSADPCM AL_SOFT_source_latency AL_SOFT_source_length AL_SOFT_source_resampler AL_SOFT_source_spatialize AL_SOFT_source_start_delay AL_SOFT_UHJ AL_SOFT_UHJ_ex


The messages are displayed in the following order based on the results of Procedure Run in

openal_info.adb.
  procedure Run is
  begin
    Init;
    List_Playback_Devices;
    List_Capture_Devices;
    Defaults;
    Open_Device;
    Versions;
    Finish;