Posts

New LV2 host implementation stack

I have released my new stack of libraries for implementing LV2 in hosts:

  • Serd, a fast, lightweight, dependency-free Turtle syntax library
  • Sord, an in-memory RDF quad store
  • Lilv, an LV2 host library (replaces SLV2)
  • Suil, an LV2 UI loading/embedding library

These libraries collectively replace SLV2, and have no dependencies except amongst themselves, and Glib (by Lilv and Sord, but this dependency will likely be removed in the near future). Serd and Sord replace Redland, making for a dramatically smaller implementation more appropriate for audio software and embedded applications.

Overall, Lilv is dramatically faster and leaner than SLV2, enough that the improvement should be quite noticeable from a user point of view (typically in a lag when the host first loads all LV2 data). Anyone using SLV2 is highly encouraged to migrate to Lilv.

These libraries are well tested, each (except Suil) with a test suite covering over 90% of the code, which runs without memory errors or leaks. They are new, however, so (as always) there may be problems; feedback is most welcome.

SLV2 is dead, long live SLV2

(See below for important information for anyone following my SVN repository)

I've decided to replace SLV2 with a new library (named "Lilv") instead of breaking the API which has been causing a lot of hassle, and would only cause more when it gets released and packaged. Among other things, this gives me the opportunity to rework the installation to support parallel installs of different major versions to prevent this kind of problem in the future. It also gives me a chance to improve the API and remove some cruft that has accumulated to avoid breaking the API (SLV2 has been around for many years now, and LV2 (and myself) have come a long way since then, it's a good time to do some laundry).

Anyone who has an SVN version of SLV2 installed, please uninstall it immediately and pretend it never existed. SLV2 0.6.6 is the last version of SLV2. The first Lilv release will be out shortly.

LV2 and Drobillad SVN repository changes

I have changed the layout of the LV2 repository and my LAD repository to no longer use externals for build system things (namely autowaf, which is now bundled in a custom waf script).

SVN does not deal well with anything changing about externals, so I highly recommend you delete your tree entirely and make a fresh checkout. If you don't do this, and have problems, I don't want to hear about them :)

Unified LV2 core/extensions code documentation

I've reworked the LV2 documentation generation system to generate all code documentation for lv2plug.in in a single Doxygen run. This means the core and all extensions' documentation are hyperlinked between each other, and there are handy global indices of everything.

See http://lv2plug.in/ns/doc/html/ for an index.

As before, you can go directly to the URI of any lv2plug.in extension in your browser for documentation, which links to the code documentation for that particular extension.

Hopefully this reference proves useful for implementers.

LV2 Extension Documentation

Recently there has been a lot of discussion on the linux-audio-dev list about LV2, and perceived problems thereof. Much of this was nonsense and FUD, but there is a problem with documentation of LV2 things in general, and the general public face of the LV2 site and wiki (i.e. it looks really bad and useful information is scattered everywhere, in inconsistent formats, and just generally hard to find or use, if it exists at all).

Towards solving this problem, I've done a lot of work on automatic documentation generation for LV2 extensions, and establishing good conventions for extension creators to follow in the future. The fruits of this effort can be seen by plugging the URI for any concept in an extension hosted at http://lv2plug.in directly into your browser's location bar.

For example, if you encounter event:inheritsTimeStamp in an LV2 data file somewhere and don't know what it means, head to http://lv2plug.in/ns/ext/event#inheritsTimeStamp (you will have to look up what the prefix "event" stands for in the file, of course). You are taken directly to documentation on that property generated from the extension itself (as defined in a .ttl file).

The same applies to entire extensions: the event extension's URI is http://lv2plug.in/ns/ext/event. Heading to that URI in your browser will take you to the documentation of that extension. This is the URI used directly in data files that refer to the extension, so no searching whatsoever is required to get at the information you need. As you can see on that page, there are links to all the related files you might need (e.g. headers, a tarball of the extension, etc).

Extension URIs will also content negotiate to return the requested type of data. Try these commands in your shell:

wget -q --header "Accept: application/x-turtle" http://lv2plug.in/ns/ext/event -O -
wget -q --header "Accept: application/rdf+xml" http://lv2plug.in/ns/ext/event -O -
wget -q --header "Accept: application/json" http://lv2plug.in/ns/ext/event -O -
wget -q --header "Accept: text/plain" http://lv2plug.in/ns/ext/event -O -
wget -q --header "Accept: text/html" http://lv2plug.in/ns/ext/event -O -

This could be used by LV2 hosts to automatically fetch from the web information they can not find locally. For example, if an extension is required by a plugin but a host doesn't know what it is, the host can trivially fetch that extension from the web and display a human readable description of what that extension does. This is the kind of thing that using good technology like RDF allows, you naysayers out there ;)

This is all a bit rough around the edges still, and the extensions hosted here aren't all documented well yet (and of course, not all extensions are hosted here), but I'd say this is a pretty big improvement. If you base your own extension on the form of these ones (which is easy), you get all this for free. Hopefully soon enough most if not all extensions and plugins will work this way, at which point I'd say that the reference documentation problem of LV2 is solved about as well as it possibly could be. Better than any other technology I have seen anyway (how many things do you use where you can just plug whatever you're curious about right into your browser and get taken directly to the documentation for that thing?).

Of course, more higher level "tutorial" type documentation is still needed, but this is a separate problem. As far as reference documentation goes, here is the chicken. Go forth and create eggs.

Indices to the currently hosted extensions: /ext /extensions /dev

Stay tuned for more tools to come, e.g. a similar documentation generator for plugins, a plugin/extension validator, etc.

GStreamer LV2 Surround

My last post was mostly about adding multi-channel support to GStreamer.

That was only partially implemented though - many elements in GStreamer (and pretty much all of the ones that support more than stereo) require each channel to be explicitly labeled with its position. This information wasn't bridged until now.

The two sides of this situation are:

The LV2 Port Groups extension: http://lv2plug.in/ns/dev/port-groups.lv2/port-groups.html
GStreamer multi-channel: http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-gstmultichannel.html

LV2 "roles" correspond to GstAudioChannelPosition. Unfortunately, the mapping was a bit strained with the Port Groups extension as it was at midterm time. Fortunately, that extension is not finalized yet, and in the process I found some other problems with it, so I decided to bring it closer to the way GStreamer does things, which seems to be common in other software that does this sort of stuff. Formerly, the port groups extension used the channel names from the relevant surround spec (see the Wikipedia page on Surround Sound). This resulted in a lot of roles that were really the same thing, e.g. the "Surround Left" channel in 5.1 is really the same as the "Left Back" channel in 7.1. This was pretty confusing in practice. GStreamer instead always uses positional names like "Left Back", which is unambiguous regardless of context (you don't have to know if it's 17.2 or whatever to know what "Left Back" probably means...). So, I changed the LV2 port groups extension to be similar (though not identical; munging an LV2 extension to match GStreamer API wouldn't be appropriate).

This information is now queried out from LV2 plugins that have it, mapped to GStreamer channel positions, and set as capabilities on mulit-channel pads. This means multi-channel surround LV2 plugins should now work fine with surround sound GStreamer set-ups, for example playing a Theora video through some audio processing and out through Alsa.

I updated swh-plugins for the minor changes, and added port group information to Invada Studio Plugins.

More to come...

GStreamer SoC Midterm Summary

Apologies for not blogging along the way for those who are interested in this project. I'm more into actually doing things rather than blogging about doing things ;)

So, LV2 in Gst, where are we? Well, I've had LV2 plugins working with the same functionality as LADSPA plugins for a while. The main downside was shared by LADSPA: no support for multi-channel streams.

Some background for those unfamiliar with LADSPA or LV2: LADSPA and LV2 plugins are very simple in terms of I/O. A plugin has a collection of "ports" which contain either a single floating point value (control) or an array of floating point values (audio). LV2 extends this to any types but that's not important here. This is simple but causes problems in the face of stereo and other multi-channel streams: if a plugin has 3 audio inputs and 2 audio outputs, for example, what is what? Some kind of 3-channel audio input with stereo output? 5 completely unrelated ports? A stereo input and stereo output with a "sidechain" (common with e.g. compressors)? This information is not available in LADSPA, the best you can do is guess (which is practice means it just doesn't work).

GStreamer works with multi-channel streams as a single interleaved stream, so this is a problem. Thankfully, LV2 makes it trivial to add whatever information you like about plugins without having to touch a line of code since plugins are described in RDF (see the LV2 site for more information). All that needs to be decided is how to actually model that information. A specification for this is called an "ontology" in general/theory, and an "extension" in the LV2 community.

So, the problem is we need(ed) a good multi-channel ontology for LV2 plugins to work well inside Gst, since most things in Gst are at least stereo. The difficult thing with creating ontologies is making sure anything anyone might want to describe in the future is accounted for. Here's my best shot at this so far: LV2 Port Groups, based largely on earlier work by Lars Luthman and some input from the LV2 community. This extension isn't final, but expresses all the information needed by Gst for multi-channel (and more). (I also wrote the documentation generator that created the aforementioned specification page in the hopes that more user friendly documentation will encourage adoption by plugin and host authors).

I've created patches for the popular SWH and Calf plugin packages to add this information. When the extension goes final they will be included in these projects, but in the mean time are included in my git branch of gst-plugins-bad (see http://git.drobilla.net).

This is, as far as I know, the first time coherent multi-channel information has been available about plugins from the "LAD" community (e.g. LADSPA, DSSI, LV2). Coincidentally, this information is required for recent work on Ardour, among other things. In hindsight, this was a pretty glaring hole in the general state of LAD plugins, but back to GStreamer...

I've rewritten quite a bit of the GstSignalProcessor class (used by the LADSPA and now LV2 wrapper elements) to support multi-channel plugins. In code terms this means creating a set of buffers for non-interleaved data used by the plugin, and interleaving/deinterleaving buffers to/from Gst, respectively.

In summary: many LV2 plugins now exist with useful multi-channel information, and stereo LV2 plugins now work correctly in GStreamer. It should now be simple to add support for other audio plugin interfaces (VST? AudioUnits?) that also works with multi-channel streams.

Next up:

  • Get the "role" information from the plugin data and use it to support surround streams correctly
  • Finalize and publish the LV2 Port Groups extension, and contribute patches for all major plugin collections

Where to go from there is pretty open-ended. Unlike LADSPA, LV2 can theoretically support any kind of data, or any feature (non-realtime and non-audio things included). Extensions just need to be made to bridge the gap. What sort of functionality would you like to see bridge the GStreamer/LV2 gap?

Unix Modular Synth

I've decided to use my blog to archive random ideas until I figure something better out (on that note, anyone know of any good RDF based mind-map software, or something generic that can easily be used as one?)

Until then:

<drobilla> crazy thought of the day: write an LV2 extension for text
stream input/output ports, and you can write a trivial unix cmd line
utility wrapper plugin
<drobilla> anyone want to convert midi to text then run it through
sed and grep and convert back to midi in a modular? :)
<gordonjcp> ahahaha
<gordonjcp> you sick sick man
<drobilla> unix modular, best thing ever

Ingix? Really wouldn't be that hard. Could even make it parallelize forkey pipelines, if the LV2 contexts extension is powerful enough. More on that later...

« Page 12 / 12