Archive for the 'p.d.o' Category

ただいま!

I'm back from Japan. Time went too fast... Met a lot of people we hadn't seen for a while, had a great time. Only problem is that I'm totally jetlagged. Woke up at 3am this morning, and decided to actually do something after trying to sleep some more for an hour.

The downside of holidays is the 4000+ mails (excluding spam) that got in my mailbox. I've already gone through most of the new bug reports and have been able to vote for the last GR that was issued while I was away.

One of the most annoying problem that was raised during my vacation is this Firefox trademark issue. We've been avoiding to change the package name for a while. We got agreements to use the Firefox name when we had to drop the "Mozilla" part of "Mozilla Firefox", and now it seems they (again) changed their mind.

I really think we should go with the iceweasel name because this name is already widespread as the "debian may rename firefox this way" name. It is even in wikipedia.

On other news, we bought a MacBook and a Nikon Coolpix S6 for Miki, and a (already broken) PSP as well as some books for me. I'll write more on these in coming posts.

2006-09-21 05:16:40+0900

firefox, me | Comments Off on ただいま!

日本に行ってきます

I'm leaving for Japan in a few hours.

I have been careful not to leave too much mess in my packages for this vacation period, so all should be running just fine until I come back.

Closing all comments and trackbacks to avoid spam.

2006-09-03 13:57:22+0900

me, p.d.o | Comments Off on 日本に行ってきます

Firefox 2.0b2 in experimental

Yesterday, I uploaded Firefox 2.0b2 in experimental. Please give it a try and checkout if some of the bugs in firefox are fixed by this new release. Same kind of help welcome with the version in unstable. When the bug count is more than 200, it gets painful to do bug triage, so any help on that matter will be very much appreciated by Eric and I.

In other news, work has started on seamonkey. Unfortunately, I'll be away for a little while, so I'll have to leave quite an amount of the work to Alexander Sack, but I'm pretty sure he'll be able to handle it. Anyways, we hope to be able to work out a full featured package for etch so that people using mozilla on sarge will get a correct upgrade path.

I also uploaded yesterday a new xulrunner release that (finally) provides some of the NSS tools, so that administrators can handle keys/certificates databases for mozilla products. It is still in NEW, but should reach unstable soonish (let's just hope the ftp-masters won't reject the new package).

2006-09-02 12:27:07+0900

firefox | Comments Off on Firefox 2.0b2 in experimental

Meme time

The metros from the world I've used:
Berlin SBerlin U

Actually there are some cities listed on the original site I've been to, but didn't take the subway, like Toulouse, Rennes, Amsterdam, Barcelona, Stockholm, Fukuoka, Sendai...

2006-08-31 21:22:49+0900

me, p.d.o | Comments Off on Meme time

Two things I don’t like about “multimedia linux”

Kernel being dumb by being smart

Memory cache is a good thing to speed up a computer, but it's a PITA when it comes to stopping playing a DVD or a big video file.

The kernel usually keeps in memory cache data that has been read from the hard drive so that it can get it faster next time the same data is accessed. I don't know exactly on what grounds fragments are decided to be kept or not, but observation shows that playing a DVD or a Xvid file makes the cache grow more than significantly. Moreover, while playing the video, the other software from the desktop (nautilus, for example), is not used, thus, the kernel decides it can swap it to disk virtual memory.

Then, when you stop reading your video and want to come back to normal activity, your desktop is damn slow for some long seconds. That makes the experience a real pain.

Overuse of network bandwidth

I noticed that when I switched from a samba network share to an apache based DAV one: reading a video file from the DAV share with totem-gstreamer filled my apache logs very quickly. It seems gstreamer/gnomevfs seeks a lot in the file to play the video. Instead of making one HTTP request, it does several thousands, each time requesting again data it already received.

As a result of that, it usually takes up to 1 mega byte per second to play a video that has a bitrate of 1 mega bit per second, with a nice effect of network congestion when the bit rate grows for detailed sequences.

Do you find it normal that it takes 5 minutes to download a 45 minutes file at 2~3 MB/s, and 1MB/s for 45 minutes to play it directly from the network ?

Well, now, gstreamer 0.10 doesn't even support reading from HTTP/DAV, but the problem remains the same when reading via sftp with gnomevfs.

2006-08-19 08:40:26+0900

miscellaneous, p.d.o | 3 Comments »

Firefox 2.0b1 in experimental

After quite some work on packaging it, Firefox 2.0b1 is finally being uploaded to experimental.

It is linked to the system libmyspell instead of the bundled one, and can use system dictionaries like Thunderbird already does. I'm also working on using the system libsqlite3, but it first requires some build changes in the debian sqlite3 package and some more work to see if it's really feasible... you see, they like to take external libraries and modify them so much as adding symbols, changing some internals... and these changes only exist in the mozilla codebase... (the 2 main examples of that being expat and sqlite3)

It also includes a working DOM Inspector which upstream didn't include in their release because they are in the process of moving the component in the core.

I also had to fix some more the build system so that some things would be installed by make install (they tend to forget it), others would just be installed (mistakenly removed rules...) or make clean would do its work: cleaning (they tend to forget to flag files for removal when they create it in a Makefile). All that makes me wonder what their review/super-review thing is worth.

Anyways, please give it a try, especially if you reported a bug on earlier versions, it would be helpful if you closed bugs that are fixed by this release (don't forget the 'Version:' in the closing message so that the BTS version tracking would do its work).

Update: Upstream Firefox 2.0b1 has a working DOM Inspector. It only appears it just doesn't build correctly the way we build Firefox... might be some missing changes to the Makefiles. Again. *sigh*

Update 2: It was trickier: missing something to make the inspector symbols public instead of having a hidden visibility...

Update 3: It was actually my fault. /me goes hiding under a rock. And I managed to remove a comment to this post when removing spam... *sigh*. I think I need to take a break.

2006-07-21 08:38:52+0900

firefox | Comments Off on Firefox 2.0b1 in experimental

Want your name in Firefox 2 ?

Then, help spread Firefox and get creditted in Firefox 2. Now, what I think is really amazing is how much effort they spend to credit those helping to spread Firefox, but not those helping to fix it.
Don't get me wrong, I don't care about being creditted myself for the several patches I sent and more, but I'm pretty sure a lot of people who sent patches like me are not creditted either.
It's already a PITA to get patches applied (some patches are still waiting to be reviewed or applied)...

Update: At least, they credit in the CVS logs.

2006-07-17 07:42:06+0900

firefox | 3 Comments »

Undeleting opened files on ext3

I'm a specialist when it comes to delete files I didn't intend to. 3 years ago, I did an rm -rf that cost me most of my ${HOME}, and I wrote some software (which i really should work on, BTW) which helped recover most of it (it's tricky to get files back from ext3 once they are removed from the filesystem, since ext3 clears the block pointers from the inodes then).

Today, I somehow managed to remove log files. Fortunately the log files were still in use by a process, so they were still in the filesystem. Unfortunately they were still in use by a process, filling and filling and filling... and in no way i wanted to lose all this data.

Let's consider, for the needs of the demonstration, the following case:
mh@namakemono:/mnt/test$ while true; do date; sleep 1; done > log

That fills a 'log' file every second with the current date.
mh@namakemono:/mnt/test$ tail -2 log
2006年 7月 4日 火曜日 20:48:02 CEST
2006年 7月 4日 火曜日 20:48:03 CEST

The file keeps growing and growing. Now, let's remove it.
mh@namakemono:/mnt/test$ rm log

The file is not in the directory any more, but remains in the filesystem. It is actually readable through /proc:
mh@namakemono:/mnt/test$ ls -l /proc/10724/fd
合計 5
lrwx------ 1 mh users 64 2006-07-04 20:52 0 -> /dev/pts/1
l-wx------ 1 mh users 64 2006-07-04 20:52 1 -> /mnt/test/log (deleted)
lrwx------ 1 mh users 64 2006-07-04 20:52 10 -> /dev/pts/1
lrwx------ 1 mh users 64 2006-07-04 20:45 2 -> /dev/pts/1
lrwx------ 1 mh users 64 2006-07-04 20:52 255 -> /dev/pts/1
mh@namakemono:/mnt/test$ tail -2 /proc/10724/fd/1
2006年 7月 4日 火曜日 20:52:45 CEST
2006年 7月 4日 火曜日 20:52:46 CEST

As you can see, it kept filling while deleted. The usual technique to recover such a file is to copy it from /proc. I happen to have done so some times before, it works pretty well for static files. But that doesn't in our case: we'll get a new copy of the file, frozen at some point in time. Here, we'd want to 're-link' the file.

Basically, that can be done with debugfs. The problem is that I didn't find a clean way to get the inode number from the /proc/10724/fd/1 file. But that can be worked around. You need root access (what a surprise), and hope your filesystem was mostly clean before removing the file.

namakemono:/mnt/test# e2fsck -n /dev/namakemono/tmp
e2fsck 1.39 (29-May-2006)
Warning! /dev/namakemono/tmp is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.
/dev/namakemono/tmp contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Deleted inode 113570 has zero dtime. Fix? no
(...)

Don't worry, the -n option will make the filesystem opened read-only, so there's no risk for your data.
The interesting part of the output is obvious: the number of the deleted inode. You now only need to link the inode:
namakemono:/mnt/test# debugfs -w /dev/namakemono/tmp
debugfs 1.39 (29-May-2006)
debugfs: cd test
debugfs: ln <113570> log
debugfs: q

And see how it worked:
namakemono:/mnt/test# tail -2 log
2006年 7月 4日 火曜日 20:58:40 CEST
2006年 7月 4日 火曜日 20:58:41 CEST

You can tail again, it will show you the file is being appended to.

I guess you can do something along these lines to restore a file from ext2. I don't know for other filesystems.

If someone knows how to get the inode number without e2fsck, comments are opened :)

Update: Well, it didn't take long for me to actually find a better way:
namakemono:/mnt/test$ lsof -p 10724 -a -d 1
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
bash 10724 mh 1w REG 254,3 13552 113570 /mnt/test/toto (deleted)

Basically, when the file can be found in /proc/$pid/fd/$fd, run lsof -p $pid -a -d $fd.

2006-07-04 21:17:08+0900

ext3rminator, miscellaneous | 4 Comments »

Long live the battery

After playing around with gnome-power-manager so that it can support spicctrl (which is to be done in hal, actually) to be able to adjust LCD brightness according to whether the AC adapter is plugged or not, I wanted to go a bit further in my quest for battery life. To be honest, I was already adjusting the LCD brightness with a custom acpid event script, but it's still nicer to have it out of the box.

Anyway, the main issue I remembered for battery life, apart from LCD backlight and Wi-Fi, is CPU power states.

When on battery, the CPU in my laptop can handle 4 such states. From C1 to C4 (According to the acpi docs there's actually a C0 state, so that'd make 5). But when on battery, the CPU never goes past level C2. I did some basic check a long time ago, by removing modules, and after removing Firewire, PCMCIA, and USB support, the CPU would go in C3 and C4 states. Though this definitely saves battery because it turns off parts of the computer, I wanted to know exactly what was sucking the CPU, and to keep at least USB, that I use more than the rest.

After selectively removing the modules, it turns out the uhci_hcd support (USB1) is somehow responsible. Which is sad, because my USB mouse is USB1. But it also turns out there's always a peripheral connected to the USB1 hub on my laptop. Indeed, the internal bluetooth support, which is activated at the same time as Wi-Fi, is connected internally through USB1. If I turn off Wi-Fi, it disconects the BT USB device. It appears that in this configuration, having uhci_hcd loaded doesn't have an influence on the CPU. It still reaches C3 and C4 levels. Problem is I don't want to turn off Wi-Fi.

So, with the help of my friend google, I found out that it's possible to unbind drivers from devices, and successfully unbound the USB port the BT device is connected to, without deactivating all the other (external) ports. The sad thing is that when doing such, it also automagically disables the Wi-Fi device (an ipw2200) IRQ, but modprobing ipw2200 again enables it without enabling the BT device.

Next step was to find a way to have this set-up applied automatically at boot-time. I tried to add the following to my udev rules:
ACTION=="add", SUBSYSTEM=="pci", ID=="0000:00:1d.2", ENV{UDEV_START}==1, OPTIONS="ignore_device"
which i'd have expected to do what i want, but it doesn't. I also tried:
ACTION=="add", DRIVER=="uhci_hcd", RUN+="/bin/echo -n 0000:00:1d.2 > /sys/bus/pci/drivers/uhci_hcd/unbind"
which doesn't work either. But:
ACTION=="add", DRIVER=="uhci_hcd", RUN+="/some/script/containing/the/previous/echo"
does. Well, it does work when you restart udev, but not when you reboot. Unfortunately, the initramfs (built with the initramfs-tools) loads a lot of modules, including USB. Meaning that udev doesn't load these and doesn't apply the rules then. Unless I write my own list of modules to load at boot time, initramfs-tools won't produce a useful initramfs for my case. Yaird, on the other hand, did what I wanted it to do, except that it still lacks support for resuming from suspend-to-disk.

In the end, I put a script in /etc/rcS.d. This script unbinds the uhci_hcd driver from the BT device port and re-modprobes ipw2200.

I got a bad surprise, though. After a fresh startup, the CPU would be stuck on C2 state again. Remember how the OpenGL performance would drop if I switch to console and back to X ? It also turns out that it also makes the CPU able to reach C3 and C4 states. There seems to be something odd with the radeon driver...

2006-07-02 09:53:01+0900

miscellaneous, p.d.o | Comments Off on Long live the battery

WordPress and daylight saving

WordPress has a wonderful feature: instead of providing a timezone where you live, you tell it how much hours your local time differs from GMT. Which just fails when dealing with daylight saving.

And I just noticed that my setting was still 1 hour, instead of 2. I remembered to change time on my wallclocks, mobile phone, but I forgot my blog... But changing that will change it only for future posts and comments.

So, for people who forgot like me, here are two SQL queries to fix the database:

update wp_posts set post_date = convert_tz(post_date_gmt, 'GMT', 'Europe/Paris'), post_modified = convert_tz(post_modified_gmt, 'GMT', 'Europe/Paris');
update wp_comments set comment_date = convert_tz(comment_date_gmt, 'GMT', 'Europe/Paris');

Don't forget to replace Europe/Paris with whatever your timezone is ;) . Note that this will require you to run, if you've never done it before, something like
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -p -u root mysql

2006-06-25 22:39:02+0900

p.d.o, website | 2 Comments »