Archive for the ‘work’ Category

Setting the repeat rate on an input device (Kernel 2.4 and 2.6)

Monday, December 8th, 2008

If you ever come into the situation of having to set the repeat delay/period on an input device (/dev/input/eventX), with the additional challenge of needing it to work on both 2.4 and 2.6 kernels, maybe this code snippet might help you (fd is the filedescriptor of the device, opened writable):

        #include <linux/input.h>
        struct input_event ie;
        ie.type = EV_REP;
        ie.code = REP_DELAY;
        ie.value = 1000; /* 1 second initial delay */
        if (write(fd, &ie, sizeof(ie)) == -1)
                perror("REP_DELAY");
        ie.code = REP_PERIOD;
        ie.value = 250; /* 4 events per second */
        if (write(fd, &ie, sizeof(ie)) == -1)
                perror("REP_PERIOD");

Looks pretty trivial, doesn’t it? But it took me quite some time to realize that I needed to write a “magic” event into the device to set the properties ;)

“smart” suspend in pm-utils

Tuesday, October 7th, 2008

I finally implementd the “smart” suspend in our pm-utils package. This means that hopefully more machines will just suspend to RAM “out of the box” without any tweaking of configuration etc. It also leverages the quirks list in HAL which is a bit bigger than the one in s2ram (but IMVHO also of lower quality…) in case the machine is unknown to s2ram.

Give it a try in the next beta, or, if you can’t wait any longer, fetch it from home:seife:Factory (the Build Service is pretty busy lately, so the packages are not built for Factory yet, just use the 11.0 version, it should work in 11.1 too).

UMTS/GPRS Image compression

Thursday, September 18th, 2008

While reading another of Frank’s blog posts, I remembered that I had the same problem some time ago and used bmctl.pl, a perl script that I had found somewhere on the web to disable image compression on 3G connections. Maybe it is useful for someone…

Updated storage-fixup package

Thursday, September 18th, 2008

After reading about Frank’s various problems on the Samsung Q45, I decided to help him out and updated the storage-fixup package in FACTORY, so now it includes the fix for his machine.

Frank, now you only need to start using FACTORY ;)

Bad HP, continued…

Friday, July 25th, 2008

So the motherboard got exchanged. That’s fine. The MAC address of the ethernet card changed as a consequence, that’s unavoidable and no real problem.

But why on earth do they have to change the DMI identification strings of the machines in mid-production?

Before, the machine reported itself like that (”s2ram -n” output):

This machine can be identified by:
sys_vendor = "Hewlett-Packard"
sys_product = "HP Compaq 2510p Notebook PC"
sys_version = "F.0A"
bios_version = "68MSP Ver. F.0A"

Now it reports

This machine can be identified by:
sys_vendor = "Hewlett-Packard"
sys_product = "HP Compaq 2510p (RU537EA)"
sys_version = "F.0A"
bios_version = "68MSP Ver. F.0A"

When I entered it into the s2ram database, I of course used the full “HP Compaq 2510p Notebook PC” string, not expecting it to change within the same model.

Bah!

But I should have known better: looking at whitelist.c shows, that HP has always had the bad habit of changing those strings all the time (just look at all those different nx5000 entries).

Bad HP, bad…

Thursday, July 24th, 2008

My cool new machine was already sent back for warranty repair. The external display, connected to the docking station, did not get a signal anymore, so the motherboard had to be replaced. Ok, bad luck, but nothing to worry about. I had another similar machine (nc2400, the predecessor of the 2510p) to use during repair, so it was not that bad. But what really pisses me off is the fact, that i needed to boot Vista, just to reactivate the built-in UMTS card. When I first had to do it after fitting the card into the machine, I was thinking that it might be Sierra Wireless who needs the card to be “activated” or that I just had overlooked some BIOS setting in my eagerness to use the new toy, so I did not bother too much.
But today - I had of course booted Linux and wondered where the ttyUSB* devices had gone - I searched all the BIOS settings and everything, but there was just no device appearing on the USB bus. So I finally had to boot Vista, start HP’s “Wireless Manager” and switch it on there.

That’s 10GB of valuable harddisk space wasted, just for an UMTS activator program. I hate that.

Shame on you, HP guys. I’m really pissed.

Cool KPowersave tip of the day

Saturday, July 19th, 2008

If you got a notebook where changing the backlight brightness via software is possible in linux (check the info dialog you get when left-clicking on the kpowersave icon in the systray), try this: move the mouse pointer over the kpowersave icon and roll the mouse wheel up and down.

Have fun :-)

Triple Dragon continued

Wednesday, July 9th, 2008

This week is entirely dedicated to getting the Triple Dragon started with some usable software - and it is going along quite well.
I feared that I would have to dig down into DirectFB to solve my original framebuffer problems (on the first try I was unable to set the transparency - the setting, which is done with a private ioctl(), was always ignored), since the original software uses DirectFB, but in the end this is fortunately not the case.
The solution was simple: I need to issue the transparency-ioctl() after setting the framebuffer parameters, not before.
Right now, enigma is pretty usable, the “normal” TV viewing stuff is already working. I’m now refining the build system, so that I can tell people what they need to do to build the software, then I’ll look at the init scripts etc, so that they can even boot it.
Next thing will be fixing the not yet working stuff - some hardware-dependent like the SCART switching stuff, some software like the media-player and record / timeshift features, but then I’ll hopefully have some more people working on the project ;-)

Suspend to disk with low memory machines

Thursday, June 5th, 2008

Now this is an interesting bug report :-)

Executive summary: if your machine has less than 128MB of RAM, then please turn off the splash screen in /etc/suspend.conf

HP BIOS update madness

Friday, May 23rd, 2008

Say you wanted to update the BIOS on a colleague’s HP nc6230. You go to the HP website to find a “ROMPaq for HP Notebook System BIOS (68DTA) – FreeDOS Bootable Diskette”, which sounds exactly like what you’d want to download.
Well, follow that link and you’ll get a file called sp35281.exe. Does not look like a floppy image at all.
So let’s find out what it is:

~> file sp35281.exe
sp35281.exe: MS-DOS executable PE  for MS Windows (GUI) Intel 80386 32-bit

Damn. A Windows executable, just to create a floppy image…
But there is always wine, so we’ll start it with that…

…long story short: it is some kind of self-extracting archive, which extracts an executable (of course for Windows, not DOS…), which then will write the image to the floppy disk.

There would probably be the possibility to configure wine to use a floppy image as drive A:, but fortunately this was not necessary. Examining the rom.exe, not even too closely gives:

~> du -b .wine/drive_c/SWSetup/sp35281/rom.exe
1502208 .wine/drive_c/SWSetup/sp35281/rom.exe

Which is exactly the size of a floppy disk image (1474560 Bytes) plus 27kB.
Just guessing, i extracted the last 1440kB from the executable:

tux@d173:~> dd if=.wine/drive_c/SWSetup/sp35281/rom.exe of=floppy.img bs=1k skip=27
tux@d173:~> file floppy.img
floppy.img: DOS floppy 1440k, x86 hard disk boot sector

Voilá - a bootable floppy image. Now i only hope for HP to start recognizing that they are doing no favour to their customers by obfuscating their BIOS updates like that…