Home of the Squeezebox™ & Transporter® network music players.
Page 2 of 9 FirstFirst 1234 ... LastLast
Results 11 to 20 of 83
  1. #11
    Senior Member
    Join Date
    Jan 2010
    Posts
    137

    Updated start up script for command-line users

    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--------------------------
    Last edited by nonnoroger; 2012-09-08 at 08:23. Reason: Removed stray * characters in script

  2. #12
    Senior Member ralphy's Avatar
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    1,796
    Thank you for putting the script together. I've updated the announcement post as well.
    Ralphy

    1-Touch, 5-Classics, 3-Booms, 1-UE Radio
    Squeezebox client builds donations always appreciated.

  3. #13
    Senior Member
    Join Date
    Jan 2010
    Posts
    137
    Quote Originally Posted by ralphy View Post
    Thank you for putting the script together. I've updated the announcement post as well.
    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

  4. #14
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    19,781

    [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

  5. #15
    Senior Member ralphy's Avatar
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    1,796
    Quote Originally Posted by mherger View Post
    > 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
    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, 1-UE Radio
    Squeezebox client builds donations always appreciated.

  6. #16
    Quote Originally Posted by ralphy View Post
    I've created an OSX i386 and x86_64 only build with the ability to select the output device and set the maximum sample rate.

    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.

    The OSX intel port has been tested with 10.6 and 10.7. Forum members have reported this build works with Mountain Lion as well. See Nonnoroger's post #11 for a work around to the environment.plist support removal from 10.8.

    This version plays 24/96 wave and flac files natively using the latest LMS 7.8.0 nightly. The maximum sample rate can be set as high as 192000 in the USEPAMAXSAMPLERATE key, see below, but I haven't tested it, any value higher defaults to 192000.
    ................
    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

  7. #17
    Junior Member
    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!

  8. #18
    Senior Member ralphy's Avatar
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    1,796
    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, 1-UE Radio
    Squeezebox client builds donations always appreciated.

  9. #19
    Senior Member
    Join Date
    Jan 2010
    Posts
    137
    Quote Originally Posted by ralphy View Post
    New version r158 available on googlecode which automatically uses the default sound device from system preferences, if both the USEPADEVICE andUSEPAHOSTAPI environment variables are NOT set. See post#1 for details.
    This is a really useful and helpful update - many thanks Ralphy. Working fine under 10.8.2.

    Much less need for my script now.

  10. #20
    Senior Member
    Join Date
    Dec 2006
    Posts
    655
    You rock, rahlpy! Working great here on 10.8.2.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •