Ccxstream - Xbox Media Stream Protocol
The XBMS Protocol
XBMSP (XBox Media Stream Protocol) or XBMS for short is another way of sharing media, supposedy it is faster than Samba. It is capable of streaming all types of media and gives the option of sharing individual folders or entire drives. XBMS is very bandwith efficient and it is a routable network-protocol which means that it is also ideal if you wish to stream over the internet, (just make sure you open the TCP/IP network-port 1400 in your firewalls on both both the server-side and the client side). For linux XBMSP support is provided by ccXStream. Once you install ccXStream on your LinkStation all you have to do is configure your XMBC to use the media share.
Ccxstream - compile from source
- Install the Precompiled C development environment, running on the LS
- Get the source tarball and compile
wget http://osdn.dl.sourceforge.net/sourceforge/xbplayer/ccxstream-1.0.15.tar.gz tar -xvzf ccxstream-1.0.15.tar.gz cd ccxstream-1.0.15 make cp ccxstream /usr/local/bin mkdir /usr/doc/ccxstream cp COPYRIGHT /usr/doc/ccxstream/ cp ChangeLog /usr/doc/ccxstream/ cp PORTING /usr/doc/ccxstream/ cp README /usr/doc/ccxstream/ cp TODO /usr/doc/ccxstream/ cp xbmsp-xml.txt /usr/doc/ccxstream/ cp xbmsp.txt /usr/doc/ccxstream/
COMMAND LINE OPTIONS
|-l address||Listen only given local address. Only one -l flag can be given. By default all local interface addresses are listened.|
|-p port||Listen given port (default is 1400).|
|-r directory||Use diven document root (default is current dir). If -S flags are present, it's often the best choice to use an empty directory as a document root. With option -r -user can create a virtual root directory into which the directories can be added with -S flag.|
|-u user||Run as given user. Give up the user privileges and run with as given user instead. You need to have root privileges in order to use this flag.|
|-P password||Require password authentication from the client. Only clients supplying the given password can use the server. The client can also pass an user name in the authentication
step, but it's ignored.
|-L||Follow symbolic links in the data directories. Normally symbolic links are not followed because of security reasons. This option overrides the default and more secure option.|
|-f||Fork process to background.|
|-F pidfile||Save pid number to given file. This is especially usable if the server is running in the daemon mode (-f).|
|-S mountpoint=dir||Show dir in the root of the fileserver as mountpoint. Multiple -S flags can be present.|
ccxstream -f -F /var/run/ccxstream.pid -P s3cre7 -r /u/documents -S video=/u/videos -S audio=/u/mp3
Run server in background and show directory /u/documents as a root directory of the server. In addition show directory /u/videos in as directory video and directory /u/mp3 as directory audio in the document root. All clients need to authenticate with password "s3cre7"
For security reasons symbolic links are not followed. Document root can however be a symbolic link. If you want to use symbolic link to point to a shared directory (-S flag) you can circumvent the symbolic link by adding /. to the end of the path. If for example /u/videos is actually a symbolic link pointing to a real video directory, you can use flag -S video=/u/videos/. instead of plain -S video=/u/videos that would not work with a symlink.
Create a startscript
#!/bin/sh # Start/stop the ccxstream daemon. # # Set SHAREDIR to directory you want to share # Set OPTIONS to other command line options you want SHAREDIR=/mnt/disk1/Music OPTIONS="-f -F /var/run/ccxstream.pid" test -f /usr/local/bin/ccxstream || exit 0 case "$1" in start) echo -n "Start services: ccxstream" /usr/local/bin/ccxstream -r $SHAREDIR $OPTIONS ;; stop) echo -n "Stop services: ccxstream" killall ccxstream ;; restart) $0 stop sleep 2 $0 start ;; *) echo "Usage: $0 start|stop|restart" exit 1 ;; esac exit 0
Change the script you just created into a executable file
chmod a+x /etc/init.d/ccxstream
Add to startup and shutdown if you want it to start on system startup
cd /etc/rc.d/rc2.d ln -s ../init.d/ccxstream S75ccxstream cd ../rc0.d ln -s ../init.d/ccxstream K02ccxstream cd ../rc6.d ln -s ../init.d/ccxstream K02ccxstream
Start the ccxstream daemon/etc/init.d/ccxstream