Month: June 2015

Network Setup for Rivendell and NetJack

The physical connections between computers running Rivendell and/or NetJack should be done with a bit of thought.  There are some special considerations in any network that carries real time audio or files that must be served on an exact schedule.  This “real time” requirement is different than most computer needs where a document or web page can be served at some time in the future, as long as it is soon.   Audio streams and playout systems need their data NOW.

Rivendell requires Internet access for its rdcatch feature, as well as to access audio files, logs, ssh management, icecast servers. ftp servers and podcast servers, etc.  A Jack server should have access to the internet for the same reasons, plus network time, printers, sending email alerts, etc.  I will call this a connection to the “Office Network” since it includes mostly non-real time traffic.

The safest way (I have thought of) is to have the Rivendell Server(s) connect to two separate networks.  One network, the “Office Network” carries all the normal traffic, connection to the internet, uploading of logs, printing reports, VoIP, etc..  The other network I call the “Music Network” carries only NetJack zita-njbridge traffic, NFS traffic for audio files, and MySQL traffic and some network management traffic.  Rivendell also requires that the Ethernet addresses for these purposes are STATIC, meaning that they are maintained permanently and  setup manually.  The “Office Network” could be automatically assigned using DHCP, or can be STATIC, although there are good reasons that the server interface to the “Office Network” should be STATIC also.

Below is a graphic showing a possible configuration of a Rivendell – zita-njbridge system in  a small radio station, or station cluster.  It is not yet set up for redundancy to provide high reliability, but later additions will permit this:

Network Layout
Rivendell – zita-njbridge Music and Office Networks###

Please note that this network will not work as shown.  The office network switch would have to be a layer 3 switch or router with routing for internet addresses or the two DHCP lines to the Rivendell Workstations should not be connected.   Internet connectivity to the Rivendell workstations can be achieved using a Squid Proxy (pretty good) or Double NAT (not such a good idea)

The “Music Network” should use Gigabyte Ethernet interfaces on the computers and switch.  It should use Cat-5e or Cat-6 cables in a unique color to distinguish it from the office network.  If patch panels are used, they should be separate panels from the office network to avoid confusion.  As you can see, only the machines that have real time functions are connected to this net.  There could be a Network Attached Storage device on this network also, but it should not be used for backups, etc.; only for music and playout traffic should be on this network.

In this installation I have arbitrarily assigned the “Music Network” to a class C non-routable set of addresses:

Parameters -192.168.60.0  netmask 255.255.255.0  Gateway 192. 168.60.1 (The server) Broadcast 192.168.60.255.

This means that any device on the “Music Network” assigned an address beginning with 192.168.60. will be a member of this network.  It does not require a router, just a switch since the knowledge of the members of this network and the needed data routes will be known by each of the computers involved.  This network could possibly have 254 devices attached, but you would never want that many.

The “Office Network” is a conventional internet connected network configured to be efficient for its size.  It carries all the regular business and computer traffic of the operation, in addition to providing audio file upload services and possibly streaming sources for Internet Streaming. Conventional network design considerations are appropriate here.  A small station could possibly use the firewall – router provided by the Internet Service Provider (ISP), or another solution with more than one ISP and a load balancing router, a router using DD-Wrt or other open source router software, or Cisco or other “heavy iron” solution.

Not shown here, but for radio stations that need to deliver programming to remote transmitters, there may be a third ethernet interface on the Rivendell Server for an “STL Network” whose exclusive purpose is program delivery, transmitter control and communications to the station transmitters.  The traffic on this network should be separated from the other networks. This network will interconnect using dedicated microwave channels, landline T-1, and/or other methods of data transport  requiring well thought out routing protocols for high reliability.


Use PulseAudio with Jack Audio Connection Kit?

Ubuntu Studio 14.04 uses Pulseaudio -> Alsa -> Jack as the connection interface for audio devices.  Pulseaudio is a very simple interface, and with it most audio cards just “show up” and play with Jack as the pulseaudio-sink and pulseaudio-source devices on the Jack patchbay.

In the olden days (Ubuntu Studio 10.04 and before) Pulseaudio was  buggy and not worth the effort to deal with the bugs.  Pulseaudio is now much more mature, and for a single sound card machine makes it much more likely that you will have Jack working right away.  If you are using Debian or regular Ubuntu, you will need a Pulseaudio plugin to hook it up with Jack.  I have not used the plugin as it is all nicely done in Ubuntu Studio.

Alsa is perfectly capable of connecting sound cards to Jack, with infinitely more flexibility, and (unfortunately) with more complexity.  Remember to turn the volume controls up in alsamixer!

There still remain some reasons to dump Pulseaudio:

  • Pulseaudio adds a fair amount of latency in the link between the sound cards and Jack  If you are just recording and playing back stuff and “real time” audio is not important, this might be insignificant, but for sound reinforcement and broadcasting, it is a serious consideration.
  • Pulseaudio works best with a single sound card – if you have an in-computer card and a USB card and want to use both, Pulseaudio is complicated at least and may not let you use the second card. (I have not been successful, but I didn’t try very hard)
  • Pulseaudio devices want to hook up to stuff in the patchbay, and I have not figured how to keep them from automatically doing so.
  • Pulseaudio and Rivendell get in the way of each other.  Rivendell wants to have multiple audio inputs and multiple outputs, and that can be a problem with Pulseaudio if they are on different cards.  (Newer versions of Rivendell connect to jack2 very nicely.
  • Pulseaudio devices Pulseaudio-sink and Pulseaudio-source hide the names of the actual sound devices, so they can be confusing when patching.
  • Pulseaudio hides and plays with some sound card settings in Alsa, so special configurations might just get reset to the defaults at next boot.

The reasons to keep Pulseaudio:

  • Alsa can be tricky to get all your audio devices working right unless you are happy to use the command line.
  • Ubuntu Studio comes with Pulseaudio installed and working, and dumping it can cause your installation to stop working until you figure out what Alsa settings for your sound card are undone.
  • There are some tricks to getting Pulseaudio to uninstall or to disable it. (It keeps coming back) (disabling works well on Ubuntu 18.04)
  • Pulseaudio now keeps a simple setup simple (except for those crazy patchbay devices)
  • Removing pulseaudio has limitations because some applications (ex Firefox) insist on only using pulseaudio and getting them to work with jack if pulseaudio is defeated or uninstalled may be impossible.

Assuming you want to simply disable Pulseaudio, here is what you do:  (Preferred if you are not in a storage limited environment)

  1.   Make a backup of the configuration file –
    sudo cp /etc/pulse/client.conf  /etc/pulse/client.conf.ORIG
  2.  Run the following command to edit the configuration file:
  3.   sudo sed  s/; autospawn = yes/autospawn = no/ /etc/pulseaudio/client.conf
  4. Install package alsa-tools
    sudo apt-get -y install alsa-tools
  5. and reboot.

Assuming you want to remove Pulseaudio, here is what you do:

From hecticgeek.com:

1. First let’s remove PulseAudio from your Ubuntu OS. I don’t remember since when Ubuntu used to come installed it by default, but for the recent versions such as: 12.04 Precise Pangolin, 11.10 Oneiric Ocelot, 11.04 Natty Narwhal, 10.10 and 10.04 the below command should remove it.

sudo apt-get -y remove pulseaudio

2. Now do a reboot since PulseAudio daemon (system service) is also running from the background. So it’s better to let the OS update everything.

3. You need the package alsa-tools, but that is already installed in Ubuntu-Studio, but not in regular Ubuntu.

4.  The script I will be publishing later will do this all automagically.

If you just want to just disable PulseAudio, you can edit the config file

1.   Copy /etc/pulseaudio/client.conf for a backup

sudo cp /etc/pulseaudio/client.conf /etc/pulseaudio/client.conf.orig

2.  Modify /etc/pulse/client.conf  the line   ; autospawn = yes to autospawn=np

sudo sed  s/; autospawn = yes/autospawn = no/ /etc/pulseaudio/client.conf

3.  Reboot or kill the pulseaudio job.