<?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>Adrian's Thoughts &#187; Ubuntu</title>
	<atom:link href="http://blog.frith.co.za/tag/ubuntu/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.frith.co.za</link>
	<description>Ramblings about life, university, mathematics, computing, Linux, open source, etc.</description>
	<lastBuildDate>Thu, 19 Mar 2009 10:23:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ubuntu on an HP Compaq dx2300 Microtower</title>
		<link>http://blog.frith.co.za/2009/03/19/ubuntu-on-an-hp-compaq-dx2300-microtower/</link>
		<comments>http://blog.frith.co.za/2009/03/19/ubuntu-on-an-hp-compaq-dx2300-microtower/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 10:23:21 +0000</pubDate>
		<dc:creator>adrian</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[University]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[Compaq]]></category>
		<category><![CDATA[dx2300]]></category>
		<category><![CDATA[HP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Microtower]]></category>
		<category><![CDATA[soundcard]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.frith.co.za/?p=77</guid>
		<description><![CDATA[My new desktop at varsity is, as described in the title, an HP Compaq dx2300 Microtower. First thing I did when I got access to it was, of course, to install Linux &#8211; Ubuntu 8.10 in this case. It&#8217;s a pretty nice machine (although not particularly high-spec) and pretty much everything worked straight away from [...]]]></description>
			<content:encoded><![CDATA[<p>My new desktop at varsity is, as described in the title, an HP Compaq dx2300 Microtower. First thing I did when I got access to it was, of course, to install Linux &#8211; Ubuntu 8.10 in this case. It&#8217;s a pretty nice machine (although not particularly high-spec) and pretty much everything worked straight away from install. The graphics card is Intel, so I&#8217;m not going to be doing any serious gameplaying (<em>this is a work computer, anyway</em>) but it runs Compiz pretty well. Being a desktop, suspend and hibernate aren&#8217;t terribly important, but as it happens they work fine.</p>
<p>The only problem &#8211; and this is the main point of this post &#8211; was with the soundcard (an Intel HDA). The box has three audio outputs: headphone plugs front and back, and a tinny built-in speaker. Under Ubuntu all three outputs were switched on all the time, and it wasn&#8217;t possible to adjust them separately. The purpose of headphones in a shared lab environment is entirely defeated if the built-in speaker is always on! I tried fiddling with all of the multitude of ALSA settings, but nothing worked. It couldn&#8217;t have been a hardware problem, because it did the right thing under Windows.</p>
<p>So, the problem was narrowed down to the audio driver, <code>snd-hda-intel</code> to be specific. Some googling established that changing the <code>model</code> parameter to the module might have some effect on the output selection behaviour. Further searching established that the possible values are listed in <code><a href="http://www.kernel.org/doc/Documentation/sound/alsa/HD-Audio-Models.txt">Documentation/sound/alsa/HD-Audio-Models.txt</a></code> in the kernel source.</p>
<p>To find out what the possible values are, you have to know which codec your card uses. This you can do by running </p>
<blockquote><p><code>cat /proc/asound/card0/codec#0 | grep Codec</code></p></blockquote>
<p>For the dx2300 the result was <code>Realtek ALC888</code>. Indeed, under the list of models for the ALC888, there is one called &#8220;<code>3stack-hp</code>&#8221; for &#8220;HP machines with 3stack&#8221;. Guessing that this was the correct one, I added to <code>/etc/modprobe.d/alsa-base</code> the line </p>
<blockquote><p><code>options snd-hda-intel model=3stack-hp</code></p></blockquote>
<p> and rebooted. Hey presto, suddenly the internal speaker switches off when headphones are plugged in.</p>
<p>tl;dr summary: If you have a dx2300 and you&#8217;re having problems with the audio under Linux, then add the line <code>options snd-hda-intel model=3stack-hp</code> to the file <code>/etc/modprobe.d/alsa-base</code> (at least in Ubuntu; your distro might put module options in a different file).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.frith.co.za/2009/03/19/ubuntu-on-an-hp-compaq-dx2300-microtower/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>How to make ThinkPad volume keys work properly in Kubuntu</title>
		<link>http://blog.frith.co.za/2007/04/02/how-to-make-thinkpad-volume-keys-work-properly-in-kubuntu/</link>
		<comments>http://blog.frith.co.za/2007/04/02/how-to-make-thinkpad-volume-keys-work-properly-in-kubuntu/#comments</comments>
		<pubDate>Sun, 01 Apr 2007 23:45:58 +0000</pubDate>
		<dc:creator>adrian</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ThinkPad]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.frith.co.za/?p=10</guid>
		<description><![CDATA[I really like Ubuntu. I mean, I really, really like it. But it exhibits one really irritating behaviour on most IBM/Lenovo ThinkPads. You see, ThinkPads (except for some in the R series) have a hardware sound mixer, and the volume control buttons operate the mixer directly in hardware, without any interaction from the operating system. [...]]]></description>
			<content:encoded><![CDATA[<p>I really like Ubuntu. I mean, I <em>really, really</em> like it. But it exhibits one really irritating behaviour on most IBM/Lenovo ThinkPads. You see, ThinkPads (except for some in the R series) have a hardware sound mixer, and the volume control buttons operate the mixer directly in hardware, without any interaction from the operating system. This is unusual; most other laptops have software buttons which the OS must interpret and use to control the software mixer.</p>
<p>Now, on most distributions, I would just run <a href="http://www.nongnu.org/tpb/"><code>tpb</code></a>, and it gives a little on-screen display when I press one of the buttons. Ubuntu, however, is different. It has a special hotkeys subsystem which interprets the button presses on all sorts of laptops and passes them to a generic control program. Unfortunately, this system doesn&#8217;t know that the ThinkPad interprets the keys on its own; so every time you press a volume key, it gets interpreted in hardware <em>and</em> in software. This is really irritating, because the volume jumps in huge steps every time you press the button. And if you change the volume in software, they get out of sync and it all gets really complicated.</p>
<p>The appropriate behaviour, of course, would be to just display a notification without changing the software mixer&#8217;s volume; and I hope the Ubuntu folks will eventually implement this. For the meanwhile, anyway, there is a fix at least for Kubuntu. (Sorry, GNOME users, I don&#8217;t know what the equivalent solution is for you).</p>
<ol>
<li>Install the package <code>kmilo-legacy</code>.</li>
<li>Arrange to have read access to the device <code>/dev/nvram</code>. On Feisty, at least, this required setting up a custom <code>udev</code> rule by creating a file <code>/etc/udev/rules.d/50-user-custom.rules</code> with contents <code>KERNEL=="nvram", MODE="0664"</code> and running <code>chmod 0664 /dev/nvram</code> to fix the permissions without rebooting.</li>
<li>Run <code>kcmshell thinkpad</code>, and then tick the &#8220;Run Thinkpad Buttons KMilo Plugin&#8221; option and untick the &#8220;Change volume in software&#8221; option.</li>
<li>Remove the file <code>/usr/share/services/kmilo/kmilo_generic.desktop</code>. (Or move it somewhere else, or rename it to something that doesn&#8217;t end in <code>.desktop</code>, or whatever else will stop KDE from seeing it.)</li>
<li>Log out and log in again.</li>
<li>Voila!</li>
</ol>
<p>One useful side effect is that you will now get on-screen notifications when the other ThinkPad special buttons &#8211; like the brightness controls, the ThinkLight button, and so on &#8211; are pressed.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.frith.co.za/2007/04/02/how-to-make-thinkpad-volume-keys-work-properly-in-kubuntu/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
