SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Customizations
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Customizations This forums is for discussing and sharing user-created modifications for the SageTV application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss customizations for SageTV version 6 and earlier, or for the SageTV3 UI.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-15-2008, 01:26 AM
mickp's Avatar
mickp mickp is offline
Sage Aficionado
 
Join Date: Oct 2006
Posts: 468
Talking Free Network Audio Sender/Multi Zone System

Hey there,

For some time I’ve been trying to work out a way of sending audio directly from one of my machines to another. I’ve looked at various hardware solutions such as those offered by Linksys and thought “Surely someone has written a software only version of this?”. Search after search turned up nothing outside of mega bazillion dollar recording studio and broadcast solutions.

The main reason that I’d been after a solution is that my computer zone is on one side of an open plan part of the house and I like to play music on the decent stereo that’s attached to the main sage server on the far wall.

In the meantime I’ve been dealing with a vnc connection to the remote sage system to control playback (or using the remote control) though I’ve still been keen to find a more ideal solution.

I thought I’d found the perfect answer a while back when I discovered a windows implementation of e-sound daemon, the old(ish) network audio system from the Xnix world. Unfortunately the only drivers were for nt4 and were none to stable (aka didn’t work very well). The most ideal part of this solution though was that the e-sound driver showed up as a device which the sage client could use directly, bypassing my local sound hardware and routing to the remote server.

Finally... On the weekend I discussed this with a friend who suggested that there must be a vst solution for this.

NB: VST is an audio plugin standard designed for virtual synthesisers, compressors, effects units etc. You can read more about vst here. http://en.wikipedia.org/wiki/Virtual_Studio_Technology

A quick search of some vst sites showed a few promising leads. The plugin that I ended up using is a very nice free to use one called Reastream from Cockos.

Reastream is a freely available vst plugin that is also provided as part of an Excellent VST Host called Reaper. If you’re in the market for a virtual studio package you could do worse than checking out Reaper at http://www.reaper.fm (think Nuendo ultra light ).

You can download a package that contains the Reastream VSTI from http://www.kvraudio.com/get/2992.html

VST plugins are not generally able to run standalone, requiring a VST host application. There are many VST Host applications available. I’ve been working with two free host applications listed below;
SaviHost: http://www.kvraudio.com/get/1290.html
SaviHost is a lightweight vst host that’s designed to easily host a single vst plugin or instrument as a standalone executable.

Cantabile Lite: http://www.kvraudio.com/get/2225.html
Cantabile Lite is a freeware version of the Cantabile VST host. Cantabile Lite includes many more capabilities than SaviHost including it’s own sequencer.
There are many different vst hosts out there and most of them will likely work well with ReaStream. If you’re already using something else then feel free to give it a go.

I’ve used the SaviHost application happily except in some advanced configurations under Windows XP where I found that SaviHost wasn’t able to select the correct virtual audio devices (more on that later).


BASIC CONFIGURATION OVERVIEW

So that you can get an idea of how the solution works I’ve included some screenshots below that will hopefully give you an idea of what to expect;



The screenshot above shows the sending side of the system. In this case I’m using the Sage Client to send audio to the Sage Server that’s hooked up to a decent amp and speakers on the other side of the room.
ReaStream is being hosted in the SaviHost application.



Above is a screenshot of the receiving system also hosting ReaStream in SaviHost. You can basically start the Reastream plugin on startup and it will happily sit in the background listening for connections/audio from other machines.

Now for a detailed look at the sending and receiving ends;



On the sending and receiving side there is an option to define an Identifier for the stream. The screenshot above shows this set to ‘default’. The upshot of this is that you can configure a multi zone broadcast system with systems listening to different streams.

Quote:
Note to self: It should be quite easy to setup a multi zone dynamic menu in SageMC to launch Reastream clients (via a batch file and Sysinternals ps tools) on a remote system for whichever zone you wish them to listen in on.

Something like;

Lounge: Zone A
Lounge: Zone B
Lounge: Zone C
Lounge: Disable
Kitchen: Zone A
Kitchen: Zone B
Kitchen: Zone C
Kitchen: Disable
Bathroom: Zone A
Bathroom: Zone B
Bathroom: Zone C
Bathroom: Disable
The screenshot above shows ReaStream set to send audio to a specific IP address. There is also the ability to broadcast which would be useful if you wish to send audio to multiple zones at once.



On the receiving end ReaStream is configured to use the ‘default’ stream and receive audio (and midi).


CONFIGURING REASTREAM AND SAVIHOST

The nice thing about SaviHost is that it basically turns a vsti into an executable.

Download Reastream (as part of the Reaplugs package) from http://www.reaper.fm/reaplugs/

Expand reaplugs111.zip into its own directory. You should have a copy of reastream-standalone.dll in the directory.

Download SaviHost from http://www.kvraudio.com/get/1290.html
NB: the link to the site seems to be down at the moment. I may need to attach the file to this post .

Unzip savihost.exe into the directory that contains the reastream-standalone.dll

Make a copy savihost.exe and (re)name it reastream-standalone.exe

Double click the new reastream-standalone.exe file. This will launch ReaStream.dll as a standalone application.

NB: You may wish to go to the ‘View’ menu and turn off some of the toolbar, status bar and midi keyboard as they’re probably not of much use for this particular application.

Select ‘Wave’ from the ‘Devices’ menu. You will see the following dialog;



Select ‘MME: Microsoft Sound Mapper’ for input and output. 44100 is most likely the sample rate that you will want to use. The ‘Buffer’ setting defines the size of the buffer used for buffering audio. Setting this higher will help if you’re hearing occasional stuttering during playback.

Copy the directory that you’ve expanded the ReaStream and SaviHost files into to your other machine(s). On the transmitting/sending machine configure ReaStream to broadcast or enter the ip address of the target machine.

On the target (the machine(s) with the speakers) set ReaStream to receive.

NB: Make sure that both transmitting and receiving ends are using the same steam name (‘default’ by default). Also make sure that both ends have the ‘Enabled’ checkbox ticked.

On the transmitting system open the recording control panel. This may vary depending upon your sound card, OS etc. Set the system to record the ‘What you hear’ input to transmit all audio events on the system to the remote client (or should that be server??). If you don’t have a ‘What you hear’ type recording input then you may need to take a look at the advanced configuration section below.


This basic setup and should (hopefully) allow you to transmit audio around your home. More advanced configuration details follow along with some workarounds for problems that I encountered with configuring my systems.


ADVANCED CONFIGURATIONS

As I’ve mentioned above I thought that one of the best things about the e-sound daemon solution (which didn’t work ) was that it showed up as an alternative device which could be used to direct audio output from Sage to a remote audio server (to use the Xwindow/unix sense of server and client). This allows for sending specific audio such as your favorite album or playlist to the remote server without sending other local audio such as error beeps or the audio from a game you’re playing.


I’ve been using an application called ‘VAC- Virtual Audio Cable’ to achieve the same results on my systems. VAC is not freeware but is quite affordable imho considering the audio routing capabilities that it offers.


You can learn more, purchase VAC or download a trial (though an annoying one that has someone talking over your audio at far too constant an interval) by going to http://software.muzychenko.net/eng/vac.html

VAC basically allows you to create additional virtual audio devices to route audio streams between applications.


There may be freeware solutions out there that can achieve the same thing. If you know of any please let me know.

VAC adds a virtual sound driver to your system. After installing VAC you can use the VAC control panel to configure multiple virtual audio cables.



Once you’ve created a Virtual Audio Cable (there should be two present after install by default) you can configure Sage or the Sage Client to transmit audio to the Virtual Cable from the Sage Detailed Setup/Video Audio/Audio Renderer options;





The method used to select the VAC line for input/transmission from ReaStream varies depending upon a few things. I mentioned above that you may need to refer to this section if you don’t have a ‘What you hear’ recording input. This was the case for me in Vista. According to a few posts I’ve seen, it’s not uncommon for integrated sound devices not to have a ‘What you hear’ input in Vista. If this is the case then you might find that you need to use VAC (or similar software) to direct any audio to ReaStream.




In Vista you can set the Virtual Audio Cable as the default recording device by opening the ‘Sound’ control panel and selecting the ‘Recording’ tab. Select the audio input for whichever Virtual Audio Cable you’re using and set it to be the default recording input by clicking the ‘Set Default’ button. You might also find that you need to disable some microphone inputs. My webcam kept transmitting audio until I did this.


When you’re running ReaStream to send from Vista you will see an additional audio fader in the Volume Mixer for ReaStream. Adjusting the fader for Reastream will adjust whether you hear the audio that is being sent to remote computer(s).



Unfortunately, when using VAC and ReaStream in XP I found that I was unable to use the SaviHost Host application. This is where Cantabile Lite saved the day. Cantabile is a very light weight low impact application to install (932 kb for the installer).

Download Cantabile Lite from http://www.toptensoftware.com/cantabile/download.php and install it.

The first time that you launch Cantabile you’ll need to select the ReaStream plugin.




Click the down arrow next to where it says ‘Choose Plugin’ on the interface. Select ‘File’ then ‘Choose Plugin’ to browse for the ‘reastream-standalone.dll’ file.



Select ‘reastream-standalone.dll’ and click ‘Open’.



Once selected you should see the same settings dialog as described in the previous configuration instructions. Make the appropriate settings as per your desired configuration and click the save button to make sure that these settings will be remembered.



To access the settings screen again you can click the ‘Settings’ button as per the picture above.



The next configuration step is to select the sound input that you wish to use. To do this, select ‘Options’ from the ‘Tools’ menu.



In the ‘Options’ dialog, select the appropriate ‘Driver’ for the Virtual Cable that you wish to use with Sage.

Back in the main window ensure that the ‘Dry’ and ‘Wet’ volume controls are set to zero to ensure that you don’t receive horrorfying feedback.



You’re done!

Hopefully you’ll be able to work out some sort of solution using the above guide. Give it a try and let me know how you go. Given the number of options and permutations possible I’ve no doubt that there will be new and interesting behavior to work around on each system.

The next thing that I will be looking into is some kind of option to manage the settings for a multi room setup via my sage menu. I’m also keen to know if there’s an easy way to ‘quick switch’ outputs in Sage so that I don’t have to go into the advanced setup options to swap output devices. Any suggestions would be appreciated.

Mick.
Attached Files
File Type: zip savihost.zip (160.1 KB, 468 views)

Last edited by mickp; 03-15-2008 at 03:16 PM. Reason: Scaled inline images and put them back inline
Reply With Quote
  #2  
Old 03-15-2008, 10:35 AM
Addict's Avatar
Addict Addict is offline
Sage Aficionado
 
Join Date: Apr 2007
Location: San Diego, CA
Posts: 335
Wow. This is a very thorough post, thanks! I personally don't have a need for this, but just wanted to say thanks for contributing to the community in such detail. Nicely done!
__________________
Al Bsharah / Twitter
Clients:
Two STX-HD100 High-Def Extenders
Media Server / NAS:
Case: Thermaltake Armor CPU: AMD Opteron 1218 (2.6GHz Dual Core) Motherboard: ASUS MN2-LR Memory: 2GB Gfx Card: Headless Tuner: Hauppauge HD-PVR, Hauppauge PVR-350 (not in use) O/S: Windows 7 Sage: Latest RAID: On-Board Drives: 6 x 1.5TB SATA RAID-5, 2 x 80GB IDE RAID-1 (O/S) Storage: 7.5TB Total
Reply With Quote
  #3  
Old 03-15-2008, 02:38 PM
RobJ RobJ is offline
Sage Advanced User
 
Join Date: Jan 2007
Location: Tampa, FL
Posts: 97
Smile

Completely concur! Here's another WOW!!! I am hereby appointing you to take over the technical writing and documentation departments of many product companies; and not just software companies, but hardware and appliance companies too. Terrific presentation!
Reply With Quote
  #4  
Old 03-15-2008, 03:40 PM
mickp's Avatar
mickp mickp is offline
Sage Aficionado
 
Join Date: Oct 2006
Posts: 468
Thanks Addict and Rob for your kind words. Sorry Rob but I must respectfully decline the appointment. Documentation is an occupational hazard but not a passion

Unfortunately there's a bit to understand when implementing this as most htpc ppl probably haven't had much to do with vst etc. It's not difficult to comprehend, just different.

I'm enjoying finally being able to route full quality audio about the house without needing to run cables etc (this time). I was suprised that nobody appears to have made a simple all in one application to do this kind of thing.

Hopefully someone out there will find this useful.

Mick.
Reply With Quote
  #5  
Old 03-16-2008, 09:48 AM
Flips's Avatar
Flips Flips is offline
Sage Advanced User
 
Join Date: Oct 2005
Posts: 155
very cool. I might have to set this up. I currently run xlobby in the background to do this type of thing. I would love to be able to just switch to 100% sage usage.

Although to fully replace xlobby, this would have to be integrated into the sage screen and then also give myself the ability to control sage from my mobile phone, connected to the wifi in my house. The later two aren't quite as big of a jump as what this first step was. With some minor changes to the web server plugin, and a small stvi that would take care of the other two.

I saw an airport express audio in use for the first time this weekend. That's kind of a cool setup for those mac addicts. You can stream audio from itunes directly to this little box on the network, which is hooked up to your stereo system. I also found a program that will make other programs talk to it called airfoil. It also allows you to talk to other computers. That would be the all in one program that you were asking about. But I think what you outline already has much better integration with sage.

http://www.rogueamoeba.com/airfoil/windows/
http://www.apple.com/airportexpress/

flips

[EDIT] I found a couple of winamp plugins that also accomplish this:

Airport express plugin: http://www.winamp.com/plugins/details/172649
Simple remote server plugin: http://www.winamp.com/plugins/details/172649

Last edited by Flips; 03-16-2008 at 09:59 AM.
Reply With Quote
  #6  
Old 03-16-2008, 07:04 PM
m0ng00se30 m0ng00se30 is offline
Sage Aficionado
 
Join Date: Dec 2003
Location: MS
Posts: 359
Flips,
Quote:
I currently run xlobby in the background to do this type of thing.
you can tell I haven't looked at this kinda stuff in a long time... when did xlobby go to custom installer/pay software. Didn't it use to be a free open source kinda thing?

--Mike
__________________
Win7Pro, SageTV v6.6, SageMC, Intel E6850, 2048MB DDR2, , ATI4750, LG BR/HDVD/DVD-Rom,1xHDHR, 1xPVR-1600 (1x DirectTV , 1x Comcast Analog Cable, and 3x OTA Digital), USB-UIRT, and Harmony 300 Remote + 1 MVP Extender + 1 PC Client.

Last edited by m0ng00se30; 03-16-2008 at 07:06 PM.
Reply With Quote
  #7  
Old 03-17-2008, 08:57 AM
mickp's Avatar
mickp mickp is offline
Sage Aficionado
 
Join Date: Oct 2006
Posts: 468
Control of multiple zones from Sage interface

Hey there,

I spent some time on Sunday writing some batch files as a framework for managing the different sending and recieving instances of reaStream from within Sage.

Unfortunately I'm in Darwin for the week so will probably not be able to do much more playing with this until the weekend. I'll try to improve the following instructions once I'm back at home.

The batch file for managing zone connections relies on the excellent pstools from Sysinternals (now Microsoft) http://www.sysinternals.com to start and stop different copies of the reastream dll and savihost.exe

For the purposes of this exercise I've decided to create four zones ZoneA, ZoneB, ZoneC and ZoneD. Unfortunately there doesn't seem to be an easy way to load different configuration files for savihost.exe from the command line so I've taken the approach of creating a separate copy for each zone.

This means that there are quite a few files that need to be created (eight of each type) for the system to work. For licensing reasons I'm not comfortable with distributing a zip file with all of the required files. To work around this I've written a batch file that will check to make sure that all of the required files have been downloaded and prompt with the url to download them from if they are missing from the system. Once the required files are present the batch file makes the required copies of the dll and exe files for each zone (send and receive).

mzinst.cmd
Code:
@echo off
rem Batch file to install (copy) required files for multizone system.
rem more info available at http://forums.sagetv.com/forums/showthread.php?t=31524
rem
rem This file will check for the presence of required files and prompt the user to download them
rem if necessary.
rem
rem unfortunately this is required because of licensing restrictions that preclude just
rem zipping up the files and making them available for download :(
rem
rem
rem
cls
echo.
echo This batch file will check for the presence of required files and prompt you to 
echo download and expand any missing files into the appropriate directory.
echo.
echo If all required files are in place then copies of files will be made to  
echo ensure that you can use multizone.cmd without needing to manually muck 
echo about with files.
echo.
echo Good luck.
echo.
pause
rem check to see if sage is in the correct path
if not exist "C:\program files\sagetv" goto nosagedir
echo.
echo Found Sage Directory
echo.

rem check to see if there's a copy of multizone.cmd in a multizone directory under sage
echo.
echo Checking to see if multizone.cmd is present
echo.
if not exist "c:\program files\sagetv\multizone\multizone.cmd" goto nomultizone
echo.
echo Located a copy of multizone.cmd in the correct directory
echo.

rem check to see if there's a copy of pskill.exe in a multizone directory under sage
echo.
echo Checking to see if pskill.exe is present
echo.
if not exist "c:\program files\sagetv\multizone\pskill.exe" goto nopstools
echo.
echo Located a copy of pskill.exe in the correct directory
echo.

rem check to see if there's a copy of psexec.exe in a multizone directory under sage
echo.
echo Checking to see if pskill.exe is present
echo.
if not exist "c:\program files\sagetv\multizone\psexec.exe" goto nopstools
echo.
echo Located a copy of pskill.exe in the correct directory
echo.


rem check to see if there's a copy of savihost.exe in a multizone directory under sage
echo.
echo Checking to see if savihost.exe is present
echo.
if not exist "c:\program files\sagetv\multizone\savihost.exe" goto nosavihost
echo.
echo Located a copy of savihost.exe in the correct directory
echo.
rem make copies of savihost files if required
if not exist "C:\program files\sagetv\multizone\ZoneA.exe" copy "C:\program files\sagetv\multizone\savihost.exe" "C:\program files\sagetv\multizone\ZoneA.exe"
if not exist "C:\program files\sagetv\multizone\ZoneB.exe" copy "C:\program files\sagetv\multizone\savihost.exe" "C:\program files\sagetv\multizone\ZoneB.exe"
if not exist "C:\program files\sagetv\multizone\ZoneC.exe" copy "C:\program files\sagetv\multizone\savihost.exe" "C:\program files\sagetv\multizone\ZoneC.exe"
if not exist "C:\program files\sagetv\multizone\ZoneD.exe" copy "C:\program files\sagetv\multizone\savihost.exe" "C:\program files\sagetv\multizone\ZoneD.exe"
if not exist "C:\program files\sagetv\multizone\sendZoneA.exe" copy "C:\program files\sagetv\multizone\savihost.exe" "C:\program files\sagetv\multizone\sendZoneA.exe"
if not exist "C:\program files\sagetv\multizone\sendZoneB.exe" copy "C:\program files\sagetv\multizone\savihost.exe" "C:\program files\sagetv\multizone\sendZoneB.exe"
if not exist "C:\program files\sagetv\multizone\sendZoneC.exe" copy "C:\program files\sagetv\multizone\savihost.exe" "C:\program files\sagetv\multizone\sendZoneC.exe"
if not exist "C:\program files\sagetv\multizone\sendZoneD.exe" copy "C:\program files\sagetv\multizone\savihost.exe" "C:\program files\sagetv\multizone\sendZoneD.exe"

echo.
echo Made required copies of savihost.exe
echo.

if not exist "c:\program files\sagetv\multizone\reastream-standalone.dll" goto noreastream
echo.
echo Located a copy of reastream-standalone.dll in the correct directory
echo.
rem make copies of savihost files if required
if not exist "C:\program files\sagetv\multizone\ZoneA.dll" copy "C:\program files\sagetv\multizone\reastream-standalone.dll" "C:\program files\sagetv\multizone\ZoneA.dll"
if not exist "C:\program files\sagetv\multizone\ZoneB.dll" copy "C:\program files\sagetv\multizone\reastream-standalone.dll" "C:\program files\sagetv\multizone\ZoneB.dll"
if not exist "C:\program files\sagetv\multizone\ZoneC.dll" copy "C:\program files\sagetv\multizone\reastream-standalone.dll" "C:\program files\sagetv\multizone\ZoneC.dll"
if not exist "C:\program files\sagetv\multizone\ZoneD.dll" copy "C:\program files\sagetv\multizone\reastream-standalone.dll" "C:\program files\sagetv\multizone\ZoneD.dll"
if not exist "C:\program files\sagetv\multizone\sendZoneA.dll" copy "C:\program files\sagetv\multizone\reastream-standalone.dll" "C:\program files\sagetv\multizone\sendZoneA.dll"
if not exist "C:\program files\sagetv\multizone\sendZoneB.dll" copy "C:\program files\sagetv\multizone\reastream-standalone.dll" "C:\program files\sagetv\multizone\sendZoneB.dll"
if not exist "C:\program files\sagetv\multizone\sendZoneC.dll" copy "C:\program files\sagetv\multizone\reastream-standalone.dll" "C:\program files\sagetv\multizone\sendZoneC.dll"
if not exist "C:\program files\sagetv\multizone\sendZoneD.dll" copy "C:\program files\sagetv\multizone\reastream-standalone.dll" "C:\program files\sagetv\multizone\sendZoneD.dll"

echo.
echo Made required copies of reastream-standalone.dll
echo.


echo.
echo Looks like everything is in place.  Enjoy!
echo.
echo.

goto end

:nosagedir
echo.
echo OMG.  Can't find a c:\program files\sagetv directory
echo.
echo This is too weird.  Aborting :(
echo.
goto end

:nomultizone
echo.
echo Unable to locate required file c:\program files\sagetv\multizone\multizone.cmd
echo.
echo Please download a copy from 
echo http://forums.sagetv.com/forums/showthread.php?t=31524
echo and try to run this batch file again.
echo.
goto end

:nosavihost
echo.
echo Unable to locate required file c:\program files\sagetv\multizone\savihost.exe
echo.
echo Please download a copy from 
echo http://forums.sagetv.com/forums/attachment.php?attachmentid=6646^&d=1205565775
echo.
echo copy it to c:\program files\sagetv\multizone and 
echo try to run this batch file again.
echo.
goto end

:noreastream
echo.
echo Unable to locate required file:
echo c:\program files\sagetv\multizone\reastream-standalone.dll
echo.
echo Please download a copy from 
echo http://www.reaper.fm/reaplugs/reaplugs111.zip
echo.
echo copy it to c:\program files\sagetv\multizone and 
echo try to run this batch file again.
echo.
goto end

:nopstools
echo.
echo Unable to locate required file:
echo c:\program files\sagetv\multizone\psexec.exe
echo or 
echo c:\program files\sagetv\multizone\pskill.exe
echo.
echo Please download a copy of psutils from  
echo http://download.sysinternals.com/Files/PsTools.zip
echo.
echo copy the files to c:\program files\sagetv\multizone and 
echo try to run this batch file again.
echo.
goto end
:end
echo.
pause
The multizone.cmd batch file handles starting and stopping instances of reaStream for sending and receiving in each zone. When starting a zone for receiving from a zone on a particular computer all other zones are stopped before launching the required zone. When launching an instance of reastream to send to a zone all receiving instances are stopped then all instances of the sending zone are stopped on all pc's detected on the network before starting the sending instance on the specified computer (I hope that makes sense).

multizone.cmd has the following syntax;

multizone.cmd action targetComputer ZoneName username* password*

* username and password are optional. If they are not provided then the currently logged on user will be used to launch or kill processes on remote pc's.

Some examples;

multizone.cmd listen hal ZoneA mick mypassword
This will kill any other listening reaStream instances on the computer called hal and will launch the ZoneA listening instance of reastream.

multizone.cmd send samael ZoneA
This will kill any listening processes on samael, kill any send ZoneA processes on all machines detected on the network then launch the ZoneA reastream process on Samael. In this case no username and password have been supplied so the credentials of the current user will be used.

multizone.cmd listen hal none mick mypassword
This will stop any listening reastream processes on the computer hal.

For those interested in arcane dos stuff here's the content of multizone.cmd

Code:
@echo off
rem
rem Batch file my Mick to control instances of reastream on networked pc's to implement a 
rem multi-zone network audio system
rem
rem For further info see http://forums.sagetv.com/forums/showthread.php?t=31524
rem
rem

rem set debug to true (below) when initially setting up new targets
rem this will cause the interface to show so that you can configure the settings

set debug="true"


rem set path to multizone files on all clients (leave quotes out)
set mzpath=C:\program files\sagetv\multizone

cd %mzpath%

rem goto help if no parms provided
IF !%1==! goto help

rem Here's where we handle parameters
set action=%1
set target=%2
set zone=%3
set user=%4
set pass=%5

rem handle username and passowrd params not being present
set uparam=-u
IF !%4==! set uparam=% 
set pparam=-p
IF !%5==! set pparam=% 

rem if debug true then launch reastream interactively on target
if %debug%=="true" set interact=-i

goto %action%
goto end

:listen
echo action is %action%
echo target pc is %target%
echo zone is %zone%
rem echo interact is %interact%
echo.

echo kill all other listening instances on target
pskill \\%target% %uparam% %user% %pparam% %pass% ZoneA.exe
pskill \\%target% %uparam% %user% %pparam% %pass% ZoneB.exe
pskill \\%target% %uparam% %user% %pparam% %pass% ZoneC.exe
pskill \\%target% %uparam% %user% %pparam% %pass% ZoneD.exe

rem skip launch if zone is none
if %zone%==none goto end

rem launch correct listening zone on target
psexec -d %interact% %uparam% %user% %pparam% %pass% \\%target% "%mzpath%\%zone%.exe"

goto end

:send
rem this is where we set a machine to send audio for a zone.  There can be only one per zone!

rem get a list of all pc's currently in the network 

if exist pclist.txt delete pclist.txt
net view > pclist.txt
rem process list of pc's and kill appropriate zone send processes on all pc's on the network
rem this is messy and I should probably use find or something to stop errors popping up.  Maybe later.
rem this should not be used in an environment with too many pc's.
for /F "tokens=* delims=" %%i in (pclist.txt) do pskill %%i %uparam% %user% %pparam% %pass% send%zone%.exe

rem kill all receiving and sending on target.  Presumably we don't want to be creating interesting loops :)
pskill \\%target% %uparam% %user% %pparam% %pass% ZoneA.exe
pskill \\%target% %uparam% %user% %pparam% %pass% ZoneB.exe
pskill \\%target% %uparam% %user% %pparam% %pass% ZoneC.exe
pskill \\%target% %uparam% %user% %pparam% %pass% ZoneD.exe
pskill \\%target% %uparam% %user% %pparam% %pass% sendZoneA.exe
pskill \\%target% %uparam% %user% %pparam% %pass% sendZoneB.exe
pskill \\%target% %uparam% %user% %pparam% %pass% sendZoneC.exe
pskill \\%target% %uparam% %user% %pparam% %pass% sendZoneD.exe

Rem now launch the send zone on the target machine
psexec -d %interact% %uparam% %user% %pparam% %pass% \\%target% "%mzpath%\send%zone%.exe"


goto end

goto end
:help
echo.
echo insert help text here
echo.
echo.
goto end

:end
rem clear env vars so they're not lying about teh place
set user=%
set pass=%
set target=%
set zone=%
set action=%
set mzpath=%
set interact=%
exit
To get multizone up and running you will need to unzip the attached zip file and place the 'multizone' directory from the zip file in the c:\program files\sagetv directory.

Once you've done this run the mzinst.cmd batch file and this should prompt you for the files that you need to have in the c:\program files\sagetv\multizone directory to continue.

Just in case, the files that you need are;

c:\program files\sagetv\multizone\multizone.cmd
included in the attached zip file

c:\program files\sagetv\multizone\savihost.exe
can be downloaded from http://forums.sagetv.com/forums/attachment.php?attachmentid=6646^&d=1205565775

c:\program files\sagetv\multizone\reastream-standalone.dll
can be downloaded from http://www.reaper.fm/reaplugs/reaplugs111.zip

c:\program files\sagetv\multizone\psexec.exe
c:\program files\sagetv\multizone\pskill.exe
can be downloaded from http://download.sysinternals.com/Files/PsTools.zip

In general (production) use the multizone.cmd batch will launch the reastream processes in the background without a visible user interface. This is required so that there aren't any focus issues when launching processes.

Unfortunately, for each of the computers configured there is some additional configuration required. I've not found a way to avoid having to configure each instance of reastream/savihost on each of the machines that will be used. The procedure is not too arduous but could take a while if you have a large number of pc's


Copy the c:\program files\sagetv\multizone directory to each computer that will participate in the multizone setup (after you've run the mzinst.cmd file to produce the required .exe and .dll files)

Make sure that you have debug enabled in multizone.cmd by editing the debug setting on line 15 of the file so that it reads;

set debug="true"

for each client you will need to execute the following commands and then configure the reastream plugin with appropriate send/receive and identifier settings.

For each computer (substitute computername below) type the following at a command prompt (ask if you don't know how to do that);

cd c:\program files\sagetv\multizone

multizone.cmd listen computername ZoneA username password


If all is well you should see the plugin launch on the targeted pc. You will need to configure the reaStream plugin to receive, set the 'Identifier' field to be ZoneA and check the enabled checkbox.



In the 'File' menu, select the 'Autosave plugin bank' entry (so that it is checked)



From the 'Devices' menu select 'Wave...'. Click okay on the 'Select Wave Devices' dialog (I'm not sure why this is required but it has been on my systems).



Close the plugin window. The settings should be remembered from now on.



Now rinse and repeat the above actions for ZoneB, ZoneC and ZoneD.



Now for the Send settings...

For each computer (substitute computername below) type the following at a command prompt (ask if you don't know how to do that);

cd c:\program files\sagetv\multizone

multizone.cmd send computername ZoneA username password


If all is well you should see the plugin launch on the targeted pc. You will need to configure the reaStream plugin to send, set the 'Identifier' field to be ZoneA, check the enabled checkbox and select '*broadcast' in the 'ip:' dropdown box.



In the 'File' menu, select the 'Autosave plugin bank' entry (so that it is checked)



From the 'Devices' menu select 'Wave...'. Click okay on the 'Select Wave Devices' dialog (I'm not sure why this is required but it has been on my systems).



Close the plugin window. The settings should be remembered from now on.




Now rinse and repeat the above actions for ZoneB, ZoneC and ZoneD.

Congrats. You're almost done

Now for the rewarding bit . You sould now be able to configure a Multizone menu on each of your sage servers to control zone configuration on each of your Sage systems. I've used Neilm's dynamic menu to add these items. Sagemc has this wonder configured by default and I thoroughly recommend that you use it because it's good .

Here's a pic;



The idea here is to setup menu items to allow sending to each zone from any machine that you might want to use as a source and receiving from any machine with speakers that you might want to play music from. The use of four zones should give ample flexibility for most setups. If you require more zones then you could add them to this config without too much difficulty.

An example menu might have entries like;

Send Hal > Zone A
Send Hal > Zone B
Send Hal > Zone C
Send Hal > Zone D

Send Samael > Zone A
Send Samael > Zone B
Send Samael > Zone C
Send Samael > Zone D

Send Shodan > Zone A
Send Shodan > Zone B
Send Shodan > Zone C
Send Shodan > Zone D

Receive Zone A > Hal
Receive Zone B > Hal
Receive Zone C > Hal
Receive Zone D > Hal

Receive Zone A > Samael
Receive Zone B > Samael
Receive Zone C > Samael
Receive Zone D > Samael

Receive Zone A > Shodan
Receive Zone B > Shodan
Receive Zone C > Shodan
Receive Zone D > Shodan

Receive Zone A > Xerxes
Receive Zone B > Xerxes
Receive Zone C > Xerxes
Receive Zone D > Xerxes

It may make sense to split this up into separate send and receive menus.

The menu entries just need to call multizone.cmd with the appropriate arguments.

To add the menu items I used the paste option in dynamic menus. I'm travelling at the moment so can't write detailed instructions on the process of adding menu items right now

Hopefully there will be a quicker way of adding these menus to each machine on the network. I'll have a play with this on the weekend. In the meantime any suggestions on how to do this are welcome.

Here's an example send and receive xml menu entry;

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE sageMenu PUBLIC "-//NIELM//DTD SAGEMENU XML 1.4//EN" "http://www.sage-community.org/~nielm/nielm_modules/dynamic_menu/sagemenu_1_3.dtd">
<sageMenu version="1.4">
<actionMenuItem title="Send Hal > Zone A">
<actionList>
<extCommand arguments="send hal ZoneA" command="c:\progra~1\sagetv\multizone\multizone.cmd" waitforexit="0" window="normal"/>
</actionList>
</actionMenuItem>
</sageMenu>




<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE sageMenu PUBLIC "-//NIELM//DTD SAGEMENU XML 1.4//EN" "http://www.sage-community.org/~nielm/nielm_modules/dynamic_menu/sagemenu_1_3.dtd">
<sageMenu version="1.4">
<actionMenuItem title="Receive Zone A > Hal">
<actionList>
<extCommand arguments="listen hal ZoneA" command="c:\progra~1\sagetv\multizone\multizone.cmd" waitforexit="0" window="normal"/>
</actionList>
</actionMenuItem>
</sageMenu>

Once you've got everything configured and working edit the multizone.cmd file(s) so that debug is set to false;

set debug="false"

This will allow everything to run in the background without taking focus from Sage.

There's a fair amount of work involved in getting this going at the moment but once it's up and running it's very, very, very cool . Hopefully there will be ways to make the configuration easier.

Also: If you have wireless links you may need to be careful with how many broadcasts you have running at a time due to bandwidth limitations.

Mick.
Attached Files
File Type: zip multizone.zip (2.6 KB, 430 views)

Last edited by mickp; 03-17-2008 at 09:09 AM.
Reply With Quote
  #8  
Old 03-17-2008, 07:27 PM
Flips's Avatar
Flips Flips is offline
Sage Advanced User
 
Join Date: Oct 2005
Posts: 155
Quote:
Originally Posted by m0ng00se30 View Post
Flips,


you can tell I haven't looked at this kinda stuff in a long time... when did xlobby go to custom installer/pay software. Didn't it use to be a free open source kinda thing?

--Mike
Don't get me started...

It was back in October or so when the whole mess started. They offered a one time only buy in to the beta for $200. Now they will ONLY sell to professional installers.

So they basically said, "jog on" to all the DIYers and all the people that created add-ons to xlobby to make it into what it is today. I'm using the last free version and that works for me.

flips

flips
Reply With Quote
  #9  
Old 03-18-2008, 07:23 PM
wbarber69's Avatar
wbarber69 wbarber69 is offline
Sage Expert
 
Join Date: Oct 2004
Location: Hammond, La.
Posts: 512
Send a message via ICQ to wbarber69 Send a message via AIM to wbarber69 Send a message via MSN to wbarber69 Send a message via Yahoo to wbarber69
ok now all we need is to automate the whole process and set it up in a .exe file and were all set
Reply With Quote
  #10  
Old 03-19-2008, 04:54 AM
Flips's Avatar
Flips Flips is offline
Sage Advanced User
 
Join Date: Oct 2005
Posts: 155
mickp, again great work! I can't wait to get some time so I can try to set this up. Thanks again,

flips
Reply With Quote
  #11  
Old 03-19-2008, 05:53 PM
mickp's Avatar
mickp mickp is offline
Sage Aficionado
 
Join Date: Oct 2006
Posts: 468
Quote:
Originally Posted by Flips View Post
mickp, again great work! I can't wait to get some time so I can try to set this up. Thanks again,

flips

Thanks Flips,

Let me know if you run into any problems.

Mick.
Reply With Quote
  #12  
Old 03-19-2008, 06:44 PM
mickp's Avatar
mickp mickp is offline
Sage Aficionado
 
Join Date: Oct 2006
Posts: 468
Quote:
Originally Posted by Flips View Post
very cool. I might have to set this up. I currently run xlobby in the background to do this type of thing. I would love to be able to just switch to 100% sage usage.

Although to fully replace xlobby, this would have to be integrated into the sage screen and then also give myself the ability to control sage from my mobile phone, connected to the wifi in my house. The later two aren't quite as big of a jump as what this first step was. With some minor changes to the web server plugin, and a small stvi that would take care of the other two.

I saw an airport express audio in use for the first time this weekend. That's kind of a cool setup for those mac addicts. You can stream audio from itunes directly to this little box on the network, which is hooked up to your stereo system. I also found a program that will make other programs talk to it called airfoil. It also allows you to talk to other computers. That would be the all in one program that you were asking about. But I think what you outline already has much better integration with sage.

http://www.rogueamoeba.com/airfoil/windows/
http://www.apple.com/airportexpress/

flips

[EDIT] I found a couple of winamp plugins that also accomplish this:

Airport express plugin: http://www.winamp.com/plugins/details/172649
Simple remote server plugin: http://www.winamp.com/plugins/details/172649
Airfoil looks interesting. I'll probably give this a go over the weekend.

Mick.
Reply With Quote
  #13  
Old 03-19-2008, 09:16 PM
PGPfan's Avatar
PGPfan PGPfan is offline
Sage Fanatic
 
Join Date: Apr 2003
Location: Oldtown, Idaho USA
Posts: 862
Agreed, Airfoil looks really intrigueing! I wonder if it'd be possible to interface this within Sage very effectively considering apparently it supports Applescript.

MickP, the solution you described above - can it work via the extenders?

-PGPfan
__________________
Sage Server: Gigabyte 690AMD m-ATX, Athlon II X4 620 Propus, 3.0 GB ram, (1) VistaView dual analog PCI-e tuner, (2) Avermedia Purity 3D MCE 250's, (1) HD-Homerun, 1.5 TB of hard drives in a Windows Home Server drive pool, Western Digital 300GB 'scratch' disk outside the pool, Gigabit LAN
Sage Clients: MSI DIVA m-ATX, 5.1 channel 100w/channel amplifier card, 2 GB ram, , (1) Hauppauge MVP, (1) SageTV HD-100 Media Storage: unRAID 3.6TB server
Reply With Quote
  #14  
Old 03-20-2008, 01:01 AM
mickp's Avatar
mickp mickp is offline
Sage Aficionado
 
Join Date: Oct 2006
Posts: 468
Quote:
Originally Posted by PGPfan View Post
Agreed, Airfoil looks really intrigueing! I wonder if it'd be possible to interface this within Sage very effectively considering apparently it supports Applescript.

MickP, the solution you described above - can it work via the extenders?

-PGPfan
Hi PGPfan,

I don't think the above solution will work on the extenders . It's possible to run reaStream under Wine but that would mean some challenging hacking on the extenders.

A good jack driver for Windows would probably be the go for integrating this type of capability with linux based devices (i'm assuming that the extenders are linux based. Is that correct?). Unfortunately I've not found a jack driver for Windows . Does anyone know what audio system the extenders use?

Ultimately it would be cool if Sage could add a capability like this to the base product. I'd be very happy with multi zone support in the music player so that you could enable multiple audio targets on other sage servers, clients and extenders. This could possibly be done by playing the files on each destination in synch rather than streaming audio at a system/device level.

Mick.
Reply With Quote
  #15  
Old 03-20-2008, 01:39 PM
PGPfan's Avatar
PGPfan PGPfan is offline
Sage Fanatic
 
Join Date: Apr 2003
Location: Oldtown, Idaho USA
Posts: 862
Hi Mick,

I've been playing around with the demo of Airfoil. Man, this is awesome! Talk about painless to setup (now, interfacing via Sage might be another thing all together). It seems to be very controllable via the Applescript, but I'm not sure exactly how to pass info to and from Sage with it.

I'd love to see the Sage folks contact the Airfoil folks and do a little partnership. It could probably be made to work with an extender (which, at least in the MVP's case, is running Linux) since they (Airfoil) already make a Linux port of their 'speaker' client.

This is easily worth the $25 price if we could get it to work with Sage. Hard to imagine something based on 'Apple' being so inexpensive.

-PGPfan
__________________
Sage Server: Gigabyte 690AMD m-ATX, Athlon II X4 620 Propus, 3.0 GB ram, (1) VistaView dual analog PCI-e tuner, (2) Avermedia Purity 3D MCE 250's, (1) HD-Homerun, 1.5 TB of hard drives in a Windows Home Server drive pool, Western Digital 300GB 'scratch' disk outside the pool, Gigabit LAN
Sage Clients: MSI DIVA m-ATX, 5.1 channel 100w/channel amplifier card, 2 GB ram, , (1) Hauppauge MVP, (1) SageTV HD-100 Media Storage: unRAID 3.6TB server
Reply With Quote
  #16  
Old 03-22-2008, 12:14 AM
mickp's Avatar
mickp mickp is offline
Sage Aficionado
 
Join Date: Oct 2006
Posts: 468
Quote:
Originally Posted by PGPfan View Post
Hi Mick,

I've been playing around with the demo of Airfoil. Man, this is awesome! Talk about painless to setup (now, interfacing via Sage might be another thing all together). It seems to be very controllable via the Applescript, but I'm not sure exactly how to pass info to and from Sage with it.

I'd love to see the Sage folks contact the Airfoil folks and do a little partnership. It could probably be made to work with an extender (which, at least in the MVP's case, is running Linux) since they (Airfoil) already make a Linux port of their 'speaker' client.

This is easily worth the $25 price if we could get it to work with Sage. Hard to imagine something based on 'Apple' being so inexpensive.

-PGPfan
Hey PGPfan,

I spent some time playing with airfoil today and it's rather cool. I'm yet to check out how it goes with multiple streams running around the place. Unfortunately I wasn't able to see how to automate airfoil from Windows.

I've sent the following support email to rogue amoeba.

Quote:
Hey there,

I notice that there's an applescript interface to allow automation/scripting of the OSX version. Is there an equivalent com or similar interface for the Windows version. I'm keen to see if it's possible to control Airfoil from within Sage TV on Windows. See http://www.sagetv.com and http://forums.sagetv.com/forums/showthread.php?t=31524 for more info re: sage. The end goal would be to create a plugin for Sage that basically reproduces the interface of Airfoil.

It would also be nice if the linux speaker app could be made to work as part of the Sage HD extender. This would probably require some cooperation from Sage though I suppose.

Regards,

Mick.
Hopefully they will respond with some info re: Windows Automation.

In the meantime I'm continuing to use the cobbled together multizone solution above.

Mick.
Reply With Quote
  #17  
Old 03-23-2008, 06:27 PM
mickp's Avatar
mickp mickp is offline
Sage Aficionado
 
Join Date: Oct 2006
Posts: 468
And the response;

Quote:
Originally Posted by Rogue Amoeba Support

Hi Mick,

Currently, there is no scripting option for the Windows version of Airfoil. It's something we'll consider for the future. Thanks for your suggestions regarding that and the Sage HD Extender.

- Justin
I guess another option for controlling Airfoil from an HTPC for the moment is to use Girder or similar.

Mick.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Audio popping and letterboxing BiSHGoD Hardware Support 5 07-23-2007 03:56 PM
best mpeg2 and AC3/DTS decoder for this system benjatelcom SageTV Software 0 02-22-2007 10:46 PM
Feature Request: Input Audio Meter davephan SageTV Customizations 0 11-06-2006 06:52 AM
No audio from #2 capture card autoboy Hardware Support 3 08-23-2006 07:40 PM
extender mvp stuck aoehlke SageTV Media Extender 72 01-18-2006 10:01 AM


All times are GMT -6. The time now is 02:21 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.