Audio System
| Audio System |
|---|
|
| What: |
| Creating a network controlled integrated music system for the entire space. |
| Participants: |
| Koen |
| Locations: |
| Whitespace |
| Events: |
| Audio system hacking |
|
|
Contents |
[edit] Current Configuration
- Two channel amplifier placed in the rack
- Stereo also placed in rack connected to TUNER input
- Extra analog audio line from main room to amplifier connected (CD input)
- PC connected to VIDEO/AUX input, see Software section below for more info
- Small stereo used as rear amplifier
[edit] Usage
- Playing files/web-streams:
- Power-up the main amplifier
- Make sure at least one zone is selected (A = Front room / B = Back room)
- Make sure the volume isn't all the way turned down (or up ;-))
- Select VIDEO/AUX
- Boot the Audio server
- Use any MPD client you like to connect to audio:6600
- note there is now a playlist provided which has the streams for a selection of popular Belgian radio stations.
- Power-up the main amplifier
- Playing audio from another laptop/music player
- Power-up the main amplifier
- Make sure at least one zone is selected (A = Front room / B = Back room)
- Make sure the volume isn't all the way turned down (or up ;-))
- Select CD
- Connect audio source to analog line in the main room and turn it on
- Power-up the main amplifier
- Playing plain old FM radio
- Power-up the main amplifier
- Make sure at least one zone is selected (A = Front room / B = Back room)
- Make sure the volume isn't all the way turned down (or up ;-))
- Select TUNER
- Power-up the stereo and use it as before
- note volume is controlled by amplifier
- Power-up the main amplifier
[edit] Ideas:
- Fixed amp sound level at max we'll allow
- Volume controlled with software
- Software: The silent guy, MPD, Play Airwolf at due time --> combined using Jack (some people suggest pulseaudio can also be used for this purpose)
- FM? Transmitter of receiver?
- Make all use cases configurable via the network, proposed solutions:
- Hack the main amplifier
- Hack the main amplifiers remote
- Do a full software solution
- connect extra audio line to the PC's line-in
- use a analog capture card to get FM input, and make these streams configurable by MPD (The Medion used as table-PC seems to have a capture card)
- use djmount to automatically mount uPNP shares enabling easy access to media files on other devices
[edit] Hardware:
[edit] What we have available
- A two channel amplifier. (Bert)
- Two big speakers (Bert)
- An average sized stereo (Kurt)
- A small stereo (Impy)
- A desktop with surround sound-card (Tom)
- Jack to cinch cables
- Cinch to cinch cables
Thanks to all who have contributed hardware!
[edit] What we need
- The small stereo currently used as aft amplifier could use an update.
[edit] Todo
-
Hang all speakers -
Connect all speakers to there amplifiers (Only one left todo, rear left) - Rack mount the amplifier
-
Connect the amplifiers to the PC -
Give the Audio System a fixed IP
[edit] Optional
- Figure out what the s-control port does on the main amplifier.
- Make the amplifier for the aft speakers powered only when music is played in that room.
[edit] Software:
This configuration was made on Ubuntu 10.10.
[edit] Jack
We will try to use Jack to make smooth combination of the audio sources. Jack was installed from the repositories. It's currently working however audio quality is horrible and now unusable. After some further investigation led me to the conclusion that Pulse-audio can also be used for this purpose. Since Pulse-audio is the default sound back-end for Ubuntu these days that option has proven to be easier to implement.
[edit] Pulseaudio
In Ubuntu 10.10 Pulse-audio is normally started on a per user basis when you log in to you gnome session. As we would like to run MPD even if nobody is logged in we also need to run Pulse-audio system-wide. This can easily be done by putting the following line in /etc/default/pulseaudio:
PULSEAUDIO_SYSTEM_START=1
Now we can start Pulse-audio system-wide:
sudo killall pulseaudio sudo /etc/init.d/pulseaudio start
After this only users in the pulse-access group can use the audio device. So we need to add both our regular user and the user running MPD (default mpd) to this group. This can be done using the following command:
sudo usermod -a -G pulse-access whitespace
[edit] MPD Server
MPD or Music player Deamon. Installed from repositories. By default MPD is configured to run system wide and use Alsa as a sound back-end. Because we want to blend several audio streams together we cannot use Alsa but Pulse-audio. To make MPD use Pulse-audio the Alsa section in /etc/mpd.conf needs to be commented out and the Pulse-Audio section needs to be uncommented.
#audio_output {
# type "alsa"
# name "My ALSA Device"
# device "hw:0,0" # optional
# format "44100:16:2" # optional
# mixer_device "default" # optional
# mixer_control "PCM" # optional
# mixer_index "0" # optional
#}
audio_output {
type "pulse"
name "My Pulse Output"
# server "remote_server" # optional
# sink "remote_server_sink" # optional
}
After this we can restart MPD.
sudo /etc/init.d/mpd restart
To make MPD control not only it's own volume but the machines master volume we must change the Alsa audio_output type again to the following:
audio_output {
type "alsa"
name "My ALSA Device"
device "pulse" # optional
# format "44100:16:2" # optional
# mixer_device "default" # optional
mixer_control "Master" # optional
# mixer_index "0" # optional
}
Make sure these things are all commented out:
#mixer_type "hardware" #mixer_type "software" #mixer_type "disabled"
Then restart Pulse-audio and MPD again. note For some reason my volume was muted after this step.
To make MPD accessible from every PC on the local network make sure the following line is in you mpd.conf.
bind_to_address "any"
[edit] MPD sound Menu
To allow the locally logged in user on the audio server easy control over the MPD daemon we installed mpd-sound-menu. This a small applet for the Gnome sound menu in the top menu bar. Installation instructions:
sudo add-apt-repository ppa:torkvemada/torkvemada sudo apt-get update sudo apt-get install mpd-sound-menu
This application was configured to automatically start when the user whitespace logs in.
[edit] djmount
We will use djmount to make all UPNP shares on the local network available to MPD. Like most software djmount can be installed straight from the repositories. The next commands allow you to mount and umount all UPNP servers on your network.
sudo djmount -o allow_other /var/lib/mpd/music sudo fusermount -u /var/lib/mpd/music
To start djmount automatically every time the system is booted the following needs to be added to the /etc/rc.local file.
djmount -o allow_other /var/lib/mpd/music
To set up a UPNP server see here.
[edit] MPD Clients
There are a wide range of MPD clients available for a wide range of platforms. Feel free to add you experiences here:
[edit] Cross-platform
- Music Player Minion Firefox extension, works good, easy to install if you have Firefox
[edit] Linux
- Ario (has avahi a.k.a zeroconf support and finds the server automatically)
- GMPC
- Sonata
- MPC (CLI) usage mpc --host=audio --port=6600 (play/stop/toggle/pause/next/prev/volume +xx/-xx/xx)
- Xfmpc
[edit] Windows
- Ario Requires you to separately install GTK first (http://gtk-win.sourceforge.net)
[edit] Mac OS X
[edit] iPhone
- http://code.google.com/p/impdclient/ Not available in the appstore :-(
- Just search for MPD in the appstore there are other free clients available
[edit] Android
- MPDroid from the market place works like a charm, source code available
- Droid MPD client
[edit] Web client
[edit] Ampache (No longer active)
A web interface to stream one's media library and control an MPD server. The debian install package seems to have a bug so it is necessary to create an extra symlink before configuration can begin. This web interface is available at http://audio/ampache. Try it using user root and password ****** (the one we often use)
Ampache requires a MySQL database. It was installed from repositories with as root password the one we use too often. The ampache user in the MySQL db is ampache, the password is """"
[edit] MPDplayer
A very simple and straight forward PHP application. Make sure Apache, PHP and the Apache PHP module are all installed properly. Download the tar file from this site http://www.renedegroot.nl/mpd.xml. Then all you have to do is untar it to your www directory and make sure user rights are set up properly. When you're in the space you can access it by simple visiting http://audio.
[edit] Silent Guy
[edit] Playing Airwolf
The Airwolf theme should be played on midnight Thursday and Friday. The file will come straight from YouTube, so we are not storing copyrighted information on our server. Play Airwolf from command line straight from YouTube ignoring video:
vlc -I dummy --vout null http://www.youtube.com/watch?v=nr_CJL1YQRc
with additions for running in crontab
DISPLAY=:0.0 /usr/bin/vlc -I dummy --play-and-exit --vout null http://www.youtube.com/watch?v=nr_CJL1YQRc
full crontab line for now (still running more frequent to allow testing):
*/2 * * * * DISPLAY=:0.0 /usr/bin/vlc -I dummy --play-and-exit --vout null http://www.youtube.com/watch?v=nr_CJL1YQRc
finally use this line in /etc/crontab do NOT use sudo crontab -e. I thought this had the same effect but it doesn't.
0 0 * * 5,6 whitespace DISPLAY=:0.0 /usr/bin/vlc -I dummy --play-and-exit --vout null http://www.youtube.com/watch?v=nr_CJL1YQRc
[edit] Doctor Who
http://www.youtube.com/watch?v=2CYDgezeQas (recent) http://www.youtube.com/watch?v=L0TEmJEjUSY (80's)
[edit] Links
A list of some links that where useful setting up this system:

