Category Archives: Hardware

IP Addresses for LANs

There are currently two systems for IP addressing – IP version 4 and IP version 6.  Version 6 is important because the world is running out of IP version 4 addresses, as there are only a little more than 4.23 trillion addresses, and we have used most of them up. We are going to concern ourselves in this article with v4 because on a Local Area Network (LAN) there is a neat scheme called Network Address Translation (NAT) that lets us re-use some IPv4  addresses in different local networks, and because IPv4 is much simpler.

IP v4 addresses consist of four, (up to) three digit numbers separated by periods or “tacks” – nnn.nnn.nnn.nnn – where each nnn can be a number between 0 and 255 (that is as much as 8 bits can hold).  192.168.20.3 is an example of a IP v4 address, while 320.168.20.3 would not.  Since a network consists of a number of computers, printers, set top boxes, internet radios, etc. we need to define what IPv4 addresses (numbers) are in your piece of the network called a “subnet”.  This can be done by a construct called a netmask.

An example of a subnet designation would be 192.168.20.0\24 (8 bits x 3 =24 bits) or 192.168.20.0 netmask 255.255.255.0 (another way of saying 24 bits) which says that the last number in the address of a device can be anything from 1 to 254 (0 and 255 are for special purposes)and it is in the subnet.  This particular example is a “Class C” network with 254 addresses available for assignment.  A netmask of 255.255.255.254 would only include two addresses

There are several sets of network addresses that are set aside for LANs as they have been made “non-routable” and cannot be routed over the internet. Any of these can be used for LAN addressing behind a home or office router.

They make up a subnet that can consist of :

  • 192.168.0.0 – 192.168.255.255    – 255 contiguous Class C networks using 192.268.nnn.000 netmask 255.255.255.0 This can also be referred to as 192.168.X.0/24  meaning that the netmask is 24 bits and X is assignable to the network.
  • 10.0.0.0 – 10.255.255.255.255    – One Class A network using 10.0.0.0 netmask 255.0.0.0  or 10.0.0.0/8
  • 172.16.0.0 – 172.31.255.255         – 16 contiguous Class B network using 172.16.0.0 netmask 255.255.0.0  or 172.16.0.0/16 – 172.31.0.0\16

There are other addresses that are also not routed, but they should never be used on a local network either

  • 192.0.2.0/24                    – These three ranges should only be used for documentation, and not have devices mapped on them
  • 198.51.100.0/24
  • 203.0.113.0/24
  • 127.0.0.1 /32                  –  The localhost or self address of a device
  • 169.254.0.0/16              –   The Link-Local default address range of a device which is not statically addressed, nor been given a DHCP lease.
  • 0.0.0.0/8                        –  This host on the network
  • 255.255.255.255/32     – Broadcast

A small office LAN will normally be connected to a router that handles the administration of the LAN IP addresses with a Dynamic Host Control Protocol (DHCP) server. The router connects to the internet through  Network Address Translation (NAT) where communication is done to the internet or your Wide Area Network (WAN) using the WAN IP address(es) of the router, and the LAN computers “Masquerade” as the router address when communicating outside the LAN.

Often, when advanced DHCP configuration is needed, for services such as auto configuration of VOIP phones you will want to use a DHCP server with more features than that offered by a home router.  This can be readily accomplished by installing a DHCP daemon on your server, the devices on the net will be answered in their DHCP requests, but be sure you disable the DHCP function on the router when you do this.  Another advantage to this scheme is that if the router dies, and you can’t get an identical replacement you will have the settings as part of your normal server backup, whereas the router ‘s backup would be useless.

These small networks often utilize an address range from the 192.168. group of class C  unroutable networks.  There are 254 ranges to choose from, with each range having 254 available addresses.  You might say 254 is an awful lot, but things add up quick when you add workstations, routers, each virtual machine on a server, cameras, phones, Ethernet switches and routers etc.

The provide a service called Dynamic Host Configuration Protocol (DHCP), by default.  Simple DHCP is insufficient for some network components like servers and printers because it is not a sure thing that a device will get the same address back each time it is turned on.  There are some technologies to get over this such as uPnP  and the techniques below for  printers, scanners, switches, servers and and other devices.  It is crucial that only one DHCP server provides configuration on a network. (There are some configurations for have backup servers, but that will not be covered here.

You might not want to choose 192.168.0.  or 192.168.1. as your class C network since those are the default address ranges for many over the shelf routers.  Other third octets to avoid are 3, 10, 15, 16, 20, 30, 86, 100, 102 and 254 as some manufacturers use them as default values also.  Avoiding these address values might make you slightly less vulnerable to to getting hacked (security from obscurity).

If you are part of a large organization that need coordination between various sites, it is desirable that certain network ranges are used for specific purposes.  One a specific address range for each purpose. ie  one range for VOIP phones, one for office traffic to printers, etc.  one for music or video work, this way the purpose of the network can be determined from its address range and color coded patch cords. When personnel have to go from site to site they won’t disconnect a Studio Transmitter Link by mistake.  Avoiding re-use or coordinating an address ranges at both ends of a Virtual Private Network (VPN) systems can avoid conflicts, confusion and collisions.

There are two other address assignment techniques which work well but require manual intervention to set up.

Static addressing is the simplest in theory, but can become quite unwieldy for large networks.  Each computer ethernet interface is setup to (a) specific address(es) within the subnet.  There are several limitations to this.  First, the IP  address used must not be also assigned to another device on the network, statically or by the DHCP server on the network.  This can be accomplished by configuring the DHCP server so only a portion of the subnet addresses can be issued by the DHCP Server, and the static addresses are within the subnet address space, but not among those that the DHCP server will issue.  The second problem is that the addresses statically configured must be kept track of – manually, usually in a spreadsheet so they can be reached by other computers, and so you don’t assign the address to another statically configured computer.  Another consideration is that many routers keep track of the host-names of the computers they assign DHCP addresses to.  Usually these office and home routers automatically enter this information into their Domain Name Servers (DNS) which translate names like www.google.com to an IP Address.  They can do this for the computers on the LAN also.  The router has no knowledge of the statically assigned computers, and cannot provide this service for them.

A better solution is to have the DHCP server for the LAN to reserve certain IP addresses for the particular Media Access Connection (MAC) addresses of the ethernet interfaces on  computers and devices on the net that need to always have the same IP Address.  These MAC addresses are printed on the devices, and can be displayed using the ifconfig command on Linux and ipconfig command on Windows. Many modern small office and home routers have this function.  You usually have to dig through the DHCP connections list to find the menu item to do this.  The manufacturers think that this is a seriously advanced feature.  On some routers it can be tricky if the device has already been issued an IP Address by the DHCP server.

If your router has the MAC reserved IP Address function (sometimes the menu calls it Static – Confusing isn’t it?) then it is generally the preferable method.  If your network has no DHCP server, then Static IP Addresses are the only route available.  The Music Networks described throughout this site generally are simple Static assigned networks, while the Office networks have DHCP assignments where all the devices that need a fixed IP address are assigned using the reserved MAC address function of the DHCP server.  If you were planning on using a home router without this feature, you might want to get another.

Whatever you do with assigned addresses, as opposed to DHCP leases issued ad hoc,  is that you should keep a spreadsheet of the Assigned IP, the MAC address, the name or hostname of the device and its physical location.  (first layer documentation of a network)   you should also keep a record of all the reserved addresses and the device MAC addresses in the case that your router dies and the router backup settings cannot be loaded into the replacement unit because it is a different model.


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.


Hardware for Audio – Server and Workstation

The Playout Station

A Rivendell playout (Radio automation) box with with Jack2 and zita–njbridge can be incredibly simple thanks to edgeradio 99.3 FM in Hobart, Tasmania, Australia.  A raspberry pi 3B+ or raspberry pi 4 with the raspberrian sd card and a good two channel or  four channel sound USB interface or an Octo 8 sound card hat from audio injector.   You will need a robust power supply, preferably battery backed with shutdown.  The raspberry pi Rivendell Playout can be used as a full automation system when attached to a server containing an NFS media store and a MySQL (Mariadb) database.   Alternately, it can be a stand alone playout for advertisments and liners on a hyper-local station or feed that takes its main programming from a network or service.  It is well suited for a station that stitches together podcasts and other programming that does not require large storage. The raspberry pi has no real time clock, so it is important to set up ntp (see Raspberry Pi -Rivendell post ) to a local server to acquire correct time quickly.  The Raspberry PI doesn’t have a good audio output, so it is necessary to add a hat or USB sound device.

If you need Rivendell to do more than a simple automation, but want to add audio processing, virtual console, etc., you should use should use a reliable  PC with a motherboard with an X64 processor  with two to four cores, Several Gigs (4+?) of Memory, and if it is to be used with a server for audio storage and database, you only  need 120 Gigs of SSD.     In a playout or editing environment, an SSD is important for fast boot, low noise  and fast loading of applications. The $50 a little SSD costs is well worth it.  An additional hard drive is useful to keep keep work files in the /home folder.  If you have a good server, you don’t need a big hard drive for the workstations unless you want to duplicate the library and database on the workstation (this is tricky because they need to be kept synced) and you would need to write a script to make the switchover quickly.

If you work with a server, you need a good quality Gigabit network card which you will set up for static addressing.

You need a good sound card fully rated for ALSA compatibility.  I have used PCI (PCI and PCIe cards don’t work with the PI) and USB  M-Audio hardware with good results, particularly the Delta 1010 cards and the all of the 17xx cards work well too.  Ubuntu studio 20.04 has also learned to play nice with M-Audio Fast Track 8R USB rack mounted box. (earlier versions did not), as well as nearly every other USB quality sound card from Beringer, Presonus, M-audio.  Pick ones that have balanced input and output and quality microphone amplifiers (If you have mikes)  Rivendell loves the Audio Sciences cards in PC computers, but they are pricey.

If the workstation computer is physically in the studio, you also want one with high volume LOW NOISE fans. This is where the Raspberry PI shines.  The little fan to cool a PI can be very quiet.   Bigger PC cabinets seem to have quieter fans than micro cases because they use larger 120 mm fans that move more air with slower blades. Use a good quality power supply and UPS.  The UPS should be connected to the computer USB  port and setup with USB drivers for that brand for graceful shutdown when the power goes out, and stays out.

The current version of Rivendell playout has a fixed window size so don’t go crazy on monitor resolution or the control window will be too small.  (I have heard that this is likely to change in the next major revision).   Your video card does not need to be anything special, motherboard cards work fine.  rdAirplay will work with a touchscreen, and there are many that work with Ubuntu, but not all.  Your touchscreen mileage may vary.  You are looking for high reliability, not blazing performance. Do not overclock.

Rivendell works with audio switchers such as the Broadcast Tools SS 8.2, and with digital IO cards that talk by RS-232 serial ports.  It would be nice if the motherboard had an RS-232 port, but a high quality USB-RS-232 converter will work.  There are cheap converters that are tricky to make work because they need a special driver that might not be available in Linux.  The machines that will be running RdCatch and RdAirplay will need this if you need these outputs to switch satellite receivers and such.  (You may be able to avoid audio switches if you have enough inputs and outputs on your soundcard when running Jack2.)  Rivendell macros can run jack_connect and jack_disconnect commands.

I am looking for a suitable case for the Pi with the Octo

The Server

A server for Rivendell should have excellent computing  performance to the workstation, and should have six or more cores on an X64 chip, with eight or more gigs of memory.  Hard drives should start with a 128 Gig SSD for the operating system, and at least 2 TB of high quality raid hard drives to use in ZFS ‘raid’ mode for audio and database.  The new ZFS file system for the large raid drives allows for flexible organization of the data volumes.  ZFS data compression on a fast machine will both increase the hard drive capacity and speed.

You should have two or three Gigabyte Ethernet ports on this machine.

It theoretically could be a “headless” machine, but some of the audio applications just really need GUI interfaces.  Sharing a monitor, mouse and keyboard with a KVM switch (Don’t confuse with KVM virtualization discussed elsewhere) to share Keyboard Video and Mouse  with another machine (such as a standby server) would be useful.    Be careful that the KVM switch and the motherboard have the same mouse and keyboard connectors.  USB to DIN adapters generally don’t work on KVM switches. No fancy video card is needed.  Some allow switching audio as well, but you will be limited to 3.5 mm jacks from the onboard sound cards which may not be easily accessible in Jack.

If this will be the “master control for audio” it will need a good ALSA compatible sound card with as many output channels as you will have outputs and inputs.  The server should have at least a  USB removable drive or a Network Attached Storage device of the same size or bigger than the RAID drive for backups.  You may have trouble finding servers that are quiet enough for the average station.  If you will be running the servers in a server closet, I recommend recently pulled 2U to 4u servers with dual power supplies. They will, however, be much too noisy for an office or studio environment.  You probably can’t afford them new, but used are inexpensive, just make sure you get multiprocessor X64 machines with enough memory.  Check whether the drive interface is SCSI or eSATA.  Make sure you can get a SSD with the drive interface you choose.  Many servers come without drives.  Make sure you get the caddys with the server and you can get new drives at a reasonable price.  You probably don’t want to use the hardware raid, as the ZFS file system in Ubuntu 20.04  is much more flexible, provides RAID functionality as well as data compression and encryption.

Your “music” ethernet network should be built with good Cat6 cables – any that go through the ceilings or floors should be ‘plenum’ rated.  Use high quality gigabit switches.  You probably can do without managed switches unless you have a lot of workstations, and then we have to tune things that I haven’t had to do yet.  There are plenty of surplus managed gigabit switches available, but they make a lot of noise.

It is possible to set up a server standby system for Rivendell, where you have two identical servers for Rivendell and the audio store or the database are kept up to date on both.  This way a failure will not put you off the air until a new server can be configured.  Similarly, you should keep your workstations as close to identical as possible  so you can switch over quickly in the case of an equipment failure.  Fred Gleason of Paravel Systems is the guy to hire if you want to get this to play.

If you are doing hot standby  servers, it would make sense to have two independent UPS systems – one for each server, and a ups for each workstation.  (Or, if you have dual power supply servers, one for each power supply in the two servers) The idea is “no single point of failure”!  This is where the use of a real router (not bestbuy specials, but ubiquity or cisco) become important.

When you set up Ubuntu on these machines make sure you choose to add .mp3 codec and use ZFS file system with LZ4 compresson.  The account you use to setup will be the main “SUDOER” account.  Use a real password and require it to be entered.  It might make sense to encrypt the main account’s /home folder.

I have not been successful in running Rivendell reliably in a straight Ubuntu LTS environment.  Back “in the day” there were a number of Rivendell boxes working in Europe on Ubuntu 14.04 and 16.04, but Centos7 is so baked into Rivendell, it just makes sense to run it in a virtual box under Linux Kernel Virtualization  (KVM).  Too many of the libraries do not align between what Rivendell expects and what Ubuntu provides, particularly the QT version.  Centos7 is not a very good jack2 host – jack itself works well, but few of the jack utilities work or work reliably in the Centos7 Environment.  We can do all the fancy stuff in Ubuntu and the bread and butter automation in the business oriented Centos7 world.

The server might be called on to do more than switch audio, serve the databases, and stream.  You may want to run the station’s phone system using Freeswitch, or at least the phone interfaces to the studio.  It makes sense to put these into separate “boxes” using Linux Kernel Virtualization  (KVM) or the more sophisticated OpenStack. If you are thinking about using openstack, you will need at least one processor per “node” so an eight processor computer for the server makes sense, along with lots of memory, as each node has its “own” memory.