Profile lv2 plug

Programming applications for making music on Linux.

Moderators: MattKingUSA, khz

Post Reply
f00bar
Established Member
Posts: 83
Joined: Sun May 12, 2013 7:40 pm

Profile lv2 plug

Post by f00bar »

How do you profile a lv2-plug? Write a specific loader? I would like to have a dummy-host that understands MIDI and feeds a given amount of frames into the plug.
ssj71
Established Member
Posts: 1294
Joined: Tue Sep 25, 2012 6:36 pm
Has thanked: 1 time

Re: Profile lv2 plug

Post by ssj71 »

f00bar wrote:How do you profile a lv2-plug?
Callgrind and Jalv. Just attach whatever input you need (audio or midi) play some notes, quit and look at the results in kcachegrind. Its helped me quite a bit to reduce cpu hot-spots. i.e.

Code: Select all

valgrind --tool=callgrind --dump-instr=yes --simulate-cache=yes --collect-jumps=yes jalv.gtk http://sourceforge.net/projects/infamousplugins#hip2b
THere is also a program called plugin-torture that has some good things, but I don't use it much (I probably should more). http://carlh.net/plugins/torture.php

It would be nice if someone extended this to a full suite of tests for plugin benchmarking, but its a pretty big undertaking.
_ssj71

music: https://soundcloud.com/ssj71
My plugins are Infamous! http://ssj71.github.io/infamousPlugins
I just want to get back to making music!
f00bar
Established Member
Posts: 83
Joined: Sun May 12, 2013 7:40 pm

Re: Profile lv2 plug

Post by f00bar »

But jalv does audio communication, so this will probably result in tons of xruns. Is there any host which does not have any backend? Any backend will interfere with profiler output.

And about denormals, we should be careful when flushing to zero.
ssj71
Established Member
Posts: 1294
Joined: Tue Sep 25, 2012 6:36 pm
Has thanked: 1 time

Re: Profile lv2 plug

Post by ssj71 »

f00bar wrote:But jalv does audio communication, so this will probably result in tons of xruns. Is there any host which does not have any backend? Any backend will interfere with profiler output.
Well, the profiler won't care about Xruns. Just don't do it during a recording session ;) Xruns are problems with the host not getting data in time to send to the hardware, and doesn't really affect the plugin itsself. Its just that typically the xruns are caused by the plugin taking too long.
Like I say I've used it. It works. I also do gdb with jalv fairly often. I've never felt a need for a dummy host like that. If you really feel it would help you'll have to write it. Probably fork off that torture program, it doesn't have a backend.
_ssj71

music: https://soundcloud.com/ssj71
My plugins are Infamous! http://ssj71.github.io/infamousPlugins
I just want to get back to making music!
tramp
Established Member
Posts: 2335
Joined: Mon Jul 01, 2013 8:13 am
Has thanked: 9 times
Been thanked: 454 times

Re: Profile lv2 plug

Post by tramp »

Simply use the jack dummy backend when running a gdb session.
On the road again.
f00bar
Established Member
Posts: 83
Joined: Sun May 12, 2013 7:40 pm

Re: Profile lv2 plug

Post by f00bar »

tramp wrote:Simply use the jack dummy backend when running a gdb session.
Sounds good. Does that stop jack from waiting on system clock? And if I already run a real jack server, how do I choose the dummy server in jalv? The secondary server is called Dummy

Code: Select all

jackd -n Dummy -ddummy -wait 0
tramp
Established Member
Posts: 2335
Joined: Mon Jul 01, 2013 8:13 am
Has thanked: 9 times
Been thanked: 454 times

Re: Profile lv2 plug

Post by tramp »

And if I already run a real jack server, how do I choose the dummy server in jalv?
You cant, you need to restart jack with the dummy back-end.

ricardocrudo from the MOD project have created a new LV2 benchmark tool
https://github.com/portalmod/lv2bm
but I guess it didn't feature MIDI-in. ( would be hard to implement MIDI-in in a dummy host, wouldn't it?)
Instead it use a sequence of control values send to the plug.
On the road again.
Post Reply