Older blog entries for aristeu (starting at number 70)

I'm sick and tired of fixing cosmetic issues trying to add support to PS3 bluetooth remote to linux (three months redoing patches). I'll just leave the latest version of the required patches here. good luck trying to get past the fashion police.

http://ruivo.org/~aris/ps3_remote/

Yes, the patches do work. If you have problems _using_ the patches, feel free to contact me.

So, the problem is solved. First off, its SUBSYSTEM is input not usb. We're handling a evdev device creation, don't forget. The final version:

ACTION=="add", SUBSYSTEM=="input", KERNEL=="event*", GOTO="wacom_rules"
GOTO="wacom_rules_end"
LABEL="wacom_rules"

ATTRS{idVendor}=="056a", SYMLINK+="input/wacom"
ATTRS{idVendor}=="056a", ATTRS{idProduct}=="0000", SYMLINK+="input/wacom-tablets/penpartner input/wacom-tablets/penpartner-%b"
ATTRS{idVendor}=="056a", ATTRS{idProduct}=="0010", SYMLINK+="input/wacom-tablets/graphire input/wacom-tablets/graphire-%b"
(...)
ATTRS{idVendor}=="056a", ATTRS{idProduct}=="0047", SYMLINK+="input/wacom-tablets/intuos2-6x8a input/wacom-tablets/intuos2-6x8a-%b"

LABEL="wacom_rules_end"

ATTRS looks for the file on the parent directories as well, solving the problem here.
One note is that if you try to get ATTRS{idVendor}=="056a" on the first rule to avoid repeating on all rules, it won't work, no idea why udev behaves this way.

It's easy to get upset with udev. On rawhide, the wacom rules simply don't work. The problem is that now there's no decent way to get Vendor/Product ids when you receive an eventX creation event. This is needed so the wacom rules can create /dev/input/wacom-tablets/<model> link. The current ugly way to fix it is to use ATTR{../id/vendor}. There must be a better solution. Yes, the rule worked for some time (BUS=="usb", KERNEL=="event*", SYSFS{idVendor}==...)

Spent my last days feeling like crap. Between fury explosions passing by depression and moments of extreme tension. The feeling that everything was falling apart. Something was terribly wrong. First suspect was the fact I don't go to climbing gym for a week, wrist injury. The lack of exercise can make me more nervous, but this is not the case: going to the gym everyday spend some time on treadmill. Coffee. In larger quantities or a stronger one can lead me to this behavior. Not the case also, I haven't been drinking more than the usual nor trying new brands. It could be lack of sleep. Hm, don't think so. I've been sleeping more than the usual since this weekend. Imagine trying to debug your brain while wanting to smash everything around. Not fun.

So, the answer came yesterday at night. I decided last friday that I wasn't having enough sugar. I'm a kind of person who prefers anything with salt than a chocolate or candy. Anyway, while reviewing what I usually eat everyday, I decided that would be healthy to have some chocolate everyday, some pieces. But what caffeine does is simply accelerate the sugar burn and having more than the usual on my veins made the amount of coffee I usually drink everyday more effective. This added to some problems I had last days resulted in a damn hard week.

No more coffee.

for you.

.

.

.

hm, what about dropping the chocolate instead?

hehe

after some time, I finally decided to do something about energy saving. I bought one of these to keep my home server running on constant power outages we got here. I installed apcupsd daemon and the CGI to provide informations about the state of battery, etc. I noticed that my home server - amd64 dual core 3800+, 3 SATA disks -, with a 19'' TFT monitor, DSL modem and a WRT54GS use 15% of APC capacity when idle and when I was compressing a big file with bzip2 (thus using one core, plus two disks (RAID1)) the usage jumped to 20%! It's 60VA more. Amazing.

I just resubmitted a very simple patch by the fourth time, at least. seems I just can't focus the code I'm writting and can't concentrate. seems I need a *lot* of effort to do so in these days. I wonder what this could be. if it's because I'm tired, I'm tired for months already and it's scary even to imagine how much time resting I would need to fix this, if this is the real problem. seems it's not going to improve next weeks, having to organize all stuff to my relocation.

fn <-> ctrl
OK, I'm getting closer to finally swap this 'fn' key with ctrl on mac's keyboard. And I need to do it quickly, before I get used with it. Lemme explain the problem first.
This powerbook has its keyboard and other keys (power button, eject button, etc) behind a bus, called ADB. I heard about some Apple notebooks using USB for its keyboard. But it's not my case. The problem with this is this keyboard controller, even reporting Fn key as a regular key (some controllers don't even let you know that there's a Fn key, making it impossible to do) but do some Fn + key sequence translation in hardware. For example: you have to configure this controller to tell if the F1-F7 keys, while pressed alone will generate a F1-F7 key event or the special functions. This could be pretty anoying: to have F1 key you should press Fn too: ctrl + alt + fn + f1 to switch from console to X. Anyway, the question here is that the keyboard controller _won't_ tell you that Fn + F1 key were pressed, only a F1 key event will show up (or brightness down).
If this processing were done in kernel level (i.e. Fn keypress + F1 would generate a brightness down, processed in kernel) it would be a lot easier to just swap the Fn with Ctrl before this processing and that would have a chance to be included in Linus' tree. But it isn't that simple.
To have this done, we have to know how the controller is configured and translate all the keys back. e.g.: if keypad's '3' is pressed, we must check if fn key were pressed before and if it were, we must generate Ctrl + 'l'. If 'l' is pressed, we must check if Ctrl is pressed and translate it to keypad's '3' killing the other 2 events. Definitely something that should be done in user level. We'll be back to this shortly.
Why don't you buy a real mouse?
One of the top issues for an Anything-but-Mac user to begin to use a mac is the mouse. On desktops it can be easily replaced by other, real, mouse. But in notebooks, it isn't so easy. You can't ignore the touchpad. It's there, built-in, doesn't waste more space in your backpack or workspace. To solve this, some sysctl options were created to emulate the second and third mouse buttons using keyboard keys. On MacOS, instead, applications usually have a modifier + mouse button to emulate other keys. This is a lot nicer because you don't lose one of your keyboard keys. Doing this on kernel isn't easy: this PowerBook has the keyboard behind ADB but the touchpad is an USB device and communicating one with other would be a big kludge and probably won't be accepted for inclusion (I agree with them). So, Michael Hanselmann began to work on inputd, a generic userspace daemon to do this kind of remap. Just for fun, I decided to write a simple application only to solve this specific problem: emulate second and third buttons using a key modifier: apple_mouse was born. But I wasn't satisfied with this. I really hate this Fn key, so I could use it as key modifier to use with apple_mouse. Not long time later I discovered Fn key isn't being reported by adbhid. While doing this, I decided it was time to fix another problem: the default SYSRQ key on macs doesn't exists in my PowerBook (and probably in other models too). Two nights later, I got these three patches. They're still waiting for comments on linuxppc-dev list, but it's safe to use them already (I'm not having problems with them). The result is that KEY_FN event is generated anyway (so you can use with apple_mouse) and you may configure the SYSRQ key on /sys/classes/keyboard0.
so?
So, while doing this stuff, I figured that now it's possible to remap Fn/Ctrl in userspace, where this kind of stuff belongs. Now just wait for an inspired night to do so. BTW, while working on apple_mouse, I was able to fix lots of bugs on libuinput and it's now functional.
more input madness
I decided to try out something new and got a trackball. I don't use mouse so much while working, so couldn't be so bad to get used with. And it wasn't. Actually it's really fun. Kinda like when you first tried to use a regular mouse. I got a lot better with it: I'm able to get flawlessly up to level 5 in xbill and played warcraft III without problem. FPS games still requires a bit more training...
and the history ends...
well, the hell is over. I got out there a bit earlier than expected, but I had a good reason for that. it's nice to hear that all that work and pain at least resulted in a working product and some complements on our work. another end, another new and fresh beginning... probably with lots of pressure and massive learning, just like I seem to like it :)
pomus
it wasn't time for buying a new notebook, but I did it: got the last 12'' powerpc powered notebook from apple. just in time, I can't find another one in any of the local stores and information page also doesn't exists anymore. the hardware is great, comes with everything I would expect from a notebook, nice keyboard, blah blah. ah, and it comes with mac os X. don't hold your breath if you think this will become one of those "OMG ponnies! macos X rox, linux sux LOL !!!11" kind of posts. the system is fine, lots of eye candies and somewhat perfect for home users. to me it's being useful for launching games, as there's no binary driver from nvidia for powerpc linux. btw, you get extra zealot points when you get one of these machines to run linux. things you never noticed being binary and not available to other architectures really pisses you off. some of those binary "blobs" (yeah, finally the openbsd cds and t-shirts arrived. never took so long to help keeping a project which I don't care alive) may be replaced by open source projects. in a more general view, the hardware is very well supported under linux and everything else than modem (which I didn't tested and probably won't) and nvidia related, just works. on nvidia support, it lacks 3D support (as expected) and tv/video output. on tv support, I managed to port nvtv to powerpc linux (it uses ioperm(), not supported on powerpc linux and maybe in other archs too) but it fails to identify and control tv out chip. on video out, it's possible to get external video but you will be unable to use notebook's tft. I guess nvidia is a lost case, as they aren't releasing documentation even for ethernet cards (martian technology) and IDE controllers (alpha-centauri technology).
bricks
so I did it again, but now I did it well: I bricked my wrt54gs in a way that JTAG cable is the only hope left. probably I managed to erase entire flash, so, as soon I get the cable built, I'll know if it's still possible to "unbrick" it. thanks to this, I finally built its serial port circuit.
127.0.0.1 is not alive
what can I say about the hell I've been living on? let's try this: sell japanese food to dogs. they don't have a damn clue about what they're buying, they don't have a damn clue about how much effort it takes, they don't have a damn clue about how much time it takes and they bark at us as our team is a bunch of incompetent idiots. *sigh*

scooby everywhere
now working "only" 8~9 hours by day, there's some spare time (and will) to play a bit. I made a sample linux kernel module to make available a bunch of contiguous memory pages to user level through mmap() for a friend. he needs a way to get an amount of physically contiguous memory and its address in user level so it can setup a video grabber to do overlay in that address (video4linux 1). he also needs to have access to this memory region. the way it's done today is using video card's memory. if you find this interesting, it's available here. it surely contains a bug, triggered by the second execution. home work! :P

SCC: breaking your software since 2005
users are great. really. when you get used to linux, you simply don't mind of doing things manually even when it should work at first time. I met this week in IRC an user who has the same notebook I have and he noticed that you should do insert/remove/insert everytime you want a card detected by cardbus controller. it happens since 2000 and I _didn't_ noticed this! it surely isn't a hardware problem since it works in OpenBSD and Windows XP in the same notebook. while doing some simple debugging I noticed the event register is simply empty in the first insert and then when the card is first removed, it comes with right value and in second insertion too. the linux' yenta interrupt handler looks a lot like OpenBSD's, so seems this is a bit more complicated than I thought before. oh fun, fun, fun!

by any chance, do you use any SCM?
quilt rules. at work we have a svn repository but before each of us commit anything others should review first and in case of an "experimental" changeset, everyone should do some testing. because of this, quilt is being so great: we're exchanging patches among us quickly in a simple way. I plan to write some sort of tutorial on these quilt "use cases" soon. and maybe creating a "quilt compare file" to quickly open vimdiff (or equivalent) to make easier to review code you don't know so well.

why write a driver? isn't ioperm() enough?
thumbs is staled for some months. I'm almost buried alive in so many bug reports and feedback on -alpha1 (none). uinputd is being slowly developed. cabal repository didn't had any commit since that tuesday, the last day before I got my tickets to concentration camp.

I've been working in thumbs these days. I decided to finish thumbs 1.0 (it even has a planned t-shirt (front, back)) and uinputd and only keep them maintained but without bigger development cycles. these are my pet projects for some time and because they're unfinished, they keep getting me out of focus very often. and as I've been tired these days, working in something that I know more or less exactly how to do is easier. seems I really don't do team work very well, so it's time to understand once for all that I'll do my projects alone. finishing this, I'll focus in some kernel area and work on it. enough of "bouncing focus".

things are getting hard at work and I've been doing other stuff at night and I'm not carrying my notebook with me for some reasons: a) so I don't need to carry a bag and show its contents every time I leave the company; b) so I don't need to worry if some *censured* pass by me in bus and drop my bag in the ground with the notebook inside; c) so I force myself to stop for some minutes and rest. actually the last one is part of some actions I'm taking to work around a condition that will only be solved with vacations. as I have 0% of chance doing this until January because of the work, slowing down is the best thing I can do. perhaps buying a car would make easier to just disappear with my notebook in some weekends.

It's raining outside, the perfect excuse to stay at home and work in thumbs without feeling guilty (yeah, sociallife.ko works very well).

61 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!