In case anyone finds it useful, here is the script I have developed to start ralphy's OSX version of SqueezePlay from the command line, setting environment variables as needed.
Setting the needed environment variables is needed for Mountain Lion but the script should also give more ease and flexibility for previous versions of OSX.
The script assumes that squeezeslave for OSX is in the shell's command search path. I put in /usr/local/bin as squeezeslave.
Also still assuming SqueezePlay is under Applications in your home directory.
The sed mangling in the script copes with output from squeezeslave -L like mine:
Output devices:
0: (Core Audio) AirPlay (2001/2011)
* 3: (Core Audio) Built-in Output (3/13)
4: (Core Audio) Soundflower (2ch) (1/11)
5: (Core Audio) Soundflower (64ch) (1/11)
6: (Core Audio) Aggregate Device (3/13)
You can select which Airplay device will be used from Audio Midi Setup's Audio devices window (without setting Airplay as the default output). I had to put up the volume level for Airplay in that window to get a decent sound level.
SqueezePlay was not sending to only one device from the Aggregate Device I tried building there.
I call my script squeezePlay and also placed it in /usr/local/bin. By default it sets the max rate to 96Khz. Give the -s option to the script to select another.
Airplay uses 44.1KHz but leaving at the default is fine.
------------snip--------------------------
#!/bin/bash
# default max sampling rate is 96000
rate=96000
rates=(44100 48000 96000 192000)
choices=(44.1kHz 48kHz 96kHz 192kHz)
# if -s argument given to script, prompt for selection from the common rates
if [ "$1" == -s ]
then echo "Type the number of the max rate to use:"
select choice in ${choices[@]}
do
if [ -z $choice ]
then
echo try again
else
rate=${rates[$((REPLY-1))]}
echo Using ${choices[$((REPLY-1))]}
break
fi
done
fi
echo $rate
echo "Type the number of the device to use:"
IFS=$'\n'
select device in `squeezeslave -L | sed -e 1d -e 's/.*Audio) //' -e 's/ ([0-9]*\/[0-9]*)$//'`
do
if [ -z $device ]
then
echo try again
else
echo $device
break
fi
done
unset IFS
export USEPADEVICE=$device
export USEPAMAXSAMPLERATE=$rate
open ~/Applications/SqueezePlay.app
------------snip--------------------------
Results 11 to 20 of 182
-
2012-09-08, 03:21 #11
- Join Date
- Jan 2010
- Posts
- 137
Updated start up script for command-line users
Last edited by nonnoroger; 2012-09-08 at 08:23. Reason: Removed stray * characters in script
-
2012-09-08, 04:56 #12
Thank you for putting the script together. I've updated the announcement post as well.
Ralphy
1-Touch, 5-Classics, 3-Booms, 2-UE Radio
Squeezebox client builds donations always appreciated.
-
2012-09-08, 10:12 #13
- Join Date
- Jan 2010
- Posts
- 137
And many thanks for the new functionality - it is already proving very useful.
I do think the script would also be useful for versions before ML where users need to change devices often.
BTW Once you are happy it is working, you can rename it with a .command extension. You will then be able to run it by double-clicking it in Finder. You will then also want to to go to Terminal Preferences, Settings, Shell tab, and set When the shell exits to Close if the shell exited cleanly. Either change the default rate in the script to your needs, or edit the script so it always prompts for the rate (as the script will run without the -s option).Last edited by nonnoroger; 2012-09-08 at 10:21. Reason: Added not about rate selection
-
2012-09-09, 21:54 #14
[ANNOUNCE] SqueezePlay for Mac OSX
> It is based on the 7.8 branch Jul 17, 2012 git check in which I've
> exported back to subversion as I really dislike git.
What a pity (but trust me: git and I aren't friends yet either :-)). How
much of a patch would this be to be merged back?
--
Michael
-
2012-09-10, 04:53 #15
The entire delta since the git export is 17M and includes support for Solaris SPARC, OpenIndiana Intel and ASIO/WASAPI for Windows. I had to update to SDL-1.2.15 as 1.2.13 wouldn't compile on OSX and it fixes video "flashing" on Solaris and Linux. Portaudio to now at the latest svn trunk, I added a newer zlib and included portaudio v18 support for Solaris.
The OSX changes are relatively small except for SDL 1.2.15.
If adding SDL 1.2.15 is not an issue, I'd be happy to spin a "mostly" osx only patch, including the device selection through environment variables and a few endianess bug fixes and such that I've fixed.Last edited by ralphy; 2012-09-10 at 05:26.
Ralphy
1-Touch, 5-Classics, 3-Booms, 2-UE Radio
Squeezebox client builds donations always appreciated.
-
2012-09-23, 08:16 #16
- Join Date
- Nov 2009
- Posts
- 37
Hey Ralphy,
Thanks for making this! Until now, other solutions for streaming music from my ReadyNAS/LMS to my Mac were not as satisfactory. Just curious, why can't SqueezePlay automatically pick up the current default output device (just like every other app) instead of having to specify one through an environment variable? I have the same question about the max sample rate - I realize this might be harder to automate.
Anyway, these are very minor and I am very happy with your solution!Main rig: SB Touch -> PS Audio DL III (Cullen IV) -> PS Audio Trio C-100 (Cullen III) --> Dunlavy Alethas.
Home Theater & Office Room: SB Classic's, Anywhere with WiFi: SB Radio; WiFi + power outlet: SB Boom
Control: iPeng on iPhone/iPad, SqueezePlay on Mac, IR Remote
-
2012-10-25, 20:14 #17
- Join Date
- Nov 2011
- Posts
- 4
ralphy, you are AWESOME! I have always run into problems trying to compile Squeezeplay with selectable output option, so I ended up just physically disconnecting onboard audio from my Mac Mini to get sound from my external output device. Now I can watch videos through my TV speakers without having to power up my tube amps. This is so great; can't wait to get home!
-
2012-11-09, 08:17 #18
New version r158 available on googlecode which automatically uses the default sound device from system preferences, if both the USEPADEVICE and USEPAHOSTAPI environment variables are NOT set. See post#1 for details.
Last edited by ralphy; 2012-11-09 at 18:25.
Ralphy
1-Touch, 5-Classics, 3-Booms, 2-UE Radio
Squeezebox client builds donations always appreciated.
-
2012-11-09, 09:33 #19
- Join Date
- Jan 2010
- Posts
- 137
-
2012-11-10, 07:40 #20
- Join Date
- Dec 2006
- Posts
- 677
You rock, rahlpy! Working great here on 10.8.2.