%init>
Misterhouse Whole-House Audio and Speech
Introduction
This page is dedicated to the audio portion of my Misterhouse setup. You must
first setup and be fairly familiar with Misterhouse, which can be found at http://www.misterhouse.net.
Basically, I use Misterhouse to control my home, including my whole-house audio
system. I installed the Festival speech engine which Misterhouse uses to talk.
I can then send this speech, multiple streams of MP3s, and (in the future) other
audio sources through my whole-house audio system.
You can see pictures of pretty much all the hardware I talk about and more
by going to this
page.
User Interface
The whole user interface right now is done through the Musica keypads or
one of my Home Theater Master MX-500 learning remotes that have learned codes
from the Musica remote. Basically, the user can do any of these:
- Turn Musica system on/off
- [Updated 10/03/04] I just switched to a two-tier menu system that is very
easy to change as it is all stored in a hash array in the code. Basically, each
button on the keypad, if held down for two seconds, jumps to a specific virtual
source (mostly various MP3 playlists). But, you can also press another button
immediately after holding down the first button to go to various other virtual
sources. For example, one button when held down for two seconds goes to the
"rock" virtual source, but if you follow that with other buttons you can get
to "classic rock", "soft rock", "alternative", etc. Also, holding down
the same button a second time will cycle through the various virtual sources
available under that button.
- Use the Pause/Play/Next/Previous buttons to control MP3 playback.
- Use the left/right buttons to scan through virtual sources.
- Press the 'up' key to switch between internal+external amp or external only.
I have this because the audio output is variable so when I switch to external-only
it cranks the volume all the way up to provide the best output level for my home
theater receiver.
- When tuned to the AM/FM tuner from my home theater receiver (which it sends
out on its zone2/zone output when needed), the last/next track buttons change
presets.
- When tuned to the DVD changer the Pause/Play/Next/Previous control the DVD
(presumably for when an audio CD is playing).
- When tuned to the Dish Network PVR, which is typically used for TV viewing,
you can press the next/last track buttons to change between "preset" music channels.
- At any time, pressing the Stop button switches to voice-only channel. This
channel also turns on automatically when you have been in a room for a few minutes
(through the occupancy code) or when a voice message with high enough priority
causes it to turn on.
- I have the mode button cause the name and artist of the current song to
be spoken.
- Finally, the Misterhouse MP3 Jukebox web interface can be used to play
selected songs over the channel normally reserved for voice-only.
That's it. All of the rest is handled by Misterhouse with the software
I have written that is discussed below.
Hardware Overview
This is the overview of the main components of the audio portion of my
whole-house audio system. What you don't see is the ChannelPlus Video/IR
distribution system I describe in "Advanced Hardware" below. I have IR control
of my home theater receiver, its components (i.e. the DVD/Tivo/etc) and the
IR-controlled A/V switch boxes. I also use modulators to put all of the video
devices (Tivo, Dish Network PVR, DVD changer) as well as some cameras onto the
video amplifier so that you can view what you are listening to on the
whole-house audio system (of course there is also audio as part of the
modulated channels, but that is mono since I only have mono modulators).
As you can see, I have some physical limitations. First of all, since the
Musica system only has four real source inputs, only four different sources can
be listened to at the same time. Since I only have 6 zones this is not a huge
problem. I can have up to four MP3 streams or three MP3 streams and one
dedicated voice-only stream (I also put voice onto the MP3 streams (pausing
them first) for important messages). Alternatively, I can have two MP3/voice
streams as well as two other sources (internet radio/DVD/Tivo/etc) in use at
one time. But I can not have more than two of those other sources in use
since I only have them going into two switch boxes.
I have space for one more device into the fourth input on the switch boxes,
or I could change the internet radio to only use one of the switch boxes and
then I could have three more inputs. I also could put several more inputs into
my home theater receiver. But, for now, this is all I've got.
Hardware Details
As far as hardware goes, I use the Netstreams Musica whole-house audio
system (http://www.netstreams.com) for
the audio distribution. Netstreams uses a dealer network but if you contact me
I can put you in touch with my dealer who allowed me to do a self-install. It
has excellent control via RS232 and very nice keypads. It supports 4 sources
and 6 zones. Each zone can listen to separate sources or multiple zones can
listen to the same source. The 4 physical source inputs means that only 4
different sources can be listened to at the same time in my house. But, using
my VirtualAudio.pm (below) I can make more than four sources available.
Along with this, I have a M-Audio Delta 410 sound card which provides 8
channels of output which I have configured into four separate stereo audio
channels. This is in a Red Hat Linux 8.0 system with a custom-compiled 2.4.27
Linux kernel with the ALSA sound drivers (http://www.alsaproject.org). It works
rather well. To play my MP3s I use AlsaPlayer (http://www.alsaplayer.org).
If you want to set things up exactly how I have them, you'll need a
dedicated Linux system that can run Misterhouse and contain the Delta M-Audio
410 as well as a free RS-232 port to connect to your Netstreams Musica ADC.
I use four RCA stereo hook-up cables to connect the four outputs from the
sound card to the four inputs on the Musica ADC.
You then need up to six Musica amplified keypads and any necessary speakers.
One thing I like about the Musica keypads is that you can buy an optional local
input/output module. You can place this in the same room as the keypad (also
installs in the wall) and it has an audio input and output. The input can be
used to connect a local source (such as a TV) to your local zone for a fifth
source for that particular zone. The output can be used to hook up a dedicated
amplifier instead of or in addition to the amplifier built into the keypad.
Or you can hook that up to your home theater receiver so that you can listen
to music on you home theater speakers.
Advanced Hardware
If you want more than just MP3 sources, read this section...
Finally, I use even more hardware to provide more physical sources.
Basically, inputs #3 and #4 have an IR-controlled A/V switch box that I got
from Radio Shack (Cat# 15-1977) in front of them. The first input into each of
these switch boxes is audio out from the M-Audio Delta 410 (the other two
channels go directly to inputs #1 and #2 on the Musica ADC). The second input
to the first switch box is zone2 output from my home theater receiver. The
second input to the second switch box is zone3 output from my home theater
receiver. The third input to both switch boxes is the output from my Windows
computer (split to both inputs) which I use for Internet radio. I currently
have the fourth input to both switch boxes available for future use.
This allows me to have up to 4 MP3 streams or 2 MP3 streams and 2 other
sources in use at one time. The other sources are either the Internet Radio
from my Windows computer or any of the sources available from my home theater
receiver, which currently includes its internal AM/FM tuner, my Tivo, my Dish
Network PVR (which I don't recommend), and my Pioneer DVD Changer.
In order to control all of this, you have to have something like the USB-UIRT which is supported by Misterhouse,
although currently you have to use the Windows-based Girder program to learn the IR codes.
While it is a bit more difficult, you need to have a way to get the IR
output from that device to your IR-controlled switch boxes, your home theater
receiver, and your various components. I chose the ChannelPlus video/IR distribution system
which I bought from Worthington
Distribution. I got a 4-channel and 2-channel modulator for all of my
video devices and cameras. I also got the DA-550BID amplifier which does a
nice job combining my modulators into 8 outputs, as well as distributing IR.
The disadvantage is that you have to install a wall plate at each location for
the 12-Volt system. The 5-volt system is easier, but I didn't see that it
provided arbitrary IR outputs like the 12-volt system does (each wall plate
provides coax out, IR out, and IR in). I just put this system in, but I'm
having probems right now with minimal video/audio distortions while
IR signals are being repeated... even on sources not directly connected
to the video distribution system. But the IR system is very reliable and
the modulated and distributed video is very good quality otherwise.
My home theater receiver (Yamaha
RX-V1400) has a wide range of audio/visual inputs and, most importantly for
this project, provides two audio output zones in addition to the main output.
These zones can output any source regardless of what is being listened to in
the main zone. Most important of all is that the receiver has discrete on/off
IR codes and discrete IR codes for each input for the main zone as well as
zones 2 and 3... all on the original remote! This means that from Misterhouse
I can turn each zone on or off independently and control each source with
discrete codes. I love this receiver -- it sounds great, automatically
calibrates itself with the included microphone, is THX-certified, and does
component video switching including up-conversion from composite/S-Video up to
component.
If you want a bit more power, a RS-232 port, and a much better remote (as
well as video out for zone 2, I believe), you can get the RX-V2400.
Unfortunately, authorized Yamaha resellers were not allowed to sell these receivers
over the Internet when I purchased mine, so I bought it from a local store.
Since I have several Home
Theater Master MX-500 remotes (with the IRClone-MX
for easy programming), I had no need for the original remote apart from
learning the IR codes, so I opted for the less expensive receiver. I highly
recommend BlueDo.com
to purchase these awesome remotes. They even have a MX-500
2-pack and a MX-500/IRClone-MX
package. The MX-500 is very user-friendly with an adequate number of hard buttons
as well as 10 devices which you can label and 20 soft buttons per device with custom
labels. It has full learning capability and great IR output strength as well as
the ability to store numerous macros. I currently own three of these things and
use them to control my A/V equipment as well as my whole-house audio system.
Software
Misterhouse
First, you need to have Misterhuose on a Linux system. I recommend having
at least one system dedicated to you home automation system. In my case, I have
a PII-450Mhz that runs Misterhouse, monitors two security cameras, and plays up
to four simultaneous streams of MP3s. But that is pushing it -- if I am
doing something like compiling a kernel it can't play MP3s too well.
Misterhouse is not easy to set up and not easy to learn, even if you
already know Perl (as was my case). But it is well worth the effort as you can
do anything with it. You can get Misterhouse from http://www.misterhouse.net.
Be sure that you are using version 2.89 of Misterhouse or newer.
ALSA
You can get ALSA drivers and utilities from http://www.alsaproject.org. To play my
MP3s I use AlsaPlayer (http://www.alsaplayer.org).
Also, I made the following change to AlsaPlayer to allow songs to be shuffled
while AlsaPlayer is already running:
--- app/Main.orig 2004-03-15 12:24:37.000000000 -0700
+++ app/Main.cpp 2004-03-15 12:25:25.000000000 -0700
@@ -291,6 +291,7 @@
" --volume vol set software volume [0.0-1.0]\n"
" --start start playing\n"
" --stop stop playing\n"
+ " --shuffle shuffle playlist\n"
" --pause pause/unpause playing\n"
" --prev jump to previous track\n"
" --next jump to next track\n"
@@ -363,6 +364,7 @@
int do_remote_control = 0;
int do_start = 0;
int do_stop = 0;
+ int do_shuffle = 0;
int do_prev = 0;
int do_next = 0;
int do_pause = 0;
@@ -415,6 +417,7 @@
{ "crossfade", 0, 0, 'x' },
{ "output", 1, 0, 'o' },
{ "stop", 0, 0, 'U' },
+ { "shuffle", 0, 0, '!' },
{ "pause", 0, 0, 'O' },
{ "start", 0, 0, 'T' },
{ "prev", 0, 0, 'Q' },
@@ -582,6 +585,10 @@
case 'I':
global_interface_script = optarg;
break;
+ case '!':
+ do_remote_control = 1;
+ do_shuffle = 1;
+ break;
case 'U':
do_remote_control = 1;
do_stop = 1;
I don't understand a lot about configuring Alsa, but I got this configuration
working for my Delta M-Audio 410 with some help from the mailing list:
pcm.ice1712 {
type hw
card 0
device 0
}
ctl.ice1712 {
type hw
card 0
device 0
}
pcm.dmixer12 {
type dmix
ipc_key 1024
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 6553
rate 44100 # set to your source rate
}
bindings.0 0
bindings.1 1
}
pcm.dmixer34 {
type dmix
ipc_key 1024 # must be same as for dmixer12
slave { # all parameters in this section must be same as for dmixer12
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 6553
rate 44100
}
bindings.0 2
bindings.1 3
}
pcm.dmixer56 {
type dmix
ipc_key 1024 # must be same as for dmixer12
slave { # all parameters in this section must be same as for dmixer12
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 6553
rate 44100
}
bindings.0 4
bindings.1 5
}
pcm.dmixer78 {
type dmix
ipc_key 1024 # must be same as for dmixer12
slave { # all parameters in this section must be same as for dmixer12
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 6553
rate 44100
}
bindings.0 6
bindings.1 7
}
pcm.channel12 {
type plug
slave.pcm "dmixer12"
}
pcm.channel34 {
type plug
slave.pcm "dmixer34"
}
pcm.channel56 {
type plug
slave.pcm "dmixer56"
}
pcm.channel78 {
type plug
slave.pcm "dmixer78"
}
pcm.dmixerALL {
type dmix
ipc_key 1024
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 6553
rate 44100
}
bindings.0 0
bindings.1 1
bindings.2 2
bindings.3 3
bindings.4 4
bindings.5 5
bindings.6 6
bindings.7 7
}
pcm.channelALL {
type plug
slave.pcm "dmixerALL"
ttable.0.0 1
ttable.1.1 1
ttable.0.2 1
ttable.1.3 1
ttable.0.4 1
ttable.1.5 1
ttable.0.6 1
ttable.1.7 1
}
The channelALL works but doesn't always sound too great, so I don't
use it unless I have to.
Finally, I use the following file for ~/.alsaplayer/config. You can
disable the parsing of ID3 tags if you don't need them.
http.buffer_size=1048576
mad.parse_id3=true
main.default_interface=gtk
main.default_output=alsa
main.fallback_interface=text
main.period_count=8
main.period_size=4096
You may want to consider following the instructions here to add a low-latency support to you 2.4.X kernel. When I did this Perl would segfault when starting Misterhouse... so I went back to a standard kernel, but I do get occasional audio delays.
Misterhouse User Code
First, I define all of my objects in my house.mht file:
MUSICA, Musica
MUSICA_ZONE, music_kitchen, Musica, 1
MUSICA_ZONE, music_mb, Musica, 2
MUSICA_ZONE, music_patio, Musica, 3
MUSICA_SOURCE, music_source1, Musica, 1
MUSICA_SOURCE, music_source2, Musica, 2
MUSICA_SOURCE, music_source3, Musica, 3
MUSICA_SOURCE, music_source4, Musica, 4
VIRTUAL_AUDIO_ROUTER, audio_router, 6, 4
VIRTUAL_AUDIO_SOURCE, v_classical, audio_router
VIRTUAL_AUDIO_SOURCE, v_opera, audio_router
VIRTUAL_AUDIO_SOURCE, v_enya, audio_router
VIRTUAL_AUDIO_SOURCE, v_romantic, audio_router
VIRTUAL_AUDIO_SOURCE, v_soft, audio_router
VIRTUAL_AUDIO_SOURCE, v_jazz, audio_router
VIRTUAL_AUDIO_SOURCE, v_kirk_mp3s, audio_router
VIRTUAL_AUDIO_SOURCE, v_pink_floyd, audio_router
VIRTUAL_AUDIO_SOURCE, v_the_cure, audio_router
VIRTUAL_AUDIO_SOURCE, v_les_mis, audio_router
VIRTUAL_AUDIO_SOURCE, v_rock, audio_router
VIRTUAL_AUDIO_SOURCE, v_soft_rock, audio_router
VIRTUAL_AUDIO_SOURCE, v_country, audio_router
VIRTUAL_AUDIO_SOURCE, v_blues, audio_router
VIRTUAL_AUDIO_SOURCE, v_dance, audio_router
VIRTUAL_AUDIO_SOURCE, v_reggae, audio_router
VIRTUAL_AUDIO_SOURCE, v_comedy, audio_router
VIRTUAL_AUDIO_SOURCE, v_classic_rock, audio_router
VIRTUAL_AUDIO_SOURCE, v_alternative, audio_router
VIRTUAL_AUDIO_SOURCE, v_80s, audio_router
VIRTUAL_AUDIO_SOURCE, v_tivo, audio_router, 3|4
VIRTUAL_AUDIO_SOURCE, v_pvr, audio_router, 3|4
VIRTUAL_AUDIO_SOURCE, v_dvd, audio_router, 3|4
VIRTUAL_AUDIO_SOURCE, v_tuner, audio_router, 3|4
VIRTUAL_AUDIO_SOURCE, v_internet, audio_router, 3|4
VIRTUAL_AUDIO_SOURCE, v_voice, audio_router
As you can see, right now I only have one zone connected! I have a lot
more wire to run and speakers to buy before I'll have my other zones connected.
Then you can use my user code to create your own:
- speech.pl: Handles the piping of Misterhouse speech through my whole-house audio system.
Also supports importance of speech events.
- musica.pl: Controls my Musica whole-house audio system and the routing of virtual audio.
Misterhouse mp3_alsaplayer.pl
I wrote this Alsaplayer interface to the standard mp3.pl included with
Misterhouse. It requires the AlsaPlayer.pm module listed below. The file
is alsaplayer.pl.
Audio info/control page for Misterhouse
I wrote this Misterhouse web script to provide status and limited control
of our whole-house audio system. Note that it is not complete at this point.
Just put music.pl in your web directory
somewhere.
Misterhouse Modules
I wrote the following Misterhouse modules to allow this system to all
work properly. Although some of these are in Misterhouse version 2.88, these
are more up to date:
- Musica.pm: A complete Misterhouse driver for the
Netstreams Musica whole-house audio system.
- PlayList.pm: An abstract object holding an audio
playlist. Currently only supports MP3s (and reading of directories and M3U files),
and is currently only used by AlsaPlayer.pm (below). But could be expanded to
do more.
- AlsaPlayer.pm: A module to start and control
the AlsaPlayer MP3 player to play MP3s through your ALSA-enabled sound cards.
- VirtualAudio.pm: A module designed to work with
any whole-house audio system to allow more sources to be transparently available
to the user than the audio system actually has physical inputs for. Currently,
I have numerous different MP3 playlists that each seem to be a separate audio
source but are really transparently routed to one of the four physical source
inputs on the Netstreams Musica system. This was written to support any type
of source, and in the future I want to add additional external audio sources
to my system that are routed using either an IR-controlled audio switcher or
relays controlled from a Weeder board.
|