zynaddsubfx: fix get samplerate from jack for busybox environment

Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
This commit is contained in:
Andreas Müller
2017-06-17 22:52:58 +02:00
parent f14c25f4b2
commit 5f214776bf
2 changed files with 47 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
From 1f8fe80a2e80b8cc44ccf4e48c7ae693d314469a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
Date: Sat, 17 Jun 2017 22:16:18 +0200
Subject: [PATCH] Nio.cpp: Do not use 'ps aux' to find jack - busybox's ps does
not support aux
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Upstream-Status: Pending
Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
---
src/Nio/Nio.cpp | 15 +--------------
1 file changed, 1 insertion(+), 14 deletions(-)
diff --git a/src/Nio/Nio.cpp b/src/Nio/Nio.cpp
index 1e26b65..9bbb5bc 100644
--- a/src/Nio/Nio.cpp
+++ b/src/Nio/Nio.cpp
@@ -133,21 +133,8 @@ string Nio::getSink()
#include <jack/jack.h>
void Nio::preferedSampleRate(unsigned &rate)
{
-#if __linux__
- //avoid checking in with jack if it's off
- FILE *ps = popen("ps aux", "r");
- char buffer[4096];
- while(fgets(buffer, sizeof(buffer), ps))
- if(strstr(buffer, "jack"))
- break;
- fclose(ps);
-
- if(!strstr(buffer, "jack"))
- return;
-#endif
-
jack_client_t *client = jack_client_open("temp-client",
- JackNoStartServer, 0);
+ JackNullOption, 0);
if(client) {
rate = jack_get_sample_rate(client);
jack_client_close(client);
--
2.9.4

View File

@@ -26,6 +26,7 @@ SRC_URI = " \
${SOURCEFORGE_MIRROR}/project/${BPN}/${BPN}/${PV}/${BPN}-${PV}.tar.bz2 \
file://0001-No-target-specific-asm.patch \
file://0002-Controller-Spliter-align-Makefiles-for-cross-compili.patch \
file://0003-Nio.cpp-Do-not-use-ps-aux-to-find-jack-busybox-s-ps-.patch \
"
SRC_URI[md5sum] = "7dc757512e5b6f3013bfb168ed01cfa3"
SRC_URI[sha256sum] = "014b1d9ad1750c310369676b46a4555ba6bec512c38ccba17ceb89c78552949a"