0

I'm new to audio programming in Ubuntu 20.04 and was looking at open source audio libraries and found OpenAL-Soft. I'm following this tutorial online https://www.youtube.com/watch?v=kWQM1iQ1W0E&ab_channel=Code%2CTech%2CandTutorials

The basic code used is

ALCdevice* p_ALCDevice = alcOpenDevice( nullptr ); //nullptr = gets default device
    if( !p_ALCDevice )
        throw( "failed to get sound device" );

When I do this it returns

[ALSOFT] (WW) Failed to open playback device: Could not open /dev/dsp: No 
such file or directory
[ALSOFT] (WW) Error generated on device (nil), code 0xa004
terminate called after throwing an instance of 'char const*'
Aborted (core dumped)

When using

const ALCchar * devices = alcGetString( NULL, ALC_DEVICE_SPECIFIER );

and

printf( "%s", devices );

it outputs

OpenAL Soft

not even sure what this output means and what it has to do with my audio devices. Anyone know whats going on?

When reinstalling using cmake

- Checking for module 'dbus-1'
--   No package 'dbus-1' found
-- Could NOT find DBus1 (missing: DBus1_INCLUDE_DIRS DBus1_LIBRARIES)
-- Checking for module 'libpipewire-0.3>=0.3.23'
--   No package 'libpipewire-0.3' found
-- Could NOT find AudioIO (missing: AUDIOIO_INCLUDE_DIR) 
-- Could NOT find OpenSL (missing: OPENSL_LIBRARY OPENSL_INCLUDE_DIR OPENSL_ANDROID_INCLUDE_DIR) 
-- Could NOT find SDL2 (missing: SDL2_LIBRARY SDL2_INCLUDE_DIR) 
-- Could NOT find MySOFA (missing: MYSOFA_LIBRARY MYSOFA_INCLUDE_DIR) 
-- Could NOT find Qt5Widgets
-- Could NOT find SndFile (missing: SNDFILE_LIBRARY SNDFILE_INCLUDE_DIR) 
-- Could NOT find SDL2 (missing: SDL2_LIBRARY SDL2_INCLUDE_DIR) 
-- 
-- Building OpenAL with support for the following backends:
--     ALSA, OSS, SndIO (linked), PortAudio, PulseAudio, JACK, WaveFile, Null
-- 
-- Building with support for CPU extensions:
--     Default, SSE, SSE2, SSE3, SSE4.1
-- 
-- Embedding HRTF datasets
-- 
-- Installing library and headers
-- Installing sample configuration
-- Installing HRTF data files
-- Installing AmbDec presets
-- 
-- Building utility programs
-- 
-- Building example programs
-- 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/brian/openal-soft/build
Brian
  • 105
  • 12
  • Did you build AL yourself? – HolyBlackCat Jun 13 '22 at 14:52
  • yeah I followed this post to install https://stackoverflow.com/questions/11195372/how-to-install-openal-sdk-on-ubuntu – Brian Jun 13 '22 at 16:17
  • Can you share the cmake log? – HolyBlackCat Jun 13 '22 at 16:28
  • cmake log for the installation of OpenAL Soft? Do I need to reinstall it for that? – Brian Jun 13 '22 at 19:14
  • Not the whole build, just the initial configuration step. Yes, download a clean copy, and run `cmake .....`, without `make`/`make install`. – HolyBlackCat Jun 13 '22 at 19:17
  • actually my speakers are no longer working now. my headphones work but volume input doesnt register from keyboard. its as if running the program shut my sound down – Brian Jun 13 '22 at 20:16
  • You should add it to the question, looks horrible in comments. D: I was expecting it to not find any suitable backends, but looks like it's not a problem. – HolyBlackCat Jun 13 '22 at 20:18
  • Can you run `ldd` on your program to make sure it uses your AL, and not the system one? – HolyBlackCat Jun 13 '22 at 20:19
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/245571/discussion-between-brian-and-holyblackcat). – Brian Jun 13 '22 at 20:24
  • If no headphones or speakers are plugged into a sound device, OpenAL will not return an audio device. See: https://github.com/kcat/openal-soft/issues/616 .. you might browse this and compare to your implementation: https://github.com/h3rb/algore (based on LibALURE) – Head Wizard Locke Aug 25 '23 at 20:12

0 Answers0