Hackathon Gunther Daemon :: Opensource Multi-User Jukebox
Clone or download
egelmex Merge pull request #145 from Eeketh/master
Fix definition of RESET_GETOPT() for unknown systems
closes #145
Latest commit 1a6bfbd Nov 23, 2012
Failed to load latest commit information.
man Update man/hgd-proto.7 Jan 4, 2012
plugins bring python up to date Oct 16, 2011
pydoc/txt regenerate pydoc Oct 28, 2011
pylib bring python up to date Oct 16, 2011
share/examples tidy/spelling Oct 17, 2011
.gitignore start separating shared client funcs in client.[ch] Nov 23, 2011
COPYING add COPYING file. Closes #35 May 16, 2011
DEVELOPERS expand -Wl,--as-needed section some more Nov 30, 2011
Makefile.in missing CONFIG_CFLAGS spotted by Nigel Taylor. Thanks Apr 15, 2012
README update readme Jan 4, 2012
autogen.sh no verbose plz Sep 5, 2011
cfg.c Merge branch '0.5.x' of github.com:vext01/hgd into 0.5.x Jan 4, 2012
cfg.h #135 no more unused variable and moved some replicated code to cfg.c Nov 24, 2011
client.c fix a leak Jan 13, 2012
client.h upload progress in nchgdc, pretty crappy, needs reworking Jan 7, 2012
common.c fixes #129 . Opens pid file before deamonsing, so we can warn the user Jan 4, 2012
configure.in Do not check MPlayer presence at compile time. Closes #133 Jan 4, 2012
crypto.c * unbreak build without libconfig (again) Oct 10, 2011
crypto.h clean up includes in new files Jun 5, 2011
db.c purge old style unused variable markers Oct 28, 2011
db.h clean an XXX Oct 19, 2011
hgd-admin.c #135 no more unused variable and moved some replicated code to cfg.c Nov 24, 2011
hgd-mk-pydoc.c define component names Oct 19, 2011
hgd-netd.c fixes #129 . Opens pid file before deamonsing, so we can warn the user Jan 4, 2012
hgd-playd.c Merge branch 'master' of github.com:vext01/hgd Jan 4, 2012
hgd.h Update hgd.h Nov 23, 2012
hgdc.c line should not be printed if playlist is empty Jan 11, 2012
mplayer.c check for MPlayer at runtime Jan 4, 2012
mplayer.h check for MPlayer at runtime Jan 4, 2012
nchgdc.c fix debug console, \r and \n turn up as ^ Jan 14, 2012
nchgdc.h fix some memory leaks. some remain. cant figure them out in this state Jan 13, 2012
net.c ineffectual assignments found by clang static analyzer Oct 28, 2011
net.h double line size, as i just queued a track which is too long for a 256 Oct 19, 2011
py.c fix a few more fd bugs and pieces Dec 12, 2011
py.h add major/minor fields to python scripting backend Oct 16, 2011
user.c unify permission printing across hgd-admin and hgdc. Also we deal wit… Oct 16, 2011
user.h bye bye admin.{ch}. (waves o/ ) Oct 16, 2011


Hackathon Gunther Daemon

HGD is a music system suitable for hackathons, internet cafes, LAN
parties etc. Music is played on one set of speakers and clients queue up
media from their own machines over the network. Because we use MPlayer to play
media, you can send anything MPlayer understands, including video.

HGD was inspired by the LPD hack -- a music system used at OpenBSD
hackathons. We plan to implement similar functionality and extend it.

Current features

 * Network listener daemon.
 * Player daemon (uses mplayer).
 * Command line client with the ability queue and vote-off tracks.
 * Works on Linux and OpenBSD.


To build, you will need:

 * Linux or OpenBSD (possibly others, not tested)
 * Make (either GNU or BSD)
 * GCC or Clang
 * SQLite3 libs and headers (if building servers).
 * OpenSSL libs and headers.
 * LibBSD (linux only) libs and headers.
 * Mplayer (for the server)

And optionally:

 * LibConfig, if you want config file support.
 * TagLib, if you want media tag support in the server.
 * Python-{2.6,2.7}, if you want the scripting backend.

If you checked out from git, you will also need:
 * autoconf
 * automake (even though we don't use it)
 * libtool (even though we don't use it)

On ubuntu (and debian?) you can do something like:
sudo apt-get install libbsd0 libbsd-dev mplayer python2.7 python2.7-dev	\
	libtagc0 libtagc0-dev libconfig8 libconfig8-dev libsqlite3-0	\
	libsqlite3-dev libssl-dev libssl0.9.8 build-essential

and for git checkouts, additionally:
sudo apt-get install libtool automake


 1) If you checked out from git, first run:

 2) Configure the build:

    If you don't want to pollute /usr/local, pass a --prefix=/some/path

    Examine the output and install anything missing. Don't forget linux
    packages headers and libraries separately.

 3) Build and install:

    * Run 'make'
    * Run 'make install'


HGD will happily run out of it's build directory, so the 'make install' step is

On MacOS X, you may have to jump through hoops. Others have succeeded using
macports for libconfig and sqlite3 dependencies. You may need to set the
include path and library path to /opt/include and /opt/lib respectively (good

Quickstart for the Lazy

This is how to configure a HGD server an client:

If you upgraded from a previous version of HGD, i would recommend
removing your state directory and starting afresh, as the database
structure does change from time to time.

If you need a custom state path (ie. not /var/hgd), you can either pass -d to
all server components (make sure they are the same of course), or make a hgd.rc
config file (see the FILES sections in manual pages).

First create the sqlite3 database:

 % hgd-admin db-init

Now you should make user accounts:

 % hgd-admin user-add <username>

You will be asked to type a password twice. Do this for all users.

Then you can run the hgd daemons:

 % /absolute/path/to/hgd-netd
 % /absolute/path/to/hgd-playd

Check the daemons came up properly:

 % hgd-admin status

If either daemons did not come up, then examine the system's 'daemon'
log (usually /avr/log/daemon) and look for errors. For debugging, you
can run the daemons in the foreground -B and turn up debugging with -x
<level> (0-3).

Then you can queue tracks:

 % hgdc q <some media file>

Each command has a manual page for detailed usage instructions. Also,
each command has a '-h' option for quick help. 

If you do not want to show the video of media files, 'unset DISPLAY'
before running hgd-playd.

For information on SSL (TLSv1) crypto, see the manual page for

Please note that SSL support in HGD is only partially implemented at
this time. You may use it for encrypting traffic, but not for server


(Only functional changes are shown)

 * 0.1   - basic functionality.
 * 0.2   - SSL crypto support and user authentication.
 * 0.3   - Config file support.
 * 0.4   - Autoconf, taglib, Python scripting.
 * 0.4.1 - Properly daemonise, log to syslog, honor SIGHUP.
 * 0.5.0 - Database schema check.
	 - Add more tag support.
	 - Network protocol minor version.
	 - Skip+pause commands (remote and local).
	 - Client can queue more than a single track at a time.
	 - Overhaul build system so that you can build just the client
	   if that is all you need. 
	 - Ability to know if you have voted.
	 - Ability to know how many votes are needed to vote-off a track.
	 - PowerPC support.
 * 0.5.1 - Fixed build on systems that force --as-needed.
	 - Better error messages about lock files.
	 - Fixed bug where hud mode kept asking for password.
	 - Configure CC variable now honored.
 * 0.5.2 - Fix compile issue ubuntu.
 * 0.5.3 - Prevent hgd-admin and hgd-netd from linking Python.
	 - Warn about stale PID files prior to daemonising.
	 - Use daemon() to daemonise.
	 - Fix weird double HUP fd bugs.
	 - Check for MPlayer at runtime instead of compile time.
         - Make pause and skip work when hgd is using a non-standard
           state path.
         - Fix build for --as-needed (this has become default on some
           Linux distros.




Inevitable. Please report bugs on github:


We thank the following people:

 * Yhg1s on #python on freenode for code reviews on Python C API code.

Feedback / Questions

Go to #hgd on freenode. If you liked and use hgd, please buy us a beer.