<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Fugue &#187; pulseaudio</title>
	<atom:link href="http://hans.fugal.net/blog/tag/pulseaudio/feed/" rel="self" type="application/rss+xml" />
	<link>http://hans.fugal.net/blog</link>
	<description>Counterpoint by Hans Fugal</description>
	<lastBuildDate>Fri, 11 Jun 2010 17:38:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>My Studio</title>
		<link>http://hans.fugal.net/blog/2008/06/10/my-studio/</link>
		<comments>http://hans.fugal.net/blog/2008/06/10/my-studio/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 17:27:01 +0000</pubDate>
		<dc:creator>Hans</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[aeolus]]></category>
		<category><![CDATA[alsa]]></category>
		<category><![CDATA[ardour]]></category>
		<category><![CDATA[jack]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[oss]]></category>
		<category><![CDATA[pulseaudio]]></category>
		<category><![CDATA[rosegarden]]></category>
		<category><![CDATA[studio]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Well, I've spent two days doing actual work in my studio and I can now confidently report my settings for the benefit of Linux-running MacBook users (and other related hoodlums). I won't go into the detail that I did in the previous posts, most of which is still relevant. I pass the option position_fix=3 to [...]]]></description>
			<content:encoded><![CDATA[<p>Well, I've spent two days doing actual work in my studio and I can now confidently report my settings for the benefit of Linux-running MacBook users (and other related hoodlums).</p>
<p>I won't go into the detail that I did in the previous posts, most of which is still relevant.</p>
<p>I pass the option <code>position_fix=3</code> to the module <code>snd-hda-intel</code>. I did this by creating <code>/etc/modprobe.d/local</code>, containing:<br />
     options snd-hda-intel position_fix=3</p>
<p>then running <code>sudo update-initramfs -uk all</code>.</p>
<p>I set up my Gnome session to run QJackCtl, which is in turn configured to start JACK on startup. My JACK settings (from <code>~/.jackdrc</code>) are:<br />
    /usr/bin/jackd -R -t2000 -dalsa -dhw:0 -r48000 -p1024 -n2 -s</p>
<p>JACK is extremely stable. I've had 2, maybe 3 xruns through two days of work, and those were when starting up applications, not when actually using them.</p>
<p>Now, since we have only one audio device and JACK has monopolized it, and we want to hear other than JACK, we need more configuration. Here is my <code>~/.asoundrc</code>:</p>
<pre><code># Set the default device to PulseAudio for all well-behaved ALSA applications
pcm.!default {
        type plug
        slave.pcm "pulse"
}
ctl.!default {
        type plug
        slave.pcm "pulse"
}

# This device can come in handy, but I mostly don't use it.
pcm.jack {
        type plug
        slave {
                pcm {
                        type jack
                        playback_ports {
                                0 alsa_pcm:playback_1
                                1 alsa_pcm:playback_2
                        }
                        capture_ports {
                                0 alsa_pcm:capture_1
                                1 alsa_pcm:capture_2
                        }
                }
                rate 48000
        }
}
ctl.jack {
        type hw
        card 0
}

# The acutal PulseAudio device
pcm.pulse {
        type pulse
}
ctl.pulse {
        type pulse
}
</code></pre>
<p>Now all well-behaved ALSA programs will use the default ALSA device, i.e.<br />
PulseAudio. PulseAudio needs to be configured now to use JACK. You'll need to<br />
get the <code>pulseaudio-module-jack</code> package, which probably means you'll need to<br />
build it yourself. I show you how to do that and how to configure PulseAudio in<br />
<a href="http://hans.fugal.net/blog/articles/2008/06/04/pulseaudio-as-a-jack-client">a previous<br />
post</a>.<br />
Incidentally you need to do the same for <code>libasound2-plugins</code> if you want to<br />
use the JACK plugin for ALSA as in my <code>asoundrc</code> above.</p>
<p>Now we have a bit of a chicken and egg problem. PulseAudio starts when you log<br />
in, and so does JACK (by way of QJackCtl in your Gnome session). But PulseAudio<br />
will fail to start if JACK isn't already running. What's more, if you decided<br />
you wanted to restart JACK for whatever reason, you'd have to restart<br />
PulseAudio too. So here's how I solved it. I leave ESD enabled in the Gnome<br />
sound settings, knowing that it will fail to start (and I won't get the really<br />
cool Ubuntu Studio startup ditty, but oh well). It needs to be checked if you<br />
want Gnome to make nifty system sounds. Now, in QJackCtl setup, on the options<br />
tab, check the box for "Execute script after Startup" and put "<code>pulseaudio -D</code>"<br />
in the box. Now PulseAudio will start whenever JACK starts, and it will<br />
stop/crash/whatever whenever JACK stops.</p>
<p>Now, you need to install <code>libflashsupport</code> to get Flash working with<br />
PulseAudio. Even so you might find occasional sites that crash it.</p>
<p>That about covers it. If you do much work with audio applications using<br />
complicated JACK graphs, don't overlook the power of QJackCtl's patchbay, which<br />
will automatically hook things up. I have a patch that will connect Aeolus to<br />
system output 3&amp;4 (headphones/external speakers), and hook my MIDI keyboard to<br />
Aeolus. So all I have to do is start Aeolus and pull some stops and I'm ready<br />
to play.</p>
<p>Which reminds me, there's still the annoying thing about JACK having 8 outputs<br />
(for surround sound) and the internal speakers are on outputs 1&amp;2, and the<br />
headphone jack is outputs 3&amp;4. If you're not getting sound from a JACK app and<br />
you think you should be, that's the first thing to check. Someday I plan to<br />
figure out the <code>.asoundrc</code> magic needed to set up JACK so that it's a regular<br />
stereo device sending sound to both the internal speakers and headphones. If<br />
you know how, please enlighten us in the comments. I know it can be done, I<br />
just haven't put in the time to figure it out and test it.</p>
]]></content:encoded>
			<wfw:commentRss>http://hans.fugal.net/blog/2008/06/10/my-studio/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>PulseAudio as a JACK Client</title>
		<link>http://hans.fugal.net/blog/2008/06/04/pulseaudio-as-a-jack-client/</link>
		<comments>http://hans.fugal.net/blog/2008/06/04/pulseaudio-as-a-jack-client/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 11:29:38 +0000</pubDate>
		<dc:creator>Hans</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[jack]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[pulseaudio]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I spoke too soon about not being able to get PulseAudio working as a JACK client. I found this post that tells you how to do it. The key I think is chmod -s `which pulseaudio`. I didn't have to start the JACK transport rolling, so that may be antiquated information. I did have to [...]]]></description>
			<content:encoded><![CDATA[<p>I spoke too soon about not being able to get PulseAudio working as a JACK client. I found <a href="https://tango.0pointer.de/pipermail/pulseaudio-discuss/2007-March/000330.html">this post</a> that tells you how to do it.</p>
<p>The key I think is <code>chmod -s `which pulseaudio`</code>. I didn't have to start the JACK transport rolling, so that may be antiquated information. I did have to build some packages from source, though:</p>
<pre><code>sudo apt-get build-dep pulseaudio
sudo apt-get install libjack-dev
fakeroot apt-get source -b pulseaudio
</code></pre>
<p>This creates a bunch of <code>.deb</code>s, including <code>pulseaudio-module-jack*.deb</code>. I just installed them all, but you can probably just install the jack module deb. Make the changes permanent by putting them in <code>~/.pulse/default.pa</code> or in <code>/etc/pulse/default.pa</code> and you're in business.</p>
]]></content:encoded>
			<wfw:commentRss>http://hans.fugal.net/blog/2008/06/04/pulseaudio-as-a-jack-client/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
