View Issue Details

IDCategoryLast Update
0006639bugs2019-04-23 09:07
ReporterSadKoAssigned Tox42 
Reproducibilityalways 
Status resolvedResolutionno change required 
Product Version4.X git (version in description) 
Fixed in Version 
Summary0006639: LADSPA and LV2 hosting problems ?
DescriptionHello!
I'm developing LADSPA-compatible plugin now and met some problems on official Ardour 4.2 build.

The first problem is with input control ports:
1. I define control port with HintDescriptor = LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE
2. I specify LowerBound = -100.0f, UpperBound = 100.0f
3. The configuration interface of plugin does not allow to set value less than 0.0f for this port.

The second problem is with audio ports: I just add printf() to connect_port and get infinite stdout:
[ladspa.cpp:39] ladspa_connect_port: 0x2c02280, 0, 0x29d9240
[ladspa.cpp:39] ladspa_connect_port: 0x2c02280, 1, 0x29d9a80
[ladspa.cpp:39] ladspa_connect_port: 0x2c02280, 2, 0x29d9240
[ladspa.cpp:39] ladspa_connect_port: 0x2c02280, 3, 0x29d9a80
[ladspa.cpp:39] ladspa_connect_port: 0x2c02280, 0, 0x29d9240
[ladspa.cpp:39] ladspa_connect_port: 0x2c02280, 1, 0x29d9a80
[ladspa.cpp:39] ladspa_connect_port: 0x2c02280, 2, 0x29d9240
[ladspa.cpp:39] ladspa_connect_port: 0x2c02280, 3, 0x29d9a80
[ladspa.cpp:39] ladspa_connect_port: 0x2c02280, 0, 0x29d9240
[ladspa.cpp:39] ladspa_connect_port: 0x2c02280, 1, 0x29d9a80
[ladspa.cpp:39] ladspa_connect_port: 0x2c02280, 2, 0x29d9240
[ladspa.cpp:39] ladspa_connect_port: 0x2c02280, 3, 0x29d9a80

Also this happens with LV2:
[lv2.cpp:31] lv2_connect_port: 0x2b28910, 0, 0x289d0c0
[lv2.cpp:31] lv2_connect_port: 0x2b28910, 1, 0x289d900
[lv2.cpp:31] lv2_connect_port: 0x2b28910, 2, 0x289d0c0
[lv2.cpp:31] lv2_connect_port: 0x2b28910, 3, 0x289d900
[lv2.cpp:31] lv2_connect_port: 0x2b28910, 0, 0x28a12c0
[lv2.cpp:31] lv2_connect_port: 0x2b28910, 1, 0x28a1b00
[lv2.cpp:31] lv2_connect_port: 0x2b28910, 2, 0x28a12c0
[lv2.cpp:31] lv2_connect_port: 0x2b28910, 3, 0x28a1b00
[lv2.cpp:31] lv2_connect_port: 0x2b28910, 0, 0x28a12c0
[lv2.cpp:31] lv2_connect_port: 0x2b28910, 1, 0x28a1b00
[lv2.cpp:31] lv2_connect_port: 0x2b28910, 2, 0x28a12c0
[lv2.cpp:31] lv2_connect_port: 0x2b28910, 3, 0x28a1b00

Also when I specify Toggle control (both LADSPA and LV2) and declare minimium and maximum values, the result values of the toggle control are always 0.0f and 1.0f even if minimum value is -1.0f.
Don't know if it is a real problem but has to be noticed.
TagsNo tags attached.

Activities

x42

2015-10-14 22:07

administrator   ~0017459

Is the code for that plugin available?

Other LADSPA plugins work just fine with a range spanning zero. e.g swh's gate (ID 1921) has a threshold -70, +20

Infinite loop when connecting definitely suggests some other issue.

http://lv2plug.in/ns/lv2core/#toggled "Indicates that the data item should be considered a Boolean toggle. Data less than or equal to zero should be considered off or false, and data above zero should be considered on or true." The range is irrelevant.
(also note http://lv2plug.in/ns/lv2core/#minimum and #maximum. those are soft-limits, the plugin must be able to cope with any value).

2015-10-15 15:08

 

test.cpp (15,554 bytes)

SadKo

2015-10-15 15:13

reporter   ~0017461

Hello! I can't reproduce it with reduced code (see test.cpp). Probably it's a compiler issue:
{ "sel_time", "Selected time", U_MILLIS, F_UPPER | F_LOWER | F_STEP, - test_plugin::DETECT_TIME_MAX, test_plugin::DETECT_TIME_MAX, 0, 1, NULL },

The problem is that "- test_plugin::DETECT_TIME_MAX" was interpreted in original implementation as 0 (compiler bug?).

But the connect_port() still runs infinitely after plugin is placed into mixer strip. You can compile test plugin and watch ardour's stdout.

SadKo

2015-10-15 15:27

reporter   ~0017462

Okay, now I understood what was going on. Constant '- test_plugin::DETECT_TIME_MAX' was as routine and placed into initialization list. And descriptors were built with initialization-list primitive, too. So it could be simply uninitialized when the descriptors were instantiated.

x42

2015-10-15 17:39

administrator   ~0017463

The "infinite" stdout is not infinite. Ports are [re]connected every process cycle. (the pointers may change any time).

printf("ladspa_run %d\n", SampleCount); to ladspa_run() and you should see e.g.

ladspa_connect_port 0 ...
ladspa_connect_port 1 ...
ladspa_run 1024
ladspa_connect_port 0 ...
ladspa_connect_port 1 ...
ladspa_run 1024

x42

2015-10-15 18:05

administrator   ~0017464

same for LV2. connect_port() is called every cycle.

Usually the control-ports stay (same pointer) and audio buffers change every cycle, but you can't rely on this. The port pointers are only valid during run().

http://lv2plug.in/doc/html/group__lv2core.html#a4d904937a1bd27cb5f5478f95c708b16

SadKo

2015-10-15 19:27

reporter   ~0017466

Okay them, it's not a bug. Thank you for information.

SadKo

2015-10-15 19:28

reporter   ~0017467

Not a problem

x42

2015-10-15 23:59

administrator   ~0017468

marking this as resolved. but feel free to ask more questions..

Good resource in general is the linux-audio-dev email list http://lists.linuxaudio.org/listinfo/linux-audio-dev and the #lad IRC chat channel on freenode http://webchat.freenode.net/?channels=lad

Issue History

Date Modified Username Field Change
2015-10-14 12:15 SadKo New Issue
2015-10-14 22:07 x42 Note Added: 0017459
2015-10-15 15:08 SadKo File Added: test.cpp
2015-10-15 15:13 SadKo Note Added: 0017461
2015-10-15 15:27 SadKo Note Added: 0017462
2015-10-15 17:39 x42 Note Added: 0017463
2015-10-15 18:05 x42 Note Added: 0017464
2015-10-15 19:27 SadKo Note Added: 0017466
2015-10-15 19:28 SadKo Note Added: 0017467
2015-10-15 23:59 x42 Note Added: 0017468
2015-10-15 23:59 x42 Status new => resolved
2015-10-15 23:59 x42 Resolution open => no change required
2015-10-15 23:59 x42 Assigned To => x42