ShellFM Wrapper

About

ShellFM Wrapper is an Enigma 1 plugin to use ShellFM on Enigma 1 based DVB boxes. As obvious by the naming this this plugin wraps ShellFM using STDIN and STDOUT.

The main window

main.jpg

The basic tasks like ban, love are skip are directly mapped to
buttons of the remote control.

The function menu

menu.jpg

All other shell-fm tasks can be selected from the function menu

LCD display

lcd.jpg

Basic stream information like title, artist and the remaining runtime of the title are also visible on the LCD.

How to install ShellFM warpper

There are two ways to use ShellFM wrapper.

  1. Install percompiled binaries
  2. Compile and install your own binaries

Precompiled plugin and binaries

As this is a wrapper only you need the plugin as well as the precompiled shell-fm (shell-fm-0.6.tar.gz) for the dreambox. This tar also includes the madlib and libao libraries you need to run shell-fm on the dreambox. Libao loads the OSS plugin (library) dynamically at runtime. By default the prefix for the libao plugins is hardcoded at compile time. To avoid problems when moving shell-fm to another directory libao in this tar has been patched. Thus you can export an environment variable called AO_PLUGIN_PATH now to set the prefix for the plugins accordingly.

So that's how it works:
* FTP the file shell-fm-0.6.tar.gz to your box (e.g. /var/tmp
* Now run the following:

cd /media/usb
gzip -cd /var/tmp/shell-fm-0.6.tar.gz | tar xvf -

* Edit /media/usb/shell-fm/shell-fm.rc and configure at least the following three parameters:

username = <your last.fm username>
password = <your last.fm password>
default-radio = <your default last.fm radio station>

Example
username = scott
password = tiger
default-radio = user/scott/personal

Please ensure that there is a blank at both sides of the equal sign

* If you decided to install shell-fm somwehere else on your dreambox please adjust the variable SHELL_FM_HOME in shell-fm.sh accordingly.

* You may have a try with shell-fm at the command line first:

cd /media/usb/shell-fm/bin
./shell-fm.sh

* Install the plugin as you usually do install any plugin on your dreambox.

* Edit the plugin configuration file shell-fm.cfg and amend the parameter shellfmbase if you installed shell-fm und the libraries to a directory other than /media/usb/shell-fm.

* Start the plugin and enjoy listing to your favorit last.fm stations

Build your own plugin and binaries

Thats what you need

  • The current ShellFM source code
  • The tuxbox patch for ShellFM to patch ShellFM al litte for the tuxbox. Jonas already built a temporary dreambox branch of shell-fm. The code will be merged into the master branch soon. However you migth want to use the dreambox branch instead of patching the master branch on your own.
  • The ShellFM Wrapper source code.
  • The CDK for Enigma

Install the CDK

Crosscompile and Install the plugin

  • Install the wrapper installation source to <CVSROOT>/dm7000/apps/tuxbox/plugins/enigma/shell-fm
  • Edit configure.ac in <CVSROOT>dm7000/apps/tuxbox/plugins/configure.ac and Makefile.am in <CVSROOT>dm7000/apps/tuxbox/plugins/enigma/configure.ac to include the shell-fm plugin (check http://wiki.dbox2-tuning.net/wiki/index.php/Plugins:Tutorial for details)
  • Change to <CVSROOT>/dm7000/cdk and compile the plugin:
rm .plugins
make .plugins

You will find the compiled plugin as follows <CDKROOT>/dm700/root/cdkroot/lib/tuxbox/plugins/shell-fm.so. You may want to strip the shared library to reduce the size from about 1MB und 100K (strip shell-fm.so).
  • Install the plugin to /var/tuxbox/plugins
  • Do the same with the configuration file shell-fm.cfg
  • Ensure that the shellfmbase is set correctly in the configuration file, as this parameter points to the basedirectory used by shell-fm

Crosscompile shell-fm for the dreambox

  • You can use the crosscomplier which you already installed as part of the CDK above
  • Create a small script called ppc_env to set the environment accordingly:
CDKBIN=<full path to root/cdk/bin>
CDKROOT=<full path to root/cdkroot>
CDKFLASH=<full path to root/cdkflash>

export CPPFLAGS="-I${CDKROOT}/include -DPPC -DTUXBOX -DWORDS_BIGENDIAN -I/media/usb/lastfm/include"
export CFLAGS="-I${CDKROOT}/include -DPPC -DTUXBOX -DWORDS_BIGENDIAN -I/media/usb/lastfm/include"
export LDFLAGS="-L${CDKFLASH}/root/lib -L/media/usb/lastfm/lib"
export ARCH=ppc
export CROSS_COMPILE=powerpc-tuxbox-linux-gnu-
export PATH=$CDKBIN:${PATH}
export CPP=$CDKBIN/powerpc-tuxbox-linux-gnu-cpp
export RANLIB=$CDKBIN/powerpc-tuxbox-linux-gnu-ranlib
export LD=$CDKBIN/powerpc-tuxbox-linux-gnu-ld
export AR=$CDKBIN/powerpc-tuxbox-linux-gnu-ar
export CC=$CDKBIN/powerpc-tuxbox-linux-gnu-gcc
export CXX=$CDKBIN/powerpc-tuxbox-linux-gnu-g++
export CXXFLAGS="-I${CDKROOT}/include"
  • source ppc_env
. ppc_env
  • Patch libao's audio_out.c file using the this patch.
  • Go ahaed and build libao and libmad using the crosscompiler
  • Apply the tuxbox patch to the shell-fm source (or use the dreambox branch) and crosscompile shell-fm for your dreambox
  • Copy the shell-fm binary as well as the libraries to your dreambox
  • Configure shell-fm and shell-fm-wrapper as advised above
  • Enjoy last.fm using your selfbuild shell-fm and shell-fm-wrapper

License / Disclaimer

ShellFM Wrapper is published under the terms of the GNU General Public License (GPL). That means, it comes with absolutely no guarantee, but you may use/modify/redistribute it under the terms of the GPL.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-NonCommercial 3.0 License