Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build from source on RPi #902

Closed
zaneclaes opened this issue Aug 19, 2021 · 7 comments
Closed

Cannot build from source on RPi #902

zaneclaes opened this issue Aug 19, 2021 · 7 comments

Comments

@zaneclaes
Copy link

Describe the bug
I want to compile a snapserver from source so that I may decrease the hard-coded buffer floor (per #329 (comment)).

When I follow the instructions to do so, I seem to have problems with the boost headers. I've downloaded v1.77.0 and unzipped it, and executed the following build command: ADD_CFLAGS="-I/home/pi/boost_1_77_0/" make

make -C client
make[1]: Entering directory '/home/pi/snapcast/client'
g++ -O2 -I/home/pi/boost_1_77_0/ -std=c++14 -Wall -Wextra -Wpedantic -Wno-unused-function -DBOOST_ERROR_CODE_HEADER_ONLY -DHAS_FLAC -DHAS_OGG -DHAS_OPUS -DHAS_SOXR -DVERSION=\"0.25.0\" -I. -I.. -I../common -pthread -DHAS_VORBIS -DHAS_ALSA -DHAS_PULSE -DHAS_AVAHI -DHAS_DAEMON -c player/player.cpp -o player/player.o
In file included from /home/pi/boost_1_77_0/boost/process/detail/basic_cmd.hpp:14,
                 from /home/pi/boost_1_77_0/boost/process/args.hpp:33,
                 from player/player.cpp:29:
/home/pi/boost_1_77_0/boost/process/detail/traits/wchar_t.hpp: In static member function ‘static std::vector<std::__cxx11::basic_string<wchar_t> > boost::process::detail::char_converter<wchar_t, std::vector<std::__cxx11::basic_string<char> > >::conv(const std::vector<std::__cxx11::basic_string<char> >&)’:
/home/pi/boost_1_77_0/boost/process/detail/traits/wchar_t.hpp:150:14: error: ‘transform’ is not a member of ‘std’
         std::transform(in.begin(), in.end(), ret.begin(),
              ^~~~~~~~~
/home/pi/boost_1_77_0/boost/process/detail/traits/wchar_t.hpp: In static member function ‘static std::vector<std::__cxx11::basic_string<wchar_t> > boost::process::detail::char_converter<wchar_t, std::initializer_list<std::__cxx11::basic_string<char> > >::conv(const std::initializer_list<std::__cxx11::basic_string<char> >&)’:
/home/pi/boost_1_77_0/boost/process/detail/traits/wchar_t.hpp:165:14: error: ‘transform’ is not a member of ‘std’
         std::transform(in.begin(), in.end(), ret.begin(),
              ^~~~~~~~~
/home/pi/boost_1_77_0/boost/process/detail/traits/wchar_t.hpp: In static member function ‘static std::vector<std::__cxx11::basic_string<wchar_t> > boost::process::detail::char_converter<wchar_t, std::vector<char*> >::conv(const std::vector<char*>&)’:
/home/pi/boost_1_77_0/boost/process/detail/traits/wchar_t.hpp:180:14: error: ‘transform’ is not a member of ‘std’
         std::transform(in.begin(), in.end(), ret.begin(),
              ^~~~~~~~~
/home/pi/boost_1_77_0/boost/process/detail/traits/wchar_t.hpp: In static member function ‘static std::vector<std::__cxx11::basic_string<wchar_t> > boost::process::detail::char_converter<wchar_t, std::initializer_list<char*> >::conv(const std::initializer_list<char*>&)’:
/home/pi/boost_1_77_0/boost/process/detail/traits/wchar_t.hpp:197:14: error: ‘transform’ is not a member of ‘std’
         std::transform(in.begin(), in.end(), ret.begin(),
              ^~~~~~~~~
/home/pi/boost_1_77_0/boost/process/detail/traits/wchar_t.hpp: In static member function ‘static std::vector<std::__cxx11::basic_string<char> > boost::process::detail::char_converter<char, std::vector<std::__cxx11::basic_string<wchar_t> > >::conv(const std::vector<std::__cxx11::basic_string<wchar_t> >&)’:
/home/pi/boost_1_77_0/boost/process/detail/traits/wchar_t.hpp:214:14: error: ‘transform’ is not a member of ‘std’
         std::transform(in.begin(), in.end(), ret.begin(),
              ^~~~~~~~~
/home/pi/boost_1_77_0/boost/process/detail/traits/wchar_t.hpp: In static member function ‘static std::vector<std::__cxx11::basic_string<char> > boost::process::detail::char_converter<char, std::initializer_list<std::__cxx11::basic_string<wchar_t> > >::conv(const std::initializer_list<std::__cxx11::basic_string<wchar_t> >&)’:
/home/pi/boost_1_77_0/boost/process/detail/traits/wchar_t.hpp:229:14: error: ‘transform’ is not a member of ‘std’
         std::transform(in.begin(), in.end(), ret.begin(),
              ^~~~~~~~~
/home/pi/boost_1_77_0/boost/process/detail/traits/wchar_t.hpp: In static member function ‘static std::vector<std::__cxx11::basic_string<char> > boost::process::detail::char_converter<char, std::vector<wchar_t*> >::conv(const std::vector<wchar_t*>&)’:
/home/pi/boost_1_77_0/boost/process/detail/traits/wchar_t.hpp:244:14: error: ‘transform’ is not a member of ‘std’
         std::transform(in.begin(), in.end(), ret.begin(),
              ^~~~~~~~~
/home/pi/boost_1_77_0/boost/process/detail/traits/wchar_t.hpp: In static member function ‘static std::vector<std::__cxx11::basic_string<char> > boost::process::detail::char_converter<char, std::initializer_list<wchar_t*> >::conv(const std::initializer_list<wchar_t*>&)’:
/home/pi/boost_1_77_0/boost/process/detail/traits/wchar_t.hpp:261:14: error: ‘transform’ is not a member of ‘std’
         std::transform(in.begin(), in.end(), ret.begin(),
              ^~~~~~~~~
make[1]: *** [Makefile:123: player/player.o] Error 1
make[1]: Leaving directory '/home/pi/snapcast/client'

Environment details

  • OS: Raspbian
  • Snapcast version: compiled from source
@badaix
Copy link
Owner

badaix commented Aug 20, 2021

Seems like boost::process requires C++17 in boost 1.77 :(
You can either use Boost 1.76 or replace -std=c++14 with -std=c++17 in client/Makefile and server/Makefile

@zaneclaes
Copy link
Author

Thanks! That worked.

FWIW, reducing the buffer size was also successful. I got down to ~120ms before noticing any distortion. Using a USB mixer as an alsa input source, I can now connect instruments directly into Snapcast to play over all 30+ speakers in every room in the house with low enough latency that the people playing the music are able to cope ;)

@kingosticks
Copy link
Contributor

Purely out of interest, what does snapcast offer that the programs dedicated to this use case (super low latency streaming) don't? Programs like JamRTC, Sonobus, Jamulus etc?

@zaneclaes
Copy link
Author

zaneclaes commented Aug 21, 2021

@kingosticks I really would like to research those more, but here's my use-case. I started with snapcast as a way to airplay to all the speakers in the house (5 zones, 30 speakers) via the shairport-sync integration. I integrated it into my Home Assistant IOT deployment, so that we can control each zone independently. This covers 99% of our use — but next week we're hosting an event at our house, and I hoped to be able to also play music with other musicians who will be attending (I'm still pretty new to the piano/keyboard, but friends play guitar, flute, etc.) so it seemed like it'd be fun to be able to play the music to all the different speaker zones. I'd definitely be interested in a lower latency solution for this part, but I would need to figure out how it fit in alongside Home Assistant and snapcast airplay (open to suggestions!)

Screen Shot 2021-08-21 at 10 47 02 AM

@PureTryOut
Copy link
Contributor

PureTryOut commented Oct 26, 2021

@badaix we're currently patching snapcast downstream in Alpine Linux to build with C++ 17, https://git.alpinelinux.org/aports/commit/?id=0b05b6f18334. Any chance of supporting C++ 17 officially?

@badaix
Copy link
Owner

badaix commented Oct 26, 2021

C++ Standards are downward compatible. You can compile snapcast with c++14, c++17 and c++20. I always tried to not make use of newer standards, to keep the requirements on the compiler low, but the develop branch officially requires c++17, and so the next release (0.26) will need a c++17 capable compiler.

@PureTryOut
Copy link
Contributor

Understood, thanks! When your deps require newer versions, you kinda have to follow along

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants