09.22.08

Status of Logitech G25 support under GNU/Linux

Last time I tried the Logitech G25 steering wheel under GNU/Linux, only two of the 7 gears could be used, there was no clutch pedal, gas and brake were in combined axis mode, a couple of buttons didn’t even work, the steering range was severely limited… long story short, there was no way to fix all those problems, so the wheel was definitely not usable for simracing purposes.

Fortunately, a few days ago I stumbled upon a thread discussing the usability of the wheel under GNU/Linux, and someone had kindly posted some links to the VDrift forums (great sim btw), where most of the previous discussions regarding the G25 had been held. It seems that some guy had released a tool that allows to use all the features of this awesome steering wheel.

Skimming through its code (yeah, it was realeased in source code form, under public domain and LGPL!), it seems to send some binary data that initializes the so called extended mode, which is not enabled by default. It looks like someone has spent some serious time sniffing through USB traffic…

Anyway, the thing is that the tool does work, and so the G25 is now much more usable under GNU/Linux! Except for one thing: trying to set the 900º rotation mode, a process during which some usb or hid driver seems to freak out and remove the steering wheel device nodes 🙁

Force feedback is supposed to have been working for some time now, but due to the aforementioned initial problems, I never really bothered to test it much (I did patch the kernel to see if the existing FFB drivers would work for the G25, and the basic effects worked, but there was no point on finding a driving game that used them).

Just in case it disappears from tha interwebs, i’m hosting the tool myself. The usage is pretty simple:

  1. Download the GNU/Linux Logitech G25 extended mode enabler tool (46KB) archive.
  2. Extract its contents anywhere, and cd to it.
  3. Compile: ./build.sh
  4. Run the tool: ./usbtools g25-set-extended-mode

And that’s it. Make sure you run jscalibrator the first time in order to calibrate and remove any nasty deadzones on all axis. For more info, simply run ./usbtools without parameters.

Now i just gotta wait for Wine to properly support forcefeedback so that i can enjoy Live For Speed the way it’s meant to 😀

Happy racing!

09.19.08

Overclockeando por necesidad…

Lleva Blade Runner en version HD tirado por mi disco duro desde hace meses, porque hasta ahora el Core2Duo 4300 a 1800 MHz no podía moverlo sin framedropping a saco ni desincronizacion de audio. Estoy en GNU/Linux y no consigo ayuda de la gráfica de ninguna forma, y para colmo mplayer no hace muchas migas con la pareja de cores, así que emplea solo el primero que pilla, aunque yo le mande lo contrario.

Por suerte, compré esa CPU porque se la suele poder subir de vueltas facilmente. Así que manos a la obra, hace unas semanas me compre un disipa Zerotherm Nirvana NV120 (izquierda), un bicharraco de espanto que casi no cabe en la torre, a cambio de ser bastante más silencioso que el stock (centro) al mínimo de velocidad. El otro ventilador es un 12 cm normal y corriente, puesto como referencia visual.

Pues bien, ayer me puse a finetunear un poco el FSB, y he conseguido acelerar la CPU un 17% (de 1800 a algo más de 2100MHz) con el ventilador aún al mínimo de vueltas!

Update: viendo que la RAM era la que petaba primero, la he dejado a la velocidad de stock, consiguiendo a cambio tirar el procesador a 2250MHz. Es decir, todo un 25% de incremento con el ventilador al mínimo y carga al 100% durante media hora. Woah!

Así que ahora, por fin, ya puedo disfrutar de Blade Runner como dios manda.

Ouuuuh yeah!!! 😀

06.20.06

¿Valen la pena los discos duros baratos?

El otro dia me topé con una página que hablaba sobre el verdadero coste de los cds y dvds. Dicen unas cuantas verdades, y unas cuantas mentiras blancas (o se decía verdades blancas? weno, dejémoslo en “omisión de datos” :P).

El argumento principal que usan para justificar que sus discos duros son mas baratos, es la mano de obra. Dicen que si un dvd tarda 20 minutos en grabarse, son 20 minutos de tu tiempo que has perdido. Que el tiempo es oro y todo eso.

Estos no han oido hablar de procesamiento en paralelo 😉

En fin, nitpicking aparte, estoy de acuerdo en que se tarda mucho en grabar discos, buscarlos por toda la habitación cuando quieres usarlos, re-grabar a discos nuevos cada N años para por si se deteriora el cd (si, Princo, te estoy mirando a ti ¬_¬), etc…

Y como ando corto de disco duro voy a comprarme uno nuevo en breves. Y, como buen friki que soy, me he preguntao cual salía mas barato por giga. Asi que, ni corto ni perezoso, he cogido /bin/bash y he empezao a codear un parseador del listado web de mod-pc.

Una vez acabado y satisfecho, ejecutando el script me aparece en pantalla cuales son los mas baratos.
Como siempre, me he empezado a ir por las ramas y he hecho el homólogo para pc-box y canal-pc.
Y luego lo he juntado todo.

Dejo aquí el script, con un poco de documentación:

Precondiciones:
-Instalar elinks, awk, sed, grep y similares.
-Navegar con tu navegador hasta la pagina de discos duros de tu tienda pcbox favorita, y guardarla como pcbox.htm.
-Ir a la pagina de canal-pc de discos duros internos y copiar-pegar las filas de discos duros a canalpc.txt

Código
elinks "http://mod-pc.com/modules.php?name=Tienda&op=vcat&cat=D" -dump |grep "HD [S,P]ATA" |cut -c 50- |sed "s/\[[1234567890]*\]//g;s/EUR.*//g;s/^\ *//g;s/PATA/UDMA/g;s/[Gg][Bb]//g" |awk '{ print $7/$5, $7, $5, $3, $1 }'|grep "\."elinks pcbox.htm -dump |grep DISCO |grep -v EXT |grep "\,"|sed "s/DISCO\ //g" |awk -F"|" '{print $2, $3, $4}'|sed "s/\(SATA[2]*\)\ .*\ \ /\1\ /g;s/GB.*SATA/SATA/g;s/GB.*UDMA/UDMA/g;s/UDMA.*\ \ /UDMA\ /g;s/,/\./g" |grep -v "GB" |awk '{print $4/$2, $4, $2, $3, $1}'cat canalpc.txt |sed "s/Serial\ ATA[^\ ]*/SATA/g;s/SATA\ II/SATA2/g;s/ATA[^\ ][^\ ]*/UDMA/g;s/\ Gb/Gb/g;s/^\ *//g;s/\ [^\ ]*[rn]\ Stock//g;s/\.\*//g;s/,/\./g;s/Disco\ .*\(\ [0-9][0-9]*Gb\ .*A\ \).*\ \ *\ \([0-9]*\.\)/\1\2/g;s/Gb//g" |awk '{print $4/$2, $4, $2, $3, $1}'
(fin de código)

Como resultado, un listado con:
precio por giga, precio total, gigas, tipo de conexion, identificador del cacharro usado en la tienda

El script de canal-pc está un poco mal (los ids varían un poco) pero weno. Para que quede más bonito en pantalla sugiero pipear el resultado con esto:

./precios.sh |sort -n -r|cut -c 2- |tr ' ' '\t'

Bueno, hasta aqui todo bien. Ahora toca el verdadero quebradero de cabeza:
¿Cuantos gigas vas a rellenar al año?
¿Cuanto va a bajar el precio de los discos duros?
Y como consecuencia lógica: ¿Cuál es el tamaño óptimo de un disco duro nuevo para no perder dinero por tener unos cuantos gigas sin usar durante un año o más?

Si sabes responder a esas preguntas, invito a que lo compartas con el resto, porque yo personalmente ya he saciado mis ganas de programar (y pensar) por esta semana…

Por cierto, los más baratos son los de Maxtor de 320 y 250 gigas en Canal-PC, a solo 27 eurocents el giga 😉

05.15.06

Bash, ese gran desconocido

Hoy, mientras descanso de hacer como que estudio, he estado mirando un poco el tema de refactorización C++. Mi editor preferido ahora mismo es VIM, así que he buscado plugins para ello. No parece haber nada interesante. Una pena.

Sin embargo, sí que he encontrado para Emacs. Se llama Xrefactory, y funciona cojonudamente :D. Me he visto obligado a aprender un poco de emacs por el camino, y sin querer también algunas chorradas como que bash tiene modo emacs y modo vim :O

#modo bash-default:
set -o emacs

#modo bash-vi:
set -o vi

Las cosas que descubre uno…

05.13.06

Realistic Fractal Worlds

As you may or may not know, I’m involved in a pretty ambitious project, named Motorsport. Its purpose is to become the most realistic simulator of vehicles (usually cars), and as such, no ideas are being scrapped (as long as they contribute to the sim realism, that is).

There are a lot of ideas floating around. You can read about a couple of those new ideas here. However, I’m going to talk about something which you won’t find there: generation of real world 3d geometry and textures on the fly, with an unlimited level of detail.

Yeah, sounds gorgeus at first. But it’s not so gorgeus as it’s difficulty to code and get right (i guess).
The idea is to:

  1. Find a free (CC-licensed if possible) source of Earth data. We need both 2d textures and a 3d model, which can usually be found in the form of (unfortunately) freaking low-res textures and freaking low-res heightmaps.
    Possible sources:

    Ok, so that has nothing to do with fractal worlds.

  2. That’s where procedural contents come into play. Take a library such as LibNoise, take the aforementioned freaking low-res contents, mix them all in a bowl on the fly, and you can get 3d meshes and 2d textures with any level of detail you may want, perfectly consistent and reproducible across different computers.
  3. But this is a vehicle sim, so we must add some roads.
    Google Maps provides some road maps (as do many other websites such as Guia Campsa, but their data most probably can’t be used without paying royalties first)
    Then there’re some professionals who work creating landxml-compatible sets, which sometimes are not even possible to buy.
    And then there’s data created by regular people with their GPS-equipped cars, for example Open Street Maps.

    Once we got some good (or bad) road data, we drop it over the heightmap we got from point 1), seamlessly integrating it by using 3d mesh data and blended textures, and add some detail (bumps, side bankings, curbs, dust, camber, variable surface properties, …) in order to make the ride a bit more interesting.

Sounds easy, does it? Of course NOT. But it’s just a rough idea of what could be done in, say 23 years or so.. give or take a day 😉

Enough dreaming for now, I should go study something about OSs (Operating Systems, not Open Source Software! 🙂

See ya!

Ps: yup, I’ve finally decided to write some posts in English, as I find it easier to find the words for technical subjects such as the one in this article. Plus English is a more efficient language when it comes to bandwidth! 😛