[Jack-Devel] How to profile jack cpu load?

classic Classic list List threaded Threaded
34 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: How to profile jack cpu load?

oleg68
I collected the profiling informaion  profiling.zip
<http://jack-audio.10948.n7.nabble.com/file/t1525/profiling.zip>  

How can I interprete this result? At the line 225 jack started sustaining
the sound and DSP load became 100%.

If the driver interrupt period became large, why the DSP load is high too?



--
Sent from: http://jack-audio.10948.n7.nabble.com/Jackit-f3.html
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: How to profile jack cpu load?

Tim-2
In reply to this post by John Rigg-16


On 07/14/2018 04:15 AM, John Rigg wrote:
> On Sat, Jul 14, 2018 at 12:41:28AM -0700, oleg68 wrote:
>> You are right. The problem was the conflict with the old jack libraries
>>
>> But .waf install with ldconfig did not help.
>
> You need to tell "./waf configure" to install jack over
> the existing jack package files. On Debian systems I use
> --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu

I would not recommended that. Always a bad idea.
It will interfere with packaging.

/usr/local is the place where all user-built software
  should be installed.
Two versions of Jack can happily coexist - one in /usr
  and one in /usr/local. Only one can be active at a time
  of course. But it is easy to switch between them.
If you want to switch back to the packaged version simply
  uninstall your user-built version from /usr/local.

Thus I mentioned "sudo ldconfig" /may/ be sometimes
  required (I think it may have been with jack-1) so that
  the system can find (switch over to) the new libraries,
  to be able to immediately start using the new installation.

Tim.

>
> Your distro may use different locations, but it's easy
> to check.
>
> John
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: How to profile jack cpu load?

Chris Caudle
On Sat, July 14, 2018 11:52 am, Tim wrote:
> Two versions of Jack can happily coexist - one in /usr
>   and one in /usr/local.

Paul always warned strongly against that.  How do you make sure the one in
usr is not used?
The recommendation I had always heard when using something like Fedora
which would try to remove a lot of packages if you removed the system
provided RPM was to just delete the files manually, without touching the
RPM database, then install the locally built version.
Maybe you found a method that works reliably, but in the past at least
even the jackd developers wouldn't trust leaving the distribution provided
files on the filesystem.

--
Chris Caudle





_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: How to profile jack cpu load?

David Kastrup
"Chris Caudle" <[hidden email]> writes:

> On Sat, July 14, 2018 11:52 am, Tim wrote:
>> Two versions of Jack can happily coexist - one in /usr
>>   and one in /usr/local.
>
> Paul always warned strongly against that.  How do you make sure the one in
> usr is not used?

Putting /usr/local/bin first in PATH ?  I do that kind of thing
frequently.

> The recommendation I had always heard when using something like Fedora
> which would try to remove a lot of packages if you removed the system
> provided RPM was to just delete the files manually, without touching
> the RPM database, then install the locally built version.

I don't think that bullshitting RPM is really the way to go.

--
David Kastrup
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: How to profile jack cpu load?

Chris Caudle
On Sat, July 14, 2018 1:57 pm, David Kastrup wrote:
> "Chris Caudle" <[hidden email]> writes:
>> How do you make sure the one in
>> usr is not used?
>
> Putting /usr/local/bin first in PATH ?

The PATH environment variable only controls where you search for
executables, not shared libraries.
https://unix.stackexchange.com/questions/22926/where-do-executables-look-for-shared-objects-at-runtime
https://unix.stackexchange.com/questions/171632/where-will-the-system-search-for-dynamic-libraries
https://en.wikipedia.org/wiki/Rpath
http://man7.org/linux/man-pages/man8/ld.so.8.html

Notice in the ld man page that executables can have a search path in the
ELF header.  The executables DT_RUNPATH value comes before the
LD_LIBRARY_PATH environment variable in the search order.

Seems like there are several ways that loading the newly compiled version
could go wrong if the older files are still present.

--
Chris Caudle


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: How to profile jack cpu load?

Tim-2
In reply to this post by Chris Caudle


On 07/14/2018 02:47 PM, Chris Caudle wrote:
> On Sat, July 14, 2018 11:52 am, Tim wrote:
>> Two versions of Jack can happily coexist - one in /usr
>>    and one in /usr/local.
>
> Paul always warned strongly against that.  How do you make sure the one in
> usr is not used?

It should be automatic.
All user-built software is usually installed in /usr/local.
Most systems automatically look in /usr/local/bin FIRST
  before /usr/bin when you type an un-pathed program name

This makes it very easy to run your own builds of software while
  NOT disturbing the packaging system's installed versions in any way.

I routinely run my built versions of jack-1 or jack-2 installed in
  /usr/local, all while my distro's jack-2 package installation sits
  undisturbed in /usr. When I want to go back to the packaged version,
  I simply uninstall my built version, that MUST be done, to go back.

This is how I helped debug jack-1 and jack-2 at the same time.

Cheers.
Tim.

> The recommendation I had always heard when using something like Fedora
> which would try to remove a lot of packages if you removed the system
> provided RPM was to just delete the files manually, without touching the
> RPM database, then install the locally built version.
> Maybe you found a method that works reliably, but in the past at least
> even the jackd developers wouldn't trust leaving the distribution provided
> files on the filesystem.
>
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: How to profile jack cpu load?

Chris Caudle
On Sat, July 14, 2018 2:21 pm, Tim wrote:
> All user-built software is usually installed in /usr/local.
> Most systems automatically look in /usr/local/bin FIRST
>   before /usr/bin when you type an un-pathed program name

I still don't follow how the applications (e.g. Ardour) get the correct
version of libjack.so loaded, /usr/local isn't even in the default ld
search path.  Putting a locally compiled version of jackd into
/usr/local/bin seems like a recipe for loading a new jackd executable
while having the jack-aware applications load the libjack.so that is found
in /usr/lib64/.  Am I missing something about how the shared libraries get
loaded?

--
Chris Caudle




_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: How to profile jack cpu load?

Tim-2


On 07/14/2018 03:28 PM, Chris Caudle wrote:
> On Sat, July 14, 2018 2:21 pm, Tim wrote:
>> All user-built software is usually installed in /usr/local.
>> Most systems automatically look in /usr/local/bin FIRST
>>    before /usr/bin when you type an un-pathed program name
>
> I still don't follow how the applications (e.g. Ardour) get the correct
> version of libjack.so loaded, /usr/local isn't even in the default ld
> search path.

Ah, terribly sorry, yes, some distros don't include that path.
Others do. And they /should/.

Assuming that is done, when you build and install software the
  installer usually is supposed to automatically run ldconfig
  which automatically switches over to the newly installed libraries.

To go back to the packaged version you MUST uninstall your
  built version.

>  Putting a locally compiled version of jackd into
> /usr/local/bin seems like a recipe for loading a new jackd executable
> while having the jack-aware applications load the libjack.so that is found
> in /usr/lib64/.  Am I missing something about how the shared libraries get
> loaded?

Correct, that would happen if /usr/local was NOT in ldconfig's
  search path.
That's why it really should be in the path if users are to build
  their own software.

Tim.
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: How to profile jack cpu load?

Harry van Haaren
On Sat, Jul 14, 2018 at 8:40 PM Tim <[hidden email]> wrote:

> On 07/14/2018 03:28 PM, Chris Caudle wrote:
> > On Sat, July 14, 2018 2:21 pm, Tim wrote:
> >> All user-built software is usually installed in /usr/local.
> >> Most systems automatically look in /usr/local/bin FIRST
> >>    before /usr/bin when you type an un-pathed program name
> >
> > I still don't follow how the applications (e.g. Ardour) get the correct
> > version of libjack.so loaded, /usr/local isn't even in the default ld
> > search path.
>
> Ah, terribly sorry, yes, some distros don't include that path.
> Others do. And they /should/.

Not that I think this is a good idea - but for completeness it is possible
to just compile JACK 1 or 2 locally (aka, no install to /usr/ or /usr/local)
and then us LD_PRELOAD to have the linker load the required .so's before
starting JACK.

This ain't pretty, but if there's no JACK .so's in LD_LIBRARY_PATH at all,
and you *must* manually specify them all the time, at least its human error
if things go wrong.

Re-hash; this is a "solution" that I don't really recommend in this case,
however LD_PRELOAD can be quiet useful in other situations (like the
magic of JACK Interposer : https://github.com/raboof/jack_interposer : )
hence my promoting it here.

<snip lots of conversation>

Regards, -Harry

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: How to profile jack cpu load?

oleg68
In reply to this post by Tim-2
termtech wrote

> /usr/local is the place where all user-built software
>   should be installed.
> Two versions of Jack can happily coexist - one in /usr
>   and one in /usr/local. Only one can be active at a time
>   of course. But it is easy to switch between them.
> If you want to switch back to the packaged version simply
>   uninstall your user-built version from /usr/local.
>
> Thus I mentioned "sudo ldconfig" /may/ be sometimes
>   required (I think it may have been with jack-1) so that
>   the system can find (switch over to) the new libraries,
>   to be able to immediately start using the new installation.

It does not work in my OS (Fedora), After installing jack to /usr/local and
ldconfig, the old jack (rpm-based) is launched. I have  /usr/local/bin in my
PATH before /user/bin. Setting LD_LIBRARY_PATH to a directory with jack
libraries also does not have any effect.

The only workable solution I found is building my own rpm and updating the
system installed jack



--
Sent from: http://jack-audio.10948.n7.nabble.com/Jackit-f3.html
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: How to profile jack cpu load?

John Rigg-16
In reply to this post by Tim-2
On Sat, Jul 14, 2018 at 12:52:49PM -0400, Tim wrote:

>
>
> On 07/14/2018 04:15 AM, John Rigg wrote:
>> On Sat, Jul 14, 2018 at 12:41:28AM -0700, oleg68 wrote:
>>> You are right. The problem was the conflict with the old jack libraries
>>>
>>> But .waf install with ldconfig did not help.
>>
>> You need to tell "./waf configure" to install jack over
>> the existing jack package files. On Debian systems I use
>> --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu
>
> I would not recommended that. Always a bad idea.
> It will interfere with packaging.

I disagree that it's a bad idea. The whole point is that
other packages that depend on the distro's jack packages
still think those are installed. The only thing to watch for
is if you update the distro jack packages it will overwrite
the compiled version, so you'll have to re-install that.

I've been using this method for many years without problems.

John
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: How to profile jack cpu load?

Thomas Brand
On Sun, July 15, 2018 20:13, [hidden email] wrote:

> On Sat, Jul 14, 2018 at 12:52:49PM -0400, Tim wrote:
>
>>
>>
>> On 07/14/2018 04:15 AM, John Rigg wrote:
>>
>>> On Sat, Jul 14, 2018 at 12:41:28AM -0700, oleg68 wrote:
>>>
>>>> You are right. The problem was the conflict with the old jack
>>>> libraries
>>>>
>>>> But .waf install with ldconfig did not help.
>>>>
>>>
>>> You need to tell "./waf configure" to install jack over
>>> the existing jack package files. On Debian systems I use --prefix=/usr
>>> --libdir=/usr/lib/x86_64-linux-gnu
>>>
>>
>> I would not recommended that. Always a bad idea.
>> It will interfere with packaging.
>>
>
> I disagree that it's a bad idea. The whole point is that
> other packages that depend on the distro's jack packages still think those
> are installed. The only thing to watch for is if you update the distro
> jack packages it will overwrite the compiled version, so you'll have to
> re-install that.
>
> I've been using this method for many years without problems.
>
>

I've been using that method as well, it works pretty good. Overwriting the
distro package's files also circumvents a lot of package dependency
issues. You could have jack installed from source and the repo jack
package will most likely be pulled in sooner or later as a dependency by
another package anyways.

In a perfect world, there should be no reason that a preferred parallel
installation in /usr/local would not work *for every client* that does not
dlopen from a fixed location or otherwise tamper with the linker
($LD_LIBRARY_PATH etc). It has the advantage of not caring to re-install
the compiled version after updates. Using 'ldd' on binaries to check which
libraries are going to be used is an easy way to predict what will happen.

In any case, checking which libraries are effectively somewhere on the
system is always good advice. 'sudo updatedb && locate libjack' followed
by selective removes and re-installs.

Greetings
Thomas


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: How to profile jack cpu load?

oleg68
In reply to this post by Harry van Haaren
When I often recompile and debug jack, it is not convinient to install
modified jack systemwide. I'd prefer to run jack with it's libraries from
somewhere in the userspace.

When I try to start jack in this manner

export LD_LIBRARY_PATH=build:build/common
build/jackd -v -R -P40  -p512 -t5000 -dalsa -d hw:Pro -r 48000 -p 1024 -n 2
-s -P

I receive the following error message
------------------------------------------------
jackdmp 1.9.12
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2016 Grame.
Copyright 2016-2017 Filipe Coelho.
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
Could not open driver directory /usr/local/lib/jack: No such file or
directory
Could not find any drivers in driver directory!
Failed to create server object
------------------------------------------------------------------

Seems the necessary .so is loaded correctly, but there are some path where
jack searches its drivers. How can I redefine this path?




--
Sent from: http://jack-audio.10948.n7.nabble.com/Jackit-f3.html
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: How to profile jack cpu load?

oleg68
The right way of starting jackd compiled locally without installing it
systemwide is

env LD_LIBRARY_PATH=build/common JACK_DRIVER_DIR=build build/jackd ...

For example:

env LD_LIBRARY_PATH=build/common JACK_DRIVER_DIR=build build/jackd -v -R
-P40  -p512 -t5000 -dalsa -d hw:Pro -r 48000 -p 1024 -n 2 -s -P



--
Sent from: http://jack-audio.10948.n7.nabble.com/Jackit-f3.html
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
12