Skip to content

snapcast: add snapserver and snapclient packages#23956

Merged
1715173329 merged 5 commits into
openwrt:masterfrom
xabolcs:23924-snapcast-add-snapserver-and-snapclient-packages
Sep 9, 2025
Merged

snapcast: add snapserver and snapclient packages#23956
1715173329 merged 5 commits into
openwrt:masterfrom
xabolcs:23924-snapcast-add-snapserver-and-snapclient-packages

Conversation

@xabolcs

@xabolcs xabolcs commented Apr 17, 2024

Copy link
Copy Markdown
Contributor

Maintainer: me (@xabolcs), @davidandreoletti

Compile tested:

  • ath79/nand: GL-AR300M

Run tested:

  • ath79/nand: GL-AR300M

Description:
Fixes: #23924

xabolcs and others added 2 commits April 18, 2024 00:18
Add Snapcast package files as is from
https://github.com/badaix/snapos/tree/29a5daebb0513faa825b12474125c0c2dd66c2ee/openwrt/snapcast

Co-authored-by: badaix <johannes.pohl@badaix.de>
Co-authored-by: David Andreoletti <david@andreoletti.net>
Co-authored-by: luciferin <40036150+hunterzero99@users.noreply.github.com>
Signed-off-by: Szabolcs Hubai <szab.hu@gmail.com>
Snapcast [1] is a multiroom client-server audio player, where all
clients are time synchronized with the server to play perfectly synced
audio.

It's not a standalone player, but an extension that turns your existing
audio player into a Sonos-like multiroom solution.
Audio is captured by the server and routed to the connected clients.
Several players can feed audio to the server in parallel and clients can
be grouped to play the same audio stream.
One of the most generic ways to use Snapcast is in conjunction with the
music player daemon (MPD) [2] or Mopidy [3].

The inclusion starts with version 0.28.0 because of OpenSSL dependency
issues of version 0.29.0. Newer versions (e.g. 0.32.3, see [4])
with optional OpenSSL support, will be incorporated with flavours,
like "-mini" and "-full" in the upcoming PRs.
More about this topic please check the inclusion PR at [5]!

[1]: https://github.com/badaix/snapcast
[2]: http://www.musicpd.org/
[3]: https://www.mopidy.com/
[4]: https://github.com/badaix/snapcast/blob/develop/changelog.md
[5]: openwrt#23956 (comment)

Fixes: openwrt#23924
Suggested-by: Tianling Shen <cnsztl@immortalwrt.org>
Suggested-by: George Sapkin <george@sapk.in>
Signed-off-by: Szabolcs Hubai <szab.hu@gmail.com>
@xabolcs xabolcs force-pushed the 23924-snapcast-add-snapserver-and-snapclient-packages branch from b31170a to cbf46ff Compare April 17, 2024 22:42
@davidandreoletti

davidandreoletti commented Aug 18, 2024

Copy link
Copy Markdown
Contributor

@xabolcs I am interested in this too and already compile snapcast (server) on my end with OpenWRT snapshot. What's missing from your code (and PR) to get merged ?

@xabolcs

xabolcs commented Aug 18, 2024

Copy link
Copy Markdown
Contributor Author

Hi!

Thaks for testing!

A few things:

  • compile tested on ... ?
  • runtime tested on ... ?
  • ipk sizes?
  • apk compatibility? (e.g. version number)

Adding myself as amaintainer would also help.

@davidandreoletti

Copy link
Copy Markdown
Contributor

On my end:

  • Compiled snapserver (aarch64) binary on x86-64 machine.
  • Runtime tested on NanoPi R4s (aarch64)
  • ipk sizes (snapserver 0.28.0): 743k
  • apk compatibility? I have not built any APK for OpenWRT so far :-)

@xabolcs

xabolcs commented Aug 18, 2024

Copy link
Copy Markdown
Contributor Author

Sorry for noob question, but how did you build my branch?

@davidandreoletti

Copy link
Copy Markdown
Contributor

Sorry for noob question, but how did you build my branch?

I did not build your branch. I thought you were asking about my hardware setup for an eventual test.

@xabolcs

xabolcs commented Aug 19, 2024

Copy link
Copy Markdown
Contributor Author

OK, thanks for clearing up the misunderstanding! 🙏

I'll let you know when I have packages for you - built from this PR.

@davidandreoletti

Copy link
Copy Markdown
Contributor

OK, thanks for clearing up the misunderstanding! 🙏

I'll let you know when I have packages for you - built from this PR.

(ping @xabolcs )

@xabolcs

xabolcs commented Jan 15, 2025

Copy link
Copy Markdown
Contributor Author

Hi @davidandreoletti !

Thanks for the reminder! Sorry, I was carried away! 🙂

Well in the meantime Snapcast 0.29.0 came out which has HTTPS support, but I'm so noob I don't know how to add those dependencies! 🙈
I mean:

Package snapserver is missing dependencies for the following libraries:
libcrypto.so.3
libssl.so.3

Sure, I could stick with 0.28.0. 🤷

@xabolcs xabolcs force-pushed the 23924-snapcast-add-snapserver-and-snapclient-packages branch from cbf46ff to 9f1e2e9 Compare January 15, 2025 09:37
@davidandreoletti

Copy link
Copy Markdown
Contributor

Stick with 0.28 for this PR.

0.29 dependencies will be investigated in a new PR.

@xabolcs

xabolcs commented Jan 15, 2025

Copy link
Copy Markdown
Contributor Author

Stick with 0.28 for this PR.

I had to backport a few Boost v1.87.0 compatibility commit for that ... sure its far more easier for me. 👌

After revisiting the PR, it didn't even compile because of commit
c50de92 ("boost: Updates package to version 1.87.0").

Signed-off-by: Szabolcs Hubai <szab.hu@gmail.com>
@xabolcs xabolcs force-pushed the 23924-snapcast-add-snapserver-and-snapclient-packages branch from 9f1e2e9 to f970ef6 Compare January 17, 2025 21:43
@xabolcs

xabolcs commented Jan 17, 2025

Copy link
Copy Markdown
Contributor Author

After backporting 3 commits, 0.28.0 is compiling again! 🎉

Here is the result for SNAPSHOT (and apk), please test!
snapcast-apk.tar.gz

@xabolcs

xabolcs commented Jan 18, 2025

Copy link
Copy Markdown
Contributor Author

Almost there:

Dirty patches detected, please refresh and review the diff
Error: Process completed with exit code 1.

@xabolcs xabolcs force-pushed the 23924-snapcast-add-snapserver-and-snapclient-packages branch from f970ef6 to 9e81165 Compare January 18, 2025 09:46
@xabolcs xabolcs marked this pull request as ready for review January 18, 2025 15:48
@davidandreoletti

davidandreoletti commented Feb 2, 2025

Copy link
Copy Markdown
Contributor

@xabolcs My build system broke with the switch to OpenWRT's new "apk" package manager. I can compile this PR's snapcast package now. Will get back to you soon with my testing on the same hardware as you.

@davidandreoletti

Copy link
Copy Markdown
Contributor

@xabolcs Snapcast works on NanoPi R4s (4G) with OpenWRT master + this PR.

Thank you!

@davidandreoletti

davidandreoletti commented Feb 11, 2025

Copy link
Copy Markdown
Contributor

@neheb This is a new package. Both individuals confirm the package compiles and works on their machine.
What's the next step to get this merged ?

Comment thread sound/snapcast/Makefile Outdated
PKG_NAME:=snapcast
BASE_VERSION:=0.28.0
PKG_SOURCE_DATE:=2024-04-15
PKG_SOURCE_VERSION:=5fa01b8a49d842ed368138ee071cdf1c34be7a64

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just use the version here? something like

PKG_VERSION:=0.28.0
PKG_SOURCE_VERSION:=v$(PKG_VERSION)

as is done elsewhere.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just use the version here?

Snapcast has master branch for release versions and develop branch for nightly builds.

In the older days there was too much commit between the two and the development version was stable enough to use it.

That's why I wanted to include the exact commit and commit date from what the actual version was built.

Sure, badaix releases Snapcast often these days, so your suggestion could work too.
I would stick with this advanced versioning, but if you ask me to change it to the simple versioning, I would do it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like that. If needed, SOURCE_DATE can be revisited.

Comment thread sound/snapcast/Makefile Outdated
SECTION := sound
CATEGORY := Sound
TITLE := Synchronous multiroom audio player
DEPENDS := +AUDIO_SUPPORT:alsa-lib +libstdcpp +libavahi-client +libatomic +libogg +libflac +libopus +boost +libsoxr

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

libstdcpp is included with boost. Minor detail.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

libstdcpp is included with boost. Minor detail.

Thank you very much! I'm a package maintainer newbie.

@neheb

neheb commented Feb 11, 2025

Copy link
Copy Markdown
Contributor

@davidandreoletti unfortunately the answer is constant pinging and hoping someone cares.

@davidandreoletti

Copy link
Copy Markdown
Contributor

@davidandreoletti unfortunately the answer is constant pinging and hoping someone cares.

For this package, @xabolcs and I are active. Your 2 feedbacks will be acted on.
Are you ok @neheb ?

@neheb

neheb commented Feb 11, 2025

Copy link
Copy Markdown
Contributor

huh?

@davidandreoletti

davidandreoletti commented Feb 11, 2025

Copy link
Copy Markdown
Contributor

@neheb Your message sounded a bit negative: "unfortunately the answer is constant pinging" and perhaps you growing tired of "hey I need you" kind of pings.

Looks like I misinterpreted. I am sorry and let's move on.

@xabolcs

xabolcs commented Feb 11, 2025

Copy link
Copy Markdown
Contributor Author

For this package, xabolcs and I are active.

@davidandreoletti
May I add you to PKG_MAINTAINER:= as a co-maintainer? I could deal with the code ( 😅 ), but being active here (e.g. to watch the issues) and the extra testing would be a great help to me!

@1715173329 1715173329 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@GeorgeSapkin

Copy link
Copy Markdown
Member

Might be a good idea to add CI test scripts (test.sh) for both packages to ensure the binaries run without errors.

@xabolcs

xabolcs commented Sep 8, 2025

Copy link
Copy Markdown
Contributor Author

Might be a good idea to add CI test scripts ...

Do you have something in mind, @GeorgeSapkin ?

While I can play with workflow yamls and test.shs, but I have no imagination what to do! 😅

When to trigger those scripts? On Boost change? On Snapcast change? Both?
What to do within those scripts? snapserver --version and snapclient --list should be enough? Or a mini end-to-end test to setup a fifo and feed with some noise for snapserver and wire up a simple snapclient config to listen that music with null output?

root@GL-MT6000-64B ~ # snapserver --version
snapserver v0.29.0
Copyright (C) 2014-2024 BadAix (snapcast@badaix.de).
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Johannes M. Pohl and contributors <https://github.com/badaix/snapcast/graphs/contributors>.

root@HT-TM02-43C ~ # snapclient --list
0: null
Discard all samples (playback) or generate zero samples (capture)

1: default
Default Audio Device

2: sysdefault
Default Audio Device

3: default:CARD=CODEC
USB Audio CODEC, USB Audio
Default Audio Device

4: sysdefault:CARD=CODEC
USB Audio CODEC, USB Audio
Default Audio Device

5: front:CARD=CODEC,DEV=0
USB Audio CODEC, USB Audio
Front output / input

6: surround21:CARD=CODEC,DEV=0
USB Audio CODEC, USB Audio
2.1 Surround output to Front and Subwoofer speakers

7: surround40:CARD=CODEC,DEV=0
USB Audio CODEC, USB Audio
4.0 Surround output to Front and Rear speakers

8: surround41:CARD=CODEC,DEV=0
USB Audio CODEC, USB Audio
4.1 Surround output to Front, Rear and Subwoofer speakers

9: surround50:CARD=CODEC,DEV=0
USB Audio CODEC, USB Audio
5.0 Surround output to Front, Center and Rear speakers

10: surround51:CARD=CODEC,DEV=0
USB Audio CODEC, USB Audio
5.1 Surround output to Front, Center, Rear and Subwoofer speakers

11: surround71:CARD=CODEC,DEV=0
USB Audio CODEC, USB Audio
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers

12: iec958:CARD=CODEC,DEV=0
USB Audio CODEC, USB Audio
IEC958 (S/PDIF) Digital Audio Output

@GeorgeSapkin

Copy link
Copy Markdown
Member

@xabolcs I meant a version check or an equivalent.

@xabolcs

xabolcs commented Sep 8, 2025

Copy link
Copy Markdown
Contributor Author

There is a --version for snapclient, too!

root@HT-TM02-43C ~ # snapclient --version
snapclient v0.28.0
Copyright (C) 2014-2022 BadAix (snapcast@badaix.de).
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Johannes M. Pohl and contributors <https://github.com/badaix/snapcast/graphs/contributors>.

But I still don't know where to start. Do you have some pointers where to start looking?
Did I asked relevant questions in my previous comment, at least? Did I understand your suggestion correctly?

@GeorgeSapkin

Copy link
Copy Markdown
Member

If there are just two binaries and their names match those of their respective packages, and they both support a --version argument, it should be enough to add test.sh in the package root directory:

#!/bin/sh

"$1" --version | grep -F "$PKG_VERSION"

The script is used by CI in the Test via Docker container step.

@xabolcs xabolcs force-pushed the 23924-snapcast-add-snapserver-and-snapclient-packages branch from b14cadb to 0fdfdd3 Compare September 8, 2025 12:40
@xabolcs

xabolcs commented Sep 8, 2025

Copy link
Copy Markdown
Contributor Author

The script is used by CI in the Test via Docker container step.

Thank you very much, now I see it!
Added, pushed.

May I add your Suggested-by: into the script or to the commit?

@GeorgeSapkin

Copy link
Copy Markdown
Member

May I add your Suggested-by: into the script or to the commit

Sure.

@xabolcs xabolcs force-pushed the 23924-snapcast-add-snapserver-and-snapclient-packages branch from 0fdfdd3 to a72a846 Compare September 8, 2025 13:56
Comment thread sound/snapcast/Makefile
include $(TOPDIR)/rules.mk

PKG_NAME:=snapcast
PKG_VERSION:=0.28.0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latest release is 0.32.3. Why not use that one?

@xabolcs xabolcs Sep 8, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @GeorgeSapkin !

The latest release is 0.32.3. Why not use that one?

It started with 0.29.0 where OpenSSL support introduced and I got problems with it (back in January 2025):

Well in the meantime Snapcast 0.29.0 came out which has HTTPS support, but I'm so noob I don't know how to add those dependencies! 🙈
I mean:

Package snapserver is missing dependencies for the following libraries:
libcrypto.so.3
libssl.so.3

Sure, I could stick with 0.28.0. 🤷

At that point of time I decided to stick with 0.28.0 and deal with this OpenSSL support later with a followup PR where I introduce different flavours: snap*-mini and snap*-full.
And I also want to make the Avahi dependency optional: snapcast/snapos#4

And then, last week @1715173329 suggested how to solve the problem

I found this:

Package snapserver is missing dependencies for the following libraries:
libcrypto.so.3
libssl.so.3

Please add libopenssl to DEPENDS, it should resolve the issue.

And now we are here.

In summary:

  • I'd like to include snapcast before OpenWrt 25.xx branches off (and hopefully backport to 24.10, @hunterzero99 had a success build for once)
  • with that in mind I choose to stick to 0.28.0 and backport compatibility fixes
    • because I don't know how to be a maintainer in openwrt/packages and this would be my first package
  • and after I learn how to deal with those things above, I plan update to latest tagged Snapcast or even to specific develop commit (see talk with @neheb)

If you have time and energy to coordinate me with these problems (disabling the OpenSSL support is on upstream develop, see snapcast/snapcast#1427) I happily go this way in this PR! 👌 🙏

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the summary. I guess if everybody else is OK with this, then I'm OK.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the summary.

Thank you for asking!
Now it's summarized. 🙂

Should I add a few lines about these into the commit?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it wouldn't hurt for future reference.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it wouldn't hurt for future reference.

riscv64 is still building, but here comes my amended commit message!

@1715173329

Copy link
Copy Markdown
Member

Please do not add Suggested-by tag to real files, leaving them in the commit message is good enough.

@xabolcs xabolcs force-pushed the 23924-snapcast-add-snapserver-and-snapclient-packages branch from a72a846 to 174ca44 Compare September 8, 2025 15:16
@xabolcs

xabolcs commented Sep 8, 2025

Copy link
Copy Markdown
Contributor Author

Please do not add Suggested-by tag to real files, leaving them in the commit message is good enough.

Done!

@openwrt openwrt deleted a comment from xabolcs Sep 8, 2025
@xabolcs xabolcs force-pushed the 23924-snapcast-add-snapserver-and-snapclient-packages branch from 174ca44 to b79c6d0 Compare September 8, 2025 20:32
@GeorgeSapkin

Copy link
Copy Markdown
Member

Are 5 separate commits necessary? Judging by the comments, the first two commits don't compile on their own. And do the last 3 boost-related commits needs to be separate? As in would there be any use reverting to any of those individual commits?

@xabolcs

xabolcs commented Sep 8, 2025

Copy link
Copy Markdown
Contributor Author

Are 5 separate commits necessary? ...

They are showing history.

I created the first commit to separate my work from the original badaix/snapos work.
The second commit is my work (with the help of yours). I want to keep these two separate.

The other commits are just boost compatibility commits. If everybody would have been faster (including me) then this PR consisted only the first two commit.
But I was driven away and boost upgrades kicked in.

I think they have their value (maybe they need rewording).

Of course, in the end, only one commit is necessary. 🤷

@GeorgeSapkin

Copy link
Copy Markdown
Member

Of course, in the end, only one commit is necessary. 🤷

I'm not sure if you're agreeing or disagreeing with me here 😅

@xabolcs

xabolcs commented Sep 8, 2025

Copy link
Copy Markdown
Contributor Author

I'm not sure if you're agreeing or disagreeing with me here 😅

You are right!
I'm just a contributor and you are a committer. It's all up to you how you commit my contribution, if you commit at all.

I hope my (2 base + 3 compat) commits aren't pollute the git history too much.
And if we (contributor + reviewers) have more time (to incorporate those what I earlier wrote) then it will be 2 commits again, as it was in 2024 when I opened the PR and the boost was at 1.86.0. 🙂

@xabolcs

xabolcs commented Sep 8, 2025

Copy link
Copy Markdown
Contributor Author

Of course, in the end, only one commit is necessary. 🤷

I'm not sure if you're agreeing or disagreeing with me here 😅

As I already wrote earlier, my ultimate goal is to add Snapcast into openwrt/packages so I'll follow your (or any other commiter's) lead.
In the end I'd like to install snapclient and snapserver using only the package manager, like apk add snapserver or opkg install snapclient.
That's why I opened the original issue and that's why I opened this pull request.

@1715173329 1715173329 merged commit 7dee0d0 into openwrt:master Sep 9, 2025
11 of 12 checks passed
1715173329 pushed a commit that referenced this pull request Sep 9, 2025
Snapcast [1] is a multiroom client-server audio player, where all
clients are time synchronized with the server to play perfectly synced
audio.

It's not a standalone player, but an extension that turns your existing
audio player into a Sonos-like multiroom solution.
Audio is captured by the server and routed to the connected clients.
Several players can feed audio to the server in parallel and clients can
be grouped to play the same audio stream.
One of the most generic ways to use Snapcast is in conjunction with the
music player daemon (MPD) [2] or Mopidy [3].

The inclusion starts with version 0.28.0 because of OpenSSL dependency
issues of version 0.29.0. Newer versions (e.g. 0.32.3, see [4])
with optional OpenSSL support, will be incorporated with flavours,
like "-mini" and "-full" in the upcoming PRs.
More about this topic please check the inclusion PR at [5]!

[1]: https://github.com/badaix/snapcast
[2]: http://www.musicpd.org/
[3]: https://www.mopidy.com/
[4]: https://github.com/badaix/snapcast/blob/develop/changelog.md
[5]: #23956 (comment)

Fixes: #23924
Suggested-by: Tianling Shen <cnsztl@immortalwrt.org>
Suggested-by: George Sapkin <george@sapk.in>
Signed-off-by: Szabolcs Hubai <szab.hu@gmail.com>
@1715173329

Copy link
Copy Markdown
Member

Merged, thank you!

@xabolcs

xabolcs commented Sep 13, 2025

Copy link
Copy Markdown
Contributor Author

Sorry for creating faillog for snapcast since the beginning!
I started to fix that PulseAudio dependency.
I'm going to cut that (and while at it, the Avahi) dependency out.

I'm very sorry!

xabolcs added a commit to xabolcs/openwrt-packages that referenced this pull request Sep 13, 2025
While testing my integration of Snapcast, I didn't test with CONFIG_ALL*
and CONFIG_BUILDBOT flags, but the buildbots did and failed with a lot
of undefined reference to PulseAudio.

Fix it with preventing PulseAudio detection.
While at it, prevent Avahi detection too to save more flash space.

These features will be available later, through flavours.

Fixes: openwrt#23956
Fixes: eeb8d13 ("snapcast: add package snapserver and snapclient")

Signed-off-by: Szabolcs Hubai <szab.hu@gmail.com>
robimarko pushed a commit that referenced this pull request Sep 14, 2025
While testing my integration of Snapcast, I didn't test with CONFIG_ALL*
and CONFIG_BUILDBOT flags, but the buildbots did and failed with a lot
of undefined reference to PulseAudio.

Fix it with preventing PulseAudio detection.
While at it, prevent Avahi detection too to save more flash space.

These features will be available later, through flavours.

Fixes: #23956
Fixes: eeb8d13 ("snapcast: add package snapserver and snapclient")

Signed-off-by: Szabolcs Hubai <szab.hu@gmail.com>
@xabolcs xabolcs deleted the 23924-snapcast-add-snapserver-and-snapclient-packages branch September 25, 2025 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Snapcast packages (snapserver, snapclient)

7 participants