08:53 am, 15 Feb 08
network sound between linux and mac
Thanks to a tip from
mart and a followup from
jmason, it turned out to be nearly trivial.
The remaining bit I don't understand is that it seems to remember the output device for different applications. What I'd prefer is a global switch: local or network. I haven't figured out quite where this sort of info lives, though.
- Instead esound on the Mac. I used MacPorts:
sudo port install esound
. - Configure esound to allow any client:
sudo vi /opt/local/etc/esd.conf
and change thedefault_options
line to read:default_options=-tcp -public -promiscuous -port 5678
- Start esd:
esd &
. - Back on the Linux box, tell PulseAudio about the new network device:
pactl load-module module-esound-sink sink_name=projectar server=projectar.local:5678
(You can pick your own sink_name, of course, and also the server; I'm using zeroconf.) - Tell PulseAudio to use the network device. I think this means running
padevchooser
and clicking through the obvious menus to set the "sink", but it also seems that program may be deprecated in favor ofpavucontrol
, which also involves clicking through the obvious menus to set the same setting. Or you can do it from the command line withpacmd
andset-default-sink
.
-ao pulse
.The remaining bit I don't understand is that it seems to remember the output device for different applications. What I'd prefer is a global switch: local or network. I haven't figured out quite where this sort of info lives, though.
If your setup is anything like mine was by default, you've probably got your Gnome apps talking the ESD protocol to PulseAudio's fake ESD on localhost, which then goes through all of PulseAudio's machinery only to have it come back out as ESD on the other side.
I guess having the ability to quickly switch between sinks makes that indirection worthwhile, though. I guess for completeness sake you could install PulseAudio on the Mac, so it'd go $GnomeApp → Fake ESD → PulseAudio in Linux → (PulseAudio RTP over the network) → PulseAudio On Mac → ESD on Mac → CoreAudio → Speakers. Fun stuff.
Running PA on the Mac would maybe have the benefit of PulseAudio's "latency estimation", whatever that means, or maybe better buffering.
It's always weird to me when you talk about Linux!
"Latency estimation" isn't that useful unless you're trying to sync something with the sound. For example, try watching a video with the sound routed through your Mac. I tried a very extreme case of this a while back: I ran mplayer on one box and had PulseAudio and X running on another showing the output. The sound and the video were both synced. I don't know how it does it, but it seems to work!
The fake esd that PulseAudio ships still causes the individual clients to show up in the volume control. I think it's just a thin wrapper around connecting to PulseAudio directly. Not really sure how it works internally, but it seems pretty seamless.
If you want to be able to switch everything at once, maybe you could investigate having two levels of PulseAudio: the first uses the second as a sink, and then you make the second do the selective routing. I've not tried anything like this, but it seems like it should work in theory.
As for me talking about Linux... I've been using it constantly for nearly a year now!
thanks :-)
thanks :-)this help me allot !
we use LTSP servers in schools and now i can use PulseAudio clients to send sound to old ESD servers in various student's machines over the network.
it works great !