For those of you who want to use OpenSolaris[7] as an alternative for Linux, music and videos playback is essential. In order to do that, installing mplayer[1] (and probably xmms[2]) is a must. I couldn’t find any pre-compiled packages that would actually work on my system, so I had to compile them. Moreover, compiling MPlayer graphical user interface (GUI) is also important.

I used OpenSolaris 2008.11 running on i386 system on 32 bits.

Installing necessary packages

First of all, I needed to install the compiler and the compiling tools: gcc, gmake and gawk. The first two can be found in the opensolaris.org repository. I got the last one from the Blastwave[8] repository.

I noticed that Midnight Commander[9] was not installed. This program is very important to me, so I decided to install it.

$ pfexec pkg install SUNWgnu-mc

As a first step, I added Blastwave to the repositories list

$ pfexec pkg set-authority -O http://blastwave.network.com:10000/ Blastwave

The second step was to install the compiler packages

$ pfexec pkg install SUNWgcc SUNWgmake IPSgawk

Next, I needed to install some libraries, mostly used for the GUI (gtk, glib, iconv, etc).

$ pfexec pkg install SUNWGlib SUNWGtk SUNWgnome-common-devel

The last thing I did was to install some headers used for compilation (usually called the devel packages in Linux).

$ pfexec pkg install SUNWsfwhea SUNWaudh SUNWxorg-headers

Some configuration was still necessary. It appears that pkg-config is not configred when it is installed. I had to set the PKG_CONFIG_PATH myself.

$ export PKG_CONFIG_PATH=/usr/lib/pkgconfig

Next, I had to change the PATH variable a little. It seems that awk provided by SUN[10] with OpenSolaris is different from the GNU[11] version, so I had to change the PATH so that the compiler will get to the GNU version first (and use it).

$ export PATH=/opt/csw/bin:$PATH

Downloading XMMS and MPlayer source

I downloaded XMMS and MPlayer source code from their respective websites. None of of them has a special source code for Solaris so I used the default Linux version.

  • XMMS 1.2.11[4]
  • MPlayer latest svn snapshot[5]

After downloading, I unzipped the source codes into ~/sources/ (~ has the meaning of the home folser, located on my computer at /export/home/alex).

Building MPlayer

Before running the ./configure script, I had to change it a bit. Mplayer uses install utility to install itself into the system. The only problem is that the version supplied by SUN is different from the GNU one that can be found on Linux. To solve this, I changed ./configure so that it would use ginstall (_install=install was changed into _install=ginstall).

Another modification that I had to make in ./configure is deleting a some lines with some -rdynamic option.

./configure: line 508: _install=ginstall

./configure:line 7705:#if test …     <- comment these lines

./configure:line 7706:# …

./configure:line 7707:#fi    <- until here

Configuring MPlayer was very easy. I enabled the GUI, the OSD Menu and the Real Player codes. Suprisingly or not, OpenSolaris does not have /usr/local/bin in the default PATH. Not to modify the PATH settings, I chose to set the prefix in /usr/gnu as most of the Linux programs are installed there.

$ ./configure –prefix=/usr/gnu –enable-gui –enable-real –enable-menu

For building MPlayer, I have used gmake instead of make for the same reason mentioned before: SUN‘s tools are different from GNU‘s.

$gmake

Building XMMS

XMMS was somehow more difficult to build. It seems like some part of the mpg123 code used form mp3 decoding cannot be made position independent under SunOS code style. This is why I had to make some changes in ./configure by specifically telling the compiler not to build SunOS or Solaris code style.

./configure: line 33414:       *-*-netbsd* | *-*openbsd* | *-*-solaris* | *-*-sunos*)

Configuring XMMS was pretty straight forward. As for MPlayer, I chose as the installation folder /usr/gnu.

$ ./configure –prefix=/usr/gnu

As for MPlayer, I built used gmake for building.

$ gmake

Installing

Once the compiling of the two programs was done, all that was left to do was installing both of the programs and downloading a skin for MPlayer GUI.

In order to install the programs into the system, I had to login as root.

$ su –

The actual installing of XMMS and MPlayer is done by running gmake install (in each of the two source folders). Please keep in mind that it is very important to be logged in as root, otherwise you cannot write into /usr/gnu.

# gmake install

The last step was downlaoding a skin for MPlayer GUI. I chose the standard skin, that can be found on MPlayer‘s download page. The skin comes as an archive with a folder have the skin’s name inside it. The content of the archive has to be copied into /usr/gnu/share/mplayer/skins. Just rename the folder (with the name of the skin) into default. You should have a folder like this:

/usr/gnu/share/mplayer/skins/default

Running XMMS and MPlayer

One of the downsides of XMMS and MPlayer in OpenSolaris is that after installation, they will not appear in the Graphical Desktop Environment menues. You can run them by thyping xmms or mplayer (gmplayer for GUI) in the run window. You may also create some launchers in the panels.

$ xmms

$gmplayer

When using XMMS, please be sure to set the output pluign to Solaris audio plugin, as OSS driver will most probably not work.

Problems

There are still some problems that I couldn’t fix.

For XMMS, the OSS driver did not work. The problem was solved by choosing the Solaris audio plugin as output.

For MPlayer, the font encodings for the subtitles do not work. I still get en error:

subtitle-font: prepare-charset failed.

iconv doesn’t know ucs-4 encoding. Use the source!

If anyone knows how to fix this, please leave me a comment.

Enjoy.

Links

  1. MPlayer, www.mplayerhq.hu
  2. XMMS, www.xmms.org
  3. Compiling MPlayer on OpenSolaris 2008.05, http://blogs.sun.com/lewiz/entry/compiling_mplayer_on_opensolaris_2008
  4. XMMS Source code, version 1.2.11, http://alex.ipworkshop.ro/download/opensolaris/xmms-1.2.11.tar.bz2 (the version with the ./configure modified is available for download)
  5. MPlayer svn snapshot, http://alex.ipworkshop.ro/download/opensolaris/mplayer-checkout-snapshot.tar.bz2 (the version with the ./configure modified is available for download)
  6. MPlayer standard skin, http://alex.ipworkshop.ro/download/opensolaris/standard-1.9.tar.bz2
  7. OpenSolaris, www.opensolaris.com
  8. Blastwave, www.blastwave.org
  9. Midnight Commander, www.midnight-commander.org
  10. Sun Microsystems, www.sun.com
  11. The GNU Operating System, www.gnu.org