<?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>Random Wisdom &#187; alsa</title>
	<atom:link href="http://scrolls.mafgani.net/tag/alsa/feed/" rel="self" type="application/rss+xml" />
	<link>http://scrolls.mafgani.net</link>
	<description>An attempt at organizing my thoughts ...</description>
	<lastBuildDate>Sun, 13 Mar 2011 22:54:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Addressing Individual Audio Channels of a Multichannel ALSA System</title>
		<link>http://scrolls.mafgani.net/2005/10/addressing-individual-audio-channels-of-a-multichannel-alsa-system/</link>
		<comments>http://scrolls.mafgani.net/2005/10/addressing-individual-audio-channels-of-a-multichannel-alsa-system/#comments</comments>
		<pubDate>Mon, 03 Oct 2005 22:17:00 +0000</pubDate>
		<dc:creator>Mostafa</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[How To ...]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[5.1 sound]]></category>
		<category><![CDATA[alsa]]></category>
		<category><![CDATA[aplay]]></category>
		<category><![CDATA[multichannel]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[surround sound]]></category>

		<guid isPermaLink="false">http://scrolls.mafgani.net/?p=22</guid>
		<description><![CDATA[At first I thought I could just use one of the audio editors to create a 5.1 channel sound file and blank all the channels that I don&#8217;t want. Sweep claims to be a multichannel audio editor but at the moment it&#8217;s not possible to edit the individual audio channels. So, I tried out Audacity. [...]]]></description>
			<content:encoded><![CDATA[<p>At first I thought I could just use one of the audio editors to create a 5.1 channel sound file and blank all the channels that I don&#8217;t want. <a href="http://sweep.sourceforge.net">Sweep</a> claims to be a multichannel audio editor but at the moment it&#8217;s not possible to edit the individual audio channels. So, I tried out <a href="http://audacity.sourceforge.net">Audacity</a>. Although Audacity allows the editing of the individual channels, it&#8217;s not possible to save the edited file in a multichannel format &#8211; it&#8217;s invariably down-mixed to stereo. So, custom sound files were no longer an option .. </p>
<p>At this point, I started looking at the <a href="http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html">ALSA PCM plugins</a>. The <span style="font-weight:bold;">route</span> plugin seemed like the perfect candidate. In order to use the plugin I had to create the plugin definitions in the file <span style="font-style:italic;">~/.asoundrc</span>:</p>
<pre>
[darkknight@darkworld ~]$ cat .asoundrc
pcm_slave.rt {
        pcm surround50
        channels 5
}

pcm.front_l {           #Front Left
        type route
        slave rt
        ttable.0.0 1
}

pcm.front_r {           #Front Right
        type route
        slave rt
        ttable.0.1 1
}

pcm.front_c {           #Front Center
        type route
        slave rt
        ttable.0.4 1
}

pcm.rear_l {            #Rear Left
        type route
        slave rt
        ttable.0.3 1
}

pcm.rear_r {            #Rear Right
        type route
        slave rt
        ttable.0.2 1
}

pcm.front_both {        #Front - Both
        type route
        slave rt
        ttable.0.0 1
        ttable.0.1 1
}

pcm.rear_both {         #Rear - Both
        type route
        slave rt
        ttable.0.2 1
        ttable.0.3 1
}
</pre>
<p>The plugins can be used with the <span style="font-weight:bold;">aplay</span> utility:</p>
<pre>
[darkknight@darkworld ~]$ aplay -D front_c /usr/share/sounds/alsa/Front_Center.wav
Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
</pre>
<p>Of course it makes sense to use only Mono files with the plugins since the mappings are always carried out from channel 1. It&#8217;s the <span style="font-style:italic;">ttable</span> entry that&#8217;s responsible for the mapping. The first value is the source channel (0 = channel 1, 1 = channel 2, etc.). The second value is the channel to route to. The third value controls the volume; a value of 0 means 0% volume and a value of 1.0 means 100% volume.</p>
<p>With the new plugin definitions, it&#8217;s even easier to balance the speaker levels. The following command will alternate between the front speakers and the center speaker until interrupted:</p>
<pre>
[darkknight@darkworld ~]$ while [ 1 ]; do /usr/bin/aplay -D front_both -q /usr/share/sounds/alsa/Noise.wav;
/usr/bin/aplay -D front_c /usr/share/sounds/alsa/Noise.wav; done
</pre>
]]></content:encoded>
			<wfw:commentRss>http://scrolls.mafgani.net/2005/10/addressing-individual-audio-channels-of-a-multichannel-alsa-system/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Audigy 2 ZS on FC4</title>
		<link>http://scrolls.mafgani.net/2005/08/audigy-2-zs-on-fc4/</link>
		<comments>http://scrolls.mafgani.net/2005/08/audigy-2-zs-on-fc4/#comments</comments>
		<pubDate>Tue, 23 Aug 2005 12:07:00 +0000</pubDate>
		<dc:creator>Mostafa</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[alsa]]></category>
		<category><![CDATA[audigy]]></category>
		<category><![CDATA[sound]]></category>

		<guid isPermaLink="false">http://scrolls.mafgani.net/?p=10</guid>
		<description><![CDATA[I&#8217;ve finally got a setup that sounds just as good as it does on Windows. I&#8217;ve tested the surround system with a DVD and so far it sounds pretty good. I think the trouble was that there wasn&#8217;t any signal generator to let me balance the speakers properly. But today I discovered that there is [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve finally got a setup that sounds just as good as it does on Windows. I&#8217;ve tested the surround system with a DVD and so far it sounds pretty good. I think the trouble was that there wasn&#8217;t any signal generator to let me balance the speakers properly. But today I discovered that there is an <span style="font-style: italic;">alsa</span> subdirectory under <span style="font-style: italic;">/usr/share/sounds </span>that contains a noise file. Playing that in a loop:</p>
<pre>$ while [ 1 ]; do aplay /usr/share/sounds/alsa/Noise.wav; done</pre>
<p>I finally managed to get that elusive speaker balance through <span style="font-style: italic;">alsamixer.</span> Now, all that&#8217;s missing is CMSS3D <img src='http://scrolls.mafgani.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>This <a href="http://alsa.opensrc.org/emu10k1">site</a> might be useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://scrolls.mafgani.net/2005/08/audigy-2-zs-on-fc4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

