Internet Pocket Radio Casting Studio

April 24, 2017


JackObsStudio.iso (~967 MB) Apr 16 2014
Jack-OBS-Studio.Apr.16.2017.tgz

  1. The studio software should work with any late model computer but OBS may not be compatible with systems with older graphics cards. If you have an older system, testing it first with the live DVD or flash drive would be advisable.
  2. Recent testing of the install script with the recently released Ubuntu 17.04 Mate revealed problems. These included:
    • The operating system crashed;
    • Qjackctl refused to follow patchbay connections;
    • JAMin does not display the audio spectrum (blank window);
    • JAMin minimum window size is considerably larger and inconvenient.
    I expect these will be sorted out soon but, at this time, usage with Ubuntu 17.04 Mate is not advised. The package has not yet been tested with other versions of Ubuntu 17.04.
  3. The ISO is a fully functional, bootable, installable LIVE Lubuntu based version of Linux that may be burned to a DVD or USB flash drive and executed directly. All of the studio software is pre-installed in the ISO. There will be an icon on the main page titled Run Jack OBS that will start the major components including a sample video playing in SMPlayer.
      When you click the Run Jack OBS icon on the screen, a script file will initiate the software needed to begin casting. This may take several seconds to complete, especially if you have booted from a DVD. Please wait. Attempting to interfere with the process will not make it work faster. The script file has several sleep points while it waits for parts of the system to initialize.

      If you are using a DVD for your boot device, expect a very choppy startup as DVD data rates are not fast enough for the amount of initial activity. It should smooth put after a few seconds, however. It may also be a bit choppy if you are booting from a slow USB flash drive.

      In the Live ISO, there is one user: jack and the password is abc123 which is also the root password. Change it if you install to a permanent drive. Changes made in the live version, however, are lost when you shutdown.

  4. If you want to install the studio software on an existing Linux system, you need the .tgz file. It contains the directory Jack-OBS-Studio which should be decompressed into your home directory. This directory contains the Bash script and configuration files needed to install, configure, and run the studio.

    To make the script files executable, type:

      chmod u+x *.script

    To install to your existing system the software only (and not the ISO), your distro of Linux must be Ubuntu compatible. It has been tested with Lubuntu 16.10 and Mint 18.1. Other recent similar versions of Linux should work as well. Testing on other systems is underway and the list will grow. The installation relies on .deb packages and the apt-get package. If your system does not use these, the install will not work in its present form. The installation script performs a number of apt-get installs, copies files to configuration directories, adds your username to some software groups (created by the installations), and adds lines at the end of two files in /etc.

    • To run the install script on an existing Linux installation, open a terminal window in the Jack-OBS-Studio directory. Become root, and run the script install.script (note: you may need to make it executable as shown above).
    • The install.script will attempt to install several software packages, and configure your system. It has been tested only on Lubuntu 16.10 and Mint 18.1 but it will probably work on most Ubuntu based distros. Besides installing software, the script will add some settings in /etc and add you to some groups that were created by software installations. You will be asked questions in the script. When it asks for username, that should be the username that you logged in as (that is, you name, not root or any other name). The install script will generate a lot of messages and take some time. You must be connected to the Internet for this to work as it will download and install several packages.
    • Once the software has installed, re-boot to be sure all the changes have taken place and the correct daemons have been started.
    • To run the studio, enter the Jack-OBS-Studio directory, open a terminal window, and run, as yourself, NOT as root, startStudio.script (you may need to make this executable as shown above.) The startStudio.script will start the components which have been previously installed and you will see a display similar to the demo below.
  5. The startup script and demo. Regardless of whether you have booted from the ISO or installed the software to an existing system, the startup script and demo is the same. The script is startStudio.script and it is located in the Jack-OBS-Studio directory (This is the script invoked by the icon in the ISO).

    The startup script starts the JACK daemons and other software. You may modify it.

    Once all the tasks have started and the windows have finished repositioning themselves, you will see the Jack Audio Master (jamin) interface in the upper left, Jmeters center left, the Qjackctl lower left, SMPlayer lower center, the Qjackctl patch bay lower right and Open Broadcast Studio upper right. A brief video will be playing, with sound, in the SMPlayer window. The meters and green bars (in jamin) should be moving and a copy of the video should be playing in OBS. When the video finishes, you may restart it or load another audio or video file.

    To begin casting, click the Start Streaming button in OBS but only if you have first configured the casting site's URL and streaming key (see below).

    If you wish to shut down, click the X boxes in each window as per normal EXCEPT: do not click the X box in the patch bay, click the X box in Qjackctl instead. Killing Qjackctl will close the patchbay as well. Note: if you decide to kill the patchbay first, you will not see it the next time you start up but can bring it back by clicking the patchbay button in Qjackctl.

      Note: input audio is probably enabled (depends on your system settings). That is, your Line In or Mic may be active. Consequently, if you are on a laptop, your microphone may cause feedback. Mute it.

Summary

The easiest way to try this is to get the ISO, install it on a bootable USB drive, and run it. However, as is the case with all LIVE ISOs, any changes you make during a session will be lost when you exit unless to make them to a separate file system. Note: you can probably create a separate partition other than the boot partition on the flash drive: the bootable partition is only about 1 GB and most flash drives are considerably larger. You may format it either with ext4 or a Windows file system. Linux recognizes all.



Demo of the studio in action. Recorded at 720 so enlarge to full screen for best view. Note that I adjusted the audio (follow the cursor) early on. The demo was created using OBS in record mode. What you are seeing could have been the stream.

Overview
    "... A webcast is a media presentation distributed over the Internet using streaming media technology to distribute a single content source to many simultaneous listeners/viewers. A webcast may either be distributed live or on demand. Essentially, webcasting is "broadcasting" over the Internet.

    The largest "webcasters" include existing radio and TV stations, who "simulcast" their output through online TV or online radio streaming, as well as a multitude of Internet only "stations". Webcasting usually consists of providing non-interactive linear streams or events. Rights and licensing bodies offer specific "webcasting licenses" to those wishing to carry out Internet broadcasting using copyrighted material.

    Webcasting is used extensively in the commercial sector for investor relations presentations (such as annual general meetings), in e-learning (to transmit seminars), and for related communications activities. However, webcasting does not bear much, if any, relationship to web conferencing, which is designed for many-to-many interaction.

    The ability to webcast using cheap/accessible technology has allowed independent media to flourish. There are many notable independent shows that broadcast regularly online. Often produced by average citizens in their homes they cover many interests and topics. Webcasts relating to computers, technology, and news are particularly popular and many new shows are added regularly.

    Webcasting differs from podcasting in that webcasting refers to live streaming while podcasting simply refers to media files placed on the Internet. ..."

    https://en.wikipedia.org/wiki/Webcast

Webcasting is a growing hobby and business interest for many people and there are a number of free and pay sites that host casting services. Among those that support audio and video streaming are:

  1. Ustream
  2. Vaugnlive
  3. iVlog
  4. YouNow
  5. Facebook
  6. YouTube
  7. Twitch
  8. Hitbox
  9. Stream.me
  10. Livestream
There are several software encoding packages used to implement streaming. Some of these are proprietary, such as those from YouTube, Facebook, and Skype, and some are more general purpose such as Xsplit, VLC, FFsplit, Flash Media Encoder (Adobe), and Open Broadcast Studio and others. Some are free, some are open sources, some have both free and paid versions.

The streaming software most used in Linux is Open Broadcast Studio (OBS), a re-write of Open Broadcaster (which is still available) (https://obsproject.com).
OBS supports multiple scenes, audio sources, broadcast settings (frame rate, resolution, compression, audio and video bit rates, sample rates, as well as a recording mode where the contents are saved to disk rather than broadcast.

A scene in OBS can consist of multiple elements including realtime screen capture direct media embedding, text, cameras, images, slide shows, and audio sources. Multiple scenes can be organized and saved and scenes can be changed in real time, with a preview mode and special effects (e.g. fade, swipe, slide, luma Wide and fade to color).

In Linux, the most advanced sound server is JACK (see below), a low-latency audio server which provides a large professional features not available in the more commonly used PulseAudio sound system. Also, experience indicates that OBS stability is enhanced when using JACK rather than PulseAudio. However, JACK, while is compatible with OBS and related clients, setup can be challenging.

PocketRadio

Pocket Radio is a Lubuntu 16.10 based bootable (and installable) live, fully functional, ready-to-go, operating system image for Internet radio and/or video casting studio pre-configured with JACK and OBS.

The name derives from the fact that the entire bootable operating system and studio can be put on a USB flash drive and carried in your pocket. With it, you can experiment with a working version of JACK and OBS, experiment with parameters and settings. You may also install the system to a permanent, bootable, hard drive.

The usage options for PocketRadio are:

  1. As a portable, bootable, live distro.

    Although, the system can be installed to a hard drive (see below), it can be reasonably used from a flash drive alone. While any changes made to the live configuration are lost when the system is shutdown (as is the case with all live distros), permanent data storage is usually possible since most flash drives are large and the area of the drive occupied by the PocketRadio system image is only about one gigabyte. The remainder of the USB flash drive can be formatted for storage of music, video, configuration files, and so forth. Other drives on the host system, regardless of the file system format, including external drives, may also be accessed by the live system. Once the live version is loaded into memory on a system with 4 GB or more, performance is generally very good.

  2. Install the Pocket Radio Distribution to a bootable hard drive.

    The ISO may be installed to a permanent read/write hard drive. The result will be a Lubuntu installation with the additional components specific to Jack and OBS (listed below). The installation procedure and dialog is the same as for standard Lubuntu.

    However, please note that if you want to install the system to a hard drive, there is an error in the on-screen install icon (due to the ISO packaging software).

    To initiate the install procedure, open a terminal window and type

      sudo sh -c ‘ubiquity gtk_ui’

    You will be prompted for the user (jack) password which is abc123.

    Also, during installation, you will be prompted for a user name. It will ignore the name you type (as well as any password) and create user jack --- the default user name as used in live version default user. the password will also be abc123. You may change the password once the system is installed as well as add additional users.

    In the fully installed system, user jack's directory will have the full PocketRadio scripts but you may create additional users from the System Tools menu. These new users may have any password and you may copy the PockRadio script files to them.

  3. Installation to an Existing Linux Installation

    See above.



Components

The component software packages pre-installed and configured in the distribution are:

  1. OBS (Open Broadcast Studio).
      OBS is the casting software. With it you assemble a scenes consisting of fixed images, live camera feeds, audio inputs, the content of windows from your desktop, and so forth. The contents of the active scene may be encoded and sent to a streaming server where the stream is then distributed to viewers on the Internet. There is also the option to record your program for possible streaming or other use at a later date.
  2. The Jack Audio Connection Kit (JACK)
    • "... JACK is a low-latency audio server, written for any operating system that is reasonably POSIX compliant. It currently exists for Linux, OS X, Solaris, FreeBSD and Windows. It can connect several client applications to an audio device, and allow them to share audio with each other. Clients can run as separate processes like normal applications, or within the JACK server as "plugins". ..." http://www.jackaudio.org/api/
    • "... JACK was designed from the ground up for professional audio work, and its design focuses on two key areas: synchronous execution of all clients, and low latency operation. ..." http://www.jackaudio.org/api/
      "...JACK Audio Connection Kit (or JACK; a recursive acronym) is a professional sound server daemon that provides real-time, low-latency connections for both audio and MIDI data between applications that implement its API. JACK has been developed by a community of open-source developers led by Paul Davis (who won an Open Source Award in 2004 for this work) and has been a key piece of infrastructure and the de facto standard for professional audio software on Linux since its inception in 2002. The server is free software, licensed under the GNU GPL, while the library is licensed under the more permissive GNU LGPL. ..."
      https://en.wikipedia.org/wiki/JACK_Audio_Connection_Kit
      See also: http://www.linux-magazine.com/content/download/63041/486886/version/1/file/JACK_Audio_Server.pdf
  3. Supporting components include:
    1. JAMin - the Jack Audio Master Interface.
        JAMin is the JACK Audio Connection Kit (JACK) Audio Mastering interface. JAMin is an open source application designed to perform professional audio mastering of stereo input streams. It uses LADSPA for digital signal processing (DSP). JAMin is licensed under the GPL.
      • JAMin features:
      • Linear filters
      • JACK I/O
      • 30 band graphic EQ
      • 1023 band hand drawn EQ with parametric controls
      • Spectrum analyzer
      • 3 band peak compressor
      • Lookahead brickwall limiter
      • Multiband stereo processing
      • Presets and scenes
      • Loudness maximizer
      from: http://jamin.sourceforge.net/en/about.html
    2. QjackCtl JACK Audio Connection Kit - Qt GUI Interface
        Provides a simple GUI dialog for setting several JACK daemon parameters, which are properly saved between sessions, and a way control of the status of the audio server daemon. With time, this primordial interface has become richer by including an enhanced patchbay and connection control features.
        from: https://qjackctl.sourceforge.io/
    3. Jmeters and Meterbridge that provide graphical VU and other audio metering and displays.
    4. Mixxx an open source, GPL audio mixing and DJ studio, configured for JACK output.
        Mixxx is free DJ software for Windows, Mac OS X and Linux. It’s easy to use so you can start mixing your favorite songs in no time, even if you’ve never DJed before. Mixxx offers a variety of features for experienced DJs and beginners alike, such as automatic beat and key detection, master sync, hotcues, looping, 4 decks, effects and many more. You can perform with Mixxx using MIDI and HID controllers, CD players, vinyl turntables or even just your computer’s keyboard and mouse.
        from: http://www.mixxx.org/
    5. SMPlayer & mpv - a video and audio player configured for JACK
        SMPlayer is a free media player for Windows and Linux with built-in codecs that can play virtually all video and audio formats. It doesn't need any external codecs. Just install SMPlayer and you'll be able to play all formats without the hassle to find and install codec packs.

        SMPlayer is a graphical user interface (GUI) for the award-winning MPlayer, which is capable of playing almost all known video and audio formats. But apart from providing access for the most common and useful options of MPlayer, SMPlayer adds other interesting features like the possibility to play Youtube videos or download subtitles.
        from: http://smplayer.sourceforge.net/

    6. JackEQ Audio equalizer
        JackEQ is intended to provide an accessible method for tweaking the treble, mid and bass of any JACK aware applications output. Designed specifically for live performance, it is modeled on various DJ mixing consoles which the main author Patrick Shirkey (aka DJ Kotau) has worked with live.

        JackEQ is a tool for routing and manipulating audio from/to multiple input/output sources. It runs on the JACK audio system, and uses the DJ EQ swh ladspa plugin created by Steve Harris, also one of jackEQ's major contributors along with Jack O'Quin who crafted the majority of the JACK ports menu code.
        from: http://djcj.org/jackeq/

    7. PulseAudio Volume Control
        PulseAudio Volume Control (pavucontrol) is a simple GTK+ based volume control tool (mixer) for the PulseAudio sound server. In contrast to classic mixer tools this one allows you to control both the volume of hardware devices and of each playback stream separately. It also allows you to redirect a playback stream to another output device without interrupting playback.
        from: https://apps.ubuntu.com/cat/applications/pavucontrol/
    8. guvcview A software package to control video capture devices used with OBS.
        The guvcview project aims at providing a simple interface for capturing and viewing video from v4l2 devices, with a special emphasis for the linux uvc driver.
        The project provides a control interface based on Gtk3 or Qt5, depending on the build configuration. A console only option is also available.
        You can also use guvcview has a control window only, (from console: guvcview --control_only), this allows image control on other apps, like ekiga, cheese, mplayer, skype, ...
        from: http://guvcview.sourceforge.net/
    9. OpenShot Video Editor
        Simple. Powerful. OpenShot Video Editor is a free, open-source video editor for Linux, Mac, and Windows licensed under the GPL version 3.0.
        OpenShot can take your videos, photos, and music files and help you create the film you have always dreamed of. Easily add sub-titles, transitions, and effects, and then export your film to DVD, YouTube, Vimeo, Xbox, PlayStation, and many other common formats.
        from: http://www.openshot.org/
    10. RecordMyDesktop An application to create a video and audio record of a desktop session.
    11. QJackRcd An application to record Jack audio.
    12. JackMixer An application to mix Jack input and output.

How It Works

When you click the ‘Run Jack OBS’ icon, a Bash script file is initiated. The script, in turn, starts the several programs ans services needed to begin an Internet streaming cast. The script file, jack.script, at present, is shown below. It does the following:

  1. Enters the directory containing the demo code and video.
  2. Names the current window “studio start”
  3. Checks that it is not being run as root.
  4. Terminates any current instances of daemons jackd and jackdbus
  5. Sets the Jack Server name
  6. starts the jackd daemon
  7. Pauses one second to allow the software to initiate.
  8. Clears the desktop.
  9. Starts jmeters
  10. Starts jamin
  11. Starts OBS
  12. Starts SMPlayer playing a short video clip
  13. Starts qjackctl which, in turn, establishes the audio connections.
  14. Re-arranges the desktop for maximum visibility
  15. Waits until all tasks have finished.
If you look at the Patchbay connections in the lower right, you will see the Jack audio connections that are being used. Patchbay is part of qjackctl which is labeled as Jack Connection Kit in the display in the lower left box.

  1. Output from mpv and system are routed to jamin input (right hand box).
    1. Mpv is the the actual video player being used by SMPlayer. So, audio from the video is being routed to jamin. The regular expression after mpv is used to take the output from any instance of mpv. If you play more than one video, the second video will be a second instance of mpv and it will, unless captured, connect to both system and jamin and this will produce an echo. The regular expression prevents this from happening.
    2. System is any input arriving at the audio card’s Line In or Microphone, depending on your systems settings. This input is likewise sent to jamin.
  2. Jamin processes the audio. Jamin has equalizers, compressors, limiters and other tools. The output of jamin (left hand box) is routed
    1. to system (your audio card output),
    2. processed (the name given to the instance of the jmeters) and
    3. JACK Input Client (the input of OBS).
You may add additional sources (such as Mixxx) and targets (equalizers, other meters, etc). If you add an equalizer (in which case you’ll probably want to remove jamin, the equalizer will have two entries: a set of input sockets (right box) and a set of output sockets (left box). If you alter the patchbay configuration, you should save it.

OBS takes images and audio from several sources and assembles them on the screen. The screen and audio will be sent to the streaming server (or, you may record the cast to disk). A given assembly of input sources is called a scene. In the demo, there are two scenes (lower right OBS box).

In the scene shown by default, video insert, there are five sources of audio and video:

  1. meter processed. This is the display of the meters.
  2. JACK Input Client. This is the audio coming from JACK. There is a volume control and mute button for the audio in the box under the label ‘Mixer’.
  3. The video from SMPlayer (mpv, actually).
  4. The display from jamin.jam
  5. a static image of a road named Nebraska (photo is actually from Iowa).
The size and position of the elements on the screen may be adjusted by drag and drop with your mouse. Additional elements, for example a camera, may be added by clicking the large plus sign. Element layers can be moved up or down by the up and down arrows. If a higher display element overlaps a lower element, parts of the lower element will be obscured. You can switch scenes by clicking on a selection in the Scenes box. You may control the transition (fade, etc).

If you want to begin streaming, you need to provide a streaming key and URL. Click Settings:

In the picture, the URL for Vaughn Live is shown (substitute the URL for your server and the stream key (provided by your streaming service).

Other options allow you to set the audio bit rate, number of frames per second, video resolution and so on. Generally, you want to set the bit rates, frame rates and resolutions as low as possible consistent with content goals in order that your overall stream rate will be attractive. High stream rates tend to discourage viewership on tablets and cell phones. A 'good' bit rate is one not higher than 1 megabit per second.

Once you have established your settings and streaming key, on the main screen, click “Start Streaming” and you’ll be an Internet sensation in no time....

Audio from non-compatible systems

In the case where where audio output from a non-compatible software package must be used (such as Firefox or Chrome, at present), an inexpensive (about $8.00) USB audio card can be used to take audio from the package and, usually by means of a mixer which you will probably want for your microphone anyway, routed back into the system as input to JACK (see below for details).

hardware level audio control in most Linux systems is handled by ALSA (Advanced Linux Sound Architecture). It interacts with the actual audio hardware. ALSA typically can support up to eight sound cards, each capable of input and output.

ALSA is not accessed directly by programs. Instead, programs access a sound server. In most systems, the default audio server is PulseAudio. PulseAudio permits multiple audio sources and targets to connect concurrently. It is PulseAudio that interacts with the hardware level audio server ALSA.

In this configuration, JACK replaces PulseAudio and manages the connection to ALSA. Thus, software connects to JACK and JACK connects to ALSA.

However, if you start PulseAudio software prior to starting JACK and configure your system such that PulseAudio will interact with ALSA to use the added audio device, PulseAudio-only compatible software will work. PulseAudio Volume Control can be used to select the device that PulseAudio will interact with (via ALSA).The output from an added USB device may be routed back into the main JACK controlled device directly via a cable or a combination of mixer and cable.

Video Players

SMPlayer is essentially a wrapper for mpv. Mpv may be initiated directly from a command line with a command of the form:

mpv --msg-level=all=no --no-osc --volume=100 --ao jack --shuffle --autofit=450 --playlist=PlayList.m3u

where:

  • --no-osc turns of the on screen display - a graphical area that shows progress and allows for start, pause, etc. on screen mouseover.
  • --volume=100 sets the volume output at max. The volome can be controlled be better controlled in jamin.
  • --ao jack tell mpv to route audio output to JACK.
  • --shuffle causes mpv to shuffle the play list.
  • --autofit sets the witdth of the mpv window in pixels. The height will vary to achieve the correct aspect ratio.
  • --playlist=PlayList.m3u is the name of the playlist of audio or video recordings. Most common playlist formats are accepted.
In the terminal window from which the above command was launched will appear a synoptis of the recording being played. The contents of this window may be captured by OBS for a title display.

You may launch mpv from the startStudio.script by the command:

mate-terminal --working-directory=/media/joeuser/VideoClips -e ./abc.script &

where:

  • --working directory identifies the director containing the script file with the mpv command from above.
  • -e ./abc.script is the bash script file containing the mpv command from above.