Compiling and Installing Snowmix.

Updated for Snowmix 0.5.1

Introduction


This page contains information about compiling, installing and testing Snowmix.

Preparations and bootstrap.


To compile, install and run Snowmix, Snowmix source code must be downloaded onto a supported platform. Furthermore Snowmix requires a number of libraries and tools.

The good news is that Snowmix's boostrap script will detect platform and offer to install any missing package or libraries.

Top

Sudo.

The bootstrap script will use the command sudo for installing missing packages and you will be required to provide your password for sudo for it to succeed.

If you are uncomfortable providing the password to the boostrap script, you can alternatively install any missing packages your self beforehand. See the list of required software here. The bootstrap script will then either detect the installed packages or ask to skip detecting possibly missing packages and proceed without executing sudo needing the password. Unfortunately this does not fully apply for the Mac OS X, but you can look in the boostrap script for any wrong doing your self.

Some distros, such as Debian and others, the users do not by default have access to execute *sudo* commands. To have access to execute the *sudo* command on a Debian system, you need to add your username to the sudo group in the /etc/group file. Alternatively you may be able as root to run the command:

# adduser YOUR_USERNAME sudo

After adding your username to the sudo group, you need to log out and log in again. ALterntive to adding your user name to the sudo group, you can alter the /etc/sudoers file to grant you access to execute the sudo command. This takes effect immediately.

On Ubuntu you can manually install the missing packages using the following command:

sudo apt-get install build-essential automake autoconf libtool g++ pkg-config \ libsdl1.2-dev libpango1.0-dev libpng12-dev libosmesa6-dev freeglut3-dev

Some Ubuntu/Debian alike distros may require tcl8.6-dev or tcl8.5-dev instead of tcl-dev. tcl-dev in one of its versions/incarnations is needed by Snowmix to include the embedded Interpreter offering advanced scripting.

Top

GStreamer


GStreamer-1.0 (GStreamer 0.10 is no longer officially supported here nor at the GStreamer project) is needed by the demo examples and the scripts to feed audio and/or video streams to Snowmix and to read mixed video and/or audio from Snowmix.

GStreamer versions 1.2.0-1.2.1 have an issue with the alpha value (setting value to 127 instead of 255) when converting video streams from I420/YUV to BGRA.

GStreamer versions 1.2.1-1.2.2 have a performance issue (uses 2-4 times as much CPU) when converting video streams from I420/YUV to BGRA lowering the overall performance of a Snowmix video mixer system.

Gstreamer versions 1.5.0-1.5.2 seems to have issues with Matroska mux and TS mux and demux, but seems otherwise fine.

Due to these issues, the scripts of Snowmix will require GStreamer 0.10 if GStreamer 1.2.0-1.2.2 is installed, but an upgrade to newer versions are strongly recommended.

The recommended GStreamer version is GStreamer-1.6.3. Version 1.4.5 was the recommended version for Snowmix 0.5.0.

The basic GStreamer tools can on Ubuntu be installed by executing the following command although this may be an older version:

$ sudo apt-get install gstreamer1.0-plugins-good gstreamer1.0-plugins-bad \ gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools gstreamer1.0-alsa

GStreamer packages for other platforms are listed for most on the required software page.

Because some modules like faac and others seem to be missing in some of the prebuilt binary packages of GStreamer, it is recommended, that you take the time to compile GStreamer yourself. Make sure to document how to in a script, so you have when GStreamer releases new versions. For most platforms, all you have to do is to:

./autogen.sh make sudo make install

For each package, you can at the end of autogen.sh (actuallay it is after './configure' performed by autogen) see which module elements that are included and which are not. It will for a lot of module element depends on whether or not you have the right libraries and development (typical the devel version) files for header files installed on your system. It takes some times to go through, but it is worth it.

Alternative to compile and install GStreamer yourself, the author of Snowmix can do it for you for a smaller fee.

Top

Tcl/Tk


If you want to run the GUI utilities such as snowaudio.tcl for controlling audio, snowscene.tcl for controlling scenes or snowoutput.tcl to monitor output timing and buffers, you will need Tcl/Tk and BWidgets. To install these packages on a Ubuntu platform execute one of the following:

$ sudo apt-get install tcl8.6 tk8.6 bwidget tcl8.6-dev $ sudo apt-get install tcl8.5 tk8.5 bwidget tcl8.5-dev $ sudo apt-get install tcl tk bwidget

Once again, the boostrap script supplied with Snowmix will offer to install the required packages, Tcl and Tk tools included for all supported platforms.

Top

Compiling Snowmix:


Unpack the Snowmix package, enter the main directory and run the bootstrap script. The script may be needed to run more than once if packages are missing. After running the bootstrap script, you can rerun the configure program with your own customized settings. After bootstrap and the optional configure process, you run the make command as shown below:

$ tar -xzvf Snowmix-0.5.1.tar.gz $ cd Snowmix-0.5.1 $ ./bootstrap $ make

That's it. Please pay attention to what the bootstrap script will tell you when it finish, hopefully without any errors. At the end of the boostrap script you will be told something like this:

You can rerun ./configure --prefix=YOUR_INSTALLATION_DIR if you need to change the installation path for Snowmix You can revert the bootstrap script by executing the command './strapboot' >>>>>>>>>> PLEASE NOTE <<<<<<<<<<<< By default the Snowmix will be installed in /usr/local. If you want to change this, please run ./configure --prefix=YOUR_CHOICE If Snowmix is installed into /usr/local you need to set the enviroment variable SNOWMIX to /usr/local/lib/Snowmix-0.5.1 Consider adding the following to your ~/.bashrc or ~/.bash_profile export SNOWMIX=/usr/local/lib/Snowmix-0.5.1 Then after finishing this script, logout and login again to continue Press return to continue Now you can compile Snowmix and install snowmix using the following commands: make sudo make install After that, you can run Snowmix by executing the command snowmix ini/YOUR_INI_FILE Or you can run the demo by executing the command 'snowmix_demo' For questions and help, please use the discussion forum at http://sourceforge.net/projects/snowmix/ where you in the Wiki also can find a lot of documentation, examples and help. See also website http://snowmix.sourceforge.net/ for ressources and documentation

Please read what the boostrap script tells you and take the actions it suggests.

After succefully running make, you now have the binary snowmix in the src directory. You can change the default installation directory through the configure command before running the make command. Use ./configure --help for more information.

Platform Comments


Linux CentOS: You need to add permissions to run sudo. GStreamer seems to miss H.264 and AAC encoder and decoder modules needed for the demo example.

Linux Chakra: Runs fine, but Chakra seems to miss BWidget as an installable package although available for Arch Linux. Perhaps you can download it and install it your self.

Debian: Needs package sudo and you need to add permissions to run sudo for the user running the bootstrap script.

Fedora: For Fedora 23 you need to add the rpmfusion repository and install relevant gstreamer plugins to run the snowmix_demo. Similar for Fedora 22, but untested. The commands are:

sudo rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-23.noarch.rpm sudo rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-23.noarch.rpm sudo dnf install gstreamer-plugins-bad gstreamer-plugins-bad-free-extras gstreamer-plugins-bad-nonfree \ gstreamer-plugins-ugly gstreamer-ffmpeg gstreamer1-libav gstreamer1-plugins-bad-free-extras \ gstreamer1-plugins-bad-freeworld gstreamer1-plugins-base-tools gstreamer1-plugins-good-extras \ gstreamer1-plugins-ugly gstreamer1-plugins-bad-free gstreamer1-plugins-good \ gstreamer1-plugins-base gstreamer1

Linux Mint: All is fine.

FreeBSD PCBSD: You need to execute the following command

sudo ln -s /usr/local/bin/bash /bin/bash

for the scripts to work. Run all commands in bash rather than other shells. No video/image sinks was found for GStreamer1.0 for PCBSD10.2. No 'wish' needed for tcl GUI programs was found.

OpenSUSE: The package gstreamer-plugins-libav isn't found by zypper. You need to find the right version yourself and install it manually. Without it, you may miss important decoders such as decoder for H.264 etc.

Linux Ubuntu: All is fine.

Top

Including Support for OpenGL 3D Graphics


Because Glshapes is alpha-code in Snowmix version 0.5.1, you need to compile or recompile Snowmix to include support for Glshapes. To do this you will need to execute the following commands:

$ cd TO_WHERE_THE_SNOWMIX_CODE_TREE_RESIDES $ ./bootstrap $ ./configure --enable-snowmixosmesa --enable-snowmixx11 --enable-snowmixglu --enable-snowmixglut \ --prefix=/usr/local --libdir=/usr/local/lib $ make clean $ make $ sudo make install

Please note that Mac OS X users and others, may want to use the prefix to be /opt/local and libdir to be /opt/local/lib or whatever is preferred on the platform.

OpenGL has not been tested on the ARMv7 platform. Most implementations with ARMv7 offers OpenGL ES as opposed to regular OpenGL. Quite likely only few changes to Snowmix will be necessary to get Snowmix to work with OpenGL ES, but this is currently untested.

You can read more about Snowmix OpenGL Support in the Snowmix GL Shapes Guide.

Top

Installing Snowmix:


From Snowmix version 0.5.0, Snowmix is supposed to be installed before running. You can technically run Snowmix without installing it by setting the enviroment variable SNOWMIX to the base of Snowmix's directory. However then you are on your own. So to install you need to execute the following command:

$ make install

However unless you set installation directory in the configuration process to be something writable, or you are root, you may have to do:

$ sudo make install

From Snowmix version 0.5.0 and onwards, Snowmix is intended to be installed and has been tested as such.

Top

Testing and running Snowmix:


It is strongly advised not to run Snowmix as root. Testing Snowmix requires that you have installed a complete set of GStreamer and GStreamer plugins. You will need the plugin-base, plugin-good, plugin-bad, plugin-ugly and plugin-libav. On how to to install GStreamer and these plugins, if not already installed by the bootstrap script or by other means earlier, please use Google to search for help.

IMPORTANT: Before running any of the scripts, you need to set the enviroment variable SNOWMIX as explained by the end of the boostrap script.

A permanent solution would be to add the following to your .bash_rc file in your home directory:

export SNOWMIX=/usr/local/lib/Snowmix-0.5.1

Please note that the actual setting depends on where you installed your Snowmix collection.

On Mac OS X you should set the SNOWMIX variable in your ~/.bash_profile. PLEASE see the section further down on installing Snowmix on the Mac OS X platform regarding the SNOWMIX variable and the installation path.

When Snowmix has been installed and you have set your SNOWMIX environment variable permanently and logged out and in again, you can now run the Snowmix demo as test:

$ snowmix_demo

This demo will open one terminal window for Snowmix, one experimental audio mixer based on Tcl/Tk, one terminal running output of audio and video as well as more terminal windows running test input streams. If all goes well, you will hear audio and see a window with the mixed result depending on which menu point you choose when running the demo.

If you want to test individual ini files, you can do so using the following commands and replacing the *some_ini_file* with your choice of ini file. Available ini files are found in the $SNOWMIX/ini directory and ~/.snowmix/ini directory.

# In a terminal window $ cd $ snowmix ini/some_ini_file # In another terminal window $ xterm -e bash output2screen # In a third terminal window $ xterm -e bash input2feed 1

In the window running Snowmix, you can now type Snowmix commands. To begin with, you can type 'help' and press return. Type 'quit' when you want to stop Snowmix. If you terminate Snowmix in any other way, some of the shared memory allocated will stay allocate and build up until you can not start Snowmix again. Allocated shared memory can be found listed in /run/shm or /dev/shm (on Linux) and can be deallocated by deleting files in there. The files you need to delete are /run/shm/shmpipe*. However if you don't know what you are doing, bets are you will create problems for you and your machine. If you delete the shm files there, you will have to restart your GStreamer pipelines.

Top

Core Dumps.

Snowmix will core dump if the shared memory file system is full. On Linux you can see the state of the shared memory file system is full by executing the command:

$ df -k /run/shm

If Snowmix exits abnormally (or by using CTRL-C), Snowmix will leave shared memory allocated. If this happens a couple of times, you will eventually run out of shared memory space. The allocated shared memory space can be released by deleting the files /run/shm/shmpipe*. However if you do that, you will have to restart your GStreamer pipelines feeding Snowmix and reading from Snowmix.

The following is no longer thought to be true, but left here for later inspection. In the code in controller.cpp Snowmix will core dump when calling mmap() after shm_open() and ftruncate(). So far I don't know how to prevent it. Suggestions and hints are welcomed. This problem however seems to have gone, though it has not yet been fully verified.

Top

Compiling Snowmix for Mac OS X.


Snowmix compiles on Mac OS_X Lion, Mountain Lion, Maverick and Yosemite. It might also work on older Snow Leopard, but it has not been tested.

El Capitan, Yosemite, Maverick and Mountain Lion

To compile Snowmix on OS X on El Capitan, Yosemite, Maverick and Mountain Lion, you need to install Xcode, which Apple provide through App Store for free. So install Xcode first and possibly the Command Line Utilities. The bootstrap script will check for the Utilities and offer to be download and install it if missing.

Lion and Snowleopard

To compile Snowmix on OS X on Lion and Snowleopard you first need to install Xcode, which Apple may no longer provide through App Store for free. Then you need to download the Command Line Utilities and install this package as the bootscript can not do this. You can find the Utilities for Lion on the Apple Developer website, but for Snowleopard you may have to search elsewhere.

El Capitan, Yosemite, Maverick, Mountain Lion, Lion and Snowleopard.

The boostrap script will offer to download and install port for Mac as well as a number of libraries mentioned in the Linux Section. It will also offer to download and install GStreamer for Mac for you. If you have a GStreamer version older than 1.6.3, you may want to remove that version before running the bootstrap script.

When Xcode has been installed and Snowmix has been downloaded to your Download directory, you can execute the following commands to compile Snowmix:

$ cd $HOME $ mkdir Developer $ cd Developer $ tar -xzvf $HOME/Downloads/Snowmix-0.5.1.tar.gz $ echo 'export PATH=/opt/local/bin:/Library/Frameworks/GStreamer.framework/Commands' >>~/.bash_profile $ echo 'export SM=$HOME/Developer/Snowmix-0.5.1' >>~/.bash_profile $ echo 'export SNOWMIX=/opt/local/lib/Snowmix-0.5.1' >>~/.bash_profile

Please note the use of single quotes as opposed to double quotes.

What you set the SNOWMIX enviroment variable depends on what you have selected when you ran the configure sctipt. If you ran the configure script through the bootstrap script, Snowmix will be installed into /opt/local/lib/Snowmix-VERSION for the OS X platform when you run the installation command. If however you ran the configure script afterwards, it will depend if you specified a path for the prefix. The configure script used without argument, will by default select an installation path in /usr/local rather than /opt/local. The bootstrap script may install port packages into the /opt tree by default.

Now logout and login again for changes to take effect and then run the following commands assuming you did set the PATH to include /opt/local/bin :

$ cd $SM $ ./bootstrap $ make $ sudo make install $ snowmix_demo

If '/opt/local/bin' is not included in your PATH environment variable as described, the bootstrap script may not fail, but subsequent executing "make" probably will.

If you do not allow the bootstrap script to install any possibly missing packages and tools, the subseqent make command is likely to fail unless all required software is installed and found.

If GStreamer is not in your PATH environment variable as described above, the demo script is likely to fail.

Reports on success and failures on the Mac OS X platform are very welcome in the Support Forum.

Important. The Tcl GUI scripts works poorly on OS X if tcl/tk and wish is not version 8.6. Recommended version is 8.6.4 or newer. By default Mavericks and earlier versions of Mac OS X have by default a Tcl version earlier than 8.6. If you have an OS X based system upgraded several versions, you may have several versions of Tcl installed all over the system. Some of them may even be version Tcl 8.4. This need to be cleaned. New Tcl can be downloaded for free from ActiveState Download.

Top