Arnt Richard Johansen's home page

How to work around USB disconnection errors on Windows

...yeah. It's been more than four years since my previous blog post. Sorry.

What compels me to break the silence this time is yet another technical problem that I've solved, and that deserves more Google juice.

I recently bought myself a new computer. It's running Windows 8.1, partly because I wanted to use it for music production, which is a niche where the FLOSS ecosphere offers little or no usable software for the serious amateur. I also have a Novation Launchkey 49 USB MIDI keyboard.

When I plug in the MIDI keyboard, it sometimes does not work. Or, I suppose I should say, it usually does not work. Maybe 80–90% of the time, you get that yellow triangle with an exclamation mark on it when it appears in the Device Manager, that I haven't seen since the 90s... Back in the day, it usually meant there was an IRQ conflict (on non-Plug-and-Play hardware), but looking at the properties, it says that “The I/O request was canceled” (Well, I have a Norwegian Windows, so it actually said “I/U-forespørselen ble annullert”. But Unlocalize can help with that.)

It's possible to work around the problem by connecting and disconnecting the MIDI keyboard until it works, but that gradually got on my nerves. After some weeks of sporadic googling, I finally found a thread on Steam Community where someone had similar problems with a different piece of hardware.

The workaround that worked for this person was “to disable the xHCI option in the bios”.

So I did just that. In the ASUS UEFI BIOS utility for H81I-PLUS, in “Advanced Mode”, under the “Advanced” menu (yep, you have to “go advanced” twice), under USB configuration, I set Intel xHCI Mode to Disabled.

As is usual for Windows, I don't know why it works, but it does work. I've tried connecting and disconnecting the keyboard several times, and every time it pops up in the Device Manager, without that nasty exclamation mark.

[Monday, Jun 30, 2014 @ 22:03] | [] | # | G

How to watch NASA TV on Linux

If you are in a hurry: point xine to this stream URL: http://www.nasa.gov/55644main_NASATV_Windows.asx. If that doesn't work, try vlc, or mplayer.

These days, I find most of the solutions to my computer problems on Google. These myriads of faceless voices, scattered throughout forums, mailing lists, and blogs, have been a fantastic help. So I think it's only fair that, whenever I'm able to solve a problem on my own, and there's not a lot of well-organized information to find on the web, I should make a little write-up of what I did. This is one such write-up. It's meant for search engines; if you're reading this because you are subscribed to my blog, it's probably not going to be very interesting to you.

I am planning to watch the launch of STS-128 on NASA TV tomorrow morning. So I thought I'd prepare in advance. You see, the ordinary course of events when I want to watch a shuttle launch is something like the following:

  1. Going to the official NASA TV home page
  2. Getting redirected to Video Player Help. This page is of little help, because none of the pages that they want you to go to to download video player plug-ins offer an alternative for Linux. Also, when you try to navigate back, you just snap back again. Obviously they don't even want you to see the page in a browser that's not completely up-to-date with plug-ins.
  3. Googling for “nasa tv linux” and coming up blank.
  4. Asking around in IRC channels I hang out on: “Hey, anyone have a working stream URL for NASA TV ...?” Sometimes, miraculously, a fellow space geek will be on, and pass along a working URL, which I will then watch, and... (sigh) neglect to bookmark for the next launch. Other times, I'm not so lucky, which brings us to the final point:
  5. Missing out on the launch.

Obviously, this needed to be solved, so I don't have to suffer the indignity of step 4 ever again. Actually saving the URL for later is one part of the solution, but who knows if and when they're going to change it? So it needs to be something repeatable.

After some fiddling around with the browser, it turned out that turning off Javascript sufficed to not get redirected away from the NASA TV home page. After that, it was just a matter of hovering the links to find out that the one titled “Public Channel” points to the following Javascript snippet:

javascript:nowPlayingNASATVChannel('1');javascript:GetSelectedChannel('http://www.nasa.gov/55644main_NASATV_Windows.asx','http://www.nasa.gov/ram/35037main_portal.ram','http://www.nasa.gov/qtl/151335main_NASA_TV_QT.qtl')
which I then pasted into a terminal, and trimmed out the superfluous bits, leaving only the .asx URL.

[Monday, Aug 24, 2009 @ 22:10] | [] | # | G

Cowon D2 review

After having owned the Cowon D2 portable multimedia player for about two months, I think I have had enough experience with the device to write a mostly accurate review.

The Good

One of the most important criteria when I set out looking for a portable audio player was that it has to work with the setup I already have. Specifically, it has to work with my computer, which is running Linux 99% of the time, and it has to work with my music collection, which is mostly in Ogg Vorbis.

Why Ogg Vorbis, you ask? Well, a couple of years ago I would have given you the whole speech about freedom and how important it is to have open standards, so that the market will compete on quality rather than who has the best vendor lock-in scheme. I still think that is important, but nowadays it's more a matter of convenience. I have gigabytes upon gigabytes of music that I already bought and ripped, and I do not want to rip it again, or re-encode it.

Cowon is one of the very few companies that actually takes other audio formats than MP3 seriously. That is perhaps the main reason that I chose to buy one of their products.

I was surprised to see that there was no complete manual in the box, just a quick-start guide. On further thought, I came to the conclusion that it was probably a wise decision. It saves the trees, the vast majority of the customers have a computer and access to the Internet, so they can go look it up there.

Other reviewers have mentioned this, but it bears saying again: the Cowon D2 is smaller than you think it is. It is actually about as big as a pack of cigarettes, and fits easily into any pocket I have, including front jeans pockets.

The Bad

The D2 isn't only an audio player, it's a video player as well. Yes, you can actually play videos on the tiny little 2.5" screen. I don't have much use for this feature, but one day I decided to try it out, just for fun. Boy, was I disappointed.

After becoming familiar with the D2's great audio format support, it comes as a surprise that the D2 can't play any old video file you put on it. I tried with MPEGs, AVIs, even QuickTime files, nothing worked. After some googling, I was able to dig up a post on Ubuntuforums with a link to a converter script. The script ran, it was able to convert a video so that the D2 could play it, but the whole process was impractically slow. So it does not seem that I will be using the D2 to play videos after all.

Indeed, according to the manual, “All video files must be converted using jetAudio VX. Any other video files are not supported by D2.” I may be underestimating the difficulty in decoding multiple video formats in hardware, but this seems like an unfortunate choice by a company that adheres to open standards in so many other aspects.

I wasn't planning on using the D2 as a recording device, but if dictation capabilities are important to you, you should note that in the unit I have, the internal microphone is broken. I can fix it temporarily by squeezing the front and back of the chassis near the microphone, but that is not very practical.

The Ugly

So you want to play Science@NASA? Sure, we can arrange that. Which of the two copies of the first episode do you want?
Oh, this might sound like Evils Toy, but it's really Science@NASA. Honest. The cover art? Never mind that. I know what this is. The meta-data told me so.
You want to play something else?
One of these database entries is the actual podcast episode you're looking for, and I'm not telling you which!

Occasionally, after having uploaded a lot of new tracks to the D2, some or all of the meta-data are completely wrong. Sometimes all or nearly all of the tracks have no artist/title tags (they appear as Unknown), other times you get the artist and track names of the wrong album. In addition, when the device is in this kind of state, it is prone to lock up simply by trying to play specific songs.

I tried to initialize it to factory default according to the procedure in the knowledge base, but that didn't help with restoring the broken meta-data. The only thing that worked was to re-upload all affected files to the device.

Since the D2 takes a bit longer to boot after I've uploaded data to it, I suppose it is building some kind of master index that gets easily corrupted.

Needless to say, this firmware bug is very annoying, because I usually load a lot of new tracks onto the D2 just before I'm leaving somewhere. That is when the bug is most likely to happen, and I can't fix it before I get back to the computer so I can re-upload the tracks.

I'm sorry, Cowon, but you really need to do more QA on your firmware. As it is now, I cannot recommend buying the D2.

[Saturday, Jun 28, 2008 @ 23:06] | [] | # | G

arj.nvg.org takes to the sea

Summer has begun, and I'm fed up with the old look of my home page. Not only is black-on-white sooo 2004, but the CSS was a shoddy cut-and-paste job from a how-to web site that cared way too much about supporting bugs in legacy browsers, and way too little about liquid layout, simplicity, and portability.

So I sat down with some new tutorials, and redid the style sheet with beautiful floating boxes in as simple CSS code as I could manage. At the suggestion of Taliesin, the creator of the excellent CALS site, I used Colorhunter as an aid to select the colour scheme.

I had imagined a particular kind of steely blue sea in the header, so I typed “stormy sea” into Flickr's advanced search page, filtering for pictures licenced under Creative Commons. In less than five minutes, I had found a perfect fit — the photo by Anne Ruthmann that you see above — cropped and resized it in Gimp, and set it as the background for the H1 element. Salty!

The new layout should work in any browser, and you should be able to look at it in a maximized window on a screen width of up to 1600 pixels before the header starts to look funny. If you have Firefox or Safari, you will even see the rounded corners on the boxes, which is a preview of the border-radius feature that is slated for inclusion in CSS3. Please let me know if something looks wrong.

I have two more posts in the works, and both have to do with digital audio. After that, I may or may not go on blogging hiatus again. Until then: stay subscribed. :-)

[Friday, Jun 27, 2008 @ 23:35] | [/web] | # | G

Building an ALSA pipeline out of software that insists on outputting to a real MIDI port

Recently I've had a problem for which there was no readily available answer on Google. If you found this through a web search, I hope the following will be of help. I have to stress, however, that my understanding of ALSA is quite superficial, and the solution that is presented here may have worked for the wrong reasons.

What I was trying to do, was to do keyjazz on vkeybd, feed the MIDI events into QMidiArp (an arpeggiator), and use the arpeggiated sequence as input to Alsa Modular Synthesizer (Ingen seems to be more powerful and easier to use, but it has some... issues, that prevent me from running it successfully).

QMidiArp seems to be the software arpeggiator on Linux, but unfortunately, it wants to talk to ALSA MIDI interfaces. That is, it will only transmit events to /snd/seq or whatever, where an actual hardware synthesizer should be connected. Patchage shows no output streams that can be subscribed on QMidiArp, only the input (which can easily be connected to vkeyb).

It was part 10 of the Linux MIDI howto that spurred me on to a solution. There is a program called aconnectgui (available in the Debian/Ubuntu package of the same name) that, unlike Patchage, will show you the outputs that correspond to hardware devices. Just start it up (after you have started all the programs that will be in the pipeline), connect the output of vkeybd to the input of QMidiArp, connect the first output of QMidiArp (the one corresponding to ALSA port 0) to the input of ams, and there you go!

[Sunday, Mar 23, 2008 @ 14:11] | [] | # | G

You can't code Python with pencil and paper

The fact that Python uses indentation to indicate block levels is mostly a good idea, but how does one sketch code longhand in a reliable way? You'd have to use squared paper for that.

[Friday, Mar 31, 2006 @ 15:55] | [] | # | G

Programming languages created by women

The relationship between programming languages and facial hair is well-known. When the author has a full beard, the programming language tends to be successful in the industry for decades. When the author is clean-shaven, the programming language tends to be lean, beautiful — and very rarely used for practical purposes. The truly bizarre and perverse languages (such as Perl) tend to be created by guys with moustaches.

So one day I was thinking — COBOL has certain stereotypes associated with it: it is very verbose and full of declarations, it is almost bureacratic in nature. And it is associated with a woman, Grace Murray Hopper (although, as I later found out, she didn't actually create it herself). Do other programming languages created by women have yet other amusing commonalities, similar to those Tamir Khason pointed out with respect to facial hair?

There aren't a lot of those languages, for sure. The lack of woman-made programming languages reflect a skewed gender distribution in computer science, and in science in general. However, with the help of John Cowan (who is quite knowledgeable about almost everything), and others, I have found the following:

  • FLOW-MATIC was written by Grace Murray Hopper. (Thanks to Jay Kominek for pointing this out.)
  • FORMAC was written by Jean E. Sammet.
  • COBOL wasn't actually written by Grace Murray Hopper — although it was very much influenced by her FLOW-MATIC. However, Jean E. Sammet sat in the committee that specified COBOL.
  • Icon was created by husband-and-wife team Ralph E. Griswold and Madge T. Griswold.
So there it is, programming languages created by women. All four of them. That's altogether too few to say anything interesting about it, but at least now it's collected in one place, on the web and searchable for ever. If anyone knows of any additional ones, please let me know, and I'll update the list.

[Thursday, Feb 09, 2006 @ 22:39] | [] | # | G

Lorsta Bø lives on!

This just in:

The Norwegian Loran C stations will not be shut down on January 1st after all, as I said they would be in my previous post.

The Norwegian government announced today that they are going to propose to the Parliament that the Loran C stations at Jan Mayen, Berlevåg, Bø and Værlandet are to be kept operative throughout 2006. By doing this, they are bowing to pressure from several European countries who want to have Loran C remain as a backup system in case GPS fails.

Links to news stories (in Norwegian): NRK Nordland, Vesterålen Online

[Friday, Dec 09, 2005 @ 18:48] | [] | # | G

Technological nostalgia

One of the things I have come to enjoy in Pirbadet (Trondheim's newest and largest swimming pool) is the fountains or showers that spray warm water in the small north-eastern pool. Whenever I stand under them with my head touching the surface of the water, I get a soothing sense of 里心[?]. This is because the splashing of the shower when it hits the surface of the water sounds almost exactly the same as the clattering noise of Loran-C.

Due to the proximity to the Loran-C station at Bø, this is a ubiquitous sound back home. It can be received on long-wave radios on frequencies far above its nominal 100 kHz. In the days of analogue telephone, RFI was a constant annoyance to those who lived within a 10 km radius of the antenna. Even when not audible, it affected modem users.

I miss it. And it is going to be a sad day when Lorsta Bø is shut down on January 1, 2006. But technology must progress, I suppose. This is the age of the GPS, and Loran is no longer a necessary navigation aid.

[Friday, Nov 25, 2005 @ 11:33] | [] | # | G

TADS files for Norwegian

The discussion on an old blog posting on IFComp 2003 by Huftis mentions the fact that there are very few Norwegian text adventures known. As I read this, I realized in horror that I have had fully working TADS libraries on my hard drive since at least 2003 (or maybe even 2001), and I haven't shared them with anyone!

So, here they are. No rights reserved, except as mandated by the TADS licence.

They are based on the libraries for TADS version 2.5.5, so they are a little bit outdated. That's the downside of translating these things. But I have tested them with version 2.5.8 on Linux, and my little test game compiled nicely (except for a few warnings that seemed to make no difference).

I hope there will be many many Norwegian TADS games in the coming years, to make up for my sin of not releasing this right away.

[Wednesday, Mar 09, 2005 @ 17:06] | [] | # | G

Thank you, Poland!

Thank you, Poland!

[Tuesday, Dec 28, 2004 @ 15:57] | [] | # | G

Migrating from GreyMatter to Pyblosxom

The transition from GreyMatter to Pyblosxom was not entirely painless, though much easier than I had expected. CGI installation was a breeze (although it took me a while to figure out that even though the installation doc did not say anything about moving other files than pyblosxom.cgi and config.py into the CGI directory, Pyblosxom actually consists of a small suite of scripts whose path has to be specified in config.py.

Then came the whole business with URL rewriting. Having URLs like http://arj.nvg.org/pyblosxom.cgi/path/to/blog_entry.html looks ugly, and I'm not sure it is even compliant with the relevant URI standards to have pyblosxom.cgi as anything else than a directory in this case. So I wanted to redirect http://arj.nvg.org/path/to/blog_entry.txt to the pyblosxom script, but only if it does not exist as a regular file.

The solution I found (after reading up on mod_rewrite a while, and various swear words) was adding the following to my top level (but not sitewide) .htaccess:

RewriteEngine on

# If the requested file or directory does not exist
RewriteCond %{REQUEST_FILENAME} !-F
# Try serving it through Pyblosxom
RewriteRule ^(.*)$ /pyblosxom.cgi/$0 [L]

# Replace index.html with Pyblosxom
RewriteRule ^$ /pyblosxom.cgi [L]

Porting the visual layout was not very difficult, either. The "templates" in GreyMatter are quite similar to those in Pyblosxom, so I only had to retrieve them from the web interface and paste them together into Pyblosxom flavour files. Besides, most of the work was done in standalone CSS files anyway.

I opted not to write an import script, since I only had 8 entries in my old blog. Instead, I downloaded the source from the web interface, and inserted <p> and </p> where necessary. Non-Western text in Unicode was troubling, however. GreyMatter stores such characters in a puzzling internal format. After having given up typing the Russian word язык in on emacs, Yudit and KEdit, I pasted it from the web browser to Yudit.

[Tuesday, Dec 21, 2004 @ 17:34] | [/web] | # | G

Help stop software patents in the EEA!

NO E-patents!

[Monday, Oct 04, 2004 @ 20:24] | [] | # | G

Welcome to the World Wide Web. Anything you say, can and will be used against you.

Google indexes a lot of web pages. Probably all the ones you've ever produced, and most of those who mention your name.

*Roots through ~/www/ to find and remove things he wouldn't want his future employers to find out about, before the Internet Archive gets hold of it*

[Monday, Sep 15, 2003 @ 20:38] | [/web] | # | G

You know you've been programming TADS too much when...

You know you've been programming TADS too much when you don't move the furniture before vacuuming the floor, because you assume that they are fixeditems.

[Friday, Jun 20, 2003 @ 23:40] | [] | # | G