Installing PulseAudio on Mac

Discussion in 'Mac Basics and Help' started by ecooper7, Jun 3, 2015.

  1. ecooper7 macrumors newbie

    Jun 3, 2015
    Hi all,

    I am trying to install PulseAudio on my Macbook Pro (Mountain Lion). Basically my goal is to be able to forward audio over SSH from a Linux server to the speakers on my Mac.

    I found and started following these instructions:

    I saw that there was a dependency on MacPorts, so I followed these instructions to install that, too:

    Back in the PulseAudio instructions, when I ran
    I saw that MacPorts was installing a lot of basic utilities that I already have installed, such as llvm, automake, libtool, etc. I expect that this will cause conflicts at some point, and maybe is the cause of the problem...?

    When I run the ./ step, I get tons of errors. Full output here:

    Not even sure where to begin with that many errors. Anyone have any luck getting PulseAudio working on osx?
  2. SlCKB0Y macrumors 68040


    Feb 25, 2012
    Sydney, Australia
    Just curious, but why does the Linux server have to play the audio? I.e why can't you stream an audio file instead of the audio?
  3. ecooper7 thread starter macrumors newbie

    Jun 3, 2015
    Mainly because it's the most general solution. Whether I'm playing a .wav file from the command line, or watching a youtube video in an X-forwarded Firefox window, I would be able to hear it.

    Realistically though, I am only really ever playing .wav files from the command line. I was able to get something set up where I stream the data from the server to my laptop using netcat. I am not entirely sure what is the best way to continually 'listen' for it on my laptop, though.

    What I am doing now is this, using the SoX 'play' command:

    ecooper7@mac-laptop $ ssh -R 1234:localhost:1234 ecooper7@linux-server
    ecooper7@mac-laptop $ while true; do nc -l 1234 | play - ; done

    ecooper7@linux-server $ cat mysound.wav | nc localhost 1234

    This is maybe turning into more of a SoX question (unless there's another way?), but I am doing the 'while true' loop because SoX terminates and closes the pipe when it sees the EOF of the streamed .wav file. The loop is just so that it keeps listening for more files. It works if I play a few files individually, but it fails if I do this:

    ecooper7@linux-server $ cat *.wav | nc localhost 1234

    It fails in that it only plays the first audio file, because on the laptop end, SoX sees the first audio file's EOF, terminates, and starts up again with a new pipe.
  4. SlCKB0Y, Jun 8, 2015
    Last edited: Jun 8, 2015

    SlCKB0Y macrumors 68040


    Feb 25, 2012
    Sydney, Australia
    Have you considered having an NFS or SMB share on the Linux box? You could then script play back on the Mac as if it were a local file.

    Do you need the wavs to play as they are created in realtime or just on demand?
  5. subsonix macrumors 68040

    Feb 2, 2008
    MacPorts is completely self contained in /opt/local, the point of that is exactly to prevent conflicts and dependency problems if say Apple update the main system. You can also back up and/or move it while taking all dependencies with you.

    In these cases, it makes sense to start with the first error reported solving that often solves many of the others of the same kind, it also not uncommon that one error cascades to more errors. In this case, it can't find standard system installed C headers, which points to a path variable being messed up.

    Are there any reason why you want a 'bleeding edge' (as it's put) version of PulseAudio? MacPorts being a software repo already has PulseAudio avialable so you should be able to do: port install PulseAudio
  6. ecooper7 thread starter macrumors newbie

    Jun 3, 2015
    NFS or SMB might work, I'll look into that, thanks for the suggestion.

    Basically I am creating the .wavs and then wanting to listen to them right after. E.g. from an ssh session from my laptop, I would ideally want to be able to do something like:

    ecooper7@server $ cd /some/really/long/path
    ecooper7@server $ [some commands to create the audio, which must be run on the server and not my laptop]
    ecooper7@server $ play output.wav

    and hear it from my laptop speakers.

    My $PATH is this:


    I haven't had this problem installing other things from source that depend on standard C headers, so I'm not really sure what's going wrong with the path.

    I don't really need bleeding edge. I did also try 'sudo port install pulseaudio' and it appeared to install without error, but then when I try to run it, I get this error:

    When I search for that error, I found what appear to be some unresolved bug reports, as well as this solution: which suggests changing some configuration flags. I am not too familiar with macports, but my understanding is that it should have all the flags set correctly out of the box and you shouldn't have to change anything, so this led me to believe that the macports version of PulseAudio is out of date or maybe not supported.
  7. subsonix, Jun 16, 2015
    Last edited: Jun 16, 2015

    subsonix macrumors 68040

    Feb 2, 2008
    It may be a path set in the make file, not your $PATH variable because these headers are found in /usr/include. For any problems with a particular port I would check with the MacPorts mailing list.
  8. articice macrumors newbie

    Dec 16, 2015
    There's no point in forwarding ports over SSH, Pulseaudio can work as a tcp server.
    Try adding something like:

    load-module module-native-protocol-tcp auth-ip-acl=

    to, and setting server address in client.conf.

    I'm just about to build Pulseaudio on a Mac G5, use it as a multimedia server for my living room, wish me luck :)

    ps: you can also discover local sound servers with Avahi and forward sound to different sinks using some nice taskbar applet.

Share This Page