Archive for the 'Hacks' Category

Page 2 of 7

Packard Bell OneTwo all-in-one with touch screen

I’ve just bought a Packard Bell OneTwo (M3700), a 600 Euros all-in-one computer with a 20″ multipoint touch screen (there are bigger models with 23″ touch screen, wifi and some other options). This machine will be used to run OpenBravoPOS, a free (libre) point of sale software. So far, I think this machine is just perfect for the job.

Getting it to run smoothly under Linux is not a walk in the park, however. There are some quirks and some assembly is required, but once you’re done (that takes a couple of hours at most once you’ve got all the info, which you have if you’re reading this) this machine is just great.

It’s fast, with a 2.1 GHz Pentium Dual-Core (T4300) CPU, 4 GB of RAM, an Intel GM45 GPU with up to 256 MB of shared RAM, gigabit networking, a fast 320 GB SATA disk and a combo DVD-drive (not a slot-in, too bad). The screen is nice, and the touchscreen is incredibly smooth, precise and sensitive. The sound is good, the webcam is great and it works out of the box, too!

Update: added a note about the card reader.

Update 2: the instructions can also be found on the Debian wiki now.

Continue reading ‘Packard Bell OneTwo all-in-one with touch screen’

Pommed v1.30: bug fixes

Pommed v1.30 is a bug fix release fixing two small bugs:

  • a crasher bug on PowerMac machines
  • a bug in the sysfs backlight driver, mishandling brightness values with more than 3 digits

If you are running on a recent MacBook/MacBook Pro with a recent kernel, you’ll probably want to upgrade to this release.

pommed v1.29: architectural fix

pommed v1.29 is a bugfix release, kind of. The fix is an architectural one related to the video mode switch feature.

When pressing the video switch key, your graphical pommed client of choice checks which VT its X server is running on and whether this VT is the active one before executing your video mode switch script.

To check that the VT is currently active, it is necessary to open one VT (we use the one our X server is running on) and perform an ioctl() call on it.

Depending on your setup (login manager or startx, basically), your user will or will not have any right on the device node associated to the VT. Which means the VT state checking code would always fail in some setups.

This is now fixed by moving that code into pommed itself, with a DBus method for the clients to call. You’ll need to update both pommed and the clients for this to work, for obvious reasons.

pommed v1.28: new machine

pommed v1.28 is a minor update adding support for the MacBookPro5,3.

pommed v1.27: new machines

pommed v1.27 is out as a maintenance release adding support for 3 of the newer machines:

  • MacBook5,2 (White MacBook)
  • MacBookPro5,2 (17″ MacBook Pro, June 2009)
  • MacBookPro5,5 (13″ MacBook Pro, June 2009)

Some machines are still missing, as I haven’t got any report about them yet.

Looks like the keyboard backlight behaviour and keys handling will have to be modified slightly for the new machines, but it’s really touchy to get right. I’ll need to try it out on the actual hardware.

Releasing a rewrite of mt-daapd/Firefly Media Server

About a year ago, I bought a SoundBridge, having grown tired of running a media player on one machine or another to listen to music. The SoundBridge really fits my needs perfectly.

The server-side counterpart, mt-daapd (Firefly Media Server), on the other hand… not so much. Feature-wise, it works and does what it’s supposed to do, so the issues aren’t there.

The first issue was with the crappy, below-average packaging of mt-daapd in Debian. I’ve fixed that since I think, at least now it’s in a state where I’m not looking away from the screen while typing apt-get install mt-daapd.

The second issue came after looking at the code, while writing patches for Debian. Eek. It’s horrible in about every aspect you can think of. No coding standard, outdated comments, cruft everywhere, either #ifdef’d out or not, useless code left lying around inside functions, obvious memory leaks, and way more levels of indirection than is actually needed, let alone sane. Also, someone is clearly in deep and urgent need of taking “Pointers in C 101″. My eyes still hurt.

Well anyway, I’ve been contemplating either fixing it or rewriting it because I can’t stand such crappy code. Also, mt-daapd has been unmaintained upstream for something like 2 years, given that the upstream developer just pretty much disappeared.

So, with way more time on my hands than I’d like these days, I’ve finally jumped in, pulled the whole SVN into a git repository and started cleaning things up then rewriting it piece by piece. Good way to keep myself busy, producing something useful while doing so and playing with a couple new things.

This rewrite is called forked-daapd, for lack of a better name at the moment, it’s GPLv2+, and the code is available in a git repository at

git://git.debian.org/~jblache/forked-daapd.git

It’s not a feature-for-feature rewrite. I’ve tossed out a few things.

It’s Linux-only for a start, and then I’ve thrown out the web interface, the XML-RPC interface that goes with it,  the iTunes XML playlist support (only useful on Mac OS X) and the smart playlists. Maybe a couple other minor things I can’t think of right now.

It’s Linux-only because it uses signalfd and inotify. It’s built on libevent and pthreads, but doesn’t abuse threads either like mt-daapd does (spawning one thread per HTTP request … seriously). Parsers for the RSP and DAAP queries are built with ANTLR v3. Media handling is mostly done by ffmpeg, though ffmpeg suckiness in parsing metadata in some formats had to be compensated by dedicated metadata parsers. It’s a shame ffmpeg can’t handle raw FLAC streams with VORBIS comments, that is, bog-standard .flac files, while it goes to great length to support proprietary formats (though I should note it fails miserably on WMA too).

So, new things I played with: signalfd, libevent, threads, ANTLR, ffmpeg. Threads aren’t really a first, but I did some new things. inotify isn’t a first either, but it’s the first time I use it to watch events other than IN_CREATE or IN_MODIFY; that leads to quite some unhappiness towards the inotify API, which has some real shortcomings. I’m still shaking my head in disbelief.

It will happily support multiple concurrent clients, even when decoding media files to WAV, without abusing the machine it’s running on. I thought of adding more threading, especially in the decoding case, but I doubt this will be needed by anyone. Unless you’re streaming to hundreds of clients at the same time, which doesn’t look like a plausible usage scenario to me.

I don’t know where I’m going with this project. Right now it works for me and covers my needs. I’ve tested both the RSP and DAAP protocols with my SoundBridge, and DAAP with iTunes. I’m not an iTunes user so I may have skipped on the complicated things with iTunes, although I looked hard.

If there’s enough interest in this project, it can become a full-blown project on Alioth (it can even have a name that doesn’t suck!).

pommed v1.26: new external keyboard, fixes

I’ve just released a maintenance release of pommed. Nothing new under the sun in this one:

  • support for the new mini external keyboard,
  • the keyboard backlight idle timer now only takes keystrokes on the built-in keyboard into account,
  • move away from using /dev/mem to access PCI memory, use sysfs resource files instead.

There are a couple of ideas floating around, we’ll see if any one of those lands into a future release.

mt-daapd EPIC WIN

I’ve been doing some code lately, fixing things here and there, and over the last few days gave mt-daapd some attention.

First, I was reported a segfault of mt-daapd when reloading web pages too fast. Surprisingly, it turned out to be a stupid omission in a simple routine and it is hard to hit without disabling the cache in the browser.

Now, I just fixed something that’s been bugging me for a while: mt-daapd did not handle Avahi daemon restarts, leading to mt-daapd becoming invisible to clients relying on mDNS until you restarted it.

And, wow, that went a bit further than expected. As I expected, the simple piece of code needed to handle that wasn’t there. But still it did not work, as it turns out the event loop for the Avahi polling wasn’t being run. Replace stupid code reinventing the wheel by the Avahi-provided wheel and there, it works. But not when run as a daemon (aka foreground only). Well yes, starting the thread before daemonizing isn’t going to work well, so fix that. EPIC WIN \o/

As mt-daapd’s upstream is not active anymore I’m accumulating fixes for mt-daapd in the Debian package, to the point I’m starting to consider setting up a git repository somewhere with those fixes and possibly some more code rework if I feel like it.

pommed: now using git

I’ve migrated pommed to git yesterday. The public URLs for the git repository are:

git://git.debian.org/git/pommed/pommed.git

http://git.debian.org/git/pommed/pommed.git

The SVN repository will disappear shortly.

pommed v1.25: wireless keyboard, DBus configuration

Two fixes in this release, let’s start with the more important one :)

The DBus configuration file shipped with pommed now explicitly allows method calls to org.pommed, which is needed with the newer versions of DBus where the default configuration on the system bus has been made more strict to close a security hole. If the pommed clients stopped working for you after a DBus update, replace /etc/dbus-1/system.d/pommed.conf by the dbus-policy.conf file shipped with pommed.

Second fix is related to the Apple wireless (Bluetooth) keyboard, which previous versions of pommed would recognize just fine but reject because it exposes a type of events usually indicative of a mouse (and pommed doesn’t listen to mouse devices). This is now fixed for this particular keyboard, so pommed will react to the hotkeys on this keyboard too.

For the complete list of changes, see the ChangeLog file in the source distribution. Comments at the usual address :)