Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ecooper7

macrumors newbie
Original poster
Jun 3, 2015
3
0
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:
https://github.com/zonque/PulseAudioOSX/wiki/Building-from-source

I saw that there was a dependency on MacPorts, so I followed these instructions to install that, too:
https://guide.macports.org/chunked/installing.macports.html

Back in the PulseAudio instructions, when I ran
./bootstrap_machine.sh
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 ./deploy.sh step, I get tons of errors. Full output here:
http://pastebin.com/0LKqy6Dx

Not even sure where to begin with that many errors. Anyone have any luck getting PulseAudio working on osx?
 
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.

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?
 
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.
 
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.

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?
 
Last edited:
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...?

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.

When I run the ./deploy.sh step, I get tons of errors. Full output here:
http://pastebin.com/0LKqy6Dx

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
 
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?

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.

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.

My $PATH is this:

/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/texbin:/Users/ecooper/.rvm/bin:/Users/ecooper/.rvm/bin

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.

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

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:

http://pastebin.com/JzKQ8YJG

When I search for that error, I found what appear to be some unresolved bug reports, as well as this solution: http://unix.stackexchange.com/questions/137169/pulseaudio-server-on-android 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.
 
My $PATH is this:

/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/texbin:/Users/ecooper/.rvm/bin:/Users/ecooper/.rvm/bin

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:

http://pastebin.com/JzKQ8YJG

When I search for that error, I found what appear to be some unresolved bug reports, as well as this solution: http://unix.stackexchange.com/questions/137169/pulseaudio-server-on-android 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.

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.
 
Last edited:
Basically my goal is to be able to forward audio over SSH from a Linux server to the speakers on my Mac.

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=192.168.0.0/24

to default.pa, 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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.