Rivendell Loadable Module SDK - For Sending Now & Next Data to external systems
From Rivendell Wiki
Missing rlm.h file erorr message when trying to compiling RLM module
Q: I am trying to compile the RLM modules for the now-next data in Ubuntu. Is it possible to do this without compiling all of Rivendell?
I downloaded rivendell-1.7.0.tar.gz source packages.
NOTE: Replace <basename> below with the name of the module, test, twitter, facebook, etc.
The rlm_<basename>.c files for the modules have lines similar to the following ones from rlm_serial.c that tell how to compile.
* To compile this module, just do: * * gcc -shared -o rlm_serial.rlm rlm_serial.c
However when I got to the rlm directory and run that comand it tells me:
rlm_serial.c:31:21: error: rlm/rlm.h No such file or directory
and then scrolls off a bunch of other errors that I am assuming are related to not finding that file which is in the same directory.
A: To fix this change the include statement in the rlm_<basename>.c file that you want to compile:
To the following:
While the behavior of these two searches, for the file to include, is up to the compiler, usually the angled brackets means to search through the standard library directories, while the quotes indicate a search in the current directory which is what we want in our case.
Q: Now that you have compiled the RLM how do you install and configure it?
A: For example to add the Twitter module, add the 'rlm_twitter.rlm' module to the list in RDAdmin->ManageHosts->select the host->Edit->RDAirplay->EditNow&NextData, and specify the path to the configuration file as the Argument. A sample configuration file is 'rlm_twitter.conf'. Do the same for any other modules you would like to add. You will need to restart RDAirplay for the module changes to take effect.
If you download the Rivendell Source Packages the modules will be rlm folder and the example configuration files in the conf folder.
For those wanting to create new RLMs read the comments at the top of the rlm.h file.
Seeing what it can do with test RLM
If you want to see what all the RLM SDK can put out, a neat trick is to compile the test RLM. There is no configuration file needed. Just install it as described above. Now close RDAirplay if it is open. Then open a terminal and type:
Running RDAirplay this way the test module will output all the available information that you can pick and choose to send out via a Rivendell loadable module in the terminal window you started it in. Note: Do not close the terminal window as this will kill RDAirplay as well.
Note: Do not use this plugin from with Rivendel versions greater than 2.0 as they will not work. A new version of the icecast2 RLM comes with Rivendell 2.0. Use it instead as it will work. How to set it up is explained in Streaming_from_Rivendell
I've spent a few hours replacing rdstream with a "proper" plugin for rdairplay to send track information for the currently playing track to an icecast2 server. Attached is the source file for that plugin. (You can find the file here in this post on the Rivendell mailing list archive.
A quick FAQ:
Q: So...how do I install it?
A: First, install libcurl-dev. It's a requirement for this to work. Put the source file into your rivendell build tree in de "rlm" directory. Then switch to said directory and type:
gcc -fPIC -Wall -lcurl -I.. -shared rlm_icecast2.c -o rlm_icecast2.rlm
Then type "sudo make install" to copy the plugin to the proper location in your Rivendell 1.7.2 installation
Q: Fine, now how do I use it?
A: Well, fire up rdadmin, and go the rdairplay configuration. Click that big "Configure Now & Next Parameters". Then below the loadable modules field, click "add". Select the right plugin (rlm_icecast2) and refer it to a configuration file. The format of the configuration file is a simple "parameter=value" type pair, containing not quite coincidentally the same parameters as a darksnow (frontend to darkice) configuration file. The parameters used are:
server=<server> port=<port> mountpoint=<mountpoint> pass=<password> icecast=Icecast 2
If the latter entry is not present, the code will print a message, it only supports icecast2. The default user for an icecast2 streaming server for track updates is "source".
Q: What's the quality of this plugin?
A: It works for me. It's probably considered very ugly code, but I'm not a developer by any stretch of the imagination. I can copy/paste (don't worry, all public domain example code) well, and am able to interpret the error messages my compiler spits out at me. So will this code have bugs and memory leaks and otherwise icky side-effects? Probably. If you find any, please let me know.
Ferdinand O. Tempel
Rivendell version 2.0 RLM
The structure of the RLM has changed with version 2.0 of Rivendell the ones that come with the Rivendell packages have been modified to work any privately written Rivendell Loadable Modules will need to be modified to work with Rivendell 2.0
Other Useful Wiki pages
For other options on getting meta data (now & next playing) out of Rivendell to Icecast and Shoutcast and other systems see the following wiki pages: