Hello,
Sorry about that. My mistake.
--
Due to administrative overhead, messages sent by non-members to
jack-devel will be discarded. Please join the mailing list and then
resend your message.
Jack on Raspberry PI 2.eml
Subject:
Jack on Raspberry PI 2
From:
Ron <rlpatton(a)aol.com>
Date:
4/16/2015 10:47
To:
jack-devel(a)lists.jackaudio.org
Hello,
I have downloaded, built and installed the latest version of Jack on a
Raspberry PI 2 running Raspbian (Linux 3.18.11-v7+ #777 SMP PREEMPT).
ron@squireoaksfarm-radio ~/src/quick2wire-python-api $ jackd --version
jackdmp 1.9.11
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2014 Grame.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
jackdmp version 1.9.11 tmpdir /dev/shm protocol 8
I have been all over the internet trying to find a solution to the
following error that prevents the jack server from starting (using
qjackctl):
10:31:31.869 Patchbay deactivated.
10:31:31.882 Statistics reset.
10:31:31.931 ALSA connection change.
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
10:31:31.961 ALSA connection graph change.
10:31:35.651 JACK is starting...
10:31:35.653 /usr/local/bin/jackd -dalsa -dhw:0 -r48000 -p1024 -n2
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
10:31:35.682 JACK was started with PID=9484.
jackdmp 1.9.11
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2014 Grame.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK server starting in realtime mode with priority 10
Cannot lock down 82278944 byte memory area (Cannot allocate memory)
10:31:36.022 JACK was stopped successfully.
10:31:36.028 JACK has crashed.
10:31:37.778 Could not connect to JACK server as client. - Overall
operation failed. - Unable to connect to serve
r. Please check the messages window for more info.
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
I have tried to start the sever with the "--no-mlock" option.
Here are the contents of audio.conf
ron@squireoaksfarm-radio /etc/security/limits.d $ more audio.conf
# Provided by the jackd package.
#
# Changes to this file will be preserved.
#
# If you want to enable/disable realtime permissions, run
#
# dpkg-reconfigure -p high jackd
@audio - rtprio 95
@audio - memlock unlimited
#@audio - nice -19
The user "ron" is a member of the audio group.
Please help,
Ron
73
Ron / W4MMP
Hi Fons,
After our discussion in LAC I did two things :
- remove some log messages
- allow to better control thread priority definition, basically following the model used on Linux (server_priority = N, client_priority = N-5 so that the client may use threads with a priority between client RT value and server RT value) (see : http://comments.gmane.org/gmane.comp.audio.jackit/17931). On Windows it works like the following:
- using the -P number below 89 make all RT thread takes THREAD_PRIORITY_TIME_CRITICAL priority
- using value more than 89 moves in the MMCSS ("Pro Audio") class where 4 values can be used (AVRT_PRIORITY_LOW, AVRT_PRIORITY_NORMAL, AVRT_PRIORITY_HIGH, AVRT_PRIORITY_CRITICAL)
- client priority is 3 below server priority: so if 92 is used for the server, then JACK server RT thread will actually takes AVRT_PRIORITY_CRITICAL and client thread will use AVRT_PRIORITY_CRITICAL - 3 = AVRT_PRIORITY_LOW
- then the client my possibly use a value between AVRT_PRIORITY_LOW and AVRT_PRIORITY_CRITICAL for some other threads.
Tell me it if works the way you need to, and if not, how we can improve the implementation.
Links for the binaries here:
https://dl.dropboxusercontent.com/u/28869550/Jack_v1.9.11_32_setup.exehttps://dl.dropboxusercontent.com/u/28869550/Jack_v1.9.11_64_setup.exe
Thanks.
Stéphane
> Do you want to synchronize JACK clients so they do something in the same
> cycle / at the same sample time?
Yes, I think so.
> You could inject an event to JACK that's being distributed to the clients
> (inside JACK). The clients would then receive the events in the same cycle
> and can process (at given sample pos) in that cycle.
This sounds very good. However, I am not sure what you mean in terms of code. Can you please provide some example code?
> > Nonetheless, if I have 40 instances of zyn, I'd
> > like to (actually must) compute them concurrently. So how to do this with
> > one client?
>
> By using your own internal graph mechanism that has parallel capabilities.
> See, for excample, https://github.com/flowprogramming/dspatch
This one is based on pthread_cond_wait(), which is either implemented as a spinlock or not realtime safe (I guess the second). So how can this help?
> > The best way I can see is using an array of jack clients, and hoping
> > they'll process() at the same time. However, this sounds very tricky...
>
> There can be very good reasons for using JACK 1. If a user is doing that,
> you won't get any parallelization at all.
Does JACK 2 allow to use multiple jack clients that call process() at the same time? Or does it allow to enter process() with multiple threads? There seems to be no documentation/tutorial about JACK 2.
> But again, I wasn't proposing "one jack client per effect" ... I was
> proposing only a single JACK client per application, and NOT using JACK's
> audio graph capabilities within your application: you would need to compute
> execution order yourself or use a nice library for this (not that there
> necessarily are any nice libraries).
Need to ask once more. Assuming I'll do this - one jack client and zynaddsubfx as a plugin. Nonetheless, if I have 40 instances of zyn, I'd like to (actually must) compute them concurrently. So how to do this with one client?
The best way I can see is using an array of jack clients, and hoping they'll process() at the same time. However, this sounds very tricky...
> But again, I wasn't proposing "one jack client per effect" ... I was
> proposing only a single JACK client per application, and NOT using JACK's
> audio graph capabilities within your application: you would need to compute
> execution order yourself or use a nice library for this (not that there
> necessarily are any nice libraries).
Ok, so you do not propose to use multiple clients and exploit JACK's graph capabilities. Just for interest: For what (main) reason(s) didn't you propose it?
Thanks everyone for the help.
Am Donnerstag, 9. April 2015, 09:00:38 schrieben Sie:
> Speaking entirely personally, I think this design is just plain nuts. I
> know there are some JACK-ecosystem developers who disagree with me, but I
> think that using JACK clients for this purpose is just wrong and is pushing
> the design scope for JACK.
Ok, let's say I'll do what multiple people proposed here: one jack client per effect + only data exchange between effects via jack ports.
Then see this example:
piano roll ----- (notes) -----> synthesizer
How should one transfer notes using a jack buffer? Of course, one could make a structure to transfer notes, cast this structure to const char*, and *hope* it fits into the port buffer. Is there any better way? Maybe a "custom port type"?
Hi,
> So a part of the dependencies in the signal processing flow is only
> known to your sequencer, which leads to a situation where jack can not
> know, if all dependencies for running a certain client process function
> are satisfied?
> I personally would try to avoid that so that things will become easier,
> which means no need for ringbuffers (input and output buffers that
> depend on each other are passed together to the process function) and
> spinlocks (jack always calls the clients callback, if data is definitely
> available) for synchronization.
This was my first thought aswell. However, if you'll end up with 40 lfo generators that just compute f(x)=sin(x) (or even simpler), you'll have 40 additional threads that need to communicate with each other. I wonder if that is so good...
Hi,
> I try to understand your plan:
>
> simple data flow example:
>
> zynaddsubfx_1_output
>
> V
> sequencer_client_1_input
>
> V
> sequencer_input_ringbuffer
>
> V
> (sequencer processing stuff)
>
> V
> sequencer_output_ringbuffer
>
> V
> sequencer_client_output
>
> V
> system_client_input(hardware output)
Your picture is indeed correct. To add some more examples:
* Something like this is also possible
sequencer_input_ringbuffer_1 sequencer_input_ringbuffer_2
V V
plus (i.e. addition of sound-waves)
V
plus_effect_ringbuffer
* The part that you labeled "(sequencer processing stuff)" might be filled with:
V
peak_controller_effect some lfo generator
V (lfo) V (lfo)
zynaddsubfx_2_volume_input zynaddsubfx_2_filter_freq_input
V
(zynaddsubfx_2)
V
zynaddsubfx_2_output
V
sequencer_client_2_input
V
> Maybe also what you envision to happen in which thread or which
> callback?
Let's take the second example. zynaddsubfx itself is in another process, so we don't need to run this at all. For feeding each ringbuffer from zyn, I planned to use a separate jack client. E.g., if process() of sequencer_client_1_input is being called, it simply copies "nframes" into sequencer_input_ringbuffer.
Everything that now remains (e.g. lfo generator, peak_controller_effect, sending input to zynaddsubfx_2) is done by a process() callback of sequencer_client_output. I call this one the master jack client.
About the problem:
A point where I think spinlocks can't be avoided would be, e.g., reading from sequencer_output_ringbuffer. The sequencer's master jack client would need to do that in process(), but it can not guess when the ringbuffer reader from sequencer_client_2_input has even started to feed the ringbuffer.
> Do you want to do some signal processing in your sequencer or would it
> be ok to delegate this to other jack clients? (may be easier)
Hopefully you got it from the explenations above: the master jack client would do this right now, as I planned. Other ideas will be fine, too. Though, I guess, for "some lfo generator", e.g., a separate jack client would be overkill, as this generator simply does, e.g., f(x) = sin(x).
Hello,
currently, I am trying to write a sequencer which should be able to contain 40 or more instances of zynaddsubfx, plus some effects. zynaddsubfx outputs data using jack, so for each zynaddsubfx, I'll add a jack client with two ports each, and a ringbuffer. These clients will simply forward zyn's output to the respective ringbuffer.
So far (using jack2 at least), we end up in a parallelized setup. The problem is that I would like the sequencer to output it's final sound via jack, too. So the sequencer gets one more jack client, which is connected to the sequencer's out ports. This client must call process() to do everything except feeding the ringbuffers, e.g.:
* computing simple effects, like lfo generation, lfo transformation, ...
* sending control parameters *to* zynaddsubfx
* post-process zyn's audio data by reading the ringbuffers
However, the last points is an issue. If there's nothing to read, I'll need to use a spinlock to wait for zynaddsubfx. Even if that spinlock is atomic-based and lock-free (I think it should be RT safe then), this will cause many unused CPU cycles.
Does anyone have a better idea than using spinlocks?
Thanks + kind regards,
Johannes