This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new!


GNUMP3d: A small, portable, MP3/OGG streaming server

By Joseph Quigley on April 06, 2007 (8:00:00 AM)

Share    Print    Comments   

Suppose you want to let a friend thousands of miles away listen to a song from your computer. Perhaps you just want to open up the music library on your computer to a select few while you're on another client on your local area network. Enabling file sharing might be overkill. Instead, you can use a streaming server such as GNUMP3d. Streaming servers are useful for more than Internet radio; they can let people choose individual songs from your music library and play them -- no need to configure NFS, SSH, or Samba.

GNUMP3d is a small, portable streaming server for Ogg Vorbis and MP3 files. It also supports a few video formats. It is designed to be stable, self-contained, and secure. Because it is written in Perl, it can be run on most Unix or Unix-based platforms (such as BSD, Linux, and Mac OS X), and even on Microsoft Windows. GNUMP3d's simple, themeable, Web-based interface is intuitive, and the package includes its own server, creating almost no dependencies.

GNUMP3d requires some configuration to set up properly. The server can be run as root or as a normal user. Most distros provide an init script to run GNUMP3 at boot time. Users who don't have access to system configuration files or just don't want to run GNUMP3d as root can run the server as a non-root user.

The first time GNUMP3d is run by a normal user, it returns an error message stating that it can't use the default log file, since normal users don't have permission to write to /var/log/gnump3d/access.log. To get around that, you have two options. The first is to copy the main configuration file (located at /etc/gnump3d/gnump3d.conf) to the normal user's home folder (~/.gnump3drc). The other is to edit the main config file to save logs to a different place by changing the "logfile" variable. I opted to copy the main config file to my home directory and change the "logfile" variable to write to a file in my home directory.

When run by a normal user, GNUMP3d always checks the home directory for the .gnump3drc config file. If it does not find it, GNUMP3d will use the system config file located in /etc. GNUMP3d also needs to know where to find the folder containing your music. You can create a symlink at /var/music (where GNUMP3d looks for music by default) and point it to your music folder, or change the "root" variable in the configuration file from /var/music to your music folder.

The config file has many more features. Security-minded people will want to read all the comments in the security section of the file. For starters, GNUMP3d can be run from an init script. To be more secure, the server can be run as a separate user (instead of root) by uncommenting the "user" variable and changing it, preferably to the user "nobody." GNUMP3d also supports usernames and passwords to keep out prying and unauthorized eyes.

Whenever GNUMP3d is run, it will index the music collection (either to build it or to look for changes). If the collection is larger than 15GB, this may take a while. To prevent GNUMP3d from indexing music every time it is run, you can use the --fast command line argument. The only downside to this approach is that if a file is deleted, GNUMP3d may try to play it anyway, not knowing about the file's current state.

To let users browse streamable music, GNUMP3d provides a small Web server. You can view it by pointing a browser at http://localhost:port, where port is the port that GNUMP3d is configured to run on. (It's usually port 8888, unless specified otherwise in the config file.) As long as a firewall isn't suppressing incoming connections from other computers, other users can browse and listen to music by pointing their browsers to the GNMP3d's host IP address or hostname.

GNUMP3d's Web interface is easy to use and is themeable. Most themes provide a link to a search box or display it on every page, and custom themes are easy to make. If you know a bit of HTML and CSS you can quick create a good-looking theme. The interface provides links to download and stream songs and create playlists filled with random songs or even the entire music library. You can browse and search music by ID3 tags. GNUMP3d also provides song information and statistics such as the bitrate, genre, file name, and the song's length. The statistics feature provides lists of the most popular songs, directories, users, most recent tracks served, the most popular user agents (usually the browser identification), the most popular clients (by IP address, hostname, and connection count), and what is currently playing on other people's computers.

You can listen to streamed songs from XMMS, VLC, RealPlayer, Amarok, WinAmp, Zinf, iTunes, or pretty much any other program that plays streamed MP3s or Ogg files and can support M3U playlists. GNUMP3d also provides the option to download music to any computer for users who would rather not stream it. I was, however, unable to download or stream several video files, and I could not find much information regarding video from GNUMP3d's site.

GNUMP3d is available in several popular Linux distribution repositories. It is easy to configure, set up, deploy, secure, and interact with. Because it's written in Perl, it is one of the most portable streaming servers around. With source code taking up less than two megabytes, the server might even run on embedded systems. It's a great way to share your music easily.

Share    Print    Comments   


on GNUMP3d: A small, portable, MP3/OGG streaming server

Note: Comments are owned by the poster. We are not responsible for their content.

GNU and MP3 - what's wrong with this picture?

Posted by: Anonymous Coward on April 08, 2007 04:38 AM
And so you have no problems with GNU "stealing" Fraunhoffer/SGS/Nortel/Lucent code but you're up in arms that BSD people borrowed GPL code?

Too bad GPL'ers can't legally access MP3s without violating 100s of patents then STAY THE HELL OUT!


Re:GNU and MP3 - what's wrong with this picture?

Posted by: Anonymous Coward on April 08, 2007 10:21 PM
Patents? On software? You'd have to be american to get an idea like that.


Re:GNU and MP3 - what's wrong with this picture?

Posted by: Anonymous Coward on April 09, 2007 02:06 AM
Too bad some people are such sheep that they'd go along with the ridiculous idea of patents on software.


Uninstalled it about a month ago single songs only

Posted by: Anonymous Coward on April 10, 2007 06:21 PM
The interface/gui looks pretty good. One problem is that (from my memory) it lists songs and movies all on the same page, but the different tabs are supposed to list songs/movies in different fashions, yet more than a couple of tabs displayed everything the same way. Also don't like the inability to really control access/permissions to certain songs or movies, or by folder, without going to the command line and chmod'ing everything.

The deal breaker was the fact that I couldn't play more than one song at a time with xmms (and possibly other players (noatun, iirc, others), I couldn't queue songs, after each song ended I had to go back to the gui and click on another song for it to start playing. xmms would show songs queue'd in its queue window, but as the first song ended, it would just sit there instead of starting to play the next song in the window. I then had to go to the gnump3 gui and click on another song to get that song to start playing.


This sounds an awful lot like...

Posted by: Anonymous Coward on April 07, 2007 01:56 AM
Netjuke, <a href="" title=""></a>, a streaming server I've been running for about 5 years.


Thanks for the news!

Posted by: Anonymous Coward on April 07, 2007 02:36 AM
I've been looking to do *exactly* this, and I've been having some trouble with SlimServer (the instructions say to click on a non-existent link in <a href="" title=""></a> )

This is how I am spending my Friday night. Well, maybe not, but maybe the beginning of it...


Nice streaming app

Posted by: Anonymous Coward on April 12, 2007 01:52 AM
Nice streaming music application. Very simple to setup - all I had to change in gnump3d.conf was the path to my music directory. Thanks for pointing it out.


Another alternative: musicindex

Posted by: Anonymous [ip:] on February 12, 2008 12:56 AM
FYI, if you already have a Apache web server running (or if you plan to have one), you can use musicindex to stream your music. The advantage is that you can additionally benefit from any other feature of Apache (authentication, encrypted over ssl, etc). It is quite simple to setup. Details here:


This story has been archived. Comments can no longer be posted.

Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya