{"id":22,"date":"2011-04-02T03:30:55","date_gmt":"2011-04-02T02:30:55","guid":{"rendered":"http:\/\/parseq.co.uk\/wordpress\/?p=22"},"modified":"2012-01-27T02:41:10","modified_gmt":"2012-01-27T02:41:10","slug":"setting-up-pulseaudio-1-0-beta-for-windows","status":"publish","type":"post","link":"https:\/\/parseq.co.uk\/wordpress\/archives\/setting-up-pulseaudio-1-0-beta-for-windows","title":{"rendered":"Setting up PulseAudio 1.0 beta for Windows"},"content":{"rendered":"<p>This is a bit of a niche post, so if you&#8217;ve never heard of PulseAudio then carry on elsewhere :)<\/p>\n<p>If, like me, you&#8217;ve been looking at setting up a PulseAudio server on Windows, you&#8217;ve no doubt come across an old binary download for version 0.9.6, which is approaching the healthy age of four years as of this writing. PulseAudio&#8217;s development has been very intensive since that time, with a lot of new features released. Sadly though, that development came at the cost of Windows compatibility, which meant that no newer versions were available for Windows. Until now that is, as the PulseAudio community is working on full Windows compatibility for the imminent release of version 1.0. Full details of progress are available <a href=\"http:\/\/pulseaudio.org\/wiki\/WindowsSupport\">on the PulseAudio wiki<\/a>, but in the meantime a full build has been made available as a <a href=\"http:\/\/bosmans.ch\/pulseaudio\/pulseaudio-1.0dev-1105.1.zip\">zipped package<\/a> (I&#8217;ve also mirrored it <a href=\"\/uploads\/pulseaudio-1.0dev-1105.1.zip\">here<\/a>, but keep an eye out for updated versions). If you want help setting it up, then read on. <!--more--><\/p>\n<h3 id=\"basics\">The Basics<\/h3>\n<p>There is no installer, so unzip the files into a location of your choice. For this tutorial, I&#8217;m going to assume the files are in C:\\PulseAudio. Next, you&#8217;ll need to open a command prompt. Windows Vista and 7 users will need to open a prompt with Administrator access: to do this, find the command prompt in your start menu, right click it, and select &#8220;Run as administrator&#8221;. Click yes if asked. Windows XP users can just open a prompt without further nonsense. In the prompt, type the following and hit enter:<code>cd C:\\PulseAudio\\bin<\/code> We can now test the program is working by typing <code>pulseaudio.exe -p \"C:\\PulseAudio\\lib\\pulse\\modules\" -nF \"C:\\PulseAudio\\etc\\pulse\\default.pa\"<\/code> (and press enter). I got a few warnings and errors at this stage (it is beta software after all), but I think it&#8217;s safe to assume that if it doesn&#8217;t crash, it&#8217;s working enough for our needs. Hit ctrl+C to return to the prompt.<\/p>\n<p>The next step is to configure PulseAudio to listen to connections on the network, since I assume nearly all Windows users want PulseAudio to stream audio from a Linux\/Unix\/BSD system. For this step you&#8217;ll need a text editor which can handle unix line endings, which does not include Microsoft&#8217;s own Notepad. If you don&#8217;t have one, I recommend <a href=\"http:\/\/notepad-plus-plus.org\/\">Notepad++<\/a> as it&#8217;s totally free. Open your editor (Vista and 7 users will need to open it as administrator), and open the file at C:\\PulseAudio\\etc\\pulse\\default.pa. Underneath the line that reads <code>load-module module-null-sink<\/code> enter a new line: <code>load-module module-native-protocol-tcp listen=0.0.0.0 auth-anonymous=1<\/code> You can now save the file, and restart PulseAudio with the same command line used earlier, and you should be able to play sound on your Windows machine across the network!<\/p>\n<p>There is a caveat: this allows any machine on the network to send audio to you. If you are not firewalled from the internet or you don&#8217;t consider your network secure, you must use a cookie file that PulseAudio generates for you. You can find it in your user profile: on Windows XP, it&#8217;s located in C:\\Documents and Settings\\&lt;your username&gt;\\.pulse-cookie. Vista and 7 users can find it at C:\\Users\\&lt;your username&gt;\\.pulse-cookie. Simply copy this file to the home directory of the user that is sending you sound on the remote machine. Often this will be your own home directory, but some daemons run their own (for example, <a href=\"#mpd\">MPD<\/a> on Ubuntu requires the cookie to be in \/var\/lib\/mpd). When you&#8217;ve done this, you can remove the &#8220;auth-anonymous=1&#8221; part from the line above.<\/p>\n<p><strong>Update: <\/strong>There is one more step necessary which I wasn&#8217;t aware of previously. In this version, the default behaviour of the server is to exit after 20 seconds of no playback, which is obviously not something we want. Open your text editor (as administrator if necessary) and start editing the file at C:\\PulseAudio\\etc\\pulse\\daemon.conf. At the end of the file, copy in the following: <code>exit-idle-time = -1<\/code> This simply tells PulseAudio not to exit until we say so.<\/p>\n<h3 id=\"mpd\">Setting up MPD<\/h3>\n<p>The reason I want PulseAudio on Windows is to use it with <a href=\"http:\/\/mpd.wikia.com\/\">MPD<\/a>, running on another machine on the network. This allows me to use the same music player when booting between Windows and Linux on my work PC, without needing two different interfaces or two copies of the same music library. MPD is surprisingly easy to get working across a network. On the machine running MPD, open the mpd.conf file with your favourite editor, and as root if necessary. On most distros the file is at \/etc\/mpd.conf. At the end, append the following: <code>audio_output {<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;type \"pulse\"<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;name \"Friendly Name\"<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;server \"hostname\"<br \/>\n}<\/code> replacing &#8220;Friendly Name&#8221; with the name of your choice, and &#8220;hostname&#8221; with the hostname or IP address of the machine running PulseAudio. Optionally, you can now comment out any old audio_output entries. Restart MPD. Lastly, use your client to specify which output to use. With MPC, this is specified as <code>mpc enable X<\/code> on the command line, where X is the number of your output (the number is based on the ordering of outputs in the mpd.conf file). In GMPC (which I use), you can switch outputs under the Server menu. Load up a track and hit play &#8211; you should now be hearing music in Windows.<\/p>\n<h3 id=\"service\">PulseAudio as a Windows service<\/h3>\n<p>This step is optional, and a bit involved, but if you want PulseAudio to be a service that runs when Windows starts up, this is how to do it. You will need something called &#8220;Windows Server 2003 Resource Kit Tools&#8221;, which is made by Microsoft and can be <a href=\"http:\/\/www.microsoft.com\/downloads\/en\/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&amp;displaylang=en\">downloaded for free from their website<\/a>. We need only two programs from this pack &#8211; instsrv.exe and srvany.exe. Install the pack, and keep track of where it was installed. In my case this was C:\\Program Files (x86)\\Windows Resource Kits\\Tools. Open a command prompt, as administrator if necessary (you can use the prompt from earlier if it&#8217;s still open). Use the cd command as demonstrated previously to navigate to where the tools were installed. Now run <code>instsrv PulseAudio \"C:\\Program Files (x86)\\Windows Resource Kits\\Tools\\srvany.exe\"<\/code> If your tools were installed somewhere else, then adjust that path so that it points to where srvany.exe ended up. Hopefully you&#8217;ll get a little message proclaiming success. You will now need to open the registry editor, which you can do by typing regedit in your start menu&#8217;s run box. If you&#8217;ve not used regedit before, it&#8217;s a little daunting but I will hold your hand all the way through. The layout is similar to Windows Explorer: the left pane holds &#8220;keys&#8221; which behave a little like folders, and the right pane holds &#8220;values&#8221;. Use the left pane to navigate to HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\PulseAudio. In the right pane, right click in the empty space and select New, then Key. You&#8217;ll be able to enter a name for it now, so enter Parameters. Now navigate into the new Parameters key, right click in the right pane again and select New, then String Value. Give it the name &#8220;Application&#8221; (without the quotes). Press enter to save the name, and double click your new value. In the prompt that pops up, enter the full command you used earlier to start PulseAudio, so using the same example as above this would be <code>C:\\PulseAudio\\bin\\pulseaudio.exe -p \"C:\\PulseAudio\\lib\\pulse\\modules\" -nF \"C:\\PulseAudio\\etc\\pulse\\default.pa\"<\/code> Click OK, and close regedit. Open Control Panel, head to Administrative Tools, and open the Services applet. If you scroll down you should see our PulseAudio service. Make sure you aren&#8217;t still running PulseAudio in a command prompt (ctrl+C to exit), then right click the service and select Start. If you don&#8217;t get any errors, then this has probably worked, but you can check by looking for pulseaudio.exe in Task Manager (Windows 7 users might need to click &#8220;Show processes from all users&#8221;). From now on, PulseAudio will start as soon as Windows boots, and be available to all users.<\/p>\n<h3 id=\"links\">Useful links<\/h3>\n<ul>\n<li>My heartfelt thanks go out to Maarten Bosmans and the other contributors working on Windows support. <a href=\"http:\/\/www.mail-archive.com\/pulseaudio-discuss@mail.0pointer.de\/msg08805.html\">His announcement of the new version is available here<\/a>.<\/li>\n<li>Further MPD instructions can be found at <a href=\"http:\/\/mpd.wikia.com\/wiki\/PulseAudio\">the MPD wiki<\/a>.<\/li>\n<li>More information on srvany and registry editing <a href=\"http:\/\/support.microsoft.com\/kb\/137890\">on the Microsoft Website<\/a><\/li>\n<li><a href=\"http:\/\/pulseaudio.org\/\">Official PulseAudio website<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This is a bit of a niche post, so if you&#8217;ve never heard of PulseAudio then carry on elsewhere :) If, like me, you&#8217;ve been looking at setting up a PulseAudio server on Windows, you&#8217;ve no doubt come across an old binary download for version 0.9.6, which is approaching the healthy age of four years &hellip; <a href=\"https:\/\/parseq.co.uk\/wordpress\/archives\/setting-up-pulseaudio-1-0-beta-for-windows\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Setting up PulseAudio 1.0 beta for Windows<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,6,7],"tags":[11,10,14,8,13,12,9],"class_list":["post-22","post","type-post","status-publish","format-standard","hentry","category-geekery","category-linux","category-tutorial","tag-bsd","tag-linux-2","tag-new-version","tag-pulseaudio","tag-tutorial-2","tag-unix","tag-windows"],"_links":{"self":[{"href":"https:\/\/parseq.co.uk\/wordpress\/wp-json\/wp\/v2\/posts\/22","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/parseq.co.uk\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/parseq.co.uk\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/parseq.co.uk\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/parseq.co.uk\/wordpress\/wp-json\/wp\/v2\/comments?post=22"}],"version-history":[{"count":17,"href":"https:\/\/parseq.co.uk\/wordpress\/wp-json\/wp\/v2\/posts\/22\/revisions"}],"predecessor-version":[{"id":79,"href":"https:\/\/parseq.co.uk\/wordpress\/wp-json\/wp\/v2\/posts\/22\/revisions\/79"}],"wp:attachment":[{"href":"https:\/\/parseq.co.uk\/wordpress\/wp-json\/wp\/v2\/media?parent=22"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/parseq.co.uk\/wordpress\/wp-json\/wp\/v2\/categories?post=22"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/parseq.co.uk\/wordpress\/wp-json\/wp\/v2\/tags?post=22"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}