Guitar Hero drum sets

I recently bought a Band Hero set, because I love music, yet have difficulty motivating myself to play, and rather liked the drumming from trying out Guitar Hero World Tour. There was a major disappointment with some chopped up songs (supposedly for censoring), which I’ll likely write about later.

However, what I wanted to mention today is the sensitivity tuning. It appears the GH drums were always based on actual MIDI drum sets – the kinds used for training without a proper soundproof studio. That meant they use MIDI ports, and include the ability to tune the hit sensitivity. The BH drum set beats out the GHWT set in this regard, as it has MIDI out as well and thus needs no special software to play.

However, the tuning method isn’t documented. This is done all the time with proprietary stuff, but makes no sense. It’s not like you can’t experiment anyway, and documenting the controls (a bunch of channel 16 CCs) would’ve taken half a page of the manual, or equivalent space on, say, the assembly instructions. As the tuning kit was sent out for free when it was introduced (because the WT sets were often so badly tuned it rated as defective), it doesn’t really make sense for greed to motivate this omission either.

Anyhow, the tuning kit provided by RedOctane only works with some versions of Windows (requiring a MIDI interface and .NET 2.0) or some Mac versions (didn’t check closer). The two or three knowledgebase entries describing it alone contain more text than would’ve been needed to describe the protocol (and so does this rant). I eventually managed to combine a simulated Windows machine, a virtual MIDI interface, and a MIDI message monitor to find out what the program sent. The grand total is 8 messages.

Had I known these messages beforehand, I could have used my MIDI keyboard to tune the drumset. No programming, no downloads, and very little effort. What I wound up doing, though, was writing a small script to tune Guitar Hero or Band Hero drums from GNU/Linux. Activision (who host the support site where you find the tuning kit) didn’t want to link this to the knowledgebase, though they did suggest mentioning it in the forum.

Finally, to not come off as a jerk, here’s the actual list of CCs used. They’re all sent on channel 16.

Drum pad sensitivity, low values mean higher sensitivity, values used by program range from 4 to 40: 100=pedal, 102=blue, 103=green, 104=red, 105=yellow, 106=orange.
The settings are saved by sending CC 101 with value 3, then two seconds later CC 119 with value 119. I’m not sure precisely what these commands do, but it wouldn’t be entirely surprising if the first erases EEPROM and the second writes it. If not saved, the settings should revert on the next powerup.

Camera selection

As you may or may not know, my computer systems mainly run Debian GNU/Linux. Somewhat contrasting with this, I also follow some video services online, such as YouTube and ustream.tv. Sadly they require Flash. Anyhow, I was inspired by several videos online and thought it would soon be time to post one of my own. This led me to search for a camera.

After much digging around, I settled for a Logitech QuickCam AF. After attempting to use it for a while, I can only conclude this was not the best choice. It has good sides – resolution up to 1600×1200, frame rate 30fps (up to 800×600), panning and tilting, UVC interface, JPEG compression and motorized focus. As simpler webcams go, it’s fair. But it doesn’t have true autofocus like the Vision Pro, or 30fps 720p like Microsoft LifeCam Cinema.

I found a few programs to cooperate with the camera, most notably mjpg-streamer, but it’s not very polished. I mucked about a little bit with javascript and wrote a simple page adding clickable panning to that as an experiment, but it needs the feature to tilt and pan in the same operation. It does have the advantage of needing very little CPU, and demonstrates working control of pan and tilt – which neither luvcview nor v4l2ucp do, in the packaged versions.

The most jarring problem I’ve encountered has to do with lighting. This camera wants light – lots of it. It defaults to solving this by raising exposure time, leading to awful frame rates and blurred pictures. On the other hand, I really do have a shortage of light, so manually lowering exposure (why are there two settings to make it manual?) leads to visible flicker and colour distortions.

In all, I find there’s a need for some better processing applications. Something to help control the focus, recode (as with ffserver), and target (either manually or motion detection). I’m aiming for video conferencing, so I’ll want audio with echo cancellation as well. On that note, the mono mic in the webcam is limited to 16kHz sample rate. It appears BruteFIR is the program for that, but how to set it up properly is a mystery.

Has anyone heard of any decent solutions?

Text mode web browsers

Recently I encountered a quiz question about what a “command line web browser” for GNU/Linux was called. It was apparent that text mode was intended rather than command line – a command line program won’t actively use the whole screen, only the (current) command line itself. What caused more confusion, though, was that several of the answers were existing text mode browsers.

Both Lynx and Links were mentioned. The latter is about in at least two major flavors, ELinks and Links 2. The latter actually supports graphics more and even Javascript, but it’s lightweight enough that it long was my main browser (currently I tend to use Iceweasel, for convenience). The final text mode web browser that came to mind was w3m, which also bears the somewhat unusual distinction of supporting images inside a graphical terminal.

Metakit

Some years ago, I encountered a neat puzzle game called Deadly Rooms of Death. While an interesting game in itself, this post is not about that. Having caught my eye, though, I had a thought to port it to some portable gaming platform. I made some effort, unfinished, to port it to Nintendo DS, and then found out more about its structure.

During Software Freedom Day 2009, this came to mind again, as someone mentioned column-oriented databases. DROD happens to use one of these, which also eschews the tradition that database engines are squeezed into SQL interfaces. Instead it’s an embeddable library, with support for file based, in-memory, or indeed overlaid databases, simultaneous reads and writes, and automatic format conversions. It’s called Metakit. This quite remarkable bit of software struck me as convenient yet remarkably unknown. It would do an excellent job in many places SQLite is now used, and I’ve long had a slight distaste for that engine because it not only relies on reparsing SQL statements, it forces conversion to text strings for any data content – particularly numeric entries. I vaguely hope this post will bring Metakit some deserved attention.

Parallel microcontrollers

As you no doubt know, I’m fascinated with both computing and electronics. I particularly like to learn about the borderlands of these fields, and started mucking about with microcontrollers some years ago, some CPLDs, and recently FPGAs. With my limited budget, I necessarily keep looking for the best a hobbyist can get, and that means manual soldering, two-layer PCBs, and manual via wiring. Surface mounted technology means less drilling, but some variants are too hard to handle, particularly BGAs.

I started my foray into self built controller boards by purchasing a few Atmel ATtiny2313 AVR microcontrollers. These have a very well thought out processor, fair amounts of memory built in, and plenty of specialized I/O devices to assist in various tasks. The weaknesses lie in resilience (I’ve seen output drivers fail), programming sensitivity (unintentional configurations can make a chip useless), and the fact that they’re 8-bit sequential machines. Anything that happens has to pass through the single CPU. The main weakness is that unless there’s an already included peripheral to do what you need, you can only update one or eight pins (in port groups) at a time, and the sequential operation means you must be careful to handle events fast enough to not miss others. Recently a variant called the Xmega was introduced, resolving some of this by adding DMA, transfer channels, and an event system; all leading to more direct connections and lower latencies.

From the other end of the spectrum I got a few Xilinx CPLDs and eventually a Spartan (3A) FPGA starter kit. These are programmable logic, allowing to build anything – as long as you have the logic cells – but also requiring you to do so. The ready built parts are few, from none in the CPLDs to the Spartan’s multipliers, block RAMs and clock managers. Example extra modules may be found at sites like Open Cores. Xilinx was chosen for a very simple reason – they’re the only PLD brand I know of with free to use development tools (Webpack). I tried getting started on Atmel’s hybrid FPGA/MCU devices, FPSLIC, but they have no synthesis tools. You’re left to attempt renting access to Mentor Graphics tools, at rates far surpassing any hobbyist budget. I did try to get an evalutation license a few times, but they never produced one that worked.

At the same time, multicore computing has seen a rise in popularity, and a few manufacturers have jumped on this bandwagon even for microcontrollers. Right know I can think of two, Parallax Propeller and Xmos XS1.

The Propeller is really a marvel of engineering – with misguided preconceptions. Parallax’ most well known product is without a doubt their Basic Stamp controller boards. They took the ease of programming from 80s era microcomputers – that is, built in Basic interpreters – and applied them to a popular microcontroller, the Microchip PIC family. PICs are very dominant in the MCU market, but they’re not the best design. Instructions take multiples of 4 cycles, so the higher frequencies aren’t really impressive. That latter feature was kept in the Propeller, as was the interpreted language, while “hard to use” features like interrupts were discarded. Basically, the propeller gives you eight microcontrollers in one, each having two timers, but everything has to be bit-banged and polled or waited for, and you can’t run at very high speeds – when you try to access shared memory, each cog has its dedicated 1/8th timeslot. And that includes the ROM, richly sprinkled with useful items like a font and sine tables. Per-cog memory is 512 words, half what my AVRs chosen for being cheap had. At least you get the important feature of 8(!) NTSC video generators. Meanwhile, the development tools are thrown together, and you get a “high level” language noone else uses, with trivial optimizations left out because the compiler itself is too difficult to maintain.

Xmos XS1 looks much more promising, to me. These engineers have learned from the past. Like Sun’s Niagara architecture, the processor itself is multithreaded. Like MIPS, it avoids interlocking pipeline stages, giving consistent instruction timing. From the Transputer, it inherits a multiprocessing model that’s easy to analyze and extend, with links for interconnecting multiple cores. We’re at the first generation of chips, with up to four cores, and there’s a sample board showing 512 hardware threads (using 16 chips, each with 4 cores, each with 8 threads). It’s still four clock cycles for one instruction, but by having each pipeline stage work for a different thread, four threads can run at full speed on a single core. And the clock speed is 400MHz here, so the instruction rate is 100MIPS – compared to the Propeller’s 20. Admittedly these are top ratings, as memory contention is an issue; memory access heavy code will need extra cycles for instruction loading, as may branching. Programming in familiar languages is available by leveraging free software development tools like LLVM. Occam’s parallel programming features have been translated into a very C-like language, giving a more familiar layout. But the important part comes in the I/O blocks, where we have precise timing, hardware assisted shifting and strobing, and events which can trigger interrupts or wake threads. The mere concept of a sleeping thread gives us automatic power saving (which the Propeller also has, to a degree), as opposed to the sleep management which is always a challenge on traditional MCUs.

But it eventually must come to complete designs to be interesting. 3.3V builds are now commonplace, so that’s no longer an obstacle, but the Spartan 3 family of chips require two to three different voltages for power; which must all be routed to the chip in at least four places. External clock sources are necessary for many tasks. And the Xmos XS1 comes either with a BGA package, or a QFP where the only ground connection is a pad in the bottom; which means you must solder under the component. It’s doable, but not easy. That’s where the Microchip and Parallax designs stand out; they make breadboard friendly PDIP components.

In all, this ranting summation wasn’t planned out. What I’d really like is some suggestions – are there any other options out there?

Hearse

I’ve been asked to post occasional tips about free software. Not some particular type, but merely things I know of that might perhaps be of interest to others. So, today I will mention Hearse. This is a small add-on program for NetHack, one of the most well known and expansive Roguelike games. Ordinarily, in the game you may encounter graves and ghosts of earlier players, but only those who played on the same host. Hearse adds a service for exchanging the “bones” data, meaning you can enjoy this small bit of interaction with your friends even though you play on separate machines. Enjoy!

SmartConnect and the wonders of DRM

When I updated to firmware 210, I found I needed to reinstall a lot of software. BirdStep SmartConnect was one of them.
SC provides a function that is standard with many other phones, that of automatically selecting a useful Internet connection from those currently available. This is missing in S60 3fp1 which the E71 (but not the E71x, with the same hardware) uses. This was quite the drawback for an ambitious E series device, so Nokia found a workaround. They licensed BirdStep SmartConnect.
It still required the user to find the program, though. You do so using the Download! service, where it is one of a myriad items marked as costing 0. Or was – now it’s marked “try for free”. The first time I installed it, it worked fine. The downside of installing this way is that I got no SIS file, so when I needed to reinstall after a firmware upgrade, I had to find it all over again.
So I did. It was marked “try”, and after installation, considered itself unlicensed and refused to work.
I looked the issue up on the ‘net and found two plausible culprits – an online license check during installation and stale data files from the previous install. It turns out that enabling online license checks merely causes the download to fail. The other fix, which was listed on BirdStep’s FAQ, actually worked.
After three reboots, two manual erasures, and a bunch of reinstall attempts, I had managed to wipe the botched licensing data, and the newly installed program automatically reported a licensed E series device, for a feature that should have been included from the start (and could – remember, this was with a firmware update). How astoundingly convenient and helpful for the customer, wouldn’t you agree?

Update: The Download! service is no longer available. Nokia now expect you to use Ovi Shop, which requires a huge download, apparently does invasive stuff to your system as it demands you reboot the phone, and yet leaves the now useless Download! app in place. It also forces updates, which mean downloading and rebooting all over again. I haven’t searched through that to find SC again, but it certainly complicated the process further.

Firmware 210.21.006 for Nokia E71

I found out that Nokia had put out another firmware update, 210.21.006. As per usual, installing it required me to use NSS to switch product codes.
The update is a stability patch. It’s said it finally does something about the camera’s purple haze, although it seems to me this is merely a fix to the white balancing. It’s still very noisy, but each improvement is appreciated.
The simple bugs are left alone: Contacts still uses a custom pure white background instead of the theme and Messages still shows names backwards. What I’m hoping they did fix is internal bugs, that have previously caused graphics corruption, program crashes and even phone reboots. Since I had no known way to trigger those bugs, I can’t confirm it.
The rumour mill also says hacking the phone to remove the signature requirements for installing programs has become harder. Personally I’ve used the tedious symbian open signed online process, so it makes no difference as yet.
This time around I chose to restore my settings from the PC Suite backup. This led to some confusion as apps largely, but not completely, disappeared from the menus. Reinstalling them fixed most of it, though the Maps 3 beta required an extra procedure – manually erasing the maps, running Maps 2, then reinstalling Maps 3 with the updater. Had they provided a SIS for Maps 3 it would have been a simple reinstall.
In conclusion, I would recommend this update; it should contain bug fixes that matter, even if they’re not the visible ones.

Hello, world!

This is my first wordpress blog post, written on a Nokia E71 using Wordmobi. I have posted bloggish material before, about this phone, at linuxportalen. I might copy that over once I’m a bit more at home with things.
Right now I’m updating to Nokia Maps 3 (beta): the topographic map mode looks promising.