Making Firefox play nicely with Laptop Mode

December 18th, 2009

Linux has a tweakable knob called laptop_mode which is meant as an energy saving tool for laptop users on battery: it basically says “try not to touch the disk for X minutes at a time, unless you really need to, and once you do, do everything that you’ve been piling up all at once”. It’s great for laptop users, and doubly so for things like my huge laptop with two 7200RPM HDDs. Seriously.

Now, there are two things that mean you “really need to” hit the disc: reading data that isn’t already cached (duh), and the fsync() and fdatasync() calls. The latter are requests by an application to ensure that all of the data written to far has hit the disc, and they cause the disk to spin up in laptop mode.

Unfortunately, Firefox has a habit of randomly issuing fdatasync() calls. It does this as part of the SQLite backend for its various databases (especially places.sqlite), in order to avoid data corruption. Now, data corruption isn’t terribly likely on a laptop with a battery (which is essentially a built-in UPS), so this is a terrible annoyance with little benefit anyway. There has been talk about this problem, but apparently it’s still around (and the toolkit.storage.synchronous about:config property didn’t work for me). Most of the reports appear to claim that this happens while browsing, but I’ve seen it happen periodically even when Firefox is left idle. Maybe it’s caused by some extension or AJAX webapp? Who knows.

Read the rest of this entry »

iPhone syncing on Linux, part 2

October 31st, 2009

Last post was more along the lines of an announcement, so here’s a more concrete guide. There have been new releases of most parts of the software stack in the past few days, so now is the time to grab them if you’re interested. Libgpod is the exception, since it’s still being worked on to get proper support for the iPhone OS 3.x database. That said, if you’re interested in being an early adopter of iPhone sync support and helping us test it, here’s how.
Read the rest of this entry »

iPhone syncing on Linux

October 27th, 2009

Those who watch my git repos may have noticed that I’ve been working on this for a while now. iPhones and iPod Touches have never been properly supported under Linux (especially non-jailbroken devices) because they are just so different from all the previous iPod models. There was a lot of new code to write and Apple hasn’t exactly made it easy either:

  • The iPhone uses a custom USB communications protocol, connection-oriented, which is totally different from standard mass storage devices
  • It provides multiple services over this protocol, and many have to be interacted with to complete sync
  • iPhone OS 2.x brought us a new hash (designed to lock users into iTunes) that so far had not been reverse engineered
  • iPhone OS 3.x brought us a new SQLite-based database format which, although a lot more Linux-friendly than the old proprietary format, does require a bunch of new code (and the old format still needs to be supported for compatibility).

Well, I’m happy to say that all of this is coming to an end and that Linux will finally get quite complete iPhone/iPod Touch syncing support soon, thanks to the work of many dedicated people. Read the rest of this entry »

Enabling Intel VT on the Aspire 8930G (and other InsydeH2O-based laptops)

June 28th, 2009

It seems the ongoing trend for laptops is to integrate and hide as much as possible from the user. We’re all used to minimalistic crappy BIOS setups with two or three configuration options. However, things go way too far when OEMs remove options related to features that the hardware is capable of but which are disabled by default. This happens with Intel VT on many laptops – even if the CPU supports it, you may not be able to find the BIOS setup option to turn it on.

I certainly wanted to use a feature that I paid for, so I started investigating the BIOS and here’s what I found out.
Read the rest of this entry »

iPhone OS 3.0 music: totally incompatible

June 21st, 2009

With the new OS version, Apple totally changed up the database format. Now it’s based on a whole bunch of SQLite files and there are also a few files in a format similar to the old proprietary one. There are more than likely still hashes in the critical files, and there’s also a suspicious pair of files that appear to be entirely encrypted. The SQLite format is open and certainly better than the old one, but someone still needs to interface a media player to it.

The upshot of this is that a whole new support library will need to be written or large changes in libgpod need to happen to support the new SQLite format. The DBVersion hack also isn’t going to work – either someone needs to reverse engineer the complete hashing algorithm (and maybe that encrypted file stuff), or the MusicLibrary binary on the phone needs to be patched. So, if you’re currently syncing music with free software, you’ll want to hold off on upgrading to 3.0.

Patching the check out of MusicLibrary looks trivial enough, so although it’s not as easy as the DBVersion hack, it isn’t a real showstopper. The hash algorithm looks the same as the old one, or at least quite similar (and just as badly obfuscated). Those encrypted files do scare me a bit though.

More SPMP goodness: now with pseudo-3D

June 13th, 2009

After a few days of reading very, very weird disassembled code and poking registers, the odd 2D hardware finally works (for the most part). It can draw lines, so I threw in a software 3D transform. Here’s the Stanford Bunny in a glorious 448 vertices and 1416 lines of jaggy wireframe awesomeness.

Read the rest of this entry »

Sunplus SPMP305x media player hacking

June 9th, 2009

I’ve joined a bunch of friends in a quest to reverse engineer and write custom software for Sunplus SPMP305x chips. These chips are inside all sorts of chinese media players, particularly the fairly powerful kind with a camera, video playback, etc. The chip is based around an ARM926EJ-S core, but the peripherals around it are completely custom – check out the marketing blurb. Most current work is on reverse engineering the hardware interface so we can completely replace the default firmware.

If you’re interested and you have one of these or don’t mind spending $33 to get an interesting ARM machine, check out the wiki, Google Code project for the Prex port and other stuff, and my Git repository with a port of MINI and a bunch of client utilities for reverse engineering and testing the hardware stuff. Most importantly, however, come visit us at #spmpdev on the EFNet network! Most of the work and chitchat happens in the IRC channel.

sunplus test image

Acer Aspire 8930G Linux audio support

June 3rd, 2009

I’ll eventually write a longer post about how different bits and pieces of this laptop’s hardware fare under Linux. For now, I’ve managed to strike one of the more annoying issues: proper audio. Scroll down if you’re impatient and want the code; read on if you want the full story.

This laptop is peculiar because it has built-in “5.1″ audio. Yes, it does really have 6 speakers, though you’d be hard pressed to get much spatial separation out of them (and they aren’t even placed around symmetrically). However, the speakers do end up making a very decent multiway audio system, by laptop standards: the “rear” pair (which is actually between the keyboard and the screen; the mind boggles) is good with the high end, the “front” and center speakers (front edge of the laptop) are your average mediocre speakers that can handle mid-end, and the “Tuba” not-so-”sub” woofer fills in enough low-end to equal a decent overall speaker, although of course with zero stereo/spatial separation since there’s only one of it (actual subwoofers can pull off mono because the human ear can’t really hear spatial position at low frequencies, but the Tuba is more like the only non-sucky speaker in the entire laptop).

What this boils down to is that you really want good audio support for all 6 speakers if you want to take advantage of the audio capabilities at all. Most importantly, stereo needs to be upmixed and a good portion of the normal audio needs to be routed to the Tuba. ALSA’s asound.conf makes this easy, assuming the actual hardware works fine. Of course, that’s not the case.
Read the rest of this entry »

Quickpasting

April 27th, 2009

If you’ve ever worked with other people on some piece of code or program, particularly over IRC or IM or some other form of real-time or fast text communication, chances are you’ve used one of the many “paste” sites available (my personal favorite is pastie). These sites offer a convenient way of sending small to medium chunks of text to other people quickly, by simply copyng and pasting the text into a web form. This is a lot better than the old way of having to send an e-mail attachment, spam an IRC channel, or upload the text to some web host, but as I used pastie more and more often I started to realize that it could be made even faster.
Read the rest of this entry »

HDCP Authentication Failure

February 26th, 2009

pixel snow

And I wasn’t even watching protected content.

This is (one of the many reasons) why DRM needs to die.