<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><title>Josh Bialkowski (Posts about pulse-audio)</title><link>https://www.joshbialkowski.com/</link><description></description><atom:link href="https://www.joshbialkowski.com/categories/pulse-audio.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2018 &lt;a href="mailto:josh.bialkowski@gmail.com"&gt;Josh Bialkowski&lt;/a&gt; 
&lt;a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"&gt;
&lt;img alt="Creative Commons License" style="border-width:0"
 src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /&gt;
&lt;/a&gt;&lt;br /&gt;
This work is licensed under a
&lt;a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"&gt;
Creative Commons Attribution-ShareAlike 4.0 International License&lt;/a&gt;.
</copyright><lastBuildDate>Tue, 20 Mar 2018 01:47:58 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Streaming Sound Between Devices</title><link>https://www.joshbialkowski.com/posts/2017/streaming-sound-between-devices.html</link><dc:creator>Josh Bialkowski</dc:creator><description>&lt;div&gt;&lt;p&gt;Today I spent a little time figuring out solutions for "casting" audio from one device to another. Here are some notes on how to make this happen.&lt;/p&gt;
&lt;div class="section" id="background"&gt;
&lt;h2&gt;Background&lt;/h2&gt;
&lt;p&gt;I have an old laptop setup as a media-center PC connected to my TV and receiver. This is pretty much the only set of speakers we have in the apartment so whenever we say "I'd like to listen to some music" we almost always mean "through these speakers". However we don't really have a good source of music these days. Sometimes we listen to youtube, sometimes amazon music, sometimes google music. Sometimes we play audio files from a laptop or desktop.&lt;/p&gt;
&lt;p&gt;Ideally, I'd figure out a good media management solution, but until that day a decent stopgap and otherwise generally useful feature would be "play this music here on this device I'm using but make the sound come out of those nice speakers over there".&lt;/p&gt;
&lt;div class="text-center"&gt;&lt;img src="https://www.joshbialkowski.com/images/2017/pulse_network_drawing.png"&gt;&lt;/div&gt;
&lt;p&gt;I'm currently able to listen to Google Play Music or Youtube from Firefox or Chrome on either Ubuntu system in the house (desktop or laptop) or from Google Play music or Amazon Prime Music from my Android phone. Amazon Prime Music is apparently broken (no audio) on Ubuntu period...&lt;/p&gt;
&lt;p&gt;In theory this solution &lt;em&gt;should&lt;/em&gt; work for any ubuntu application and any app on Android.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="other-options"&gt;
&lt;h2&gt;Other Options&lt;/h2&gt;
&lt;p&gt;I've previously tried or briefly entertained the following solutions:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;a class="reference external" href="http://georgielabs.net/"&gt;Soundwire&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;buggy&lt;/li&gt;
&lt;li&gt;annoying ads&lt;/li&gt;
&lt;li&gt;wasn't worth the purchase price&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a class="reference external" href="http://www.sonos.com/en-us/shop"&gt;Sonos&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;To expensive&lt;/li&gt;
&lt;li&gt;Not into that whole "ecosystem" thing&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a class="reference external" href="https://askubuntu.com/a/70700/24107"&gt;Pulse Audio Multicast/RTP&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;Problems with flash from browsers&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class="section" id="pulse-audio"&gt;
&lt;h2&gt;Pulse Audio&lt;/h2&gt;
&lt;p&gt;My current solution is to "enable network access to local sound devices" on the Pulse Audio server running on the media center laptop connected to the receiver. The solution came from &lt;a class="reference external" href="https://askubuntu.com/a/170014/24107"&gt;askubuntu.com&lt;/a&gt; but I'll describe it here as well.&lt;/p&gt;
&lt;div class="section" id="install-paprefs"&gt;
&lt;h3&gt;Install &lt;cite&gt;paprefs&lt;/cite&gt;&lt;/h3&gt;
&lt;p&gt;First, install the pulse audio preferences tool on the sound server:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ sudo apt-get install paprefs
&lt;/pre&gt;
&lt;/div&gt;
&lt;div class="section" id="configure-pulse-audio"&gt;
&lt;h3&gt;Configure pulse-audio&lt;/h3&gt;
&lt;p&gt;Run &lt;cite&gt;paprefs&lt;/cite&gt; uncheck all of the options on all tabs except for&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;"Enable network access to local sound devices"&lt;/li&gt;
&lt;li&gt;"Don't require authentication"&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="text-center"&gt;&lt;img src="https://www.joshbialkowski.com/images/2017/pulse_audio_01.png"&gt;&lt;/div&gt;
&lt;div class="text-center"&gt;&lt;img src="https://www.joshbialkowski.com/images/2017/pulse_audio_02.png"&gt;&lt;/div&gt;
&lt;div class="text-center"&gt;&lt;img src="https://www.joshbialkowski.com/images/2017/pulse_audio_03.png"&gt;&lt;/div&gt;
&lt;div class="text-center"&gt;&lt;img src="https://www.joshbialkowski.com/images/2017/pulse_audio_04.png"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="restart-pulse"&gt;
&lt;h3&gt;Restart pulse&lt;/h3&gt;
&lt;p&gt;Restart the pulse audio server with:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ pulseaudio -k
&lt;/pre&gt;
&lt;/div&gt;
&lt;div class="section" id="test-the-client"&gt;
&lt;h3&gt;Test the client&lt;/h3&gt;
&lt;p&gt;Test the client by downloading a sample audio file and playing it through the network to your audio server:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ wget http://www.signalogic.com/melp/EngSamples/Orig/female.wav
$ paplay --server=192.168.x.x:4713 female.wav
&lt;/pre&gt;
&lt;p&gt;Use the ip address of the actual server. If you don't know it, you can right click on the "Network Manager" applet and click "Connection Information" or you can run (in a terminal) &lt;cite&gt;ifconfig&lt;/cite&gt; and read through the output.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="stream-browser-audio"&gt;
&lt;h3&gt;Stream browser audio&lt;/h3&gt;
&lt;p&gt;Run your browser in an environment with &lt;cite&gt;PULSE_SERVER=192.168.x.x:4713&lt;/cite&gt; and give youtube a try. This worked for me on ubuntu 16.04 (on both client and server) and with chrome and firefox. Amazon prime streaming however doesn't seem to work.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="stream-android-audio"&gt;
&lt;h3&gt;Stream android audio&lt;/h3&gt;
&lt;p&gt;Solutions came from a couple places:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;a class="reference external" href="https://android.stackexchange.com/a/58049"&gt;android.stackexchange.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="reference external" href="https://askubuntu.com/q/366032/24107"&gt;askubuntu.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="reference external" href="https://askubuntu.com/a/649393/24107"&gt;askubuntu.com&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;On the server:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ sudo apt install pulseaudio-module-bluetooth
$ pactl load-module module-bluetooth-discover
&lt;/pre&gt;
&lt;p&gt;Connect the phone and PC using bluetooth. For me, I had to initialize the pairing from the PC, rather than the phone.&lt;/p&gt;
&lt;div class="text-center"&gt;&lt;img src="https://www.joshbialkowski.com/images/2017/Bluetooth_001.png"&gt;&lt;/div&gt;
&lt;p&gt;In android bluetooth settings for the PC connection, click Use For: "Media Audio" (this was already checked for me).&lt;/p&gt;
&lt;p&gt;At this point it should just work. If you go to the &lt;cite&gt;unity-control-center&lt;/cite&gt; "Sound" section (or "Sound" on the dash menu) you should see the phone listed under the "Input" tab.&lt;/p&gt;
&lt;div class="text-center"&gt;&lt;img src="https://www.joshbialkowski.com/images/2017/Sound_002.png"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;/div&gt;</description><category>pulse-audio</category><category>ubuntu</category><guid>https://www.joshbialkowski.com/posts/2017/streaming-sound-between-devices.html</guid><pubDate>Sat, 16 Sep 2017 21:15:19 GMT</pubDate></item></channel></rss>