Nerdddd….

(suena la voz de Fercha cargándome, podría haber salido el sábado a despejarme un poquito pero me quedé hackeando un driver)

And now for something completely the same… A couple of weeks ago I bought a cheap 8-channel usb audio card based on the CM6206 because the one in my notebook was roast (ar$ 190, including shipping to my home). As expected it worked right out of the box, there were some rough edges, like missing control names and the headphone jack was silent,  but as I was running a somewhat old kernel (2.6.29) I didn’t care.

On another box with a newer kernel, 2.6.32-something, it worked better; the headphone jack mirrored the front channel and also spdif was enabled. Even so, it was managed as a generic usb device (wich is great, it means no specialized drivers) but some useful features described in the datasheet were missing.

I decided to implement the easier ones first, mainly because even I hacked the kernel before this was my first time with alsa. With the datasheet in hand I coded a quick app with libusb to poke registers. After a couple of hours I had a userspace app to select the headphone source (it lets you choose wich channel the headphone jack mirrors). Then I got the latest stable kernel, 2.6.34 at that time, and jumped into the code. A week passed and I had it implemented as another control from alsa.

You are doing it wrong.

Feeling great I made a series of shiny patches to send upstream. Lurking thru alsa-dev I glanced other patches that affect the usb-audio portion and they looked… different. Cloned the main git repo and really, it was different. Back to square one, or two.

Spent yesterday’s night merging the old changes at the new tree and got a working driver again. A couple of hours ago sent the patch to alsa-dev. This time I avoided the gmail interface because it really likes to mangle inline patches and used kmail; the bastard trimmed also everything to 80 columns. Still nobody complained but lets see how it is teared down this monday.

Sources and documentation:

http://tangopardo.com.ar/pub/src/cm6206_utils-0.0.0.tar.bz2

CM6206 datasheet: http://tangopardo.com.ar/pub/docs/CM6206+datasheet+1.7.pdf

Para qué hacerlo fácil…

huawei_e1756

huawei_e1756

Este es otro de los modem de Personal / Claro / Movistar; un Huawei E1756 en este caso. Normalmente estos bichitos aparecen como una unidad de almacenamiento con los drivers adentro para no llegar al dilema en Windows de necesitar conectarte a internet para bajar los drivers necesarios para conectarte a internet (obvio que si hubieran implementado bien las clases acm en primer lugar todo esto no sería necesario).

Con el que tenía antes no tuve que hacer ninguna magia loca, lo enchufé y el NetworkManager solito solito configuró todo; aparecía tanto como un modem comun y como un disco. Este aparece solo como un disco, o sea que hay que usar el usb_modeswitch para que cambie de funcionalidad. La última versión aún no lo tiene incorporado así que tuve que buscar un poco mas. En http://www.otubo.net/2009/12/vivo-3g-using-huawei-e1756-on-ubuntu.html ya lo resolvieron pero debo tener otra revisión del modem porque sigue sin cambiar de modo.

No pude hacer andar el usb en qemu (tampoco traté mucho) asi que ahora estoy atado a que me presten una compu con windows para sniffear como hace el driver para cambiarlo.

Primer artículo en Wikipedia

Hace un tiempo que vengo editando artículos en wikipedia, correcciones menores, algún enlace relevante. Al principio era en forma pseudo anónima, después me hice un usuario.

Aprovechando un transformador al que le rehice el secundario con varios taps para probar válvulas tomé unas fotos de la 866 y las subí a Commons. Después vi que no había aún un artículo sobre esta válvula, así que inicié uno.

Faltan datos históricos, un par de referencias y retocar un poco mas las fotos pero es un comienzo. Fué una experiencia bastante integral, aprendí a moverme en Commons, editar templates e infoboxes sin romper el resto de los artículos…

http://en.wikipedia.org/wiki/866A

Solving the *tex error “I can’t find file `pgflibrarytikzpositioning.code.tex”

Basically it means your PGF installation is waaay old. Like from 2007 if you run Ubuntu 8.04 as I happen to. If you want to find out what your version is compile this short tex file:

\listfiles 
\documentclass[]{article} 
\usepackage{tikz} 
%\usetikzlibrary{positioning} 
\begin{document} 
a 
\end{document}

(found in http://old.nabble.com/I-can’t-find-file-`pgflibrarytikzpositioning.code.tex’-td20634766.html)

After that grab a fresh copy from http://sourceforge.net/projects/pgf/. As root remove (or back up somewhere else) /usr/share/texmf/tex/context/pgf , /usr/share/texmf/tex/generic/pgf , /usr/share/texmf/tex/latex/pgf and /usr/share/texmf/tex/plain/pgf. Extract the new pgf and copy the corresponding folders to the same places, run (as root) mktexlsr and you are done.

Solito…

Este jueves por primera vez me tocó estar solo en el programa de radio (no exactamente porque Marcos y José me dieron una gran mano a distancia). No fué del todo mala la experiencia, al principio estuve un poquitín nervioso pero luego me solté. Por suerte Antonio [antoniosacco.net] me ayudó muchísimo y hablamos sobre Software Libre orientado a personas con Necesidades Especiales.

El resumen del programa se encuentra en http://ovejafm.com/programa48

En el estudio de Futura con Antonio

En el estudio de Futura con Antonio

(ahora que veo como tenía el pelo solo faltaba que aparezca Disco Stu)

Fixing Amarok’s support for Wikipedia without recompiling

Some time ago Wikipedia changed its markup and because of that one of my favorites players, Amarok stopped showing the artist information. This wasn’t something that bugged me that much to take the approach suggested in tons of places:

edit contextbrowser.cpp and change:

from: m_wiki = m_wiki.mid( m_wiki.find( “<h1 class=\”firstHeading\”>” ) );
to: m_wiki = m_wiki.mid( m_wiki.find( “<h1 id=\”firstHeading\” class=\”firstHeading\”>” ));

… save, compile and you are done. Nice as pie. Isn’t the free software world wonderful? Not that this is something hard, but I didn’t feel like doing it that way.

Sooo, today I came back home a bit tired after college and work and instead of having some sleep I chose to tackle this little problem. From the code above, we see that there’s a function that takes a static string (in this context by “static” I mean something not generated at runtime), this means that we can [generally] replace the string in the binary and it should work.

Hands on!

#cd /usr/bin
#grep firstHeading amarokapp

Yuck. Nothing!

#ldd amarokapp
(...some output ommited)
libamarok.so.0 => /usr/lib/libamarok.so.0 (0xb79a1000)
#grep firstHeading /usr/lib/libamarok.so.0
Binary file libamarok.so.0 matches

There! so we have to modify libamarok.so.0
In my system libamarok.so.0 is a symlink to libamarok.so.0.0.0
This is nothing spectacular, first backup then edit

#cd /usr/lib
#cp libamarok.so.0.0.0 libamarok.so.0.0.0.orig
#hexedit libamarok.so.0.0.0

Here I used hexedit because it was at hand, any decent hex editor should do fine. Even vim works. In this case we can do this easily because the target string is shorter than the original, so we can pad the rest with zeroes (or add a single one at the end of the new string). Obligatory? screenshots:

hexedit of libamarok.so, before

hexedit of libamarok.so, before

hexedit of libamarok.so, after (bold: changed text)

hexedit of libamarok.so, after (bold: changed text)

Note: Close Amarok before saving!!

Mine quite certainly didn’t like having its library changed while running and died as if  I killed it with a -9. After running it again everything works as expected:

Amarok showing the Garbage page's

Amarok showing the Garbage page's

Regina Spektor's bio

Regina Spektor's bio

I really like what the compression artifacts did to the background, should change that later.

Whoaa, enough for tonight,  gotta sleep a bit.

Mudanza…

no hay mucho para hablar, me voy para Dreamhost!!!!!!! (en realidad si, hay bastante para hablar; por ejemplo el Circo Informático Libre y el show del Teatro Argentino junto a la orquesta Color Tango, una de las pocas veces que no arruino todo)

FLISol 2009 en La Plata

Bueno, este año voy a ser el coordinador en La Plata del FLISol, Festival Latinoamericano de Instalación de Software Libre. Pensaba postear algo antes pero los últimos dias estuve postrado con unos ataques de vértigo horribles.

Hoy estuve averiguando por el tema de la publicidad y mañana por la mañana iré con la propuesta al Jockey y el Dardo Rocha para ver si alguno decide hospedarlo.

Algo aparte, recién se me ocurrió probar con brosershots [browsershots.org] este sitio y el contenido generado por el plugin del gallery se ve horrible! en ie6 pero bien en dillo.

Web del FLISol: http://flisol.info/FLISOL2009/

La Plata en el FLISol: http://flisol.info/FLISOL2009/Argentina/La_Plata

RMS en la Televisión Pública

Hace un ratito nomás, estuvo Richard Stallman en “Visión 7” el noticiero de Canal 7 Argentina[canal7.com.ar]. Dejé grabando la entrevista y apenas pude ver el final de la misma (y una comparación algo extraña por parte de Rosario entre el software privativo y la tendinitis).

Al igual que los sitios de otros medios públicos (LR1 – Radio de la Ciudad [la2x4.gov.ar], por ejemplo) hacen el streaming con Windows Media a través de telecomdatacenter.com.ar. Al igual que muchos otros también usan Flash. Y a diferencia de la gran mayoría, no solo es totalmente inusable sin el plugin de flash, que por cierto no uso, resultando en una estúpida página vacía; sino que tampoco puedo ver el video direrctamente con el plugin de mplayer.

Tampoco es algo que me joda mucho la vida, convengamos que no voy a tratar de mirar la tele a través de Elinks y que tipear

mplayer mms://canal7envivo.telecomdatacenter.com.ar/canal7envivo

para verlo, y añadirle un -dumpstream para guardar el video es algo taaaan complicado.

Ballmer Peak

(n.b http://xkcd.com/323/ )

I woke up with my terminal filled with sed scripts like this one:

/<div class="maple">/,/<\/div>/ {
        s/<.*>/ /g
        s/&gt;/ /g

        s/\((.*\)\n\(*.*)\)\(:\|;\)/\1\2/g
        s/[1-9]/ /g
        s/\-//g

        s/\(\#.*\)$/ /g

        s/([^()])/ /g
        s/{[^()]}/ /g
        s/\[[^()]\]//g
        s/\w*\s*:=/ /g
        s/\w*\s*=/ /g
        s/[:;=+&^$"'{}\*\\\/]/ /g
        s/\[\|\]/ /g
        s/^\(\n\)*/\1/

        /\w*(/{
                s/,\{0,\}\(\w\|[^()]\)*\(\,\|)\|\n\|\s\)/ /g
                s/^\(\n\)*/\1/
                s/\(\w*\)(/\1\n/g
                s/ *//g
                p
        }

        s/\s.\s//g
        s/\s..\s//g
}


… wich, (un)surprisingly works.

Still don’t know how nor why it does. I guess it’s time for more python.