Announcement

Collapse
No announcement yet.

[ANNOUNCE] SqueezePlay for Mac OSX

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [ANNOUNCE] SqueezePlay for Mac OSX

    > My initial testing has not raised any issues and as a bonus cpu usage is
    > lower than previous versions and memory usage also.


    Haven't monitored resources (before nor after), but a first quick test
    "just works". Thanks a lot!
    Ralphy

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

    #2
    [ANNOUNCE] SqueezePlay for Mac OSX

    I've created MacOS Squeezeplay builds with the ability to select the output device and set the maximum sample rate.

    8.0.1.r1402 - 20220924
    8.0.1.r1382 - 20211213
    8.0.1.r1368 - 20210331

    SqueezePlay-ppc-7.8.0.dmg - Support for MacOS 10.3 - 10.6. Only tested on 10.6 intel rosetta.
    SqueezePlay-i386-7.8.0.dmg - Support for MacOS 10.4 - 10.12.
    SqueezePlay-x86_64-8.0.1.dmg - Support for MacOS 10.7+. Includes fix for Big Sur.
    SqueezePlay-M1-8.0.1.dmg - Support for MacOS 12.0+. Apple M1 hardware

    If you receive the message “SqueezePlay.app” is damaged and can’t be opened. at launch, run sudo xattr -cr /Applications/SqueezePlay.app from a Terminal window to fix it.

    See the commit history for changes.

    This version plays 24/96 wave and flac files natively using LMS 7.9.3 or newer. The maximum sample rate can be set as high as 384000 in the USEPAMAXSAMPLERATE key, see below, but I haven't tested it, any value higher defaults to 384000.

    Installation?

    Mount the SqueezePlay dmg disk image file and drag the SqueezePlay.app icon to Applications.

    How do I change the output device and/or maximum sample rate?

    There's Flimflam's Automator method to create a wrapper app to include setting the environment variables.

    Also see Nonnoroger's post #11 for a work around to the environment.plist support removal from 10.8.

    For 10.6 and 10.7 you can create a file called environment.plist in your home directory in the .MacOSX folder.

    You may need to create the .MacOSX folder. So the full path to my file is

    /Users/ralphy/.MacOSX/environment.plist

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
            <key>USEPADEVICE</key>
            <string>Sennheiser USB Headset</string>
            <key>USEPAMAXSAMPLERATE</key>
            <string>96000</string>
            <key>USEPAPLAYNICE</key>
            <string>1</string>
            <key>SDL_VIDEO_ALLOW_SCREENSAVER</key>
            <string>1</string>
    </dict>
    </plist>
    For 10.8+ use should use launchctl from the Terminal app.

    Here's how to enable USEPAPLAYNICE.

    Set the variable value to 1 (true).

    Code:
    sudo launchctl setenv USEPAPLAYNICE "1"
    Confirm the variable has been set.

    Code:
    sudo launchctl getenv USEPAPLAYNICE
    1


    To obtain the list of available output devices that can be used for the USEPADEVICE key you can download squeezelite for OSX dmg, install in /Applications and run squeezelite with the -l option.

    Code:
    $ /Applications/Squeezelite.app/Contents/MacOS/Squeezelite -l
    Output devices:
      1 - Built-in Output [Core Audio]
      2 - HDMI [Core Audio]
      3 - Sennheiser USB Headset [Core Audio]
    You can see how I obtained the exact match for my Headset.

    Once you've finished editing the environment.plist file you MUST logout and log back in before the keys will be available to SqueezePlay. You can check if the values have been set from the Terminal App.

    Code:
    $ set | grep -i usepa
    USEPADEVICE='Sennheiser USB Headset'
    USEPAMAXSAMPLERATE=96000
    Source code is available on github.

    Builds are available on sourceforge.
    Attached Files
    Last edited by ralphy; 2022-09-24, 14:58. Reason: Released 8.0.1r1402 - Sep 24/22
    Ralphy

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

    Comment


      #3
      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.

      ...

      Hopefully this works for the Mountain Lion folks to override the new AirPlay default output devices.
      Many thanks for this. I have been trying it under ML (which by the way is now on 10.8.1 so is no longer a .0 release). Sorry to say that it still sends output to Airplay (very quietly) despite the environment variable settings. I tried with Built-in Output.

      I will double-check tomorrow that I have the set-up and definitions right. Anyone else been trying?

      I don't know if this is related, but Rogue Amoeba's SoundSource, which I used quite happily under Lion, is marked by them as not compatible with Mountain Lion.

      Comment


        #4
        @ralphy

        You might want to have a look at this:
        ---
        learn more about iPeng, the iPhone and iPad remote for the Squeezebox and
        Logitech UE Smart Radio as well as iPeng Party, the free Party-App,
        at penguinlovesmusic.com
        New: iPeng 9, the Universal App for iPhone, iPad and Apple Watch

        Comment


          #5
          .MacOSX/environment.plist not supported in 10.8

          Ralphy

          I set the needed environment variable using export from the command line and then ran your Squeezeslave using the open command.

          Hey presto - sound output to Built-in Output as I had specified.

          I checked my environment.plist with the XCode property list editor and there were no problems. So a little digging around led to this result that came from from the Developer Forums:

          ===========
          Change the Info.plist of the .app itself to contain an "LSEnvironment" dictionary with the environment variables you want.
          ~/.MacOSX/environment.plist is no longer supported.
          ===========

          So a bit more work for 10.8 support I am afraid.

          Comment


            #6
            A bit more on this from the Developer site (the LS stands for Launch Services - launchd):

            =============
            LSEnvironment

            LSEnvironment (Dictionary - OS X) defines environment variables to be set before launching this app. The names of the environment variables are the keys of the dictionary, with the values being the corresponding environment variable value. Both keys and values must be strings.

            These environment variables are set only for apps launched through Launch Services. If you run your executable directly from the command line, these environment variables are not set.
            =============

            For now, I will use a shell script to export the variables and open the app.

            Comment


              #7
              Thanks for tracking this down.

              I should have known to check if the environment.plist file was still supported in Mountain Lion. Part of the reason I haven't upgraded is Apple keeps "dumbing down" OSX with every release.

              Could you post your startup script so everyone can benefit?
              Ralphy

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

              Comment


                #8
                Originally posted by ralphy View Post
                Could you post your startup script so everyone can benefit?
                From a terminal command line, create runPlayer containing the three lines (assuming the app itself is in your own Applications folder):

                export USEPADEVICE="Built-in Output"
                export USEPAMAXSAMPLERATE=9600
                open ~/Applications/SqueezePlay.app

                Then make the script executable with the command:

                chmod +x runPlayer

                If you are familiar with the command line environment, you could put runPlayer in your /usr/local/bin folder where it should be found whatever your directory as just

                runPlayer

                Otherwise, from the directory you created it, type

                ./runPlayer


                As soon as I get time I will try creating the suggested dictionary for environment variables in the Info.plist for the app.

                Comment


                  #9
                  Originally posted by nonnoroger View Post
                  export USEPAMAXSAMPLERATE=9600

                  As soon as I get time I will try creating the suggested dictionary for environment variables in the Info.plist for the app.
                  I think this should be export USEPAMAXSAMPLERATE=96000

                  Once you've tested the Info.plist PM me the details and I should be able to add it to my build script.
                  Ralphy

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

                  Comment


                    #10
                    Originally posted by ralphy View Post
                    This version plays 24/96 wave and flac files natively using the latest LMS 7.8.0 nightly.
                    Does this *require* 7.8.0 LMS, or will 7.7.2 suffice?

                    Thanks! -mark

                    Comment


                      #11
                      Originally posted by mbonsack View Post
                      Does this *require* 7.8.0 LMS, or will 7.7.2 suffice?

                      Thanks! -mark
                      7.7.2 is fine.

                      I've tested 24/96 with this version as far back as 7.6.2 any sample rate higher than 96000 requires a 7.8.0 nightly.
                      Last edited by ralphy; 2012-09-07, 22:17.
                      Ralphy

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

                      Comment


                        #12
                        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, 16:23. Reason: Removed stray * characters in script

                        Comment


                          #13
                          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.

                          Comment


                            #14
                            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, 18:21. Reason: Added not about rate selection

                            Comment


                              #15
                              [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
                              Michael

                              "It doesn't work - what shall I do?" - "Please check your server.log and/or scanner.log file!"
                              (LMS: Settings/Information)

                              Comment

                              Working...
                              X