Association Subscribers Manager and Open source stuffs

To content | To menu | To search

Tag - Linux

Entries feed - Comments feed

Sunday 1 August 2010

How to build a cheap yet powerful media center

Hi all,

this post will give you my recipe to build a cheap and powerful GNU/Linux based media center. I am perfectly aware of the fact that many tutorials and howto exists around the interweb and certainly explains things far better I will do. Anyway this one could be of any use to you, the g33k with many spare parts left over from your previous computer.

This post will be updated as time pass. Indeed I have not yet all needed parts to build my ultimate media center, and I will make this howto as comprehensive and complete as possible.

Some context

Context is useful for you to see if you can learn something for your own use from this post, so :

I have many of my old computers at home, some are used as servers, some are my sandboxes, etc. I have one specifically which is a file server (NFS+Samba). It is mainly used to store multimedia content (family pictures and videos, movies, music, etc.). At this point, my thoughts were : "and what if I connect it to our TV set ?". So be it ! After some test and researches on the web, I came with the idea of using XBMC as it is by far the most advanced and optimized one. I will develop the media center software choice later.

The computer I talk about is a pretty old one : AMD Athlon XP 3000+, ATI Radon HD 3650 (AGP), 1 GB RAM. You can tell  that I can't play 1080p movies with this settings. That is not a problem since it just to validate the concept that I use this computer. I mention it because their is still things to learn from this one.

A word about interoperability and "user friendliness" : we have GNU/Linux and Mac OS X computers at home. So the file server shares directories with NFS (files) and Samba (files and printers). We also want to access multimedia content through our mobile devices (EeePC with Fedora 13, Android devices, iPhone and MacBook Air). Multimedia content is shared in DLNA through uShare.

To sum this up : we pretty much want a full feature all inclusive media box connected to our TV set and accessible from any devices on the home network.

1 - Choice of a media center software

This is the tricky part : you have to figure out you needs, and like all clients in the world you don't know what you really want :-)

Let me help you with my list to that big old Santa. I want to :

  • play all my multimedia content (photo, movies, music) on my TV set (far bigger than my computer one) ;
  • be able to put and retrieve (multimedia) files on my file server ;
  • be able to watch my last Fairy Tail episode on my Nexus One from the bottom of my bed ;
  • allow my Apple fan girl of wife to enjoy all those features on her damn closed Apple's products ;
  • share the home printer/scanner ;
  • enjoy online content like YouTube or Shoutcast radio ;
  • read my RSS feeds on my TV set (geek inside) ;
  • read my email on my TV set (the geek always strike twice).

Moreover, I have to think that the computer I use to validate the usefulness of this media center is a old one. So I want a really optimized software to be able to enjoy at last 720p movies.

Important point : I don't care about watching TV. I have a HD optic fiber connected set top box from my ISP that do this job very well, I don't want to double or replace those features. I only want a single point of entry for all the medias that are stored across my home network.

With this list in mind what are the media center software that are available to fulfill my needs ? It is important to note that I want an all integrated solution : no customization of VLC or MPlayer, no KDE desktop (as beautiful it is) with shortcuts to media directories and media players. I want something that do all my required features in one place and I want to be able to boot on it directly.

Elisa / Moovida :

I tested Elisa some time ago and I liked the interface and features available, so I went and tested it again. The interface is quite nice and it does pretty much all what you want/need from a media center. Problem is : for GNU/Linux distribution their is no packages nor sources available for version 2.0 (only 1.0.9 available). Their is one more issue to me : it is absolutely impossible to use it on my "pre-prod" computer. It is super slow (maybe Python have something to do with that ^^) and I can't even play the standard DivX (no high resolution, only standard SD movie).

So it was a no go for this one.

GeexBox

GeexBox is a media center I discovered during my quest for the ultimate media center application. This one literally rocks ! It have unique features that makes it fit my needs almost perfectly : it is able to share its content through UPnP, it can play many multimedia content, it supports SHOUTcast and NFS, it also have a unique feature : bookstore. This one allows you to read on your TV set (or whatever monitor you plug to your media center box) online content like onemanga.com. Please note that GeexBox is a full distribution, to get the media center only you want to look at Enna.

I like the interface and the features so this one could do it. But there some issues : not being able to share content with anything else but FTP is a big missing feature in my use cases. GeexBox could also be really improved by adding a plugin system (at least, I am not aware of any plugin system in GeexBox).

A special mention goes to this media center since it provides many tools for others to works great (like libdlna, uShare, etc.).

XBMC

Now for XBMC. As you read before : this is the one I choose. It can do every single thing I wrote in my whish list ! It is a really feature rich media center, and thanks to its extension system it can be made even more feature complete ! It looks like the perfect software to me : easy to use and beautiful (my wife will like it !). It is also highly tunable and extensible (lil' geek inside already like it !!). Over all, XBMC have gorgeous themes that makes it a very nice choice for something that is in the middle of my lounge. Have a look to the Confluence default theme, to the Aeon theme or to the theme/skins gallery. XBMC also have a really useful feature in my context, it is called XBMC standalone. When you use this mode, XBMC acts as a window manager. Use this with auto-login and you will have something really user friendly (I start my media center as I would have start my Blu-Ray player).

On the performance side, even if the Aeon theme is not really usable on my pre-prod configuration (it is full HD 1080p so I never expected it to works anyway), the Confluence default theme runs just great. Even the last development version taken from the SVN runs smooth (I had to tweak the compilation process a little but I'll describe this later).

Freevo

It would not be fair not to mention Freevo. It looks like an excellent media center... but I have not test it. Why ? Because I might have do a little segregation against it : as soon as I saw "Python powered" it reminded me the Elisa/Moovida experience. So in fear of bad performances I did not test it. That said, from what I can see on the website it recommends only NVidia cards and I have an ATI/AMD one. There is few screenshots available (note to the Freevo team : you should really makes more screenshots your challengers are well recognized and provides there future users with many medias to tease them) and from what I can see it is much less appealing than XBMC or GeexBox (even if it is the GeexBox team that made the main theme for Freevo).

In the other hand it seems to be very feature rich, actually it is probably one of the most feature rich Open Sources media center. No wonder why it is widely used. With a nice interface like XBMC for example (OpenGL, etc.) it would be the killer choice (given the fact the performances are corrects). Do not restrain from trying it, it looks like it will do a lot of good for you. The documentation is a bit outdated (with OpenSUSE don't bother reading it if you have packman repository it is packaged).

Final choice

Like I said previously my choice goes to XBMC for both features and a very appealing UI. Moreover the HTTP remote control, Android remote and iPhone remote allows me to drop all mouses/keyboards.

2 - Installing XBMC

Now that the one have been chosen, we need to install it. On GNU/Linux based distributions you always have two options : the easy way and the hard one.  Let's go through both of them.

The easy way: use your GNU/Linux distribution's package manager

So you are a sweet one, you want to go the easy way ? Ok let's see what you have to do. First you want to go to the page that is dedicated on Linux installation on XBMC wiki. But since, I am a nice guy let's see how to install it on OpenSUSE (10.3) and Fedora (13).

Let's start with Fedora (the easiest), simply type :

sudo yum -y install xbmc

That's it ! Off course you can do it with your favorite yum UI too. Last time I checked though, the HTTP remote control was not enable... Quite a bit of a problem to me and my Android remote...

For the OpenSUSE it's almost as simple, you just have to ensure that you enabled the packman repository. If not, go to Yast2 -> Manage repositories/sources (or whatever the real name is...) -> add a community repository -> select Packman in the list. By the way this is also here that you get some nice repositories like AMD and NVidia's proprietary drivers for your video card (that you need to run XBMC properly). Once this is done just type :

sudo zypper in xbmc

And you are good to go. Obviously, you can also stay in Yast2 and install XBMC from the UI. Who said Linux was complicated ?

The hard way : compile it yourself

Ok, you're a tough guy, ye' wanna go fer da hard way. You're damn right : bounty earned in suffering tastes better ;-)

Actually, XBMC is not that much of a problem to compile... Given the fact your CPU support SSE2 instructions... which is not the case of my old Athlon. Anyway, I prefer the SVN version over any sources because it's more unstable... Hu, I mean : because you got cutting edges developments. One of the things I wanted from the sources was VDPAU rendering (please note that official sources do it very well too, you are not forced to use SVN version). This allow us - NVidia accelerators owners - to use the specially optimized hardware acceleration in XBMC. It makes a huge difference with your typical SD DivX. So... without further ado, here is a step by step howto get and compile XBMC from sources.

The GNU/Linux distribution used is an OpenSUSE 11.3 installed from KDE Live CD. This precision is for the dependencies : you might not need to install them all. Anyway, you should read XBMC's official HOWTO compile XBMC it have many distributions specific howtos and it covers 64 bits compilation that I don't. The following guide is a super-quick super-condensed version. So, first things comes first : install the required dependencies :

zypper in make cmake autoconf automake gcc gcc-c++ boost-devel python-devel python-sqlite2 dbus-1-devel gperf gcc-fortran unzip zip unrar nasm libavahi-devel  SDL-devel SDL_image-devel SDL_mixer-devel jpegint-devel audiofile-devel fontconfig-devel freetype2-devel fribidi-devel glibc-devel hal-devel libbz2-devel libstdc++-devel libexpat-devel glib2-devel libjasper-devel libjpeg-devel mad-devel libmikmod-devel libmms-devel libogg-devel nvidia-vdpau-devel libopenssl-devel sqlite3-devel libstdc++-devel libpng-devel libtre-devel e2fsprogs-devel libvorbis-devel lzo-devel pcre-devel libenca-devel libpulse-devel libfaac-devel ccache xorg-x11-devel Mesa-devel dbus-1-devel glew-devel alsa-devel libmysqlclient-devel libcurl-devel zlib-devel xmms-devel ftgl-devel libcdio-devel libtool libsamplerate-devel libfaad-devel flac-devel libsmbclient-devel libtiff-devel enca-devel libwavpack-devel libmpeg2-devel libmicrohttpd-devel libmodplug-devel libdvdcss-devel  yasm yasm-devel libass-devel libtool gettext gettext-devel libmad0 libmad-devel

Of course, nvidia-vdpau-devel is only in the case you own a NVidia 3D accelerator. 

From SVN trunk

Checkout XBMC sources from SVN (at the moment I write this post you can read the following sentence on XBMC's irc channel on Freenode: "Addons branch merged, stay <= r28276 for a while! You've been warned!") :

svn co https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk/ xbmc/

Once this is done, cd into the newly created xbmc/ directory and boostrap the sources :

./bootstrap

Then it's time for configure :

./configure --enable-mid --disable-debug --disable-pulse --prefix=/usr --enable-ffmpeg-libvorbis --disable-ccache  --enable-vdpau

Again, VDPAU is for NVidia users only. Use this switch if you want XBMC to use the NVidia boards' hardware acceleration. Once configure is done, build the code :

make -j3

The -jX option ask make to run X concurrent jobs, usually you set the number of your processor core plus one (on my Core i7 with 4 hyperthreaded core, I will use -j9 for example). You are now ready to install XBMC :

su -c "make install"

And you are done ! The only thing that still remains is to configure your box to log in automatically on XBMC and to configure XBMC to your tastes.

A note for people with hardware that don't support SSE2 instructions (like my Athlon 3000+), you have to disable SSE2 support in libsquish the quick (and dirty) way is to comment the SSE2 instructions usage in the xbmc/lib/libsquish/Makefile.in file.

From SVN Dharma branch

Checkout the Dharma branch :

svn checkout https://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/Dharma

And everything else is the same that for the trunk. At the moment, I strongly advise you to use this branch over the trunk !

3 - Some configuration / Hints

This part is not meant to be exhaustive, I will just give hints but I will not go through all XBMC's options and I will not explain how to do things on 350 GNU/Linux distributions (go to XBMC wiki for that ^^).

3.1 - File server / organization

In my case the media center is also a file server, I use Yast2 to configure Samba and NFS to do the job. I have a user (mediabox) which is dedicated to the media center purpose. In his home directory I have a Medias sub-directory which looks like that :

Some explanations might not be required but I'll give them anyway :

  • Images : main folder for all our pictures
  • Incoming : unsorted media files
  • Music : all the music we have
  • Users : a storage directory for home network users
  • Videos : quite obvious... this is were we put videos (DVD/BR rips, vacations movies, etc.)
This Medias directory is the one shared on our home network.

3.2 - XBMC

OpenSUSE allows me to specify a user to auto log-in, I choose my mediabox user and, that is a wonderful feature of XBMC, I choose xbmc-standalone as default session. Now I can boot my media box like I boot my bluray player (well my box is actually more quick to boot that my BR player...).

In XBMC you have to add location for your multimedia content, for example for videos I have a Movies folder, go to the video item, push right (on your keyboard or remote), choose "files" and browse to select the "Movies" folder (or whatever yours is). Then select a category (Film in my case) and a scrapper, don't forget to check the "auto scan" and "recursive scan" box. I tend to prefer IMdb of thetvdb for movies. This possibility is amazing because you can set a scrapper per folder. In my case I have standard English spoken movies and French movies. I use a different scrapper for French movies (Cine-passion) for better metadata. Do the same for all your multimedia content (if you watch animes, try the ANIdb.net scrapper ^^).

In case no metadata or episodes are found for your series, please remember that XBMC needs your series episodes torespect one of those naming conventions :

  • Serie Name - S<Season number>E<Episode number>.<extension>
  • Serie Name - <Season number>x<Episode number>.<extension>
For example, the Death Note episode 3 should be name either "Death Note - S01E03.mkv" or "Death Note - 1x03.mkv".

If your movies are not correctly detected, put them in a directory (the name doesn't really matter) that contains your movie and a file with the same name as your movie but with nfo extension and put the IMdb link to this movie in the nfo file. For example, I put beowulf.mkv into the beowulf folder together with the beowulf.nfo file that contains the correct link to IMdb... Because in this case a particularly sad misunderstanding could occur...

3.3 - Remote control

A word now on remote control, XBMC can be controlled by external programs. I personally use the official XBMC Android Remote, this one have many feature, is officially developed by XBMC developers (many thanks to them !) and even if it is still a beta it is really stable and efficient. On iPhone, there is no equivalent but there is some nice stuff too. For example the highest rated one (when you search for xbmc remote in the AppStore) is not free but is almost as good as the Android version (not quite though). 

You can get the XBMC Android Remote on the market. Here is the QR-Code :

You can also remote control your XBMC by pointing your browser at your media center's address on the port you selected in XBMC settings (default: 8080).

4 - Building a cheap hardware base

Now that we have the software and since my pre-production install proved to me that the concept was worth the effort, it is time to build a decent box to use this and play all my multimedia content !

My main concerns for this box are :

  1. cost efficiency (less than 350 € is a requirement)
  2. performances (we want to be able to play HD content)
  3. silence
Although I tried to make the box relatively small it was not in my main concerns list (I already have many computer at home so... one more, one less...).

One of my point was to re-use some of my existing (but not used anymore) parts (like the spare NVidia GeForce 8800 GTS2 I have or the two 2TB seagate barracuda that are in my desk). So far what I needed was : a case, a motherboard, a CPU, some RAM memory and a silent power supply. I already own the other parts (but don't worry I will give you some hints with the price of those parts if they were to buy).

My hardware supplier is the excellent webmerchant Materiel.net, if you are not in France or Belgium you cannot use them but the prices should not change that much. So here we go :

Motherboard + RAM + CPU : upgrade kit (Intel Pentium E5400 2,70 GHz, MSI P45T-C51,2xG.Skill 1 GO DDRII PC6400) => 182.99 €
Power supply : Cooler Master Silent Pro 500W => 72.49 €
Case : Fractal Design Define R2 => 92.49 €
------------------------------------------------------------------------------------------------------
Total : 347.97 € (Google says ~ 460 US $)

The case is a bit of a luxury item but silence being on my top 3 concerns it is worth the price. If you have to buy a HDD and a video card I will advice you to choose the WD Caviar Green 1TB (62.99 €) and the Asus EAH5450 Silent (74.99 €). Both of them are silent, powerful enough for a media center and power efficient (spare your power tab ^^). In this case the box is a little bit expensive (if silence is not much a requirement for you, you can save some money on the case and video card) but it is still less than a pre-made box of this type. Moreover this box will be a file server, other cannot be that easily transformed into a file server.

5 - Conclusion

While it took some time to write this post, it is not that long to have this kind of media center up and running. I cannot imagine go back without now that I have it, I digitalize all my content and watch everything from my anime to my baby picture on it. Moreover, if your box is makes enough silent, believe me the Women Acceptance Factor is quite strong (given the fact you wife/girlfriend like to watch multimedia content).

I will update this post with more hints if asked in comments and I will add a description of our real usage of this after a week or two using it.

I hope you will enjoy reading this post as much as I enjoyed writing it !

Arnaud Dupuis

Wednesday 9 December 2009

How to install Google Chrome on Slackware 13 GNU/Linux

Hi,

The topic have been treated already on the internet but since the official build of Google Chrome only landed few hours ago, some extra informations and "re-post" cannot be bad.

So ! Google Chrome is not packaged for Slackware GNU/Linux distributions, well... That's not completely unexpected. And it is not packaged as a universal GNU/Linux binary either, which is more troublesome. Anyway here is my 2 ways to install Google Chrome on Slackware 13.

Important: I made everything on my EeePC (since I'm currently in holidays snowboarding in the French Alps) which runs a Slackware 13 x86, but everything should be exactly the same on Slackware64. I also have to warn you about my own install method : it's dirty and not especially quick ;-)

Method 1: 

My own method, it's what I used to install Chrome as soon as I got the Google's email telling me the beta version of Chrome official Linux build was out in the wild ! So it's pretty dirty, and not the quickest way to do it. It's how I installed it even before thinking about looking at the web to see if something have been done by somebody else. You have been warned.

So first, download the Fedora RPM (32 or 64 bits), then run rpm2tgz :

su -c "rpm2tgz google-chrome-beta_current_i386.rpm"

Then install the resulting package. Do not waste your time to launch it, it will not start. For me the first reason is : I have not installed seamonkey and I miss the libnss3, so a quick sprint to slackbuilds.org and I had the mozilla-nss package installed (compiling and installing a package from a slackbuild script is very well documented on slackbuilds.org).

Almost, but it does not launch... The  reason is, some poor links against libnss3. Well, at this point, I know I will not back off ! Let's shoot some ln shots !

ln -s /usr/lib/libnss3.so /usr/lib/libnss3.so.1d
ln -s /usr/lib/libnssutil3.so /usr/lib/libnssutil3.so.1d
ln -s /usr/lib/libsmime3.so /usr/lib/libsmime3.so.1d
ln -s /usr/lib/libssl3.so /usr/lib/libssl3.so.1d
ln -s /usr/lib/libplds4.so /usr/lib/libplds4.so.0d
ln -s /usr/lib/libplc4.so /usr/lib/libplc4.so.0d
ln -s /usr/lib/libnspr4.so /usr/lib/libnspr4.so.0d

If you are running a Slackware 64, just replace /usr/lib/ by /usr/lib64/ and if you are using this way to install Google Chrome, bookmark this post to be able to clean your system ;-)

If you are not very fond of the manual linking (you are a wise person), please follow the Method 2 !

Method 2:

Well, the result is the same : you will get a working Google Chrome. The path to this result is considerably easiest and quickest (given the fact you have libnss3 on your system) :

Go to slackbuilds.org and get the Google Chrome slackbuild, install it (please refer to Method 1 for the link to the howto use a slackbuild).

That's all !

As a conclusion I would say that there is the equivalent of Method 1 for the Debian 5 package, but the Slackbuild do it better than I care to explain ;-)

Enjoy Google Chrome and do not hesitate to give your feedback on it in the comments. So far for me, the difference in performance and CPU usage with Firefox on my EeePC is amazing ! I could barely run 4 tabs in Firefox, and look at the screenshot ! With 9 opened tabs it's still amazingly fast  ! I will benchmark it against Fennec soon !

Arnaud Dupuis

Monday 8 June 2009

How to get the version number of your Slackware distro ?

Hi,

This question seams to bother some peoples because it is one of the top queries which leads geeks from Google to my blog. So since, I don't want to let this question unanswered here is one answer :

In a terminal, type:

cat /etc/slackware-version

Although it is not very reliable if the Slackware is in sync with current or current64.

That's all for today, see you later.

Arnaud Dupuis

Tuesday 24 February 2009

I've got a new toy : an Asus Eee PC 1000h !!

Hi all,
Indeed I have a new geek-toy : a brand new Asus Eee PC 1000h ! Woohoo !
Unfortunatly even if Asus is manufacturing this computer with Xandros Linux the stupid Asus France do not ship it in France... The only operating system available is ... sorry I can't write it here (but it is finishing by XP).
So I am now fighting with Asus France to get those licences reimbursed.

With all that said, it's a wonderfull little computer ! I installed (almost flawlessly) a Slackware 12.2 on it and it works just fine. I have a KDE 4.2 working very well with compositing and all the fancy things ! Really it is an amazing computer.
The only thing that was bothering me is the hotkeys... Only the one controlling screen brightness were working, so I wrote a new acpi handler to extends basic Slackware one. I made a Slackware package from this one and I will post it here (and/or I will create a Freashmeat project).

I will come back soon with a HOWTO to install Slackware 12.2 on Eee PC 1000h, it's nothing difficult since almost everything is supported out of the box by the kernel-huge-smp (actually very few things needs to be be compiled by hand). I would like to come with a super-optimized kernel config file for 2.6.28 Linux kernel.

See you soon,

Arnaud Dupuis

Tuesday 30 October 2007

slack-get feature highlights #1 : managing the install medias

Hi !

Today I'm introducing a new kind of post : the slack-get functionality highlights. What is that ? Well once a week (or more often maybe) I will introduce and explain a specific functionality of slack-get.
It can be in sg_daemon, or slack-get tools (CLI or GUI). It can also be some nice features of one of the slack-get libraries (slackget10 Perl module or the upcoming C++ one).

Enough introduction ! Today's highlight is about the media management system. Before everything, please note that all the examples in this diary will work on all slack-get version >= 1.0.0_pre-alpha1

How do slack-get manage its media and how the daemon choose to download a package from a server or another ? This is indeed a good question because there is very few documentation about this feature.... my bad :(
So.. slack-get use a configuration file called medias.xml where all medias are listed. This file is a XML one (as suggested by its extension...), and look like that :
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<medialist>
    <media id="media1">
       // lets forget this part for now
    </media>
    <media id="media2">
       // ...
    </media>
</medialist>



Quite easy to understand isn't it ? there is a media list which contains a list of media... fair enough :)
Now what about the <media></media> entity ? It's basically THE basic entity for all media you want to use as an install source.
As I write this, you can have 3 types of media :
  • http ones. For all repositories you access via the http protocol ;
  • ftp ones. For... yes : all the repositories you can access via the ftp protocol ;
  • file ones. That's the general one. You can use it for installing Slackware packages from your Slackware DVD, from a NFS drive or any other repository which can be seen as "local filesystem" by your system.
The structure of the XML entity <media></media> look like that :
<media id="a_media_id">
    <files>
        <filelist>FILELIST.TXT</filelist>
        <checksums>CHECKSUMS.md5</checksums>
        <packages>PACKAGES.TXT.gz</packages>
    </files>
    <update-repository>
        <faster><!-- an URL --></faster>
       <fast>
          <li><!-- an URL --></li>
          <li><!-- another URL --></li>
       </fast>
       <slow>
          <li><!-- an URL --></li>
          <li><!-- another URL --></li>
       </slow>
    </update-repository>
    <description>The description of this media.</description>
    <web-link>http://www.mysite.org</web-site>
</media>


The <files></files> entity gives the name of the files which actually contains the wanted informations. there is 3 informations wanted :
  1. the list of the repository files ( usually in the FILELIST.TXT file ) ;
  2. the list of the files checksums ( usually in the CHECKSUMS.md5 file ) ;
  3. the detailled list of packages ( usually in the PACKAGES.txt file ).
the slackget10 Perl module compile all those informations in a single file ( called installed.xml, we will discuss about it in another "slack-get functionality highlights" issue ).
You can say here if you prefer to download the compressed version if exists and if the repository is not really standard (file name in lower case for example) you also have more flexibility here.
I got emails from a bunch of peoples who even used the old slack-get daemon (slack-getd) to install red hat packages ! Which means one thing : you can do more than I coded with slack-get :D
Actually, it's not hard to modify the initial way-of-doing-things of slack-get, you just have to replace some of the Perl modules.

Let's see a simple example : adding the Slackware 12.0 DVD to the media list.
First open the medias.xml file with your favorite editor, then add the following :
    <media id="SlackDvd12.0">
        <files>
            <filelist>FILELIST.TXT</filelist>
            <checksums>CHECKSUMS.md5</checksums>
            <packages>PACKAGES.TXT</packages>
        </files>
        <update-repository>
            <faster>file:///mnt/cdrom/</faster>
        </update-repository>
        <description>The official 12.0 cd-rom directory.</description>
    </media>

The first thing you can note is that we didn't used all the possible XML entity in this example. Indeed all fields are not mandatories. The only mandatories "fields" (attribute or tag) are :
  • id : the media id attribute ;
  • the <update-repository></update-repository> tag ;
  • the <faster></faster> tag.
So we added a new media, its id is "SlackDvd12.0", it use the standard files (so we can simplify this entry and remove the <files></files> section), and the only repository we have is in the /mnt/cdrom/ and have a small description.
We can simplify this media section (without loosing any informations), like that :
    <media id="SlackDvd12.0">
        <update-repository>
            <faster>file:///mnt/cdrom/</faster>
        </update-repository>
        <description>The official 12.0 cd-rom directory.</description>
    </media>


This example, is simple and quickly added, let's have a look at a more complete example, by adding the LinuxPackages repository to our medias list :
    <media id="linuxpackages">
        <files>
            <filelist>FILELIST.TXT</filelist>
            <checksums>CHECKSUMS.md5.gz</checksums>
            <packages>PACKAGES.TXT.gz</packages>
        </files>
        <update-repository>
            <faster>http://opensys.linuxpackages.net/Slackware-11.0/</faster>
            <fast>
                <li>http://www.nymphomatic.org/mirror/linuxpackages/Slackware-12.0/</li>
                <li>http://linuxpackages.inode.at/Slackware-12.0/</li>
                <li>http://ftp.scarlet.be/pub/linuxpackages/Slackware-12.0/</li>
                <li>http://www2.linuxpackages.net/packages/Slackware-12.0/</li>
                <li>http://mirror.etf.bg.ac.yu/linuxpackages/Slackware-12.0/</li>
                <li>http://linuxpackages.slackwaresupport.com/Slackware-12.0/</li>
            </fast>
            <slow>
                <li>ftp://linuxpackages.inode.at/Slackware-12.0/</li>
                <li>ftp://ftp.scarlet.be/pub/linuxpackages/Slackware-12.0/</li>
                <li>http://linuxpackages.cgucccc.org/Slackware-12.0/</li>
                <li>ftp://ftp3.linuxpackages.net/pub/Slackware-12.0/</li>
                <li>ftp://mirror.etf.bg.ac.yu/linuxpackages/Slackware-12.0/</li>
                <li>ftp://ftp.slackware.hu/linuxpackages/Slackware-12.0/</li>
                <li>ftp://opensys.linuxpackages.net/pub/Slackware-12.0/</li>
                <li>ftp://ftp.nymphomatic.org/linuxpackages/Slackware-12.0/</li>
            </slow>
        </update-repository>
        <description>Slackware resources to help install and configure the Linux slackware distribution, Email list, Discussion Board, Howtos, Contributed packages, and much more</description>
        <web-link>http://www.linuxpackages.net</web-link>
    </media>


Here we specify compressed files in the <files></files> section. This is possible because the slackget10::File class can load both of compressed and uncompressed files.
Then we have a list of repositories. The <faster></faster> one is like your preferred mirror, it will always be used unless it is not reachable. If it's not, servers in the <fast></fast> section are tried, then come the ones in the <slow></slow> section.
As you can see we have mixed type of mirrors : some are HTTP ones while other are FTP ones. That is not a problem, you can mix sources of all kinds. The only limitation is that slack-get must have a driver for the specified protocol (for the moment you can use only, http://, ftp:// and file://).
You can also see that we have set a web site for this media. This information is use in many way, for example in the search page of the slack-get site, or in the GUI to provide a link to the repository maintener site.

In real world, slack-get can test all the repositories and classify them by their answer time. Like in many other fields, I tried to make the slack-get's parts as clever as possible and do the right thing with the right informations. I hope it works ;-)

Now for the unreleased things and the unbelievably new informations : I will add the support of variables in repository URLs... this will allow you to write things like that in your medias.xml :
<update-repository param="$SLACKWARE_VERSION=12.0">
    <faster>http://opensys.linuxpackages.net/Slackware-$SLACKWARE_VERSION/</faster>
</update-repository>


Nice isn't it ? I'm still not sure about the final shape of this feature but I think it'll be like I just showed you.

To conclude, you are now more informed on the media management system of slack-get and you can easily manually add new repositories to your medias.xml file.
In the next version of the GUI you will be able to edit this file with a nice window.
I hope this article helped you to better understand some of the slack-get's black magic :-)
Please, feel free to react, comment and propose improvements.

Arnaud Dupuis