Categories

Albums

Shots

Pictures of things possibly worth looking at.
12 June 2012
1 images in album
2012_06_13/P6123751.jpg

Emblems

Powered By Jaws Project
Powered By Apache HTTP Server
Powered By MySQL
Supports RSS
Powered By RSS Lounge
















Enjoying My mp3 Jukebox

A while back, I wrote down some thoughts about turning a spare computer into a jukebox to connect to my home stereo. Well, that dream has become a reality, although not exactly as I had originally envisioned it.

I'm currently listening to my Black Mountain mp3's through via a jukebox controlled over the home network. Thank you very much to the makers of Theory, a client for mpd. Theory is written in python using pylons, has a nifty AJAX-based interface, and optionally hooks into AWS to grab album art.

To make theory more useable, I installed a light web server (I chose nginx) in order to proxy theory over port 80. Of course pylons can't connect to port 80, since that would be a huge security risk for a number of reasons. I created a user account under which to run theory, and added a line to /etc/rc.local which starts theory when the machine boots. As it turns out, theory didn't like having the URL paths rewritten, so I couldn't use, e.g. "location /tunes"; I had to map the app to the docroot of the host, like so:


server {
listen jukebox;
server_name jukebox jukebox.lan jukebox.26a.net;
location / {
proxy_pass http://localhost:9099/;
root /var/www/nginx-default/;
index index.html;
}
}


Finally, I didn't want the machine to be on all the time (too noisy, wastes power, generates heat), and I didn't want to wait for the whole boot sequence every time I wanted to play some tunes, so I installed hibernate and the userspace software suspend package for debian. After configuring uswsusp, I modified /etc/acpi/powerbtn.sh - at the very end of the file, I commented out the call to "shutdown", and replaced it with a call to hibernate:


#/sbin/shutdown -h now "Power button pressed"

echo "Hibernate activated by power button"
/usr/sbin/hibernate



Headless and wireless, the beige box just sits on the stack with my other stereo components in the living room, while I control it via any machine on my LAN. Ta da!
Trackback URI: http://www.26a.net/index.php/trackback/15

Leave a Comment



Write the captcha code you are seeing.

Comment XML feeds: RSS | Atom