<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments for Arun Raghavan</title>
	<atom:link href="http://arunraghavan.net/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://arunraghavan.net</link>
	<description>Extremely pithy tagline here</description>
	<lastBuildDate>Fri, 03 Feb 2012 22:57:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>Comment on PulseAudio vs. AudioFlinger: Fight! by liam</title>
		<link>http://arunraghavan.net/2012/01/pulseaudio-vs-audioflinger-fight/comment-page-1/#comment-26116</link>
		<dc:creator>liam</dc:creator>
		<pubDate>Fri, 03 Feb 2012 22:57:05 +0000</pubDate>
		<guid isPermaLink="false">http://arunraghavan.net/?p=1189#comment-26116</guid>
		<description>&lt;p&gt;Hi Colin,&lt;/p&gt;

&lt;p&gt;From the Apple dev docs (
https://developer.apple.com/library/ios/#documentation/MusicAudio/Conceptual/CoreAudioOverview/WhatisCoreAudio/WhatisCoreAudio.html#//apple_ref/doc/uid/TP40003577-CH3-SW17
)
they do use CoreAudio, but it has some differences from OSX&#039;s CA (unable to create custom codecs/audio units).
I assume that adding a simple switch/case wouldn&#039;t be feasible? I really end up going back to OSX and Windows: they have a single sound server that provides for all use cases, so clearly it is possible to design a system that works everywhere. Besides, if you can get it down to 2ms (or even 5 or 7, for that matter) I don&#039;t think anyone is going to complain about that being too large:)
Having better cooperation between JACK/PA would be fine as long as it is pretty transparent to the user (namely, install JACK with PA by default and enable JACK when required by an application). Obviously there would need to be more involved, but the goal of a &quot;single&quot; solution seems like it should be sought after.&lt;/p&gt;

&lt;p&gt;Thanks for the response, Colin.&lt;/p&gt;

&lt;p&gt;Best/Liam&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi Colin,</p>

<p>From the Apple dev docs (
<a href="https://developer.apple.com/library/ios/#documentation/MusicAudio/Conceptual/CoreAudioOverview/WhatisCoreAudio/WhatisCoreAudio.html#//apple_ref/doc/uid/TP40003577-CH3-SW17" rel="nofollow">https://developer.apple.com/library/ios/#documentation/MusicAudio/Conceptual/CoreAudioOverview/WhatisCoreAudio/WhatisCoreAudio.html#//apple_ref/doc/uid/TP40003577-CH3-SW17</a>
)
they do use CoreAudio, but it has some differences from OSX&#8217;s CA (unable to create custom codecs/audio units).
I assume that adding a simple switch/case wouldn&#8217;t be feasible? I really end up going back to OSX and Windows: they have a single sound server that provides for all use cases, so clearly it is possible to design a system that works everywhere. Besides, if you can get it down to 2ms (or even 5 or 7, for that matter) I don&#8217;t think anyone is going to complain about that being too large:)
Having better cooperation between JACK/PA would be fine as long as it is pretty transparent to the user (namely, install JACK with PA by default and enable JACK when required by an application). Obviously there would need to be more involved, but the goal of a &#8220;single&#8221; solution seems like it should be sought after.</p>

<p>Thanks for the response, Colin.</p>

<p>Best/Liam</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on PulseAudio vs. AudioFlinger: Fight! by Colin Guthrie</title>
		<link>http://arunraghavan.net/2012/01/pulseaudio-vs-audioflinger-fight/comment-page-1/#comment-26068</link>
		<dc:creator>Colin Guthrie</dc:creator>
		<pubDate>Thu, 02 Feb 2012 12:25:21 +0000</pubDate>
		<guid isPermaLink="false">http://arunraghavan.net/?p=1189#comment-26068</guid>
		<description>&lt;p&gt;Hiya Liam,&lt;/p&gt;

&lt;p&gt;Just a couple extra points on Arun&#039;s reply.&lt;/p&gt;

&lt;p&gt;It was my understanding that CoreAudio is not used on iOS? At least not the same incarnation as on the desktop space (please correct me if I&#039;m wrong). I was always under the impression that CoreAudio served the Desktop and Pro uses cases well, but not so much the Mobile. PulseAudio on the other hand serves the Mobile and the Desktop use cases well but not the Pro.&lt;/p&gt;

&lt;p&gt;As for the really, really low latency cases (i.e. Pro), I think PulseAudio&#039;s protocol may ultimately reach an event horizon down at the 2ms like latencies... as we try and use SHM for data transfer between client and server, we pass around handles to blocks of memory that contain audio data rather than passing the audio data itself. For sufficiently large buffers this is obviously the most efficient approach but as soon as you get down to really small payloads, the metadata becomes bigger than the data itself (or at least approaches it) and thus the efficient savings that were there previously actually become overheads.&lt;/p&gt;

&lt;p&gt;So with this in mind I think I have to agree with Arun and say that JACK and PA are tailored to mutually exclusive use cases.&lt;/p&gt;

&lt;p&gt;With the DBus Device Reservation Protocol supported by PA, JACK can now gracefully ask for exclusive access to the device which at least eases the pain. We can also automatically load jack sink modules into PA to allow sound to carry on playing (assuming it&#039;s patched in JACK) when this happens. So I think cooperation is the way to go here.&lt;/p&gt;

&lt;p&gt;That said I fully support any work Arun or anyone else can do to reduce PA latency further for the cases that need it (e.g. games and voip), provided this does not damage the large latency benefits for e.g. media playback :)&lt;/p&gt;

&lt;p&gt;Cheers&lt;/p&gt;

&lt;p&gt;Col&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hiya Liam,</p>

<p>Just a couple extra points on Arun&#8217;s reply.</p>

<p>It was my understanding that CoreAudio is not used on iOS? At least not the same incarnation as on the desktop space (please correct me if I&#8217;m wrong). I was always under the impression that CoreAudio served the Desktop and Pro uses cases well, but not so much the Mobile. PulseAudio on the other hand serves the Mobile and the Desktop use cases well but not the Pro.</p>

<p>As for the really, really low latency cases (i.e. Pro), I think PulseAudio&#8217;s protocol may ultimately reach an event horizon down at the 2ms like latencies&#8230; as we try and use SHM for data transfer between client and server, we pass around handles to blocks of memory that contain audio data rather than passing the audio data itself. For sufficiently large buffers this is obviously the most efficient approach but as soon as you get down to really small payloads, the metadata becomes bigger than the data itself (or at least approaches it) and thus the efficient savings that were there previously actually become overheads.</p>

<p>So with this in mind I think I have to agree with Arun and say that JACK and PA are tailored to mutually exclusive use cases.</p>

<p>With the DBus Device Reservation Protocol supported by PA, JACK can now gracefully ask for exclusive access to the device which at least eases the pain. We can also automatically load jack sink modules into PA to allow sound to carry on playing (assuming it&#8217;s patched in JACK) when this happens. So I think cooperation is the way to go here.</p>

<p>That said I fully support any work Arun or anyone else can do to reduce PA latency further for the cases that need it (e.g. games and voip), provided this does not damage the large latency benefits for e.g. media playback :)</p>

<p>Cheers</p>

<p>Col</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on PulseAudio vs. AudioFlinger: Fight! by liam</title>
		<link>http://arunraghavan.net/2012/01/pulseaudio-vs-audioflinger-fight/comment-page-1/#comment-26031</link>
		<dc:creator>liam</dc:creator>
		<pubDate>Wed, 01 Feb 2012 08:16:52 +0000</pubDate>
		<guid isPermaLink="false">http://arunraghavan.net/?p=1189#comment-26031</guid>
		<description>&lt;p&gt;Gabriel (!),&lt;/p&gt;

&lt;p&gt;Yikes, sorry about the using the wrong name. I didn&#039;t even notice the name HAD changed, to be honest. Sorry:)
I&#039;m glad you think cgroups might help. I have been having a conversation elsewhere about hybrid kernels, and the topic of XNU&#039;s scheduler came up. He thought that he&#039;d read that in the 10.7 kernel Apple had added the the ability to place the scheduler in user space. Naturally I did a bit of research but I was unable to find any documentation to support his claim (he said he would try and find it, so hopefully I&#039;m wrong and it is available b/c I am curious as to what they had in mind) but I did find that Apple groups threads into 4 categories: Normal, System high priority, kernel-mode only, and Real-time (this mode seems to use the same semantics as the new cfs scheduler, which is suggestive to me -- here&#039;s the url if you are interested:
http://developer.apple.com/library/mac/#documentation/Darwin/Conceptual/KernelProgramming/scheduler/scheduler.html#//apple_ref/doc/uid/TP30000905-CH211-BEHJDFCA
) . 
This is pretty similar to the way Android works, and seems like an &quot;easy&quot; fit for Linux, in general. Currently, as I understand it, we use rtkit to boost priority when asked, and if allowed by system policy. So the burden would be on the app devs to support this (which they must do anyway to make use of rtkit). So, in short, the apps would tell need to tell us. I&#039;m assuming, however, things aren&#039;t as simple as I understand them. 
As for managing the cgroups, I&#039;m not sure I see the problem. Assuming we already have a JACK (or whatever) bin, we can migrate a thread into a cgroup. I suppose you might make a slight tweak to rtkit to enable it to write to the mounted tasks file in /proc/cgroups/JACK/. This might be a bit of a security issue, however:)
Thanks for the Indamixx2 link. The latency seemed excellent on the ivory app (I think that is what it was called). It was harder to tell on mixx, but that was simply b/c of the lack of sharp gestures the presenter was using, as opposed to the stabbing motions used when striking a key. So, it is at least nice to know PA can get low enough to be not noticeable (to me, at least). 
Out of curiosity, did you happen to measure latency when using just PA itself on the tablet?
It seems a bit strange that PA simply residing on JACK would increase latency, especially if PA isn&#039;t doing any routing. That is,  I wonder how much latency was due to the apps themselves (the non-well optimized ones, that is), versus the presence of PA.&lt;/p&gt;

&lt;p&gt;Best/Liam&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Gabriel (!),</p>

<p>Yikes, sorry about the using the wrong name. I didn&#8217;t even notice the name HAD changed, to be honest. Sorry:)
I&#8217;m glad you think cgroups might help. I have been having a conversation elsewhere about hybrid kernels, and the topic of XNU&#8217;s scheduler came up. He thought that he&#8217;d read that in the 10.7 kernel Apple had added the the ability to place the scheduler in user space. Naturally I did a bit of research but I was unable to find any documentation to support his claim (he said he would try and find it, so hopefully I&#8217;m wrong and it is available b/c I am curious as to what they had in mind) but I did find that Apple groups threads into 4 categories: Normal, System high priority, kernel-mode only, and Real-time (this mode seems to use the same semantics as the new cfs scheduler, which is suggestive to me &#8212; here&#8217;s the url if you are interested:
<a href="http://developer.apple.com/library/mac/#documentation/Darwin/Conceptual/KernelProgramming/scheduler/scheduler.html#//apple_ref/doc/uid/TP30000905-CH211-BEHJDFCA" rel="nofollow">http://developer.apple.com/library/mac/#documentation/Darwin/Conceptual/KernelProgramming/scheduler/scheduler.html#//apple_ref/doc/uid/TP30000905-CH211-BEHJDFCA</a>
) . 
This is pretty similar to the way Android works, and seems like an &#8220;easy&#8221; fit for Linux, in general. Currently, as I understand it, we use rtkit to boost priority when asked, and if allowed by system policy. So the burden would be on the app devs to support this (which they must do anyway to make use of rtkit). So, in short, the apps would tell need to tell us. I&#8217;m assuming, however, things aren&#8217;t as simple as I understand them. 
As for managing the cgroups, I&#8217;m not sure I see the problem. Assuming we already have a JACK (or whatever) bin, we can migrate a thread into a cgroup. I suppose you might make a slight tweak to rtkit to enable it to write to the mounted tasks file in /proc/cgroups/JACK/. This might be a bit of a security issue, however:)
Thanks for the Indamixx2 link. The latency seemed excellent on the ivory app (I think that is what it was called). It was harder to tell on mixx, but that was simply b/c of the lack of sharp gestures the presenter was using, as opposed to the stabbing motions used when striking a key. So, it is at least nice to know PA can get low enough to be not noticeable (to me, at least). 
Out of curiosity, did you happen to measure latency when using just PA itself on the tablet?
It seems a bit strange that PA simply residing on JACK would increase latency, especially if PA isn&#8217;t doing any routing. That is,  I wonder how much latency was due to the apps themselves (the non-well optimized ones, that is), versus the presence of PA.</p>

<p>Best/Liam</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on PulseAudio vs. AudioFlinger: Fight! by Gabriel Beddingfield</title>
		<link>http://arunraghavan.net/2012/01/pulseaudio-vs-audioflinger-fight/comment-page-1/#comment-25956</link>
		<dc:creator>Gabriel Beddingfield</dc:creator>
		<pubDate>Sun, 29 Jan 2012 16:10:41 +0000</pubDate>
		<guid isPermaLink="false">http://arunraghavan.net/?p=1189#comment-25956</guid>
		<description>&lt;p&gt;Liam,&lt;/p&gt;

&lt;p&gt;I think you&#039;re replying to me... not Arun.... so I&#039;ll respond. :-)&lt;/p&gt;

&lt;p&gt;Yes, I agree that CGroups is a possible fix for the RT-issue.  ATM the complication is identifying which apps are JACK apps and should be brought into the audio/jack cgroup.  I recall that cgroups are assigned on a per-process basis and there has to be a controller somewhere that sorts out the processes. I recall that Paul and Torben did some work to add this to the jack server... but I don&#039;t know what the status of that is.&lt;/p&gt;

&lt;p&gt;As for the MeeGo device, it was the Indamixx 2.  Here&#039;s an engadget video: http://www.engadget.com/2011/05/25/meego-conference-2011-sights-and-sounds-video/&lt;/p&gt;

&lt;p&gt;The reason for PA+JACK was simple:  MeeGo required PulseAudio to be MeeGo compliant.  Also, it&#039;s a decent alternative to the ALSA/JACK plugin so that non-JACK apps can use the JACK server. The objective was to run JACK all the time, so it was always PA-over-JACK. After I got it set up, I only messed with PA if there was a problem. Using JACK was the point of the device.&lt;/p&gt;

&lt;p&gt;As for performance, yes we were able to meet our goals by using JACK and a tuned (and relatively un-patched) kernel.  Because of PA and some of the heavy-weight shrink-wrap audio apps... the latency out of the box was set to 20 ms. It could do about 5-10 ms if you killed PA and used some well-written audio apps.&lt;/p&gt;

&lt;p&gt;-gabriel&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Liam,</p>

<p>I think you&#8217;re replying to me&#8230; not Arun&#8230;. so I&#8217;ll respond. :-)</p>

<p>Yes, I agree that CGroups is a possible fix for the RT-issue.  ATM the complication is identifying which apps are JACK apps and should be brought into the audio/jack cgroup.  I recall that cgroups are assigned on a per-process basis and there has to be a controller somewhere that sorts out the processes. I recall that Paul and Torben did some work to add this to the jack server&#8230; but I don&#8217;t know what the status of that is.</p>

<p>As for the MeeGo device, it was the Indamixx 2.  Here&#8217;s an engadget video: <a href="http://www.engadget.com/2011/05/25/meego-conference-2011-sights-and-sounds-video/" rel="nofollow">http://www.engadget.com/2011/05/25/meego-conference-2011-sights-and-sounds-video/</a></p>

<p>The reason for PA+JACK was simple:  MeeGo required PulseAudio to be MeeGo compliant.  Also, it&#8217;s a decent alternative to the ALSA/JACK plugin so that non-JACK apps can use the JACK server. The objective was to run JACK all the time, so it was always PA-over-JACK. After I got it set up, I only messed with PA if there was a problem. Using JACK was the point of the device.</p>

<p>As for performance, yes we were able to meet our goals by using JACK and a tuned (and relatively un-patched) kernel.  Because of PA and some of the heavy-weight shrink-wrap audio apps&#8230; the latency out of the box was set to 20 ms. It could do about 5-10 ms if you killed PA and used some well-written audio apps.</p>

<p>-gabriel</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on PulseAudio vs. AudioFlinger: Fight! by liam</title>
		<link>http://arunraghavan.net/2012/01/pulseaudio-vs-audioflinger-fight/comment-page-1/#comment-25947</link>
		<dc:creator>liam</dc:creator>
		<pubDate>Sun, 29 Jan 2012 10:17:49 +0000</pubDate>
		<guid isPermaLink="false">http://arunraghavan.net/?p=1189#comment-25947</guid>
		<description>&lt;p&gt;Really nice explanations, Arun.
I realised NICE is pretty useless as a mechanism for latency, hence why android makes extensive use of cgroups (I believe they employ three categories). An interesting feature from the 3.2 kernel is a notion of cfs scheduling (http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=ab84d31e15502fb626169ba2663381e34bf965b2) via cgroups. This could be of use to help &quot;guarantee&quot; certain applications don&#039;t get relatively starved. Naturally, this would require a new cgroup type in Android that takes advantage of this, but considering that this is still marked experimental, I&#039;m not sure they are even looking at it.
Regarding those two features of JACK, they actually seem like something the musicians would like. Currently, they wouldn&#039;t the first isn&#039;t of much use since it doesn&#039;t do a great job multitasking, but being able to string together (Gstreamer-like!) audio apps would go a long ways towards making portable devices really useful instruments, but, as you said, that is not now. The second feature actually seems commensurate with the kernels new scheduling ability (via the aformentioned cfs scheduling), and since android already employs the pre-emptive kernel they COULD expose this and at least give the users the option to run a low latency dj app, or whatever. It&#039;s not as if we don&#039;t currently have problem with apps sitting on the cpu refusing to budge until the kernel throws them off:)  Besides, the preempt kernel should be able to throw off most misbehaving apps.
The power part is, obviously, why PA is so nice, so, as I&#039;ve mentioned, hopefully the remaining PA optimisations (along with making use of new kernel features) will make it &quot;good enough&quot; to use as a general purpose sound server (meaning able to offer, say, 5ms latency, when needed, and when not, 1000ms, or so). 
Lastly, regarding PA-on-JACK, was that a proof of concept, or was it an attempt to actually provide a low latency solution whilst still using PA? I&#039;m guessing, since this was a Meego device, that it was some kind of handheld, thus power was at a premium. IOW, I&#039;m guessing the goal wasn&#039;t to run PA over JACK all the time, but only when needed (something like:kill PA-&gt;replace with JACK-&gt;run PA on JACK, then when not needed, kill JACK-&gt;start PA-&gt;cross fingers). Did it work? Were you able to achieve the performance required?
This is really interesting. You should consider, when you have the time, writing another post explaining your experiences, and where you think PA could improve in order to become more useful for some niche apps.&lt;/p&gt;

&lt;p&gt;Best/Liam&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Really nice explanations, Arun.
I realised NICE is pretty useless as a mechanism for latency, hence why android makes extensive use of cgroups (I believe they employ three categories). An interesting feature from the 3.2 kernel is a notion of cfs scheduling (<a href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=ab84d31e15502fb626169ba2663381e34bf965b2" rel="nofollow">http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=ab84d31e15502fb626169ba2663381e34bf965b2</a>) via cgroups. This could be of use to help &#8220;guarantee&#8221; certain applications don&#8217;t get relatively starved. Naturally, this would require a new cgroup type in Android that takes advantage of this, but considering that this is still marked experimental, I&#8217;m not sure they are even looking at it.
Regarding those two features of JACK, they actually seem like something the musicians would like. Currently, they wouldn&#8217;t the first isn&#8217;t of much use since it doesn&#8217;t do a great job multitasking, but being able to string together (Gstreamer-like!) audio apps would go a long ways towards making portable devices really useful instruments, but, as you said, that is not now. The second feature actually seems commensurate with the kernels new scheduling ability (via the aformentioned cfs scheduling), and since android already employs the pre-emptive kernel they COULD expose this and at least give the users the option to run a low latency dj app, or whatever. It&#8217;s not as if we don&#8217;t currently have problem with apps sitting on the cpu refusing to budge until the kernel throws them off:)  Besides, the preempt kernel should be able to throw off most misbehaving apps.
The power part is, obviously, why PA is so nice, so, as I&#8217;ve mentioned, hopefully the remaining PA optimisations (along with making use of new kernel features) will make it &#8220;good enough&#8221; to use as a general purpose sound server (meaning able to offer, say, 5ms latency, when needed, and when not, 1000ms, or so). 
Lastly, regarding PA-on-JACK, was that a proof of concept, or was it an attempt to actually provide a low latency solution whilst still using PA? I&#8217;m guessing, since this was a Meego device, that it was some kind of handheld, thus power was at a premium. IOW, I&#8217;m guessing the goal wasn&#8217;t to run PA over JACK all the time, but only when needed (something like:kill PA-&gt;replace with JACK-&gt;run PA on JACK, then when not needed, kill JACK-&gt;start PA-&gt;cross fingers). Did it work? Were you able to achieve the performance required?
This is really interesting. You should consider, when you have the time, writing another post explaining your experiences, and where you think PA could improve in order to become more useful for some niche apps.</p>

<p>Best/Liam</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on PulseAudio vs. AudioFlinger: Fight! by Gabriel Beddingfield</title>
		<link>http://arunraghavan.net/2012/01/pulseaudio-vs-audioflinger-fight/comment-page-1/#comment-25936</link>
		<dc:creator>Gabriel Beddingfield</dc:creator>
		<pubDate>Sat, 28 Jan 2012 20:06:28 +0000</pubDate>
		<guid isPermaLink="false">http://arunraghavan.net/?p=1189#comment-25936</guid>
		<description>&lt;p&gt;There&#039;s two things that make JACK awesome:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;It allows applications to share audio data. So you could chain a synth application into a standalone filter/wah and then into a multi-track recording app and then monitor out the speakers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A fundamental part of JACK is that the applications must be written real-time safe in the audio callback, and the the callback runs with real-time priority (SCHED_FIFO).&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;1 is irrelevant on Android. Not only is it tedious to set up something like this on a mobile device... I get the impression that Google discourages this kind of interaction between applications.&lt;/p&gt;

&lt;p&gt;Likewise, for #2: Android will ever allow an app to run with SCHED_FIFO.  While the callback is being called, the application will have uninterrupted access to the CPU.  For Pro-Audio this is filtered out by a discerning musician who chooses apps he can trust.  On Android, someone can download a buggy app that totally locks up their phone.  (Response: &quot;Android sucks, bro!&quot;)&lt;/p&gt;

&lt;p&gt;Without SCHED_FIFO, there&#039;s no point in using JACK.  Using &quot;nice&quot; is not sufficient.&lt;/p&gt;

&lt;p&gt;And then there&#039;s power. JACK doesn&#039;t care about power consumption.  Period. It&#039;s primary purpose is performance, and gets very unhappy if things aren&#039;t performing. (Are you late coming back from a callback? That&#039;s Game Over in JACK world. The audience just heard a pop over the public address and are not very impressed.)&lt;/p&gt;

&lt;p&gt;FWIW, I&#039;ve made PA run on top of JACK for a MeeGo device.  (Requires Jack2 and dbus.) It works OK... but audio performance (not power) was the priority for that device. Also, patching full-screen audio apps into an audio patch wasn&#039;t terribly fun (as opposed to laying out the windows on your desktop and editing the patch).&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>There&#8217;s two things that make JACK awesome:</p>

<ol>
<li><p>It allows applications to share audio data. So you could chain a synth application into a standalone filter/wah and then into a multi-track recording app and then monitor out the speakers.</p></li>
<li><p>A fundamental part of JACK is that the applications must be written real-time safe in the audio callback, and the the callback runs with real-time priority (SCHED_FIFO).</p></li>
</ol>

<p>1 is irrelevant on Android. Not only is it tedious to set up something like this on a mobile device&#8230; I get the impression that Google discourages this kind of interaction between applications.</p>

<p>Likewise, for #2: Android will ever allow an app to run with SCHED_FIFO.  While the callback is being called, the application will have uninterrupted access to the CPU.  For Pro-Audio this is filtered out by a discerning musician who chooses apps he can trust.  On Android, someone can download a buggy app that totally locks up their phone.  (Response: &#8220;Android sucks, bro!&#8221;)</p>

<p>Without SCHED_FIFO, there&#8217;s no point in using JACK.  Using &#8220;nice&#8221; is not sufficient.</p>

<p>And then there&#8217;s power. JACK doesn&#8217;t care about power consumption.  Period. It&#8217;s primary purpose is performance, and gets very unhappy if things aren&#8217;t performing. (Are you late coming back from a callback? That&#8217;s Game Over in JACK world. The audience just heard a pop over the public address and are not very impressed.)</p>

<p>FWIW, I&#8217;ve made PA run on top of JACK for a MeeGo device.  (Requires Jack2 and dbus.) It works OK&#8230; but audio performance (not power) was the priority for that device. Also, patching full-screen audio apps into an audio patch wasn&#8217;t terribly fun (as opposed to laying out the windows on your desktop and editing the patch).</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on PulseAudio vs. AudioFlinger: Fight! by liam</title>
		<link>http://arunraghavan.net/2012/01/pulseaudio-vs-audioflinger-fight/comment-page-1/#comment-25879</link>
		<dc:creator>liam</dc:creator>
		<pubDate>Fri, 27 Jan 2012 00:13:05 +0000</pubDate>
		<guid isPermaLink="false">http://arunraghavan.net/?p=1189#comment-25879</guid>
		<description>&lt;p&gt;Thanks for the explanation, Arun. Since JACK wants exclusive access to the device that seems to preclude easy co-operation with PA. Too bad.
Hopefully you and the rest of the PA devs will be able to figure out the latency problems b/c, unless there is either a fundamental issue with PA (which you didn&#039;t seem to indicate there was), or a problem with the kernel (assuming pre-emption patches at a minimum), Linux should be able to provide the same functionality from a single sound daemon as Win/Mac, or, failing that, a transparent co-operative mix of JACK/PA.
Yeah, I know, easier said:)&lt;/p&gt;

&lt;p&gt;Best/Liam&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks for the explanation, Arun. Since JACK wants exclusive access to the device that seems to preclude easy co-operation with PA. Too bad.
Hopefully you and the rest of the PA devs will be able to figure out the latency problems b/c, unless there is either a fundamental issue with PA (which you didn&#8217;t seem to indicate there was), or a problem with the kernel (assuming pre-emption patches at a minimum), Linux should be able to provide the same functionality from a single sound daemon as Win/Mac, or, failing that, a transparent co-operative mix of JACK/PA.
Yeah, I know, easier said:)</p>

<p>Best/Liam</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on PulseAudio vs. AudioFlinger: Fight! by Arun</title>
		<link>http://arunraghavan.net/2012/01/pulseaudio-vs-audioflinger-fight/comment-page-1/#comment-25854</link>
		<dc:creator>Arun</dc:creator>
		<pubDate>Thu, 26 Jan 2012 06:09:33 +0000</pubDate>
		<guid isPermaLink="false">http://arunraghavan.net/?p=1189#comment-25854</guid>
		<description>&lt;p&gt;Hey Liam.&lt;/p&gt;

&lt;p&gt;So the short story is that there are very likely optimisations to PulseAudio that can get our latency down by quite a bit. I&#039;m hoping to look at this soon, time permitting. That said, JACK (at least as far as the literature says) can do something in the order of 1.33ms. They manage to do this by setting up a dedicated SHM pipeline practically from the app to the hardware, AIUI. Given the PA architecture, this is a lot harder to do. So we can likely bring down our latency floor to something that should be &quot;good enough&quot; for a number of latency-sensitive application, but getting to what JACK can do is a lot harder.&lt;/p&gt;

&lt;p&gt;Cheers.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hey Liam.</p>

<p>So the short story is that there are very likely optimisations to PulseAudio that can get our latency down by quite a bit. I&#8217;m hoping to look at this soon, time permitting. That said, JACK (at least as far as the literature says) can do something in the order of 1.33ms. They manage to do this by setting up a dedicated SHM pipeline practically from the app to the hardware, AIUI. Given the PA architecture, this is a lot harder to do. So we can likely bring down our latency floor to something that should be &#8220;good enough&#8221; for a number of latency-sensitive application, but getting to what JACK can do is a lot harder.</p>

<p>Cheers.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on PulseAudio vs. AudioFlinger: Fight! by liam</title>
		<link>http://arunraghavan.net/2012/01/pulseaudio-vs-audioflinger-fight/comment-page-1/#comment-25853</link>
		<dc:creator>liam</dc:creator>
		<pubDate>Thu, 26 Jan 2012 05:56:08 +0000</pubDate>
		<guid isPermaLink="false">http://arunraghavan.net/?p=1189#comment-25853</guid>
		<description>&lt;p&gt;Hi Arun,&lt;/p&gt;

&lt;p&gt;In the interview you gave recently to Christian Schaller, you mentioned that you think that PA and JACK serve mutually exclusive purposes. Why is that the case? It seems as though you can have a sound server that serves both purposes (low power and latency) since Windows and Mac have done this (and PA was based off of CoreAudio, IIRC). 
Naively, I would think that unless PA has some inherent pathologies, you could set the policy such that it tries for maximum power savings (up to 2 sec buffer, IIRC, and depending on the hardware) but is overridden when a client requests low latency and is active. Since this is basically how things currently seem to work, there is obviously a hardware independent floor (meaning, aside from the drivers, and other systems) in how far down latency can be pushed with PA. Why is that?&lt;/p&gt;

&lt;p&gt;Best/Liam&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi Arun,</p>

<p>In the interview you gave recently to Christian Schaller, you mentioned that you think that PA and JACK serve mutually exclusive purposes. Why is that the case? It seems as though you can have a sound server that serves both purposes (low power and latency) since Windows and Mac have done this (and PA was based off of CoreAudio, IIRC). 
Naively, I would think that unless PA has some inherent pathologies, you could set the policy such that it tries for maximum power savings (up to 2 sec buffer, IIRC, and depending on the hardware) but is overridden when a client requests low latency and is active. Since this is basically how things currently seem to work, there is obviously a hardware independent floor (meaning, aside from the drivers, and other systems) in how far down latency can be pushed with PA. Why is that?</p>

<p>Best/Liam</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on PulseAudio vs. AudioFlinger: Fight! by liam</title>
		<link>http://arunraghavan.net/2012/01/pulseaudio-vs-audioflinger-fight/comment-page-1/#comment-25852</link>
		<dc:creator>liam</dc:creator>
		<pubDate>Thu, 26 Jan 2012 05:35:18 +0000</pubDate>
		<guid isPermaLink="false">http://arunraghavan.net/?p=1189#comment-25852</guid>
		<description>&lt;p&gt;Obviously I am not saying QA isn&#039;t important, but that isn&#039;t really the question here.
OTOH if QA is important to you you would&#039;ve filed the bug report he asked for, but, as you said, you don&#039;t like PA I can see why you have little interest in actually improving it (i.e., filing bug reports).&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Obviously I am not saying QA isn&#8217;t important, but that isn&#8217;t really the question here.
OTOH if QA is important to you you would&#8217;ve filed the bug report he asked for, but, as you said, you don&#8217;t like PA I can see why you have little interest in actually improving it (i.e., filing bug reports).</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on PulseAudio vs. AudioFlinger: Fight! by Konrad</title>
		<link>http://arunraghavan.net/2012/01/pulseaudio-vs-audioflinger-fight/comment-page-1/#comment-25807</link>
		<dc:creator>Konrad</dc:creator>
		<pubDate>Tue, 24 Jan 2012 13:24:45 +0000</pubDate>
		<guid isPermaLink="false">http://arunraghavan.net/?p=1189#comment-25807</guid>
		<description>&lt;p&gt;That&#039;s impressive, good luck, maybe you&#039;re the chosen one to free Android market from low latency issues :&lt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>That&#8217;s impressive, good luck, maybe you&#8217;re the chosen one to free Android market from low latency issues :&lt;</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on PulseAudio vs. AudioFlinger: Fight! by ching</title>
		<link>http://arunraghavan.net/2012/01/pulseaudio-vs-audioflinger-fight/comment-page-1/#comment-25780</link>
		<dc:creator>ching</dc:creator>
		<pubDate>Mon, 23 Jan 2012 12:26:04 +0000</pubDate>
		<guid isPermaLink="false">http://arunraghavan.net/?p=1189#comment-25780</guid>
		<description>&lt;p&gt;i am just suggesting more tests on latency of PA. If you think Quality assurance is not important, please ignore all my word.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>i am just suggesting more tests on latency of PA. If you think Quality assurance is not important, please ignore all my word.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on PulseAudio vs. AudioFlinger: Fight! by liam</title>
		<link>http://arunraghavan.net/2012/01/pulseaudio-vs-audioflinger-fight/comment-page-1/#comment-25727</link>
		<dc:creator>liam</dc:creator>
		<pubDate>Sat, 21 Jan 2012 11:07:07 +0000</pubDate>
		<guid isPermaLink="false">http://arunraghavan.net/?p=1189#comment-25727</guid>
		<description>&lt;p&gt;i believe he already explained to you as best he could without more specifics.PA requires rt-kit so it should rarely drop out due to high loads (this should be even more true in android with its preempt patch).
Also, as he demonstrated, PA doesn&#039;t have to use vqst amounts of cpu time. His example showed very low cpu usage (apparently lower on hie arm chip than your x86!) under optimal conditions FOR BOTH. If nothing else this should demonstrate the superior latency and power draw of PA compared to AF.
BTW, what was the bug number of the report he asked you to submit? Im curious as to the causes myself.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>i believe he already explained to you as best he could without more specifics.PA requires rt-kit so it should rarely drop out due to high loads (this should be even more true in android with its preempt patch).
Also, as he demonstrated, PA doesn&#8217;t have to use vqst amounts of cpu time. His example showed very low cpu usage (apparently lower on hie arm chip than your x86!) under optimal conditions FOR BOTH. If nothing else this should demonstrate the superior latency and power draw of PA compared to AF.
BTW, what was the bug number of the report he asked you to submit? Im curious as to the causes myself.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on PulseAudio vs. AudioFlinger: Fight! by PING #03: PulseAudio, Mandriva, FreeBSD, Bumblebee, Linux, Rhythmbox, Android, Sky Map...</title>
		<link>http://arunraghavan.net/2012/01/pulseaudio-vs-audioflinger-fight/comment-page-1/#comment-25726</link>
		<dc:creator>PING #03: PulseAudio, Mandriva, FreeBSD, Bumblebee, Linux, Rhythmbox, Android, Sky Map...</dc:creator>
		<pubDate>Sat, 21 Jan 2012 09:30:27 +0000</pubDate>
		<guid isPermaLink="false">http://arunraghavan.net/?p=1189#comment-25726</guid>
		<description>&lt;p&gt;[...] vs AudoFlinger: Fight! En el blog de Arun Raghavan Comparando el rendimiento de dos pilas de audio en Android (PulseAudio es la pila tradicional en [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] vs AudoFlinger: Fight! En el blog de Arun Raghavan Comparando el rendimiento de dos pilas de audio en Android (PulseAudio es la pila tradicional en [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on PulseAudio vs. AudioFlinger: Fight! by ching</title>
		<link>http://arunraghavan.net/2012/01/pulseaudio-vs-audioflinger-fight/comment-page-1/#comment-25694</link>
		<dc:creator>ching</dc:creator>
		<pubDate>Fri, 20 Jan 2012 08:50:40 +0000</pubDate>
		<guid isPermaLink="false">http://arunraghavan.net/?p=1189#comment-25694</guid>
		<description>&lt;p&gt;My point is just the following:&lt;/p&gt;

&lt;p&gt;Audio should have low latency, even CPU is under full load by other program.
Audio should not consume much power, even when serving low latency clients.
more tests are needed to prove PA a solution for latency, quality control is important&lt;/p&gt;

&lt;p&gt;maybe my expection is too high :)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>My point is just the following:</p>

<p>Audio should have low latency, even CPU is under full load by other program.
Audio should not consume much power, even when serving low latency clients.
more tests are needed to prove PA a solution for latency, quality control is important</p>

<p>maybe my expection is too high :)</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on PulseAudio vs. AudioFlinger: Fight! by Arun</title>
		<link>http://arunraghavan.net/2012/01/pulseaudio-vs-audioflinger-fight/comment-page-1/#comment-25687</link>
		<dc:creator>Arun</dc:creator>
		<pubDate>Fri, 20 Jan 2012 04:22:31 +0000</pubDate>
		<guid isPermaLink="false">http://arunraghavan.net/?p=1189#comment-25687</guid>
		<description>&lt;p&gt;For test1 (and test2) -- I&#039;d be interested to get some more details, such as the kernel and PulseAudio versions, as well as the CPU frequency. top numbers are a percentage of current CPU frequency, so (just hypothetically) if your CPU goes down to 100 MHz, 8% might not be that bad. But this could also be a problem with bad drivers (causing more frequent wakeups in PA than they should), which would also affect your test3.&lt;/p&gt;

&lt;p&gt;If you&#039;re up to it, do file a bug and we can try to figure out what&#039;s happening (https://bugs.freedesktop.org/enter_bug.cgi?product=PulseAudio).&lt;/p&gt;

&lt;p&gt;Also, as for hungry Android applications -- there aren&#039;t that many now, given the state of AudioFlinger latency.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>For test1 (and test2) &#8212; I&#8217;d be interested to get some more details, such as the kernel and PulseAudio versions, as well as the CPU frequency. top numbers are a percentage of current CPU frequency, so (just hypothetically) if your CPU goes down to 100 MHz, 8% might not be that bad. But this could also be a problem with bad drivers (causing more frequent wakeups in PA than they should), which would also affect your test3.</p>

<p>If you&#8217;re up to it, do file a bug and we can try to figure out what&#8217;s happening (<a href="https://bugs.freedesktop.org/enter_bug.cgi?product=PulseAudio" rel="nofollow">https://bugs.freedesktop.org/enter_bug.cgi?product=PulseAudio</a>).</p>

<p>Also, as for hungry Android applications &#8212; there aren&#8217;t that many now, given the state of AudioFlinger latency.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on PulseAudio vs. AudioFlinger: Fight! by Arun</title>
		<link>http://arunraghavan.net/2012/01/pulseaudio-vs-audioflinger-fight/comment-page-1/#comment-25686</link>
		<dc:creator>Arun</dc:creator>
		<pubDate>Fri, 20 Jan 2012 04:17:28 +0000</pubDate>
		<guid isPermaLink="false">http://arunraghavan.net/?p=1189#comment-25686</guid>
		<description>&lt;p&gt;The sample rate isn&#039;t too important -- I can happily get this latency with 44.1 or 48 kHz.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>The sample rate isn&#8217;t too important &#8212; I can happily get this latency with 44.1 or 48 kHz.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on Hello &#8230; hello &#8230; hello! by Arun</title>
		<link>http://arunraghavan.net/2011/08/hello-hello-hello/comment-page-1/#comment-25662</link>
		<dc:creator>Arun</dc:creator>
		<pubDate>Thu, 19 Jan 2012 11:05:28 +0000</pubDate>
		<guid isPermaLink="false">http://arunraghavan.net/?p=1044#comment-25662</guid>
		<description>&lt;p&gt;Nope, I just broke up my blocks into 10ms chunks.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Nope, I just broke up my blocks into 10ms chunks.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on PulseAudio vs. AudioFlinger: Fight! by Arun</title>
		<link>http://arunraghavan.net/2012/01/pulseaudio-vs-audioflinger-fight/comment-page-1/#comment-25653</link>
		<dc:creator>Arun</dc:creator>
		<pubDate>Thu, 19 Jan 2012 06:53:54 +0000</pubDate>
		<guid isPermaLink="false">http://arunraghavan.net/?p=1189#comment-25653</guid>
		<description>&lt;p&gt;I misstated the numbers there, though. You can see the period size and number of periods there (not including additional buffering in AudioFlinger) -- 22ms * 4 = 88ms when the screen is on, and 308ms * 2 = 616ms when the screen is off.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I misstated the numbers there, though. You can see the period size and number of periods there (not including additional buffering in AudioFlinger) &#8212; 22ms * 4 = 88ms when the screen is on, and 308ms * 2 = 616ms when the screen is off.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on PulseAudio vs. AudioFlinger: Fight! by ching</title>
		<link>http://arunraghavan.net/2012/01/pulseaudio-vs-audioflinger-fight/comment-page-1/#comment-25652</link>
		<dc:creator>ching</dc:creator>
		<pubDate>Thu, 19 Jan 2012 06:21:50 +0000</pubDate>
		<guid isPermaLink="false">http://arunraghavan.net/?p=1189#comment-25652</guid>
		<description>&lt;p&gt;The 3 test cases represent daily use scenario:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;CPU load and power consumption when pulseaudio is serving “low-latency” client(s). - VoIP software&lt;/li&gt;
&lt;li&gt;worst latency encountered and their distribution when serving “low-latency” client(s). - VoIP software, Game and playing high quality movie&lt;/li&gt;
&lt;li&gt;condition 2 + CPU under 100% loading. - Game and playing high quality movie&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;On my old PC, PA will use about 8% CPU when i play music, the CPU will be 0% if using Alsa directly. (my card supports hardware mixing...)  --test 1&lt;/p&gt;

&lt;p&gt;I try to conference with 5 people in Skype, PA uses up to 20% CPU (around 4% increase for each people, i guest its sound mixing algorithm is O(n)), and audio begin to glitches.  I cannot imagine what i happen if i add a few more people   --test 2&lt;/p&gt;

&lt;p&gt;My Game simple have latency and glitches. The situation is even worse when i play games under virtual machine.  -- test 3&lt;/p&gt;

&lt;p&gt;My problems are gone after purging PA.&lt;/p&gt;

&lt;p&gt;I think the sound server must function well under &quot;severe&quot; environment, there are hundreds of &quot;hungry&quot; Android application waiting ahead.&lt;/p&gt;

&lt;p&gt;&quot;As for 100% CPU loading — even on the desktop, we grant real-time priority to the audio process, so the rest of your system is going to be pretty unresponsive before audio starts dropping.&quot;
--&gt; For gaming, this is crazy&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>The 3 test cases represent daily use scenario:</p>

<ol>
<li>CPU load and power consumption when pulseaudio is serving “low-latency” client(s). &#8211; VoIP software</li>
<li>worst latency encountered and their distribution when serving “low-latency” client(s). &#8211; VoIP software, Game and playing high quality movie</li>
<li>condition 2 + CPU under 100% loading. &#8211; Game and playing high quality movie</li>
</ol>

<p>On my old PC, PA will use about 8% CPU when i play music, the CPU will be 0% if using Alsa directly. (my card supports hardware mixing&#8230;)  &#8211;test 1</p>

<p>I try to conference with 5 people in Skype, PA uses up to 20% CPU (around 4% increase for each people, i guest its sound mixing algorithm is O(n)), and audio begin to glitches.  I cannot imagine what i happen if i add a few more people   &#8211;test 2</p>

<p>My Game simple have latency and glitches. The situation is even worse when i play games under virtual machine.  &#8212; test 3</p>

<p>My problems are gone after purging PA.</p>

<p>I think the sound server must function well under &#8220;severe&#8221; environment, there are hundreds of &#8220;hungry&#8221; Android application waiting ahead.</p>

<p>&#8220;As for 100% CPU loading — even on the desktop, we grant real-time priority to the audio process, so the rest of your system is going to be pretty unresponsive before audio starts dropping.&#8221;
&#8211;&gt; For gaming, this is crazy</p>]]></content:encoded>
	</item>
</channel>
</rss>

