Problem with installing libsoundio

I am setting up a Raspberry Pi B to have a music server groove basin.

To get this working it depends on libebur128. However when I try and compile it with cmake I get the following error.

$ cmake .. -DCMAKE_BUILD_TYPE=Debug
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
  CMake 2.8.12 or higher is required.  You are running version 2.8.9
-- Configuring incomplete, errors occurred!

I have also installed cmake 2.8.12. I also checked to see it it is that version and it seems so

$ /opt/cmake/bin/cmake -version
cmake version 2.8.12

if anyone knows why this is happening, it will very helpful

Sources

I have been using this guide to install groove basin
http://andrewkelley.me/post/raspberry-pi-music-player-server.html

I have also tried following this but it still dose not work

many thanks

What output do you get when you execute this line in the shell

$ which cmake

$ cmake -version

It's probably using your older version of cmake when you're using the command you've listed, which can be found normally at

/usr/bin/cmake

So most likely instead you need to run

$ /opt/cmake/bin/cmake .. -DCMAKE_BUILD_TYPE=Debug
1 Like

Thanks it seems that the older version was running

Yes that seems to have solved the problem.

Now everything seems to be installed apart from libsoundio, which is one of the dependencies. however when I install it I get the following error,

 $ make
 [  2%] Building C object CMakeFiles/libsoundio_shared.dir/src/soundio.c.o
cc1: error: unrecognized command line option ‘-std=c11’
CMakeFiles/libsoundio_shared.dir/build.make:54: recipe for target 'CMakeFiles/libsoundio_shared.dir/src/soundio.c.o' failed
make[2]: *** [CMakeFiles/libsoundio_shared.dir/src/soundio.c.o] Error 1
 CMakeFiles/Makefile2:192: recipe for target 'CMakeFiles/libsoundio_shared.dir/all' failed
make[1]: *** [CMakeFiles/libsoundio_shared.dir/all] Error 2
Makefile:113: recipe for target 'all' failed
make: *** [all] Error 2

I have a feeling that I have not installed it correctly, or I have the wrong version.

however everything before this looks fine


$ git clone https://github.com/andrewrk/libsoundio
Cloning into 'libsoundio'...
remote: Counting objects: 2051, done.
remote: Total 2051 (delta 0), reused 0 (delta 0), pack-reused 2051
Receiving objects: 100% (2051/2051), 584.21 KiB | 455 KiB/s, done.
Resolving deltas: 100% (1500/1500), done.
$ cd libsoundio
$ mkdir build 
$ cmake .. 
Configuring libsoundio version 1.0.3
-- Could NOT find JACK (missing:  JACK_LIBRARY JACK_INCLUDE_DIR) 
-- Could NOT find PULSEAUDIO (missing:  PULSEAUDIO_LIBRARY PULSEAUDIO_INCLUDE_DIR) 
-- Could NOT find COREAUDIO (missing:  COREAUDIO_LIBRARY COREAUDIO_INCLUDE_DIR) 
-- Could NOT find WASAPI (missing:  WASAPI_INCLUDE_DIR) 
Installation Summary
--------------------
* Install Directory            : /usr/local
* Build Type                   : Debug
* Build static libs            : ON
* Build examples               : ON
* Build tests                  : ON
System Dependencies
-------------------
* threads                      : OK
* JACK       (optional)        : not found
* PulseAudio (optional)        : not found
* ALSA       (optional)        : OK
* CoreAudio  (optional)        : not found
* WASAPI     (optional)        : not found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/libsoundio/build

if anyone knows why this is happening, it will very helpful

Sources

I have found libsoundio here.
https://github.com/andrewrk/libsoundio

I have also found this but i dont think its the same
https://packages.debian.org/cgi-bin/search_contents.pl?word=libasound.so.2&searchmode=searchfiles&case=insensitive&version=testing&arch=i386

many thanks

Update your C/C++ compiler.

How would you Update the C/C++ compiler on Debian, I have tried updating the system with;

$ sudo apt-get update
$ sudo apt-get upgrade

thanks for your response.

It's handled by those two commands you posted.

What version of GCC you have? gcc --version

its version

gcc (Debian 4.6.3-14+rpi1) 4.6.3

Good. Well not good. Because gcc4.6 doesn't support c11 (the -std=c11 flag). You have to install the 4.8 version of GCC. What version of Debian you have?

It is Raspbian Wheezy. Debian for the Raspberry Pi

There ya go: https://somewideopenspace.wordpress.com/2014/02/28/gcc-4-8-on-raspberry-pi-wheezy/

Hmm I looks like it fixed one thing, However they looks like something is missing

[  2%] Building C object CMakeFiles/libsoundio_shared.dir/src/soundio.c.o
In file included from /home/pi/libsoundio/src/alsa.h:14:0,
                 from /home/pi/libsoundio/src/soundio_private.h:23,
                 from /home/pi/libsoundio/src/soundio.c:8:
/home/pi/libsoundio/src/atomics.h:14:23: fatal error: stdatomic.h: No such file or directory
 #include <stdatomic.h>
                       ^
compilation terminated.
CMakeFiles/libsoundio_shared.dir/build.make:54: recipe for target 'CMakeFiles/libsoundio_shared.dir/src/soundio.c.o' failed
make[2]: *** [CMakeFiles/libsoundio_shared.dir/src/soundio.c.o] Error 1
CMakeFiles/Makefile2:192: recipe for target 'CMakeFiles/libsoundio_shared.dir/all' failed
make[1]: *** [CMakeFiles/libsoundio_shared.dir/all] Error 2
Makefile:113: recipe for target 'all' failed
make: *** [all] Error 2

has this got something to do with the libsoundio?

You've got to be kidding me.... Ahem

C11 atomics has been introduced in GCC 4.9 so you have to upgrade to GCC 4.9.

Edit: use the same guide as above, this time install the 4.9 version. And check you're using the 4.9 version by doing gcc --version

Edit 2: it's not your fault. I blame whoever made that library and didn't specify it requires gcc4.9 or newer.

that’s ok, I have just noticed that it was the wrong version. (4.8)

running the commands again this time with 4.9.

thanks for the help

1 Like

I'll go to sleep now. If you have more issues, quote me or something and I'll check back tomorrow.
In the meantime others can help.

You just have to install GCC 4.9 and hopefully no more errors should pop up.

Ok Sorry for taking a long time to reply, I been busy this week.

However I have installed GCC 4.9

$ gcc --version
gcc (Raspbian 4.9.2-10) 4.9.2

I then ran the command again (cmake .. followed by make ) and i got the flowing message

[  2%] Building C object CMakeFiles/libsoundio_shared.dir/src/soundio.c.o
In file included from /usr/include/alsa/asoundlib.h:49:0,
                 from /home/pi/libsoundio/src/alsa.h:16,
                 from /home/pi/libsoundio/src/soundio_private.h:23,
                 from /home/pi/libsoundio/src/soundio.c:8:
/usr/include/alsa/pcm.h:944:1: error: unknown type name ‘u_int8_t’
 u_int8_t snd_pcm_format_silence(snd_pcm_format_t format);
 ^
/usr/include/alsa/pcm.h:945:1: error: unknown type name ‘u_int16_t’
 u_int16_t snd_pcm_format_silence_16(snd_pcm_format_t format);
 ^
/usr/include/alsa/pcm.h:946:1: error: unknown type name ‘u_int32_t’
 u_int32_t snd_pcm_format_silence_32(snd_pcm_format_t format);
 ^
/usr/include/alsa/pcm.h:947:1: error: unknown type name ‘u_int64_t’
 u_int64_t snd_pcm_format_silence_64(snd_pcm_format_t format);
 ^
/usr/include/alsa/pcm.h:1052:1: error: unknown type name ‘int16_t’
 int16_t *snd_pcm_scope_s16_get_channel_buffer(snd_pcm_scope_t *scope,
 ^
In file included from /home/pi/libsoundio/src/soundio_private.h:23:0,
                 from /home/pi/libsoundio/src/soundio.c:8:
/home/pi/libsoundio/src/alsa.h:51:5: error: unknown type name ‘snd_pcm_chmap_t’
     snd_pcm_chmap_t *chmap;
     ^
/home/pi/libsoundio/src/alsa.h:73:5: error: unknown type name ‘snd_pcm_chmap_t’
     snd_pcm_chmap_t *chmap;
     ^
CMakeFiles/libsoundio_shared.dir/build.make:54: recipe for target 'CMakeFiles/libsoundio_shared.dir/src/soundio.c.o' failed
make[2]: *** [CMakeFiles/libsoundio_shared.dir/src/soundio.c.o] Error 1
CMakeFiles/Makefile2:192: recipe for target 'CMakeFiles/libsoundio_shared.dir/all' failed
make[1]: *** [CMakeFiles/libsoundio_shared.dir/all] Error 2
Makefile:113: recipe for target 'all' failed
make: *** [all] Error 2

when I got this error message I had a look to see if they are any solutions to solve this, and I came across this.

on looking at this git hub bug post it seems to be a bug with libsoundio.

Hopefully it should be fixed in Version 5.0.0.

yet again many thanks for the support.

No problem mate.