Category Archives: Uncategorized

a new toy

beagleboard B4

This is the Beagleboard – an TI OMAP 3530 based open source development board from the guys at TI.
It still amazes me that nowadays it is possible to pack 600Mhz CPU, DSP, 2D/3D accelerator, 128MB SDRAM and 256MB NAND flash into a package that measures something like 13x13x4 mm.

OMAP 3530
It doesn’t seem to require any active or even passive cooling and while I haven’t found any power usage measurements yet it can’t be very power hungry since basically the same chip (OMAP 3430) is used in mobile phones.

With that kind of specs this chip is sure to find use in many devices from the set top boxes, car computers and (wearable?) surveillance devices to ultra portable notebooks.

Indeed there’s already an project called Pandora that has created a handheld game console design that is belived to be the most powerful in the world and is expected to ship as early as september 2008.

But now back to the beagleboard itself – it is an extremely small (7.5cm x 7.5 cm), powerful and cheap (149$) board that has:

  • the omap 3530 chip
  • USB 2.0 OTG port (this can act as gadget or host)
  • stereo audio input & output
  • s-video output
  • DVI-D output
  • MMC+/SD/SDIO slot
  • JTAG & RS232 headers
  • an expansion header for I2C, I2S, SPI, MMC/SD

The board design originally also had an separate USB host PHY and an USB host port, but it was removed from this revision because they couldn’t get it working in a stable manner yet. It will probably show up in the next rev. but until then we have to live with the OTG port in the host mode, which will be fine in most cases. So far the only problem that I have encountered with it is the lack of support for the high bandwidth transwers in the host mode in the linux driver (musb) that handles the OTG port. In practice this means that some webcams will not work yet, but all the other USB devices that I have tried work just fine.

Since it only has a single USB OTG port I had to use powered USB hub to connect things like the keyboard, mouse, network dongle and the wireless dongle. I personally use mini usb A -> mini USB B cable and 7 port powered Trendned HUB.

beagleboard playing 720p video

This board is currently able to play back 720p purely on the ARM (with NEON vectorization). We will probably soon see DSP offloaded codecs too, which will free up the main CPU for other things and might even make 1080i possible.

I’m currently running the Ångström distribution based demo image that has Enlightenment window manager & Epiphany web browser. I haven’t been yet able to try sound since the alsa drivers that the demo image has are broken and give kernel panic on every attempt to play sound. Also the USB seems to behave strangely – sometimes all the USB devices are lost, sometimes not recognized on the boot at all. USB devices also become unresponsive when I connect more than 3 devices to the HUB, I still don’t understand if it’s HW or SW issue.

Commands out of sync; you can’t run this command now

After a recent upgrade our rather high volume Python application server started sometimes getting the “Commands out of sync; you can’t run this command now” errors from the MySQLdb library.
I didn’t have time to debug it right away and the searches revealed only various threads where users complained about similar problems without any obvious solution. So at the time I just wrote an exception handler around the database functions that will retry to execute the query when such an error is encountered, this proved to be an rather effective bandage since there were only about 2% of the cases when we got double fault.

Anyway, the problem kept ticking in the back of my mind for some weeks until I accidentally read a post by John Nagel explaining that the cursors abstraction provided by the Pythons MySQLdb library is just an illusion since the underlying MySQL C library doesn’t really support cursors and requires you to always free the results for the last query before executing next one on the same connection. Our database connection spooling library was written with an assumption that there can be multiple open cursors on the same connection and the connections were released back to the spool as soon as the execute() returned and after that the cursor object was returned back to the caller.

This lead to the following race condition which produced the above mentioned “commands out of sync” errors:

  1. thread 1 executes a query on connection 1 which returns results
  2. connection 1 is returned to the spool and cursor object is returned to the caller in the thread 1
  3. thread 2 gets the connection 1 from the spool & tries to execute a query on it (before the thread 1 has called fetchone()/fetchall() on the cursor that it has)

So I guess the morale of the story is that I shouldn’t make intuitive assumptions and should read the actual documentation more. Eeasier said than done.

a good day for biking!

Since 2000 or so each winter has gotten softer and softer around here and this winter is the first that I remember when we didn’t have any snow at all.
So it’s kind of surprising that, now when the spring has officially begun we got the first snowy days and even a real snowstorm.
This gave me an first opportunity this year to do some icebiking which I happen to like a lot.

icebiking

and the tire that makes it possible:

schwalbe ice spiker

xorg lies to me…

Some excerpts from the xorg log:

(**) intel(0): Option "PreferredMode" "768x576"
...
(WW) intel(0): Option "PreferredMode" is not used

Actually the option was used since without it the default mode is used.


(II) intel(0): RandR 1.2 enabled, ignore the following RandR disabled message
...
(--) RandR disabled

nothing to see here, move along

Sometimes I hack a little bit on something and find some interesting things along the way that I would like to share with the others or just write down somewhere so I could investigate it more sometime latter. Lets see if the blog format is suitable for this purpose and if I have energy to write something more than once a year.