hi all, continuing from a previous email where I try to start up several
audio applications from a custom init script , which is run from rc.local,
I noticed that I get several
Capture open error: Device or resource busy
error messages for the alsa_(in|out) instances I set up:
alsa_out -d hw:DSP24,0 -c 10 -j dsp_out -r 48000 -p128 -n2 &
alsa_in -d hw:DSP24,0 -c 12 -j dsp_in -r 48000 -p128 -n2 &
alsa_out -d hw:Intel -c 8 -j hda_out -r 48000 -p128 -n3 &
alsa_in -d hw:Intel -c 2 -j hda_in -r 48000 -p128 -n3 &
These work when I use the script manually by logging in the pc.
but from rc.local the seems to be a problem with alsa.
on some reboots, perhaps one (random) of these will work , but usually non
of the 4 will be loaded correctly.
what could be conflicting here?
Hi all,
I am trying to run jackd instance from /etc/rc.local (along with a few
other applications) from a custom made init script.
The system is ubuntustudio and I have setup everything to have elevated
permissions when executing applications from the @audio group.
so when I am logged on, I see this:
nass@starkill:~$ ulimit -r -l
real-time priority (-r) 95
max locked memory (kbytes, -l) unlimited
which is expected and I can execute the script I wrote.
but, when I execute my script from /etc/rc.local as
su - nass -c "ulimits -r -l cd audio_setup/scripts ; bash ./start_audio"
then my user does not (yet?) have elevated permissions.
real-time priority (-r) 0
max locked memory (kbytes, -l) 64
is there a script I can run before my start_audio script to elevate my
permissions?
thank you
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...