November 22, 2009

earth


There would be video here if you were using a modern browser that supports open video.

1920×1080 Theora | mp4
Via Nat Friedman.

November 20, 2009

I would just like to say PiTiVi rocks

Having followed its development for a long time now and used other video editing software I can say that PiTiVi is an awesome app that is only going to get better. Sure it isn’t perfect yet but that is software development for you. It takes time to get all the features in and make them solid.

One of the great parts of Open Source Software is you get to see it develop and grow. It is also one of the biggest misunderstood aspects of such software. In a world where people are gripped by the next best thing – a collective psychosis of product ADD – where patience is no longer a virtue but an outdated notion of an age long gone, evolution is about as exciting as watching paint dry. Just a reminder that even products that seem to just appear overnight, in reality had long periods of closed development to receive polish (and even then they aren’t always great but for some reason people tend to forgive shortcomings in something they bought as opposed to something they got for free).

Knowing the drive behind the developers working on PiTiVi I am confident that in time PiTiVi will become one of the prime examples of FOSS development. For now it is useful enough for some my basic editing needs and every time I try a new version it just gets that much more useful. Keep up the hard work!!!

[read this post in: ar de es fr it ja ko pt ru zh-CN ]

Why SHMConfig is off by default

Bastien mentioned the Chromium OS xorg.conf file, which includes an irritating wart - namely, Option "SHMConfig" "on". This tells the Synaptics touchpad driver to export its configuration data to a shared memory region which is accessible to any user on the system. The reason for this is that in the past, there was no good way for configuration information to be passed to input drivers through the X server at runtime. This got fixed with the advent of X input properties, and synaptics can now be configured sensibly over the X protocol.

But why was it off by default? Because, as I said, the configuration data is exported to a shared memory region which is accessible to any user on the system. And while it contains a bunch of information that's not terribly interesting (an attacker being able to disable my touchpad or turn on two finger emulation may be a DoS of sorts, but...), it also contains some values that are used to scale the input coordinates. Which means that anyone with access to the SHM region can effectively take control of your mouse. The current position is exported too, so they can also track all of your mouse input.

Now, this isn't stunningly bad. The attacker can only do this while you're touching the pad. You'll see everything that happens as a result. There's no way to fake keyboard input. They need to be running code as another user on the system - if they're running as the logged in user then they can already do all of this. And for a device as single-user as Google seem to be looking at, it's obviously not a concern at all.

But there's still plenty of places on the web suggesting that you enable SHMConfig, and various distributions that ship with it turned on (Ubuntu on the Dell mini used to, but got turned off after I contacted them about it). It's absolutely fine to do this as long as you're aware of the security implications of it, but otherwise please use X input properties instead.

the next firefox business model

If you want to use our plugin APIs you have to sign an agreement that says anytime a user crashes because of your software, you pay us a nickel.  We wouldn’t have funding problems for a while, but boy would Adobe’s shareholders be pissed.

November 19, 2009

Few Surprised at New Evidence of Staging Driver Suckage

wdyt_photo3.articleThomas Johnson (High School Janitor)

Oh yeah, I’ve seen that code.  It’s worse than what I clean up in the bathrooms after Prom or Homecoming.  The kids get high and drunk and party too hard and puke all over the place.  I deal with enough vomit from 7:30 to 6; I wouldn’t touch the staging drivers with a mop twice as long as the one I have at work.

Just Say No

Thomas just found out that none of the “staging” wifi drivers will work with hidden access points because they don’t set the IW_SCAN_CAPA_ESSID capability bit.  Furthermore, the most popular “staging” drivers (for the Ralink hardware used in many netbooks) don’t even have specific SSID scanning capability at all.

Why do you care?  Hidden APs don’t broadcast their network ID, which misinformed people think is more secure (hint: it’s not).  Before a driver can associate to the network, it needs to discover available APs and capabilities, which requires a probe-request, which exposes the network ID to everyone anyway.  But that requires driver support which none of the staging drivers have.

I fixed this issue upstream two years ago by adding IW_SCAN_CAPA_ESSID to Wireless Extensions.  Of course the staging WiFi drivers that many distros enable never got fixed because the vendor it came from didn’t bother to work with the community in the first place.  And people wonder why they don’t work.

Broadly speaking, staging WiFi drivers come in two flavors: (a) old dried gum from under the cafeteria table (drivers with a future), and (b) fresh vomit from the hung-over kid in your math class (those without a future).

The drivers with a future (winbond, rtl81xx) are or will based on the kernel-standard mac80211 wireless stack, which implements the 802.11 WiFi specification in the kernel.  Since they use the standard mac80211 stack, they get all these nice features like probe-scanning and the correct capability bits for free.  All you have to do is work on supporting the hardware itself.

The drivers without a future (rt2860, rt2870, rt3070, rt3090, wlan-ng, vt665x) are based on forks of the ancient ieee80211 stack that Intel’s ipw2×00 drivers forked from the hostap driver.  Each of these drivers includes their own copy of the core ieee80211 stack forked at different times and with different hacks.  When a bug shows up, that means 4x the work, and 4x the chance for the fix to slip through the cracks.  Which is why these drivers have no future.  They are a maintenance nightmare.  Besides, they have crap like this:

pAdapter->StaCfg.bScanReqIsFromWebUI = TRUE;

It just blows my mind why people think staging wifi drivers are a great idea.  There’s a reason staging drivers set the TAINT_CRAP flag in your kernel; because that’s what they literally are.

So what’s the right thing to do?

There’s one huge reason why dead-end staging drivers are a bad idea: there aren’t enough developers.  So do you spend that effort  on maintaining unmaintainable shit code?  Or do you spend it on fixing the code that has a future?  Most of the time you can’t do both.

If you choose to maintain the staging drivers, then things become worse over time since the staging code is simply less tested and less maintainable.   So you continue to drop hacks and fixes onto an ever-growing steaming pile of manure.  Nobody cares much about the driver (because it doesn’t use the standard kernel interfaces and thus doesn’t have a future), so your staging driver never benefits from all the great feature work and bug fixing that the mac80211 and wireless developers are doing.

But if you choose to help fix the upstream drivers that do use mac80211 (like rt2×00), and thus have a future, maybe for a few months some users won’t have great wireless.  But they didn’t before either.  But then 6 months later, all the users get great wireless with features like power saving, background scanning, WiFi Direct, Bluetooth 3, access-point mode, etc.  Those things will never be done to the staging drivers, because those drivers are a dead-end maintenance nightmare, because their code is awful, and because they don’t use the standard kernel wireless stack.

I know I’d invest the effort where it helps users the most, even if it means a few more months of subpar driver support while the official upstream drivers get fixed and the staging drivers go untouched.  That’s how things actually get better when you can’t fix everything at once.

Sigh.

If only eeepc-laptop sent standard keycodes, or something.

Oh, wait.

Writing a Linux distribution is hard. There's a huge range of interconnected dependencies. It takes a long time to learn how everything fits together, and fixing things properly rather than adding device-specific hacks often requires rewriting a lot of code. I'm sure Google will figure it out in time[1], and I'm also sure that the majority of their work is going into their UI rather than the underlying infrastructure. But even so, don't expect that you'll be able install Chromium OS on a random piece of hardware and have it work as well as, say, Fedora in the near future.

[1] Based on that script, I'd say they're about equal to Xandros at the moment

Things an Unprivileged Linux User Must Not Be Able To Do

An Unprivileged Linux User Must Not Be Able to:

* Add, Remove, or Upgrade system software (packaged or otherwise)
* Read or Write directly to/from system memory
* Load or Unload kernel modules
* Start or Stop System Daemons
* Edit System-wide configuration files
* Access other users home directories (unless explicitly granted permission by another user)
* View or Change another users password
* Add or Remove User accounts
* Change the System Clock
* Shutdown or Reboot the System (unless they are the only user logged in)
* Read or Write System Logs (/var/log/*)
* Write a file outside of /tmp or their user home directory (unless explicitly granted permission by another user)

What else am I missing?

Note: A user with sudo access is not an unprivileged user. A user who knows the root password is not an unprivileged user. A user placed into an "admin" group is not an unprivileged user.

November 18, 2009

DEV300_m65

With DEV300_m65 unused methods reduces to 886 as hwpfilter drops out of the list.

idling
Some other work ongoing on removing permanent timers which are constantly triggering when we should otherwise be idle. 3.2 will have the clipboard polling removed which makes the bare frame idle without wakeups, while patches for making math idle have been applied for 3.3. The spell checking loop in impress and draw never ends at the moment, patch available to fix that, as well as fix the graphic and ole cache manager loops to not run if unnecessary. I’ve no fixes for the more complicated writer and calc idle loops yet however.

strict aliasing
Good bit of progress on making OOo strict aliasing safe as well.

cppcheck
Played around with cppcheck as well, mostly discovered missing checks in various workbench tools and build-time tools, but a few good catches on stl iterators in main-line code, and very good on new[]/new vs delete/delete[]. A few false STL positives as well, but upstream is responsive to bug reports, so next version will give a better set.

Another 6^H 5 months, another Fedora release

Fedora 12 released today, go get it. This is the 8th Fedora release I've had the pleasure of being paid to work on in a release engineering role. It has been a long and hard trip, but with lots of rewards along the way. Our community is stronger than ever, with more volunteer (both outside and inside Red Hat) people taking up leadership roles or driving features through or just helping out where help is needed.

12 is cool. 12 was really hard to get out too. 12 had a shorter development period than previous releases, because we lost a month due to an infrastructure incident during the Fedora 10 cycle. We decided to give Fedora 11 a full 6 months as we had a lot of really cool features lining up for it and we were going to do a shorter 12 cycle to polish things up. Turns out we had people doing lots of polish, but other people doing lots of features too, even in a compressed timeline. I'm deeply impressed with the amount of work that can get done, often in spite of the challenges faced by a Fedora developer/maintainer. I can't wait to see what kind of productivity we see as some of these challenges are addressed in the Fedora 13 cycle. Some big changes are coming, tune in to the upcoming FUDCon where there will be multiple talks and hack sessions regarding these challenges our developers, maintainers, testers, and users face.

A few interesting data points for Fedora 12:
- First release in a looong time (ever since I've been doing it perhaps?) that we didn't have to slip the final release date once we got past Beta.
- First release probably ever where the x86_64 DVD is seeing more torrent downloads than the i386 DVD
- Smoothest release day EVER. Seriously. The infrastructure folks really have this down and there were 0 issues.

One more thing that seriously impresses me about Fedora 12 is the launch of our spins site. This is a fabulous new site to really help showcase the different looks that Fedora as a project can offer, finally bringing to fruition something we had been talking about for many releases/years now. There is more website (re)design coming, and I am very excited about it.

Go on, give Fedora 12 a try. A Live image gives you folks with commitment issues something to try without risk, and the install DVD/CDs (and network install iso) gives you fine tuners the ability to hand select the software you get from our vast repository. I promise you we'll do the best we can to ensure a fun, safe, and free ride.

November 17, 2009

Fedora 12

So Fedora 12 is finally out. Give it a try.

It shaped up to be a pretty good release I think.

November 16, 2009

Raising in rage against Eucalyptus in Fedora

At leat at present junction, it's a "no", although of course I cannot stop confused people from packaging it. Things that concern me about Eucalyptus:

* Lack of any kind of willingness to work with the outsiders, unless they are of course Ubuntu. It's even documented. You want to eat crumbs off someone's else table? I sure don't.

* Crazy Xensource-like premature commercialization with Eucalyptus.com. I expect trouble getting understanding (in addition or in explanation of the above).

* We already have all sorts of management stuff with oVirt, sVirt, libvirt, etc. Eucalyptus is a direct competitor for all that, not a complement to it!

* Maybe their compute cloud is the second coming of Christ, but on the storage cloud side, their S3 is worse than what I have today (except in bugginess, perhaps). And I'm sure Jeff Garzik is happy to accept patches, which is the key, goddamit.

All these points are subject to reconsideration in the future, but for now it's pretty obvious to me. I am surprised Greg doesn't think so.

UPDATE: Greg comments further. His is a different view, he wants a coherent cloud story now. But I remember too well how much of steamroller Xen seemed a few short years ago, and where did it go? So, I tend to think we need good code more than coherent story. Perhaps I'm unduly idealistic. And yes, our patchwork of projects and packages is frustrating.

November 15, 2009

Is there A20 Gate in Litl?

Havoc's post explains his vision for the way a consumer would interact with Litl in the same condescending way Steve Jobs wants us to enjoy iPhone. This should certainly sound familiar to anyone who heard of Mac:

The software is finely-tuned to the hardware, and the flippable hardware inspires one of litl OS's core features [...]

But what is in it for me? Them main issue is if Litl is hackable. Is there hardware documentation? What about software and firmware, is it GPL?

100% legacy-free. No caps lock. HDMI, not VGA. etc.

Is there no BIOS? No A20?

Note: Comments about A20 will be deleted. This post is about Havoc's indiffierence to hackerdom, not A20. Go to mjg59's post to discuss A20.

UPDATE: Havoc commented with:

There is no TPM chip or "tivoization" since there's no subscription contract. If you want to replace with Linux it's fine with us.

There's nothing too unusual about the hardware from a driver perspective. The custom wheel and button are hooked up as keyboard keys. A netbook distribution of your choice probably runs, or runs with trivial fixes, though I haven't tried on the final production hardware.

If you have questions then ask one of the litl developers.

November 14, 2009

Hail tabled with data replication

It's almost there, I can sense it. I posted the patch with the scan daemon and 1-st party copy implementation today. There's still a lot of work remaining, in particular I need Chunk to perform self-tests and 3-rd party transfers.

The biggest issue, is, however, tabled itself. Or, actually, its database. In order to support nodes coming down efficiently, it needs to know what keys were at a given node, and the information is not indexed by node. So, the alternative is either changing the whole database scheme, or severely limiting the supported scale so that the limitations of the whole-database scan do not come forward too forcefuly. Given that there's no time, I opted for proclaiming no more than 10 Chunk nodes and 1 million keys. Such small limits make tabled completely useless and a toy (until the new database), but then if anyone thinks otherwise he's deluding himself anyway.

November 13, 2009

Legacy PC design misery

I've spent chunks of the last couple of days fighting a problem that's existed for about 25 years. The 8086 was a 16-bit processor with a 20-bit address space, limiting the maximum physical address that could be accessed to 1MB. However, quirks of the segmented memory system meant that addresses greater than 1MB could be constructed - these would wrap around to the bottom of memory. Because loading the segment registers was a time consuming operation, some programmers used this behaviour as a performance optimisation.

The 80286 introduced 24 bit address space. Unfortunately, this meant that the addresses that previously wrapped to the bottom of memory now pointed at real addresses - not ideal if you were expecting the old behaviour. IBM fixed this by tying the 21st address line (A20 - they're zero indexed) through an and gate, with the default behaviour being to keep it tied at 0 and thus maintaining the old wraparound behaviour. Applications that wanted to access the full address space needed to enable the A20 logic gate. IBM didn't want to add any extra hardware to their system if they could avoid it, so tied the other side of the and gate to a spare pin on the keyboard controller. By writing a couple of bytes to the keyboard controller, your PC-AT stopped pretending to be an XT and gave you access to all of the insanely expensive RAM it had stuffed in it. Hurray!

PCs have been emulating this behaviour since the AT was first cloned. Of course, this being the PC industry, many have got it wrong. There's a set of approaches for controlling the A20 gate that may work, varying in terms of performance and desirability. Most hardware will give the desired result (ie, I have no desire to run DOS executables from 1982, make my A20 work damnit) using any of the various methods of A20 enabling. Some hardware doesn't. The most common method used in bootloaders (where we still have access to system BIOS services) is to call int 15h with an ax of 0x2401, which asks the BIOS to enable A20 for us. This isn't implemented on all hardware, but we should get a failure back that lets us go and bang on the keyboard controller in an attempt to get it to pay attention[1].

Enter the Kohjinsha SC3.

I picked this up second hand in Japan. It's a ridiculously cute little tablet, only slightly larger than hardware that's comfortably in the MID range. It booted a Fedora liveCD perfectly, though having GMA500 graphics meant that what appeared wasn't terribly attractive. Installation proceeded happily enough, followed by a reboot and... nothing. Grub loaded the kernel and initrd, jumped to the kernel and everything hung.

So, for the past couple of days, I was stepping through the kernel setup code, trying to work out where and why it was hanging. I'd got it narrowed down to the region where the kernel tried to free the memory used by the initramfs, but the failure hopped around depending on my kernel build. Something was clearly very wrong. The strangest thing about this was that if I booted the liveCD boot menu and selected "Boot from local drive", everything worked perfectly. isolinux was clearly doing something that grub wasn't, but there's rather a lot of code to step through there.

Things became a lot easier once I found that the OpenSuse version of grub worked. Their grub has a rather smaller set of patches than ours, and only a few looked even plausibly relevant. It only took ten minutes or so to figure out that it was one that altered the A20 code. Things became much clearer then.

The main functional difference between the Suse A20 implementation and the upstream one[2] is that the Suse one explicitly tests whether the A20 enabling worked by putting values at two different addresses that would be the same if A20 is disabled. By comparing them, we know whether A20 is working properly or not. If not it can then fall back to other mechanisms. The Fedora code trusted the BIOS's claim that the int 15 call had worked. The Kohjinsha's BIOS lied, A20 remained disabled, grub copied the kernel and initramfs to chunks of address space that contained lies rather than RAM and everything fell over horribly.

Thankfully, not a difficult fix once the problem was identified. But seriously, people. How hard can it be not to screw this up?

(For an excrutiatingly detailed analysis of how hard it can be not to screw this up, see here)

[1] the Intel Macs don't implement the int 15 approach, but return a failure. They also don't have a legacy keyboard controller, so attempting to hit that resulted in grub falling over. The magic IO port approach works. Another example of how the Intel Macs aren't really PCs...

[2] grub2 implements the more paranoid check

setting signature based on From/To in mutt.

Lazyweb, help me out.
I use mutt to read multiple mail accounts. Using alternates, I have it rigged so that when I reply to someone it sets my From: to the same as the address that they sent the mail To: Straight-forward stuff.

What I’d like to do next is set my .signature based upon the same rule.
I thought that this can be done easily enough with send-hooks like..
send-hook mutt- 'set signature=~/.signature1; my_hdr From: Dave Jones <emailaddress1>'
send-hook mutt- 'set signature=~/.signature2; my_hdr From: Dave Jones <emailaddress2>'

But that just seems to make it pick signature1 regardless of any header.

I googled a while, but turned up dead ends. profiles look interesting, but I’d rather not have to swap between things manually. Likewise, it looks possible to do it on a per-folder basis, but I want this to work with =mbox where all accounts land unfiltered.

Anyone set up something similar ?

setting signature based on From/To in mutt. is a post from: codemonkey.org.uk

Related posts:

  1. email addresses in dmesg a bad idea. A while ago, the following innocuous printk was added to...

On OOM

Building on what Havoc wrote two years ago about the fallacies of OOM safety (Out Of Memory) in user code I'd like to point you to this little mail I just posted to jack-devel which tries to give you the bigger picture. Should be interesting for non-audio folks, too.

Say NO to OOM safety!

November 12, 2009

what a difference having hardware makes....

So I (and other radeon developers) debug a lot of radeon problems, both locally and with people over irc/bugzilla, and I often am quite slow to deal with bugs that I can reproduce locally, its usually a last resort to do remote debugging and its unfortunate for people who have hw bugs that we can't reproduce locally.

So what prompted this post?
https://bugzilla.redhat.com/show_bug.cgi?id=527874
KMS:RV515:X1400 Thinkpad T60 resume fails

So first up, my local Thinkpad T60p with an rv530 always resumed fine, my local T42 with 7500 mostly works okay as well, so
there goes my local reproduction.

So Peng works for Red Hat in Beijing and the week before kernel summit I sat down on irc for most of two days with him running various tests. We tracked it down in that 2 days to the fact that his video RAM wasn't getting setup properly on resume. The NMI on resume let me track down that when the gpu accessed the ring, it generated an error on the PCI bus, this led to checking the contents of the PCIE gart table (with a detour through kernel vmap page handling). The PCIE gart table is in VRAM, and upon checking it on resume noticed when we copied it back into VRAM it was getting mangled. So we could deduce VRAM was broken.

I handed off to Jerome and he got traces of the BIOS posting using VBE and using ATOM (which we use in the kernel), Jerome ruled out different parts of the engines and we got reports of it working for some people when powered down for a long time or other randomness, and we were going back and forth with ideas on what might be going wrong, and had started thinking we should power off various parts of the hw before suspend, and the problem was due to inconsistent hw state on resume.

Peng happened to visit Brisbane for a Red Hat meeting this week and brought the T60, and this morning I swapped my laptop for his. First of all I tried to play by plugging in a VGA monitor, this produced another bug where the LVDS would die when starting KMS, so I fixed that quickly first. So the VGA screen was also corrupted, and VRAM wasn't enabled at all. Next I tested vbetool posting worked, also suspend/resume to corrupt, unload radeon, vbetool post and load radeon worked. Then I started testing with Jerome's userspace atom init tool, doing a s/r, unload radeon, atom post, load radeon also worked fine. This is where it started to make no sense, since Jeromes tool was doing the exact same thing as the kernel parser. I started by blaming the atom delay code in the kernel but that proved a dead end after an hour or two. Next thing I enabled the kernel atom debugging and all of a sudden it resumed fine. So it was a timing issue somewhere in atom parser running the init code.

So enabling debugging put enough of a delay between operations that something that wasn't working before now succeeds. I started bisecting the debug messages, I removed half the debugging at a time until after about 3 hrs I got it down to one printk happening between two atombios commands. The surrounding code was reading and writing one of the memory controller setup registers on the GPU, so it pointed to some register write not getting fully into the hw before we read it back and write it again later. I changed the atom code to do a read back before writing regs for certain operations and viola all resumed fine.

So this took the best part of 8 hours, I reckon if I'd been doing the same over irc with Peng it would have taken at least a month of back and forth on irc to figure it out. Having the hardware locally even for a day made it possible to track it down and figure it out so much quicker and efficently. So the bad news for anyone with bugs we can't reproduce locally is that we generally will fix any bugs we can locally first just from a efficiency point of view, since we can fix them so much quicker and faster.

November 11, 2009

What questions would you like to ask the Candidates for the Fedora Board, FESCo, and FAMSCO?

As you may have heard already, several seats of the Fedora Board, FESCo, and FAMSCO are up for election soon(¹). Right now we are in the nomination period, which will be followed by a "Candidate Questionnaire." That means we'll give candidates a list of questions to answer by private mail within one week after the nomination period closed; the results will be publish soon after that to make sure they are available to the public before the Town Hall meetings on IRC happen.

Candidates may choose to answer (or not) those questions as they see fit. Voters can use the answers to get an impression of what the candidate think or plan to do while serving for the committees they are nominated for. That should help to get a interesting discussion running during the IRC Town Hall meetings; furthermore, those people that can't or don't want to participate in the IRC meetings can use the answers to make a more informed vote.

Hence we need to prepare a few good questions that we can send to the candidates once the nomination period ends. And that's where I need *your help* now:

If you have one or more questions you'd like to send to the candidates simply go and add them to:

https://fedoraproject.org/wiki/Elections/F13_Questionnaire

It just takes a minute or two, so best to do it right now -- otherwise you might get distracted and forget about it. ;-)

I'll take care of the remaining work to review, sort, and clean up the questions(²); after that I'll send them to the candidates soon after the nomination period ended. Hence, I need your question suggestions by around the 15th November 17:00 UTC latest to get a chance to prepare everything in time.

So please go to the wiki now and add at least one hard question! The answers will help Fedora contributors to chose whom to vote for! Thanks in advance for your help .

CU
knurd

(¹) If you haven't read about it yet see
https://fedoraproject.org/wiki/Elections for details.

(²) If you want to get involved or review the questions before I send them please drop me a line and I'll try to get that arranged; maybe we can arrange a quick, informal IRC meeting on Sunday evening if there is interest

P.S.: This blog post is mainly meant to get spread via planet.fedoraproject.org ;-)

Google wave observations.

I’ve not seen google wave yet, but here are my impressions based upon reactions from those who have.

Phase 1: HEY WHO HAS A GOOGLE WAVE INVITE THEY CAN GIVE ME?
This begging phase increases in popularity as more people actually get on the site.

Phase 2: THIS IS COOL, BUT WHAT THE HELL DO I DO WITH THIS ?
Turns out that the “I have something you don’t” novelty wears off quickly when people realise they didn’t actually need it.

Phase 3: HEY WHO ELSE IS ON GOOGLE WAVE ?
Belief that others may be able to enlighten them, and get them out of phase 2.

Phase 4: HEY THIS IS PRETTY USELESS.
Followed by neglect and forgetting they even have an account.

I’ve yet to see anyone praising google wave, but I’ve seen a lot of people go quickly through the above phases. I’m sure there are some people reading this through planet.*.com using it. Is it really “all that” ? Or is this google app going to be the next orkut ? (Remember when everyone thought that was the future? Ah, 2003 I miss you).

(This post isn’t actually me in phase 1. I couldn’t care less, and will probably skip straight to phase 4 when it goes public).

Google wave observations. is a post from: codemonkey.org.uk

No related posts.

November 10, 2009

Dehalification

Is it just me, or nobody in GNOME/Freedesktop/etc. knew what they were doing for years (press "thread next" for more fun)? I wonder what David Zeuten has to say for himself about HAL. Also, what are the chances that whatever is being done now won't get rejected in, oh, a year?

a common hyperthreading misconception.

Despite having been around for seven years now, I still see a common misconception surrounding hyper-threading. People look at /proc/cpuinfo, see ‘ht’ in the flags line, and think “hey, I don’t have hyper-threading, /proc/cpuinfo is wrong!”.

But this isn’t the case. The ‘ht’ flag doesn’t signify the presence of hyper-threading or not. It signifies the presence of the ability to say yes or no as to whether the processor has any siblings. Basically “If I call this cpuid function, can I trust the results?”. This cpuid function is present in all intel processors since the Pentium 4.

So seeing a cpu with ‘ht’ in the flags, but no siblings is perfectly normal, and has been for all this time, but some people just don’t seem to get it.

a common hyperthreading misconception. is a post from: codemonkey.org.uk

Related posts:

  1. x86info hacking. Spent much of the afternoon today working on some updates...
  2. Fedora kernel packaging changes We recently made a change in Fedora kernel packaging, to...
  3. When acpi-cpufreq fails. The majority of modern CPUs that support CPU scaling now...

The ACPI Embedded Controller

Of course, the event model I described before is far too simple to be worthy of a place in the ACPI spec. At the most basic level, there's more possible events than there are GPEs to attach them to, so there's a need for some further complexity. This manifests itself in the form of the ACPI embedded controller (EC).

The EC is typically a small microprocessor sitting on your motherboard, often implemented in the same hardware as the keyboard controller. It shares a lot in common with the keyboard controller - on PCs it'll usually appear in system io space, with one register for writing a command or reading a status, and a second register for passing data back and forth[1]. There's 256 registers available, so a typical interaction might be to write the READ command (0x80) to the command register, write the EC register address to the data register and then read back from the data register to get the EC register contents.

The embedded controller will often be responsible for tracking information about the hardware, such as the temperature. Attempting to read the temperature through ACPI will execute an ACPI method - in the case of the temperature being monitored by the embedded controller, this method will attempt to read from an EC register. The EC driver then performs the read and returns the result, which gets converted into decidegrees kelvin and passed back to whatever made the temperature query.

But, as mentioned above, the EC also generates events. These may be in response to a user initiated event like a hotkey press, or may be triggered by some change in hardware state like a thermal trip point being passed. The embedded controller will then raise a GPE.

Unlike normal GPEs, the EC GPE is not handled by looking for a _Lxx or _Exx method. Instead, the ACPI tables provide information about the GPE that the EC is using. This may be in the form of a _GPE definition in the EC object in the main ACPI tables, or alternatively may be provided in an ECDT (Embedded Controller Descriptor Table), an optional table that provides all the EC information. In either case, the OS knows which GPE will be triggered by the EC. It then installs a handler that will be called whenever the EC raises that GPE.

Things get a touch confusing at this point. The first thing this handler does is read the command byte, which functions as a status byte on reads. It then checks whether the SCI_EVT bit is set. This informs the system that the GPE was in response to a hardware event, and so the EC handler writes a query command to the EC command register and then reads back a value between 0 and 255 from the data register. This is then mapped to a _Qxx method, with xx representing the number of the EC event read from the data register. Like the _Lxx and _Exx methods, the _Qxx method is then executed.

The problem with all of this is that the EC isn't that fast. When a byte is written to it, it's necessary to read back the status byte and check whether the IBF bit is set. This is set when the OS writes a byte to the data register, and cleared once the EC has processed it. The straightforward way to deal with this is to poll the status byte until the bit is cleared, and then write the next byte, but polling is slow and wastes CPU time. The EC can instead be set to interrupt mode, where it'll fire a GPE when the IBF bit clears.

The EC has one additional function. The ACPI spec allows for an i2c bus to be implemented through the EC, with EC registers mapping to i2c registers. The observant among you will realise that this means that there's an indexed access protocol being implemented on top of indexed access hardware, which is more layers of indirection than seem sane. For additional humour, this is usually only used to add support for ACPI smart batteries. ACPI batteries are generally abstracted behind a set of ACPI methods that provide information. Smart batteries instead speak i2c directly to the OS[2] for no real benefit. Linux handles these devices fine, and while the chances are you probably don't have one, the chances are also that if you do you haven't noticed.

The final quirk of ACPI events is that there's yet another means of delivering events. The term "fixed feature" is used to describe an ACPI device that isn't described in the ACPI tables. A power button may be implemented as a fixed feature device rather than a normal ("control method") device. This is indicated by a flag in the fixed feature block. Hitting a fixed feature power button will generate an ACPI interrupt, but no GPE. Instead the OS has to read the fixed feature block and note that the power button flag is set there. It then notifies userspace appropriately. Sleep buttons can also be implemented this way, but other devices will be in the normal ACPI tables and will generate either GPEs or EC events.

[1] On my laptop, these are ports 0x62 and 0x66 - compare to the keyboard controller's use of ports 0x60 and 0x64

[2] As directly as indirection via the EC can be...

Sharp TV violating the GPL

After years of using a on-it’s-last-legs 720i (i stands for i-strain) TV, this week I decided it was time to let go of the last big CRT I have, and pick up a shiny new LCD TV. After a few visits to stores to check out the options, I ended up choosing a Sharp AQUOS LC46LE700UN 46-Inch 1080p LED HDTV. I managed to find a place that had on offer for the weekend which saved me a few hundred dollars. It arrived today. It’s freaking huge. Somehow the TV looks even bigger at home than it did in the store.

After setting it up, and reading through the manual, I stumbled across a GPL notice, and an acknowledgement that it uses the following open source software components.
“linux kernel/busybox/uClibc/zlib/libpng/libjpeg/libiconv/DirectFB/OpenSSL/XLRPC-EPI”
It points you to where you can download the source code.

The 52MB helena-kernel.tgz is what I focused on first. It’s a 2.6.18 Linux kernel with a slew of stuff removed to keep the source tree small I guess. So arch only contains arm and um for example. What else is in there ? Some preempt-rt hacks, ltt, some debug stuff, a load of cvs ident damage from a broken import into their tree, and a bunch of other noise. There’s also a load of changes to files they never even compile. Like ipv6, and decnet, and sound drivers, and, and.. etc.

There’s nothing particularly notable in the tree that isn’t already upstream in some form or other. Except for an ARM port to the ‘mt5391′ platform. Work that was apparently conducted by an upstream vendor named mediatek. Why is it notable ? Well the copyright header for one thing ..

/*
* linux/arch/arm/mach-mt5391/core.c
*
* Copyright (C) 2006 MediaTek Inc
*
* This program is not free software; you can not redistribute it
* or modify it without license from MediaTek Inc.
*
* CPU core init - irq, time, baseio
*/

Unless I’m mistaken, this isn’t permitted under the GPL. If you give me GPL software, I have the right to redistribute it. If you add proprietary code to GPL code, it becomes GPL licensed. After discussion with Harald Welte, it turns out I was mistaken. It’s still not permitted, but it doesn’t automatically become GPL, the resulting work isn’t distributable by anyone.

I’ll bet Sharp don’t even know they’re doing this. They probably took the code sold-as-seen from mediatek, and assumed all was ok without even thinking of licensing concerns. I don’t know if gpl violations already had this one in their queue, but they do now.

Who knows, maybe MediaTek will wise up and actually contribute back to the source code they parasitically develop against.

Despite all this, I still like my new tv very much.

Sharp TV violating the GPL is a post from: codemonkey.org.uk

Related posts:

  1. Graphical objdump ? Hi Lazyweb. I’m curious if a tool exists already to...

ACPI general purpose events

ACPI is a confusing place. It's often thought of as a suspend/resume thing, though if you're unlucky you've learned that it's also involved in boot-time configuration because it's screwed up your interrupts again. But ACPI's also heavily involved in the runtime management of the system, and it's necessary for there to be a mechanism for the hardware to alert the OS of events.

ACPI handles this case by providing a set of general purpose events (GPEs). The implementation of these is fairly straightforward - an ACPI table points at a defined system resource (typically an area of system io space, though in principle it could be something like mmio instead), and when the hardware fires an ACPI interrupt the kernel looks at this region to see which GPEs are flagged. Then things get more interesting.

The majority of GPEs are implemented in the ACPI tables via methods with names like _Lxx or _Exx. The xx is the number of the GPE in hex, while the leading _L or _E indicates whether the GPE is level- or edge-triggered. If an ACPI interrupt is fired and GPE 0x1D is flagged as being the source of the interrupt, the ACPI interpreter will then look for an _L1D or _E1D method. Upon finding one, it'll execute it. What this method does is entirely up to the firmware - on most HP laptops, GPE 0x1D is hooked up to the lid switch[1] and so executing it will send a notification to the OS that the lid switch has changed state. The OS will then evaluate the state of the lid switch (generally by making another ACPI query) and send the event up to userspace.

How does the lid end up triggering GPE 0x1D? Things get pretty hardware specific at this point. Intel motherboard chipsets have a set of general purpose io (GPIO) lines that can, for the most part[2], be used by the system vendor for anything they want. For a lid switch, one of these lines is hooked to the switch and the BIOS configures the GPIO as an input. Pressing the switch will cause the GPIO line to become active. The GPIO lines are mapped to GPEs in a 1:1 manner, though with an offset of 16 - ie, GPIO 0xd will map to GPE 0x1d. If GPIO 0xd becomes active, GPE 0x1d will be flagged and an ACPI interrupt sent. The ACPI code will then do something to quash the interrupts, such as inverting the polarity of the GPIO[3], as well as send the notification to the OS.

Why are the GPIOs offset by 16 relative to the GPEs? The lower 16 GPEs (again, talking about Intel hardware) have pre-defined purposes[4]. These range from things like "Critically low battery" to "PCIe hotplug event" down to "This device triggered a wakeup". And the latter is what I'm most interested in here.

Various pieces of modern hardware can be placed into power saving states when not in use. The problem with this is that the user experience of having to turn on hardware before you can use it is not a good one, so in order to make this the default behaviour we need the hardware to tell us that something happened that requires us to wake the hardware up.

There's something of a chicken and egg problem here, but thankfully most of the relevant modern hardware has out of band mechanisms to tell us about things going on. The PCI spec defines something called Power Management Events (PME), which are driven by an additional current that's supplied to the hardware even when it's otherwise turned off. On plug-in PCI Express cards, firing a PME generates an interrupt on the root bridge and a native driver can interpret that, but for legacy PCI devices and integrated chipset devices the notification has to come via ACPI.

The example I've been working on is USB. It's a good choice for various reasons - firstly, there's already support for detecting when the USB controller is idle. Secondly, modern USB host controllers have support for generating PMEs on device insertion, removal or (and this is important) remote wakeup. In other words, as long as the USB bus is idle we can power down the entire USB controller. If the OS tries to access a USB device, we'll power it back up. If the user unplugs or plugs a device, we'll power it back up. If a previously idle device suddenly responds to some external input, we'll power it back up. And it's all nicely invisible to the user.

How does this work? The controller retains a small amount of power even when nominally pwoered down. This is used to keep the detection circuitry alive. When it receives a wakeup event, it asserts the PME line. The chipset detects this and fires a GPE. The OS runs this GPE and receives a device notification on the ACPI representation of the USB controller, telling us to power it back up. We do so and process whatever woke us - if the bus then goes idle again, we can power down once more.

The astonishing thing is that this all works. The only problem we have is that it relies on the machine vendor to have provided the ACPI methods that are associated with the GPEs. If they haven't, we can't enable this functionality - even though the hardware is capable of generating the GPEs, we have no method to execute to let us know which device has to be woken up. The GPE is never answered, we never acknowledge the PME and the hardware keeps on screaming for attention without getting any. And, more to the point, it never gets powered up and your mouse doesn't work.

There's a pretty gross hack to deal with this. In general, we know what the GPE to device mappings are - they're pretty static across Intel chipsets, and while AMD ones can be programmed differently by the BIOS we can read that information back and set up a mapping ourselves. This trick also comes in handy when some vendors (like, say, Dell) manage to implement one of the GPE events wrongly. Everything looks like it should work, but the method never sends a notification because it's buggy. In that case we can unregister the existing method and implement our own instead.

This code isn't upstream yet, but patches have been posted to the linux-acpi mailing list and with luck it'll be there in the 2.6.33 timeframe. My tests suggest about 0.2W saving per machine, which isn't going to save all that many polar bears but seems worth it anyway.

[1] _L1D = lid. Sigh.

[2] There's a few that are reserved for specific purposes

[3] So where before it had to be high to be active, it now has to be low to be active - this means that it'll now trigger on the switch being opened rather than closed, so you'll get another event when you open the lid again.

[4] You can find a list in the documentation for the appropriate ICH chip - the relevant section is "GPE0_STS" under the LPC interface chapter.

November 09, 2009

Looking to the past

It’s an oft-voiced suggestion that rather than looking at the bad things that happen in our communities, we should focus on the good things. There’s a number of highly successful geek women already – should we not be concentrating on encouraging more of them, rather than scaring people away with tales of thoughtlessness, discrimination and outright abuse?

Let’s draw an analogy. One day, a $20 charge appears on your credit card. You didn’t make it. You report it to your credit card company, who assure you that they take fraud seriously and then do nothing. A few days later, another $20 charge. Your credit card company tells you that such events are rare, unrepresentative of the general credit card experience and continue to do nothing. A week afterwards, another charge. This time your credit card company describes how they’re planning on implementing a brand new anti-fraud system, but that this is unrelated to any events that may currently be occuring and will give no details as to when it’s going to be rolled out. And proceed to ignore any further reports you make about fraudulant transactions.

Would you stay with this company? Or would you take your business somewhere else?

The problem with the “Let’s look to the future rather than spending too much time getting stuck in the present” argument is that it assures people that things will get better without providing a roadmap for getting there. It does nothing to validate their concerns or make them feel wanted within a community. It assumes either that people will stick with a community that doesn’t respond to their complaints, or that it’s possible to construct a community that’s welcome to an assortment of genders, ethnicities and lifestyles without any of those people being represented in the first place.

Ignoring people’s concerns is an excellent way to drive them away from your community. Doing so because of a potential future that’s probably conditional on you having those people in your community is short sighted and self defeating. Ignoring the present doesn’t benefit the future. It benefits the status quo.

(Originally posted here)

So I took a week off.



So I took a week off. is a post from: codemonkey.org.uk

Related posts:

  1. boot/init miniconf at plumbers next week. I’m MC’ing the boot/init miniconf next week at the Linux...

Is the whole world smiling or just laughing behind your back

For various reasons I am staying out of government politics these days but that doesn’t mean I’m going to stay away from a bit of controversy when it comes to my beloved Open Source crowd.

I remember at one Boston Summit, being held at the MIT Stata Center, where Luis Villa, our much appreciated lawyer in training (or is he an actual lawyer yet and more importantly can we start cracking lawyer jokes?), was holding a Marketing BOF. In this BOF we ended up listing things that GNOME didn’t do well in which someone who was not part of the GNOME community but rather an invited guest took the session to mean that GNOME was in serious trouble and was folding in on itself.

What this person failed to realize is that self introspection and acknowledging ones weaknesses is the first step to becoming stronger. In our case it was the first steps to becoming a stronger community.

It is with this in mind that I read Henri Bergius’ great synopsis on the Apple MagicMouse vs the Open Office mouse design. It illustrates one of Open Source’s short comings with mitigating complexity. To stereotype us collectively a bit, we are like Sheldon from the show the Big Bang Theory. Sheldon can solve complex theoretical physics questions in his sleep but ask him to engage in simple social interaction and he hides behind condescension and excuses the interaction as unimportant.

Similarly, ask us to solve a complex computer problem and we will do it but ask us to make it easy to use, something the masses would go out and spend money on, and the same indignant statement seems to permeate every discussion about it – “that’s not something I would want to use”. Ok, so the analogy isn’t fair because as a group we are as diverse as any other but from the amazing things that we have produced it is clear that collectively we have a hard time hiding the complexity of it all. For some reason Apple is able to promote ease of use and they get praised for it but when we try to promote it we hit a wall of cynicism – “You’ll have to pry my user interface from my cold dead hands!”

So the question is will we ever learn how to mitigate complexity or will we just leave that for others to add as a competitive advantage? Is our end goal to just be a building block of modern technology or will we be the finished product itself? I don’t have that answer but I do know it is something we need to introspect on. We need to ask ourselves these hard questions, not as acknowledgement of failure but as acknowledgement of the fact that we can always do better by honestly and without cynicism, examine our weakest points. As other parts of the industry learn from our successes in development and internally implement changes based off of the Open Source model, we too need to look at their successes in the mass market and see what we learn from them.

[read this post in: ar de es fr it ja ko pt ru zh-CN ]

November 06, 2009

my first sub hour build

So, i7 920 + 10k SATA, full vanilla OOo DEV300_m64, no ccache, no nodep, no NOHIDS, straight build from a stock “./configure” (i.e. includes building seamonkey from source and binfilter) through and including packaging with (date && VERBOSE=FALSE build –all –dlv_switch -link -P8 — -P8 -s && date) > /tmp/build.log 2>&1 took 58 minutes.

Public Service Announcement

Folks! Since quite some time now the kernel exports the DMI machine information below /sys/class/dmi/id/. You may stop now parsing the output of dmidecode thus depending on external tools and privileged code.

For example, to read your BIOS vendor string all you need to do is this:

$ read bv < /sys/class/dmi/id/bios_vendor
$ echo $bv

Which is of course much simpler, and cleaner, and safer than anything involving dmidecode.

Thank you for your time!

Dedicated separate Firefox windows

Dear intarweb,

here’s what I’d like to be able to do. I would like to start a completely separate Firefox window, in a separate process, with a given webpage. This process should be completely separate from my regular browsing, not take new links in its window when I click links somewhere else (usually they go to the most recently opened window), not crash when the regular firefox process crashes, and not bog down because my regular firefox goes to 100% CPU and beyond.

It seems to be hard to google for this idea; is it possible ?

Best post-sale screen ever

Just gave in to the geeky side of the force this morning and bought a DVD documentary about BBS’s. (the version I bought comes with a DVD full with BBS text files, ANSI art, and random crap.)

After buying, this is the screen I got:

I don’t think I ever got a chuckle out of what happened right *after* I forked over cash. Here’s to you, Bob!

The litl thing

Apparently, it uses S3. My plan to take over the world is proceeding as I have foreseen.

November 05, 2009

going walkabout (well, flyabout anyways)

Tomorrow, I am taking my the longest plane ride ever: I'm going to Brisbane, Australia for a week.

Sadly, it is not a week of vacation, but instead, a week of building bridges and improving communications between groups at Red Hat.

Okay, so maybe I might sneak out of a meeting or two to go see a Koala Sanctuary. This is my first trip to Australia, and will be the Fifth continent I have had the chance to visit. (Only Africa and Antarctica to go!)

I still have a ton of stuff to do before I go (including laundry), but I think all of my Fedora 12 bits are in the right place, so that can go forward without me (or Paul).

GNOME Miro Video Page

Will over at the Miro project, that super cool Open Source media player, sent me a link today of their Miro Community site. It is a video aggregation site that allows for communities to collect all of their video in one place even if they were originally posted elsewhere.  To that effect he has also set up a GNOME Miro Community site.  I know we have a bunch of great videos talking about GNOME and showing off its features.  This is a shout out to people who have great GNOME related video content to go ahead and start aggregating those videos so others can find them.  Let’s start building a community of open video showcasing our favorite open desktop!!!

GNOME's Miro Community Site

GNOME's Miro Community Site

[read this post in: ar de es fr it ja ko pt ru zh-CN ]

November 04, 2009

Litl’s little netbook

I popped down to Boston today to see Litl’s internet computer and catch up with friends who now work for Litl. Unfortunately I did not see Havoc there (probably release partying too much or more likely coding) but a number of GNOME folk and others who I worked with at OLPC did show up. (I’m not going to name names because I will inevitably leave someone out).

In any case the Litl webbook looks promising. Finally someone has looked at what a target group of consumers wanted and designed a simplified interface around services instead of just dropping a Linux distribution in and saying here you go. Did they hit the mark, only time can tell but for Linux on devices to win in this area we need this sort of targeted design instead of chasing the windows generic computing market. It is how Apple won with the iPod and iPhone. Anyone who reads my blog should know my stance on this issue so I won’t beat it to death.

Some key innovative features here are

  • Browser centric design
  • Easel mode in which the UI accommodates the device’s configuration
  • Instant sharing and mobile configs – if one breaks you can log in from another and continue whatever you were doing
  • Almost zero maintenance and setup (you still need to tell it who your friends are)

Sure we have some of these features being developed in GNOME (it doesn’t come as a surprise since a lot of the UI is based on work done in GNOME and other GNOME related projects like the OLPC) but this is the first complete commercial offering which brings those features into one consumer friendly device with a laptop form factor.

As someone who is proud of GNOME’s accomplishments I wish Litl the best of luck and thank them for the code they have contributed back to the community.  As a Foundation member I hope to see even more collaboration between them and the foundation in the future.  Keep up the awesome work!!!

[read this post in: ar de es fr it ja ko pt ru zh-CN ]

November 02, 2009

Quick video using Jokosher, PiTiVi and my Canon digital camera


You will need “Firefox 3.5 to view this video or another browser that support the HTML 5 video tag and ogg theora video format. I also wish planet would not filter out video tags!!!

Rome.ogv
Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License

Above is a song I was writing for my sister’s wedding. Unfortunately I never finished it and logistics got in the way of me bringing a guitar to Italy (namely I didn’t want to lug a guitar all around Italy). I thought I would record it using my Cannon PowerShot camera and edit it with Jokosher and PiTiVi to see how far our tools have gone.

I have to say it was fairly easy but I still ran into issues. As far as UI Goes PiTiVi is much easier to use than Jokosher in terms of organizing what I wanted to do. I really only needed Jokosher to tweak the sound a bit but it was still a bit of trial and error to get something decent. I used the high and low pass filters to filter out background noise and echo from my room. Jokosher lacks a basic noise filter effect which can be implemented manually in most other editors by taking a sample of the ambient noise and phase shifting it 180 degrees so the ambient noise is canceled out. Unfortunately the solid bar UI which departs from the usual wave graph makes it impossible to do this by hand. In any case the low and high pass filters worked fairly well to get the most annoying twangs and hisses out.

Another issue is not being able to mark cutin and cutout points and have PiTiVi sync the video with these point. I essentially had to do minimal processing in Jokosher so I could easily sync the video to the edited sound in PiTiVi. It would have been nice to trim the audio in Jokosher and when I imported it into PiTiVi, had it sync up to the correct points in the video. Manually doing that in PiTiVi is hard because of the timeline scale and the fact that it is exclusively drag and drop. It would be nice to be able to enter exact values or load markup metadata so I could snap to my cuts. Once the audio is in PiTiVi we are stuck with PiTiVi’s audio tools which will never be as complete as Jokosher’s (assuming Jokosher gets some development love). It would be nice to be able to jump back and forth between the two.

All that being said, once I planned out what I wanted to do it took no time at all to do it for a video as simple as this. It might not be all roses and honey yet but it is much better than it has been. The next step is to start multi-tracking in Jokosher and syncing it to a video. We shall see.

[read this post in: ar de es fr it ja ko pt ru zh-CN ]

bringing theora to youtube (the hard way)

I switch back and forth between Linux and Windows 7 pretty regularly these days.  But I have has this problem with Linux. I can’t run Firefox 3.6 nightlies (which are nicer than the 3.5 release) and Weave and Flash all at the same time. I can run Firefox 3.5 and I can have Flash, but Weave doesn’t work. Or I can run 3.6 with Weave but then Flash crashes the browser. It turns out that for me Weave is way more important than Flash but I still miss being able to watch the occasional Youtube video.

If you’ve ever run Linux for any period of time, you’ve had this kind of experience.

Anyway, I decided to try and make it so that I could easily play Youtube videos without having to use Flash. (Flash – in many ways – is the weak link in the chain.  In this case it’s because I can’t fix/hack it, although I’m happy to not have it because my browser is a lot more reliable.)

Theora + Youtube = Love

Theora + Youtube = Love

I wrote a greasemonkey script called Theoratube that connects to the Firefogg extension. It’s based very heavily on the really great Youtube without Flash Auto user script that lets you embed videos as a plug-in. But in my case I decided to use native Theora and HTML5 video because it’s more reliable, has controls and doesn’t require any additional software to start working.

How does it work?  It pulls down the video, uses Firefogg to transcode it, and then stuffs it back into the browser via a private URL.  It’s slow because it has to pull + encode the entire video, but it works surprisingly well for something that is as hacky as it is.

The worst part is the delay in between loading it and the first time you can play the video.  It needs a few changes to make it more usable:

1. It needs to download the video, start transcoding it and stream it into the browser as soon as possible.  This shouldn’t really be a problem and will probably be a pretty good experience.  Youtube bursts its traffic to start and then throttles it way back and at least on my machine the encoder can keep up pretty easily to transcode live.  This means taking it out of greasemonkey and putting into a proper extension to get everything inline properly.

2. The current Firefogg stuff works pretty well but it isn’t really designed for this use case.  For example, once you start a download of a file there’s no way to cancel it.  Same with encoding.  Also it needs an event feedback system instead of polling, which is what the greasemonkey script has to do right now.  But if you’re moving it to an extension above anyway this is probably pretty easy to do – just download in the extension directly and then include Firefogg for the encoding part.

3. Firefogg can only encode directly on a file instead of being part of a stream.  Not sure if ffmpeg2theora can handle this across platforms or not – I suspect so, but it’s something that needs to be fixed.

4. It really needs a big online cache to store data once you’ve downloaded it and encoded it to a free format.  Think of it as collaborate transcoding in the cloud.  Download, transcode, re-upload so that others can benefit as well.  You’ve already got the Youtube ID and the format it came from – that would make it pretty easy to key off of and do a quick lookup before trying to re-download the video and re-encode it.*

5. It needs to match particular quality formats to bitrates for the encoder.  Right now it just encodes everything at top quality since it’s just local and it’s the least loss you can buy.

6. The copyright issues here are…interesting.  There’s some content on Youtube for which the uploader actually has the copyright on that particular work.  (I mean, we’re talking about Youtube.  Your source for 15 remixes of Drunkest Guy Ever.)  And this is mostly about accessibility, not downloading.  So we’ll see if anyone gets upset.

7. It doesn’t handle youtube embedded videos on the web.  This will be a little trickier, but certainly not impossible.  Just need some more greasemonkey to help there.  Probably have to transform the object embeds into something else.

8. Seeking might be a little challenging, but not impossible.  There’s a parameter to the get_video call that lets you specify where to start pulling the video.  Probably offset in the number of seconds.  But needs some investigation/work.

So this is certainly 0.1 software.  But it raises an interesting tactic in making content more accessible in open formats – even without the participation of the original party.  Sometimes the work around isn’t what you expected.  (Note: I would like this for t61 as well.)

* No fooling, I wonder if Google would be willing to host such an archive?  People are willing to transcode to work around their lack of support for open formats – maybe they could at least provide a valid archive for them to work together?  Or maybe the Internet Archive?

November 01, 2009

New RPM Fusion packages: nvidia drivers for F12, staging drivers for F11 and F12

Just FYI:

  • the nvidia graphics drivers finally showed up again in the RPM Fusion repository for rawhide (the current public rawhide to be precise, e.g. what becomes Fedora 12 soon)
  • Most drivers from the linux-staging tree are disabled in the kernels that Fedora ships (among them a few wifi drivers like rtl8187se) . That's a good thing, as they are often of highly questionable quality (¹, ²). But some people nevertheless what them, as they own hardware that needs them(³). Those people from now on can get them easily for Fedora 11 and Rawhide/Fedora 12 by installing kmod-staging from RPM Fusion.
    Please note that:

    • the drivers for Fedora 11 are in rpmfusion-free-updates-testing currently and build for the kernel that is in Fedora's updates-testing repo; thus to use them you need to run something like "yum --enablerepo='*testing' install kmod-staging" and reboot into the kernel that is installed to use them
    • you need to install kmod-staging-PAE if you use a PAE kernel on your x86-32 machine
    • there are no akmod-staging package at this time
    • the package doesn't contain all the drivers from the staging tree; in case you miss one just file a bug in bugzilla.rpmfusion.org and tell the packager to enable it
Also note that it might take some hours till the mirror yum chooses for you offers the packages, as they were uploaded to the master repo just a few minutes before this blog posting got published.

We thank you for your attention and we wish you a pleasant flight.

(¹) that's the long story short

(²) don't expect the drivers to work well; NetworkManager for example will in have problems with some of the WiFi drivers in staging-kmod. In most cases that will be the fault of the driver and not NetworkManager, thus filing NetworkManager bugs that occur with staging drivers is likely a waste of your time.

(³) friends don't let friends buy hardware which need's staging (or even worse: proprietary) drivers on Linux

October 31, 2009

Ranthambore


I think our visit to the tiger sanctuary in Ranthamore has gone alright…

(Special thanks to Hema at Wipro for reminding me of the existence of Ranthambore, and to the great staff at Tiger Safari Resort Hotel in Sawai Madhopur for helping us through some complications along the way, like me misplacing our passports…)

October 30, 2009

Blog-resident development in the clouds

In case folks don't know, I'm a massive blogger, but it's not blogging about programming and most especially not blogging while programming. I dabbed in it, but it became very obvious to me that it was a province of douchebags and Rusty Russel (who blogged good things about lguest and other projects). The end of my dabbing occured when jbj declared that he's "taking development of RPM 5 to the blog". Seeing that put a capstone into my communication phylosophy. We kernel programmers do the business on mailing lists, Jon Corbet summarises the results.

But it looks like outside of the kernel, a different way of life arose, congealed, or whatever. I cooperate on Hail with Jeff Darcy, and I learned today that he has what is a programming blog. Darcy is not as exceptional as Rusty among kernel hackers. Cloud-y folks, they all blog. But I never knew what to make of that, if it was Sturgeon's law. However, Jeff is not a random wanker, he codes good things. He's also fully versed in good e-mail: no top-posting or HTML from him.

Not sure if this blog is going to explode with programming detail, but even if I'm not as cool as Jeff Darcy or Rusty Russel, why the heck not. It may be worth documenting the thinking missing from commit logs.

In case anyone asks, I still hate Twitter.

Developer Productivity Presentation

Dear interweb,

recently I’ve been doing a bunch of thinking on how to have productive developers. We’ve been having some discussions on the topic on the business side, and there are things that I take for granted that aren’t always as obvious to the more commercial side. Things like, ‘flow is the most important part’, ‘context switches should be avoided’, or ‘a 3 month deadline for development with 1.5 months of testing/deployment/… can be given double the development work with only 50% more time’.

So I started thinking it would be nice to be able to give a quick presentation to those people, explaining some of the basic concepts they should consider, and references to back it up (studies, papers, …) that give some weight to the argument beyond ‘trust me, I know because I’m a developer’.

I went out googling for something like this but I didn’t find anything, possibly because I don’t know what to look for. It seems like something useful for any kind of technical/dev manager.

If you have an idea, please let me know!

October 29, 2009

New chromium packages

Thanks to the work of Craig Schlenter, Evan Martin, and Joel Stan, there is now a workaround patch (albeit, a hack) for the chromium issue where certain websites wouldn't load. New chromium packages with this patch applied are rsync'ed to the main repository now, so you should be able to get an update by running: yum update chromium v8

USB boot the Fedora 12 Installer DVD

http://people.redhat.com/wtogami/archive/2009/livecd-iso-to-disk-fedora12.sh

This is a modified version of livecd-iso-to-disk.sh that will install the Fedora 12 Beta i386 or x86_64 onto an ext3 formatted USB drive.  You should be able to boot the USB drive, and it should automatically detect the .iso copied there.  ext3 format required!  The 3GB+ DVD .iso wont fit on vfat filesystem due to the 2GB file size limit.

Does this script work running on Fedora 11 to write the Fedora 12 DVD .iso?  I don't know.  Please try it and report back.

This will be pushed in livecd-tools-031+.  It would be nice if liveusb-creator gained similar functionality...


October 28, 2009

More GMA500

But is Intel really the party at fault, here?

For shipping a gpu without open drivers? Given that the alternatives involve someone else designing, fabbing and releasing a piece of hardware under Intel's name without being sued in the process, I'm going to have to say "Yes".

(Note that while Moblinzone.com is a website owned by Intel, the writers don't appear to be Intel employees)

an open internet

An important video from Jesse B. Dylan.

October 27, 2009

An update on the state of my head.

First off, thanks to everyone who commented on my last post, or sent email expressing concern etc. Much appreciated. Though it did make me feel like I was in an episode of house, with the number of diagnosis’s I got from everyone who had had something similar, or known someone, or known a doctor etc.

So I had my head scanned last friday, and got the results today. It showed up nothing of concern. (Which shot down the majority of the suggestions I got from people, Dr House would not be impressed with you). While a clear report in some ways was a relief as it ruled out so many things, in other ways it was annoying because I still didn’t know for sure what has been going on with the headaches over the last month.

The current theory is that I’m suffering from cluster headaches. The symptoms sure do sound familiar. (Right down to the cute graphic, though mine is the right eyeball mostly). So I got a prescription today for some naproxen and imitrex. The latter reminded me why high-deductable insurance is a bad idea. $149 for a months worth. Suck.

Hopefully they will at least make the pain manageable. How long I’ll have to take them for is currently unknown.

An update on the state of my head. is a post from: codemonkey.org.uk

No related posts.

October 26, 2009

another top 20 website supports Theora

Earlier this week, Automattic, the company behind wordpress.com and WordPress (the software this weblog runs on) announced that they would be supporting Theora along with MPEG-4 as part of their VideoPress platform.

It’s important to realize that wordpress.com is the second top 20 website in the US to add support for Theora. (The other is Wikipedia. DailyMotion has also been experimenting with Theora – number 13 in France and 38th world-wide.) These technologies are still new, but it’s nice to see that people are adopting open standards and open formats as early as possible.

Along with some web site adoption, really great tools are starting to come together to support Theora in HTML5, making it super-easy to transcode videos into open formats.

It’s great to see so much progress in such a short period of time.

I’ve included a link below to the video that describes VideoPress in an open video format hosted at wordpress.com, along with with MPEG-4 and flash fallbacks.

October 23, 2009

Friday night couch surf

It’s Friday night, the missus is away from home, and I have the place to myself after work. Most people would spend it either out or on the couch. I went for option two, with a twist – dust off that CouchDB book again and see if we can get it to work this time.

I last tried this a bunch of weeks ago, and couldn’t really get a magic mix working of that day’s version of the book (it’s a work in progress), CouchDB’s trunk (it didn’t yet have user authentication I think), and Sofa’s git master (there’s only one branch, master, and it already implemented user authentication from the 0.11 branch). It was a frustrating experience for a newcomer, since when things go wrong because of a version mismatch you end up with obtuse or confusing error messages. The #couchdb IRC channel on freenode was helpful but couldn’t offer much more than an apology that the book was in a state of flux.

Today I definitely had more luck. I was able to clone the sofa app, which is a blog example, make a post, and see some JSON action.

Now I understand most of the concepts, but I don’t know how to get started. The book explains how to get the sample sofa application and run it, and even customise it, but I don’t know how you’re supposed to start from scratch.

Again, IRC helped out: there is a ‘couchapp generate’ command that sets you off with a default structure. After that, I copied the shows/edit.js and templates/edit.html from the sofa example because I thought I’d start out by providing an edit page for my test application.

I was then greeted with an obtuse error message, that included something like this:

[error] [<0.6600.0>] OS Process Error :: {compilation_error,
"expression does not eval to a function.

and then a bunch of javascript code expanded from edit.js

I was guessing this was a syntax error somewhere, so I started removing code until I figured out path.js was the culprit. I haven’t actually written javascript before outside of a web app, so I wanted to verify by syntax checking the javascript files. Apparently these days you can just install a javascript binary on your system, and sure enough, running that on path.js gave me:

(sandbox)[thomas@ana gtd]$ js vendor/couchapp/path.js
vendor/couchapp/path.js:8: SyntaxError: syntax error:
vendor/couchapp/path.js:8: if (!noJson) && (name == “key” || name == “startkey” || name == “endkey”) {
vendor/couchapp/path.js:8: ……………….^

While I am no javascript expert, I just randomly guessed I needed additional parenthesises around the if argument, and lo and behold, that fixed my problem.

I went around browsing through couchapp’s github pages to see if the code still has that issue, and found this fix (interspersed with unrelated fixes, boo).

A quick check later on IRC told me that there is in fact a newer release than the couchapp I was using (0.3.31 vs. 0.3.32) that somehow easy_install did not pick up on – with a little luck you won’t run into the same problem as me.

Anyway, why go through all this detail ? Because it reminds me of an opinion of mine about the five minute run experience of a project. I truly believe that most people evaluate a project within the first five minutes of trying it. People will invest a little bit of their time in your project, increasing the time they spend at each step if the previous step gave them a good feeling and/or a rewarding experience. It usually starts by reading the elevator pitch of your project somewhere. That’s a five second read. If that piques their interest, they might follow through on a blog post or go to your website. Another quick step.

If that looks promising, they may read your about page, your FAQ, skim through your introductory chapter if it’s short enough, or go look at your screenshots. Maybe a minute ? And if they’re still with you, they may try to download and install the software so they can actually run it.

If that is easy (and that means, it’s just one click or command – the .exe or an installation instruction for a distro package) you’ve gotten them to the point where they can actually run the software. If it’s harder (a bunch of commands, building from source, dependency hunting, …) you’re likely to loose them. Imagine it’s easy and takes a few minutes waiting to download.

Now the clock really starts. Your app has five minutes to convince the user that it actually seems like it’s working, has some level of quality, and might do something interesting the user cares about. If the user can do something useful within those five minutes, you’ve won him over. But if within those five minutes he manages to make the program throw up errors, do something wrong, or just plain crash, or if he can’t do anything useful in it, he’s likely to discard it completely and go on to the next app he wants to try.

This counts doubly when someone actually needs to do something specific and is just looking for different applications to do the task. If you find ten twitter clients on Freshmeat, how do you decide which one you’ll want to use ?

Of course, there are exceptions. So far CouchDB’s five minute run experience hasn’t been so good compared to everything before it. The elevator pitch is right up my alley, this thing does something I’m interested in exploring. The website ticks all the right boxes, the description is excellent, and that couchdb book looks good.

But then actually trying it quickly became a swamp. Fedora only had 0.9.1 – not CouchDB’s fault of course, but the book is written for 0.10 which wasn’t released yet. Worse, the book was out of sync with the versions it recommended I use to try it. I didn’t make time to look at CouchDB for a few weeks. That was a lucky shot – this time around that part was much better, and I invested an hour in playing with Sofa.

The second roadblock was this couchapp problem. A really minor code bug, but again took me a while to figure out what was going on, not helped by the confusing error message.

Why am I breaking my own five minute run rule here ? Because I want to see if CouchDB lives up to the promise – if it really can do all this replication stuff, it seems like a perfect match for a few of my projects. I’m believing the opinion of a few people I trust. But normally, I would have moved on to playing with one of the other key-value stores instead and give them an equal chance for my developer dollar.

In any case, I’m going to push ahead some more now that I found the bug. Hopefully I have a simple edit and view working sometime this weekend if I find some more time.

Sleepy time!

Where’s my $100K?

Linked from the blog of the always excellent Harald Welte is this LIMO paper on the economic value of merging back changes to an open source project.

Quoting from there:

Currently, GStreamer comprises some 911,000 SLOC. Using our $50/SLOC factor, this equates
to an equivalent engineering cost of $45.5 million to develop this technology from scratch.

HFSNW! Surely at least $100K of that is my work. Where is my money?

chromium updates? where are they?

You may have noticed that the chromium packages haven't updated in a while. There is a reason for this.

The dirty details are here:
http://code.google.com/p/chromium/issues/detail?id=23362

The high level overview:

Some pages are failing to render (notably, msnbc.com) with the Fedora chromium builds. When those pages get processed by WebKit (in chromium), they were triggering a glibc double free error. This looks like a legitimate bug in chromium (or at least, in chromium's webkit copy), but tracking it down has not been easy. My Fedora chromium packages use system libs whenever possible (including making v8 into a standalone shared library), which involves a fair amount of patching and packaging voodoo. However, in the interest of trying to track down that bug and get it fixed, I've set that work aside and focused on reproducing the bug in a build from a completely "virgin" source tree checkout.

Unfortunately, when I do that, I hit another bug, preventing chromium from even building (I'm not entirely sure why I didn't hit this before in the packaged builds, except that v8 is built separately for me, so I may be sidestepping it entirely).

Evan Martin and Craig Schlenter on the Chromium team have been very patient and helpful in trying to debug this issue. Hopefully, we'll be able to get chromium building on Fedora again (specifically, I'm focusing on rawhide x86_64, although, all current versions of Fedora seem to suffer from this equally) and reproduce and then squash this pesky double-free bug.

friday fun: proof that sometimes youtube comments are OK

FIRST.

You must watch the video.

SECOND.

Enjoy the comments.

As a reader of “The Chap” magazine and an owner of some lovely tweed jackets and a Ukulele, I approve of this to a degree beyond measure. Such a shame that my sausagey fingers seem unable to play chords.

Thanks, Ryan!

Streaming Media Europe award and panel

So, it’s now official: Flumotion has won the ‘Best Streaming Innovation’ award at last week’s Streaming Media Europe conference in London. Thank you for all who voted! I’m surprised to see so many people in total vote, that means that there are quite a few real users out there.

I wasn’t there myself to accept the award (our commercial team accepted what basically is a technology award, but we get along well enough :)), but I did go on Friday to replace Julien on a panel about the promise and disruoption about Open Source Video (scroll to the bottom).

This was actually my first panel, but I think we did well, especially considering it was the last panel of the day. There certainly were many more questions from the audience then in the transcoding panel I attended earlier that day. The panel was led by Dr. Tsur from Kaltura, an open source video platform.

After the conference I took the underground with Damien from New Bamboo who was also on the panel. They developed Panda, a cloud transcoding solution with the very catchy tagline of ‘video solved’. It uses ffmpeg at its core, which might get them in trouble now that they want people to run it as a cloud service, so I suggested he take a look at GStreamer instead. My first suggestion was that it should be doable to provide a drop-in binary replacement with the same interface, but having looked at the output of ffmpeg -h this weekend, I’m not sure anymore – that binary was already complicated to use way back when and it has only exploded further.

In any case, since it’s an open tool, maybe someone at work should take a look and see how easy it would be to teach it GStreamer. Or, maybe instead, we should open our own transcoder solution.

Anyway, back to London and the conference. Since the conference was over after the panel and people didn’t hing around, I called Lotte, a friend living there, to go have a drink before taking the Eurostar back. And thus it happened. I felt like a real global cosmopolite, having a drink in London after a conference for my Spanish job coming in from Belgium wearing a Spanish jacket, American shoes bought in London, a Florentine shirt, and New York pants.

October 22, 2009

real time action drawing, indeed

This is what happens when you post a collaborative drawing app to a twitter account that has 1500 active followers.

Time from posting to first drawing was about 6 seconds. I wish I had caught it from the beginning.

Ogg Theora or MP4

October 21, 2009

LinuxCon 2009 Trip Report

This is a first year event, partnered with a second year event, the Linux Plumbers Conference. It was in beautiful Portland, OR where the weather was just about perfect. I only wish I had followed through with my plans to bring my bicycle. I would have had plenty of riding opportunities.

We had a Fedora table in the exhibitors area, and once the event kit showed up we had it pretty well setup with media and demo laptops and a nice banner. This was a multi day conference style event, and so by lunch time on the second day anybody who wanted to stop by the booth had and the visitors trickled off. The last day of the event the exhibitors area was closed.

I went to a number of talks, some about new developments coming and some about high level thought stuff. There was a pretty mixed bag of really technical talks and very fluffy talks,I suppose that means there was something for everyone. All in all the event seemed very well put on, very coordinated and easy to find the talks. The provided refreshments were great too.

I did get to talk to a number of people I haven't seen before / in a while, particularly on the third day which was a joint day with the Plumbers Conference. We got to have a number of hallway and bar conversations about Fedora and the development process. I feel better about the direction we're headed with rawhide et al.

I definitely want to go back next year, although I think I would be better about submitting a talk or two, something to show off Fedora. Hope to see some of you there next year!

October 20, 2009

Rumor-mongering, tribal knowledge

In a comment to mdomsch's entry about the newly introduced support for PRNG of TPM in rngd, Arjan asks why keep this in userspace. Why, indeed? Please pardon me engaging into rumor-mongering, but I heard that the problem is the maintenance of the quality of the random stream. In other words, lots of sources of the enthropy may go bad (get stuck on a certain value usually, but not only that). Detecting it in kernel would be too difficult.

Now, is this credible? It is to me, but I did not look at the source.

I'm often on the receiving end of it too. For example, yesterday I wanted to create a wildcard A/AAAA record (it's used for S3 bucket selection in tabled). All examples, without fail, used the fully qualified syntax "*.sub.dom.com.", unlike all other entires in the SOA zone. And why? Nobody knows, they just do it.

October 19, 2009

19 Oct 2009

Eww, this country is uncivilised. Just got back to my hotel room and my clothing reeks of smoke. I'd almost forgotten how horrid that was.

Ubuntu doesn't get it

<rant>

So in the past Ubuntu packaged PA in a way that, let's say, was not exactly optimal. I thought they'd gotten around fixing things since then. Turns out they didn't. Seems in their upcoming release they again did some genius thing to make PA on Ubuntu perform worse than it could. The Ubuntu kernel contains all kind of closed-source and other crap to no limits, but backporting a tiny patch that is blessed and merged upstream and in Fedora for ages, that they won't do. Gah.

And it doesn't stop there. This patch is an outright insult. This is disappointing.

Madness. Not good, Ubuntu, really not good! And I'll get all the complaints for this f**up again. Thanks!

/me is disappointed. Ubuntu, you really can do better than this.

</rant>

October 18, 2009

Time to get back into a training routine

As a road rider and racer, my cycling season tends to wind down about this time. If I were to start racing cyclocross, I’d extend it out, but for now, I’m staying out of that. The past two years, I’ve marked the end of my season with racing at the Jamestown Classic down in Rhode Island. This year, a combination of the fact that I really kind of needed to work the day and also that my fitness wasn’t really where it should have been for a race led to me skipping it. Now I’m a little bummed that I did, but c’est la vie. I’ve spent most of the past six weeks generally riding just for fun and without any real training goals in mind, although I have been watching the power numbers on my shiny new powertap out of curiosity.

Looking back on the season, it was one that was both successful on some fronts and utterly not on others. I did a good job of keeping up a good base training routine through the winter but then ended up doing little in the way of racing over the course of the spring and summer. First it was waiting for the new bike, then it was being busy, then the weather sucked, then I got hit by a car, then travel, and then the season was over. Even though I didn’t race much, I felt like I was a lot better prepared for the races I did do and that my fitness was higher as a result of the base training through last winter.

So I think it’s now time to start easing myself back into a bit more of a routine in preparation for the winter of base training. I picked up a new trainer to replace the freebie I had been using that’s significantly quieter. Last winter, I was able to do trainer time in the evenings, but with my current schedule that seems unlikely so I’m going to start getting up a little earlier to get time in before the ride into work.

Set it up last night and had the first ride on it was this morning and it’s pretty nice — quieter than the old one and seems a bit smoother as well. I’ve got a pretty good set up to start with to be able to watch DVDs or online video. I’m then streaming the audio to my iPhone with AirPhones so that I don’t have to have a long headphone cable or worry about turning up the speakers really loud. Today was watching some TV via Hulu and then a Spinervals DVD. For the latter, though, I need some better music. What do other people listen to as a good upbeat playlist for time on the trainer or even general race warmup, etc?

Comments

The Times They Are A-Changin'

Kinda fun watching this video. As it seems the big new features of the Windows 7 audio stack are the ability to move streams while they are live, to do role-based policy routing, and to pause streams during phone calls. Hah! That's so yesterday! A certain sound server I happen to know very well has been supporting this for a longer time already, and you can even buy that logic in various consumer products.

Nice to know that in some areas of the audio stack it's not us who need to play catch-up with them, but they are the ones who need to play catch-up with us.

October 17, 2009

a planet site for webgl

I’ve put up a planet site for WebGL here:

http://planet-webgl.org

It has a short list of people who have been hacking on WebGL support in browsers and the small set of people who have been doing experiments and starting to build tutorials around the technology, even before it hits mainstream browsers. Right now it carries WebGL-specific feeds from Vlad Vukicevic, Benjamin DeLillo, Jim Pick, the wonderful Learning WebGL site, Mark Steele, Peter Nitsch and the hacks.mozilla.org site, where we often carry technical announcements about technology in Firefox.

If you know of someone else who should be on the site, let me know. My contact information is in the sidebar on the planet-webgl site.

I set it up and just put it out there in a few hours so it needs some theme love – a new icon and a decent GL-inspired theme would be great, honestly. If someone has the time and the will to do this work I would love them forever and ever.