Making sure we do power management the right way
I saw a posting about PowerDevil, the new KDE power management interface. It's somewhat disheartening - for the most part, it falls into the same traditional errors made in power management (ie, letting you change cpufreq settings, using "presentation" as a power management setting rather than getting applications to actually do the right thing). But my point isn't to bitch about PowerDevil. My concern is more about why we're still failing to get the message across about certain power management myths. Implementing power management incorrectly leads to wasted power, dead polar bears and wet carpets. It's important that we get this right.Aggressive graphics power management
My current desktop PC has an RS790-based Radeon on-board graphics controller. It also has a Radeon X1900 plugged in. Playing with my Watts Up, I found that the system was (at idle!) drawing around 35W more power with the X1900 than with the on-board graphics.MOVE_REG @ 0xBC09 src: ID[0x0000+B39E].[31:0] -> 0xFF7FFF7F dst: REG[0xFE16].[31:0] <- 0xFF7FFF7F, showing that the value in question was being read out of a table in the video BIOS (ID[0x0000+B39E] indicating the base of the ROM plus 0xB39E). Looking further back showed that WS[0x40] contained a number that was used as an index into the table. Grepping the header files gave 0x40 as ATOM_WS_QUOTIENT, containing the quotient of a division operation immediately beforehand. Working back from there showed that the value was derived from a formula involving the divider frequencies of the memory PLL and the source PLL. Reimplementing that was trivial, and now I could program the same register values. Hurrah!
And another thing
I swear I'm going out in a minute, but:From isolation / Deliver me o Xbox - / Through the ethernet Copyright (c) Microsoft Corporation. All Rights Reserved. Device is Xbox Compatible. Copyright (c) Microsoft Corporation. All Rights Reserved.. This confused me for a while until I plugged it into an Xbox 360 and discovered that despite it being plugged into the ethernet port, I could control the wifi options including network selection and encryption method. Does anyone have the faintest idea how this is implemented? A tcpdump of the Xbox booting reveals some ICMP6 packets, a bunch of DHCP and some uPNP service discovery. uPNP seems like a plausible option, but I've got no idea how to probe a device for uPNP services using Linux. Has anyone played with reverse engineering this stuff? Googling didn't seem to show anything up.
Hybrid suspend
One often requested feature for suspend support on Linux is hybrid suspend, or "suspend to both". This is where the system suspends to disk, but then puts the machine in S3 rather than powering down. If the user resumes without power having been removed they get the benefit of the fast S3 resume. If not, the system resumes from disk and no data is lost.Adventures in PCI hotplug
I played with an Eee for a bit last time I was in Boston, culminating in a patch to make the eeepc-laptop driver use standard interfaces rather than just having random files in /sys that people need to write custom scripts to use. The world became a better place.Android
As a brief introduction to this - I first read through the Android code when interviewing with Google for an opening with the Android kernel team. I didn't get the job, and while I don't think anything that follows here is as a result of residual bitterness you might want to take some of it with a pinch of salt.android_early_suspend_t early_suspend; android_early_suspend_t slightly_earlier_suspend;to deal with the fact that the MSM framebuffer driver depends on the MDDI driver having brought the link bank up and so needs its suspend method called before the MDDI driver but its resume method to be called after, and the only way to handle that is to register two methods - the "slightly earlier" one which has a suspend method but no resume, and the "early" one which has a resume method but no suspend one.
Ultamatix
First, let me make one thing clear. This isn't constructive criticism. This is just criticism. It's directed at software that's so wrong-headed that there's no way to make it significantly better, and everyone involved would be much better spending their time doing something else instead of trying to fix any of what I'm about to describe. It's not worth it. Sit in a park or something instead. Meet new and interesting people. Take up a hobby that doesn't involve writing shell scripts for Linux. You'll be happier. I'll be happier. Everyone wins.function cleanup { echo "Cleaning up..." sudo apt-get autoremove --assume-yes --force-yes }In other words, "Remove a bunch of packages that might have nothing to do with anything Ultamatix has installed, and don't ask the user first. Oh, and assume yes when asked whether to do anything potentially damaging". This gets called 103 times in various bits of Ultamatix.
#Test O/S 64 or 32 bit... architecture=`uname -m` targetarch="x86" #Set 64-bit machines to download 32-bit if no options are set if [ "$architecture" != "x86_64" ] && [ "$architecture" != "ia64" ]; then architecture="x86" else architecture="x86_64" fiIt turns out that ia64 is not especially good at running x86_64 binaries. Never mind, eh?
rm -rf $AXHOME/.gstreamer-0.10 gst-inspect sudo gst-inspectWhich translates as "Delete any self-installed plugins, run gst-inspect as root in an attempt to regenerate the plugin database, really run gst-inspect as root in an attempt to regenerate the plugin database". The flaws in this are left as an exercise for the reader.
sudo apt-get --assume-yes --force-yes remove --purgeUsed 111 times. Will remove the packages it installed, but also any other packages the user has installed that happen to depend on them. Without asking.
sudo cp /etc/apt/sources.list /etc/apt/sources.bak sudo echo "deb http://ppa.launchpad.net/project-neon/ubuntu hardy main" >> /etc/apt/sources.list sudo apt-get update if ! sudo apt-get install --assume-yes --force-yes amarok-nightly amarok-nightly-tools amarok-nightly-taglib then AX_fatal "An apt-based error occurred and installation was unsuccessful"; fi echo "Restoring sources." sudo cp /etc/apt/sources.bak /etc/apt/sources.list sudo apt-get updateThe good news is that it backs up your sources.list before breaking things. The bad news is that it's still utterly horrifying.
#since we have root we need to discover normal username so we can create the shortcut & set proper permissions NU=$(cat /etc/passwd | grep 1000 | cut -d: -f1) sudo chown $NU:$NU "legends_linux-0.4.1.43.deb" sudo chmod +x legends_linux-0.4.1.43.deb sudo dpkg -i legends_linux-0.4.1.43.debList of fail:
sudo apt-get --assume-yes --force-yes install f-spot dvgrab kino devede gtkpod-aac ipod gnupod-tools libgpod-common libipod-cil libipoddevice0 libipodui-cil libhfsp0 hfsplus hfsutils libipod0If only we had some way of saying that libraries used by programs should automatically be installed when a program is. Wouldn't that be great?
echo "Adding mediabuntu repository" sudo cp /etc/apt/sources.list /etc/apt/sources.bak sudo wget http://www.medibuntu.org/sources.list.d/hardy.list -O /etc/apt/sources.list.d/medibuntu.list ... echo "Restoring sources." sudo cp /etc/apt/sources.bak /etc/apt/sources.listYeah. that'll help.
if ! DEBIAN_FRONTEND=kde sudo apt-get --assume-yes --force-yesinstall virtualboxNo, I didn't remove any spaces from that.
#create directory incase they installed it elsewhere, no sense in scraping all thier games sudo mkdir /usr/local/games/WoP/ 2>/dev/null ... sudo rm -R /usr/local/games/WoP/ 2>/dev/nullWhat, create a directory and then immediately delete it? How is this useful in any way whatsoever?
Keyboard handling
The Linux desktop currently receives (certain) key events in two ways. Firstly, the currently active session will receive keycodes via X. Secondly, a subset of input events will be picked up by hal and sent via dbus. This information is available to all sessions. Which method you use to obtain input will depend on what you want to do:FOAF updates: Trust rankings are now exported, making the data available to other users and websites. An external FOAF URI has been added, allowing users to link to an additional FOAF file.
Keep up with the latest Advogato features by reading the Advogato status blog.
If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!