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

main/pipewire: enable roc support #2987

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions main/gengetopt/patches/unary_function.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
From a3d0a0419a35bef9b80a6a12432ab30e2d1e0f5a Mon Sep 17 00:00:00 2001
From: Tomas Volf <[email protected]>
Date: Tue, 5 Mar 2024 22:27:42 +0100
Subject: [PATCH] gm_utils.h: Drop std::unary_function.

I am not sure what it does, it is deprecated/removed (depending on C++ version)
and the advice seems to be that is just is not necessary. So just remove it.

* src/gm_utils.h (print_f, pair_print_f): Drop std::unary_function.
---
src/gm_utils.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gm_utils.h b/src/gm_utils.h
index 34f9dd1..69b71e1 100644
--- a/src/gm_utils.h
+++ b/src/gm_utils.h
@@ -117,7 +117,7 @@ bool string_contains(const char *s, const char *tofind);
* Function object to print something into a stream (to be used with for_each)
*/
template<class T>
-struct print_f : public std::unary_function<T, void>
+struct print_f
{
print_f(std::ostream& out, const string &s = ", ") : os(out), sep(s) {}
void operator() (T x) { os << x << sep; }
@@ -129,7 +129,7 @@ struct print_f : public std::unary_function<T, void>
* Function object to print a pair into two streams (to be used with for_each)
*/
template<class T>
-struct pair_print_f : public std::unary_function<T, void>
+struct pair_print_f
{
pair_print_f(std::ostream& out1, std::ostream& out2, const string &s = ", ") :
os1(out1), os2(out2), sep(s) {}
--
2.46.1

12 changes: 12 additions & 0 deletions main/gengetopt/template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
pkgname = "gengetopt"
pkgver = "2.23"
pkgrel = 0
build_style = "gnu_configure"
hostmakedepends = ["automake", "slibtool", "texinfo"]
pkgdesc = "Command line option parser generator"
maintainer = "triallax <[email protected]>"
license = "GPL-3.0-or-later"
url = "https://www.gnu.org/software/gengetopt"
source = f"$(GNU_SITE)/gengetopt/gengetopt-{pkgver}.tar.xz"
sha256 = "b941aec9011864978dd7fdeb052b1943535824169d2aa2b0e7eae9ab807584ac"
hardening = ["vis", "cfi"]
1 change: 1 addition & 0 deletions main/pipewire-roc
16 changes: 12 additions & 4 deletions main/pipewire/template.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pkgname = "pipewire"
pkgver = "1.2.5"
pkgrel = 1
pkgrel = 2
build_style = "meson"
configure_args = [
"--auto-features=enabled",
Expand All @@ -10,7 +10,6 @@
"-Dsdl2=disabled", # examples
"-Dsystemd=disabled",
"-Dlibffado=disabled",
"-Droc=disabled", # TODO
Copy link
Member

Choose a reason for hiding this comment

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

should prolly split the module and the libs below and then install_if = parent, roc-toolkit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should be good now

"-Dselinux=disabled",
"-Dsnap=disabled",
"-Dbluez5-codec-lc3plus=disabled",
Expand Down Expand Up @@ -52,6 +51,7 @@
"lilv-devel",
"ncurses-devel",
"openssl-devel",
"roc-toolkit-devel",
"sbc-devel",
"v4l-utils-devel",
]
Expand Down Expand Up @@ -106,6 +106,15 @@ def _(self):
return ["usr/lib/spa-0.2/bluez5"]


@subpackage("pipewire-roc")
def _(self):
self.subdesc = "ROC support"
self.depends += [self.parent]
self.install_if = [self.parent, "roc-toolkit"]

return ["usr/lib/pipewire-*/libpipewire-module-roc-*.so"]


@subpackage("pipewire-libs")
def _(self):
self.subdesc = "runtime library"
Expand Down Expand Up @@ -138,10 +147,9 @@ def _(self):
self.provides = [self.with_pkgver("jack")]

return [
"usr/bin/pw-jack",
"cmd:pw-jack",
"usr/lib/libjack*",
"usr/share/pipewire/jack.conf",
"usr/share/man/man1/pw-jack.1",
]


Expand Down
1 change: 1 addition & 0 deletions main/roc-toolkit-devel
52 changes: 52 additions & 0 deletions main/roc-toolkit/template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
pkgname = "roc-toolkit"
pkgver = "0.4.0"
pkgrel = 0
hostmakedepends = [
"gengetopt",
"pkgconf",
"ragel",
"scons",
]
makedepends = [
"json-c-devel",
"libatomic_ops-devel",
"libltdl-devel",
"libpulse-devel",
"libsndfile-devel",
"libunwind-devel",
"libuv-devel",
"openssl-devel",
"speexdsp-devel",
]
pkgdesc = "Real-time audio streaming over the network"
maintainer = "triallax <[email protected]>"
license = "MPL-2.0"
url = "https://roc-streaming.org"
source = f"https://github.com/roc-streaming/roc-toolkit/archive/refs/tags/v{pkgver}.tar.gz"
sha256 = "60501dfdc8c0de385898dbd1eb8239d93ef962667ddb064ad796b887a41a1a46"
hardening = ["vis", "cfi"]
# check: needs cpputest
# cross: scons, can't be bothered
options = ["!check", "!cross"]


_scons_flags = [
"--disable-openfec",
"--disable-sox",
"--disable-alsa",
Copy link
Member

Choose a reason for hiding this comment

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

what setup do you use that you get crackling in? is it pipewire on both sides using the plugins, or is one side using roc-send/recv?

if you're using the cli utils on either side then you might actually want to have alsa enabled so they are directly outputting and not going through an extra layer, or at least that's a guess

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sender is chimera linux with pipewire-roc, the receiver is android using roc droid, so i think what you're suggesting doesn't apply

]


def build(self):
self.do("scons", f"-j{self.make_jobs}", *_scons_flags)


def install(self):
self.do(
"scons", *_scons_flags, "install", env={"DESTDIR": self.chroot_destdir}
)


@subpackage("roc-toolkit-devel")
def _(self):
return self.default_devel()