Sunday, July 8. 2007
(almost) Whole House Audio Posted by Andrew Ruthven
in catalyst, house at
21:25
Comments (0) Trackbacks (0) (almost) Whole House Audio
In our house we have a server that does a number of tasks, one of which is playing a jukebox (using MusicPD) it is hooked up to an amp that has speakers in our study and in our family room. This rocks, turn on the amp, have continuous music that we want to listen to and no chatter.
Unfortunately this doesn't extend to the lounge. Which means that if you sit in the lounge you can only just hear the music (unless you turn it up too loud). I've thought off and on (mostly off) about extending the jukebox to the lounge, the other week Susanne asked about having this, which meant it was finally time for me to really look into possible solutions. Warning, geeky bits follow... Since we used to use Icecast2 to stream the jukebox to Susanne's computer in our old flat I tried that first. We have a PC in the lounge that is a MythTV frontend that we could play the stream on, so that aspect is covered. Unfortunately the 5 second lag which was acceptable when Susanne's computer was a long way away from the main jukebox in our old flat was too annoying when the speakers were only a room apart (yes, I could have reduced the buffers, but it would never have been quite right). So fall back to plan B, stick another soundcard in the jukebox computer and run line level audio to the amp in the lounge. We managed to dig up an old soundcard in the good junk pile (every geek should have a good junk pile), stuck it in the computer and then proceeded to try and configure ALSA to drive it. The plan was to duplicate the same audio stream out to both soundcards. After a bit of researching and a bit of tinkering with asound.conf and it not working I decided not to waste any more time on that path. I vaguely recalled that PulseAudio was incredibly flexible and allowed all sorts of things. A quick apt-get install pulseaudio pulseaudio-module-hal and bit of reading, and I found that adding the following line to /etc/pulse/default.pa: load-module module-combine master=<sound card 1> slaves=<sound card 2> set-default-sink combined Would create a new virtual soundcard output (PulseAudio refers to this as a sink) called "combined" that would replicate the audio to both soundcards. Awesome. (The master and slaves settings were determed by using paman to inspect the PulseAudio devices.) Then after recompiling MusicPD (to add PulseAudio support, the version in Debian unstable already has it, but stable doesn't), telling it to use that sink and voila, both soundcards are playing the jukebox. To actually get the line level audio to the lounge I've used some Cat5 we already have running there (with suitable audio flyleads) and we have the jukebox playing in the lounge, in sync with the family room. The sound quality is pretty good, so I won't worry about balanced audio or anything else fancy like that. Gotta love structured cabling. Another benefit of PulseAudio is we will be able to configure our Linux workstations to use the jukebox soundcards as audio sinks as well, which will mean no more tinny little monitor speakers. w00t! Update: Say which file to add the load-module line to, and fix a typo. |
CalendarArchivesCategoriesSyndicate This BlogBlog AdministrationShow tagged entriesPowered by |