Compiling and Installing Snowmix.

Updated for Snowmix 0.5.1.1

Introduction


This page contains information about compiling, installing and testing latest Snowmix version. Information for compiling Snowmix version 0.5.1 is also available.

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 packages or libraries if any.

Top

Sudo.

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

If you are uncomfortable providing the password to the boostrap script, you can alternatively install any missing packages yourself 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. See also Bootstrapping without sudo.

For some distros, the users do not by default have access to execute sudo commands. To have access to execute the *sudo* command on a Debian based 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 following command adding your account to the sudo group:

# 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 as root alter the /etc/sudoers file to grant you access to execute the sudo command. This takes effect immediately. If sudo is not installed, you need to add the sudo as root. If sudo is not installed on a Debian or Ubuntu derrived distros, you can execute the following command to install sudo:

su - apt-get install sudo
Top

Installing required packages manually.


On Ubuntu and Ubuntu derrived distros you can manually install the required packages using the following command:

sudo apt-get install build-essential automake make autoconf libtool g++ pkg-config \ bc libpng-dev libsdl1.2-dev libpango1.0-dev tcl-dev tcl tk \ bwidget liborc-0.4-dev libosmesa6-dev freeglut3-dev freeglut3-dev

The sdo apt-get install or sudo apt intsall may work on Debian as well.

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.

The preferred version of libpng is 1.6. However, installing this versions often conflicts with a lot of other precompiled packages usually compiled for libpng12. If you can install libpng16-devtools or libpng16-dev, Snowmix will prefer that version over version 1.2 and you can remove libpng12-dev from the list of files required to be installed. This file is listed in files in the bootstrapd directory of Snowmix.

For Snowmix 0.5.2, libSDL has been upgraded from 1.2 to 2. Support for libSDL 1.2 is no longer supported from version 0.5.2. Replace libsdl1.2-dev with libsdl2-dev.

The Python packages for Snowmix 0.5.2 are only needed if support for an embedded Python interpreter in Snowmix is desired. The packages to install are:

sudo apt-get install python3-dev libpython3-dev

The above commands are only for Ubuntu derrived distros. Please check the page required packages for specifics on which packages to install for your distro of choice.

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 appear otherwise to be 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 is strongly recommended.

Snowmix version 0.5.1.1 was primarily tested using the 1.8.x to 1.16.x version of GStreamer. The recommended version is 1.16.2 or newer.

GStreamer ersion 1.6.3 was the recommended version for Snowmix 0.5.1 and GStreamer version 1.4.5 was the recommended version for Snowmix 0.5.0.

Snowmix version 0.5.2 was primarily developed using the 1.8.x to 1.16.x version of GStreamer. The recommended GStreamer version is GStreamer-1.16.2 or newer.

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 sudo ldconfig

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.

Please note that building GStreamer with autotools will for version 1.17 and newer no longer be supported as the Meson Build System.

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 depending on Ubuntu version:

$ 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 tcl-dev

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.1.tar.gz $ cd Snowmix-0.5.1.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.1 Consider adding the following to your ~/.bashrc or ~/.bash_profile export SNOWMIX=/usr/local/lib/Snowmix-0.5.1.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.

Bootstrapping without sudo


If all required packages/libraries are installed, you can choose to skip the bootstrap script all together and run the following commands manually eliminating running sudo in the bootstrap script. The commands for non macOS are:

$ tar -xzvf Snowmix-0.5.1.1.tar.gz $ cd Snowmix-0.5.1.1 $ aclocal $ autoconf $ libtoolize --force $ automake --add-missing $ ./configure --prefix=/usr/local $ make $ sudo make install

For macOS you need to replace libtoolize with glibtoolize and usually set the --prefix to /opt/local.

Top

Platform Comments


Linux Ubuntu - All works but see note for OpenGL.

Ubuntu 16.04 LTS updated to 16.04.6 LTS (Native and VirtualBox 6.1.10)
- OpenGL Support (glshapes) : CPU based OSMesa and GPU based GLX (X11) works.
Ubuntu 18.04 LTS updated to 18.04.x LTS (VirtualBox 6.1.10)
- OpenGL Support (glshapes) : CPU based OSMesa fails. Use GPU based GLX (X11).
Ubuntu 20.04 LTS updated to 20.04.x LTS (VirtualBox 6.1.10)
- OpenGL Support (glshapes) : CPU based OSMesa fails. Use GPU based GLX (X11).

Copying /usr/lib/x86_64-linux-gnu/libOSMesa.so.8.0.0 from 16.04 LTS to newer version of Ubuntu will make OSMesa for Snowmix work on these distros.

Linux Mint - All works, but see note for OpenGL.

Linux Mint 17.3 (VirtualBox 6.1.10)
- OpenGL Support (glshapes) : CPU based OSMesa and GPU based GLX (X11) works.
Linux Mint 18.3 (VirtualBox 6.1.10)
- OpenGL Support (glshapes) : CPU based OSMesa and GPU based GLX (X11) works.
Linux Mint 19.3 (VirtualBox 6.1.10)
- OpenGL Support (glshapes) : CPU based OSMesa fails. Use GPU based GLX (X11).
Linux Mint 20 beta (VirtualBox 6.1.10)
- OpenGL Support (glshapes) : CPU based OSMesa fails. Use GPU based GLX (X11).

Linux Debian - All works but see notes for OpenGL.

Debian 8.11 (VirtualBox 6.1.10)
- OpenGL Support (glshapes) : CPU based OSMesa and GPU based GLX (X11) works.
Debian 9.3 (VirtualBox 6.1.10)
- OpenGL Support (glshapes) : CPU based OSMesa and GPU based GLX (X11) works.
Debian 10.3 (VirtualBox 6.1.10)
- OSMesa crashes. Use X11 for OpenGL support

Linux Fedora - All works, but see note for OpenGL.

The bootstrap will now offer to add the rpmfusion.org RPMs and offer to add the GStreamer from rpmfusion.org. Without it snowmix_demo will fail to decode some of the codecs used.

Fedora Workstation 23 - All works (VirtualBox 6.1.10)
- For full value, you need to add packages from rpmfusion.org
Fedora Workstation 28, 29, 32 - All but OSMesa works (VirtualBox 6.1.10)
- For full value, you need to add packages from rpmfusion.org
- OpenGL Support (glshapes) : CPU based OSMesa fails. Use GPU based GLX (X11).

Linux Centos - CentOS works but with limitations.

Centos 7.6 (VirtualBox 6.1.10)
- Can compile and run, also OpenGL support for x11 and OSMesa.
- Missing gstreamer1-libav and aac codecs. As such it can not run the complete snowmix_demo as demo files contain AAC audio and H.264 video.
- As a remedy one can compile and installe the missing gstreamer-libav as well as the faac/fad for GStreamer.
Centos 8.1 (VirtualBox 6.1.10)
- You will need to enable PowerTools repo in the file /etc/yum.repos.d/CentOS-PowerTools.repo This is needed for OSMesa-devel neded for OpenGL support.
- OpenGL Support (glshapes) : CPU based OSMesa fails. Use GPU based GLX (X11).
- Missing gstreamer1-libav and aac codecs. As such it can not complete the snowmix_demo as demo files contain AAC audio and H.264 video.
- Will offer alternative way to install BWidget required for GUI Tools.
Centos 8.2.2004 (VirtualBox 6.1.10)
- Same as for CentOS 8.1

Linux OpenSUSE - All works but see note.

OpenSUSE Leap 15.1 All works, but see note. (VirtualBox 6.1.10)
- By default OpenSUSE does not include non-free (patent disputed) codecs such as AAC/H.264. These are required for the snowmix_demo. The bootstrap program will offer to add repos and packages that will fix this, If you do not say yes to adding repos and packages during running bootstrap, Snowmix will still compile and work, but the snowmix_demo will not fully work and you are on your own regarding support for the mentioned codecs. But you may not need them depending on what you want to use Snowmix for.
- By default the distro comes with the package gstreamer-plugins-cogl. See GNU bugs report log #39126

GStreamer element autovideosink does not work in VirtualBox (and possibly elsewhere) with cogl plugin installed. You will have to remove the package using this command:

sudo zypper remove gstreamer-plugins-cogl

Alternatively you can avoid using GStreamer element autovideosink al together AND change the VIDEOSINK setting in scripts/output2screen and scripts/av_output2screen to one of glimagesink, xvimagesink or ximagesink depending on your use and installation. The cogl may work on native hardware. Please test and report back.

Linux Mageia - All works

Mageia 7.1 (VirtualBox 6.1.10)

Linux Manjaro - All works except as noted.

Manjaro XFCE 20.0.3 minimal. (VirtualBox 6.1.10)
- OpenGL Support (glshapes) : CPU based OSMesa fails. Use GPU based GLX (X11).
- BWidget is currently not available as packages for Manjaro. The bootstrap program will offer to download and install BWidget in /usr/lib. BWidget for tcl/tk is required for GUI tools to work.

Linux Chakra - All works

Chakra 2017.10 (VirtualBox 6.1.10)

macOS - All works except for limited OpenGL Support. See note on this.

  • BigSur - No yet tested. bootstrap is prepared it may work.
  • Catalina - compile and works.
  • Mojave - compile and works.
  • High Sierra - compile and works.
  • Sierra - compile and works.
  • Yosemite - compile and works.
  • El Capitan - compile and works.
  • Mavericks - compile and works
  • Mountain Lion - compile and works:

OpenGL (glshapes) on macOS:

OSMesa (Off Screen Rendering - CPU based) works for all macOS version albeit it is slow (CPU based).

GLX (X11 Rendering - GPU based ) is fast, but require an X11 server for macOS. Snowmix has been tested with the free X11 server from XQuartz version 2.7.11 from the website for XQuartz.

GLX based rendering does not seem to work with macOS as guest OS on VirtualBox. Snowmix reports wrong pixel formats and may sometime crash. However it did earlier work on Yosemite and Quartz 2.7.something propbably 2.7.7 or earlier.

GLX has been tested with Sierra, XQuartz and running on a MacbookPro where it often works, but sometimes it does not. This require debugging beyond the scope of this release. So GPU based OpenGL does not work for Snowmix-0.5.1.1 on macOS (may work on older than Sierra).

Top

Including Support for embedded Python interpreter


The embedded Python interpreter introduced with Snowmix 0.5.2 is alpha code and must be specifically requested included at compile time. Python is not available for Snowmix 0.5.1.1.

To include support for Python, you must specify it to be included before compiling. The following command includes support for Python:

$ cd TO_WHERE_THE_SNOWMIX_CODE_TREE_RESIDES $ ./bootstrap $ ./configure --enable-snowmixpython --prefix=/usr/local --libdir=/usr/local/lib $ make clean $ make $ sudo make install

Note that on Mac OS X, the prefix should be /opt/local.

You can use the following command to list the flags you can set for the configure command after running the bootstrap command:

./configure --help
Top

Including Support for OpenGL 3D Graphics


Because Glshapes introduced in version 0.5.0 is still alpha-code in Snowmix version 0.5.2, 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 and newer, 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. 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 newer, 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.2

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, Yosemite, El Capitan, Sierra, High Sierra, Mojave, Catalina and possibly Big Sur. It might also work on older Snow Leopard, but it has not been tested.

Big Sur, Catalina, Mojave, HighSierra, Sierra, ElCapitan, Yosemite, Maverick and Mountain Lion

To compile Snowmix on OS X on Big Sur, Catalina, Mojave, HighSierra, Sierra, 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.

Big Sur, Catalina, Mojave, HighSierra, Sierra, 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.8.0, you may want to remove that version before running the bootstrap script.

When Xcode has been installed (and started to acknowledge various licenses etc. 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.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.1' >>~/.bash_profile $ echo 'export SNOWMIX=/opt/local/lib/Snowmix-0.5.1.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