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] | [tech] |
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:
- Going to the official NASA TV home page
- 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.
- Googling for “nasa tv linux” and coming up blank.
- 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:
- 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.
which I then pasted into a terminal, and trimmed out the superfluous bits, leaving only the .asx
[Monday, Aug 24, 2009 @ 22:10] | [tech] |
Podcasts for geeks
One of the first things I set out to do after I got my Cowon D2 was to seek out some new podcasts. Podcasts are all the rage around the internets these days, but if you have been living in a cave the past years, here is a short update:
A podcast is like a radio series, except you subscribe to it with a web feed (or equivalent) and get each new episode on your computer, which you usually then upload to your portable media player.
So, where do you find podcasts to subscribe to? Well, if you know exactly what you're looking for, you can just go to a search engine and type in something like model railroad podcast, if you're interested in model railroads. Chances are that, whatever your interests are, someone has made a show about it.
If you want to get an idea of what kinds of podcasts are out there, you can browse sites such as PodcastDirectory.
Here are some of the podcasts that I listen to on a regular basis.
This is a professionally produced 50-minute weekly program about various scientific subjects. Even though it's produced by the SETI Institute, SETI is only occasionally a subject. This is my absolute favourite; if you check out only one of the podcasts on my list, this should be it.
This monthly podcast presents some of the latest findings in neuroscience research in a popular format.
When I first discovered this podcast in the Podcast Directory, I expected something along the lines of NeuroPod. But the two podcasts could not have been more different. Whereas NeuroPod has a pop-sci approach to the frontlines of research, STAT! is made by doctors, for doctors, and has a practical, clinical focus. The typical episode of STAT! is an in-depth discussion of subjects such as what you ahould do if a patient comes into your office with a TIA. Nevertheless, I found this podcast utterly fascinating, and if you can get over the jargon (this was probably the first time I heard the word “iatrogenic” spoken), I warmly recommend it.
Unfortunately, it seems that this podcast has been discontinued, or put on ice: the latest episode available was published on April 6th, 2008.
This is another clinical podcast, which “strives to bring you the latest information about dental technology and clinical techniques”. I find dentistry a fascinating subject, partly because almost everyone goes to the dentist once in a while, but few people know much about what they do and why they do it.
Irregularly published short news stories from NASA, about 3 to 10 minutes each. A slight degree of hum, but you only really notice it when the episode ends.
The first draft of this entry included a recommendation of Eirik Newth's science podcast Superstreng. Unfortunately, since then I received the dismaying news that it has ceased production. (Actually, it was not primarily a podcast, but a show on Radio Norge that also appeared as a podcast a couple of days letter, often with additional material. Radio Norge is apparently no longer interested in airing the show.) But if you can understand Norwegian, all 118 episodes are still available for download at the Superstreng site.
[Saturday, Sep 13, 2008 @ 23:13] | [reviews] |
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.
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 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.
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] | [tech] |
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] | [tech/web] |
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] | [tech] |
It's been about a year and a half since Mark Shoulson and I started trying to make a program that could compile blazons into graphics. This is not a new concept — Robert Billard wrote a quite powerful blazonry program for Windows called BLAZONS! (which no longer seems to be supported, alas). As early as 1994, Daniel V. Klein suggested blazonry as a forerunner of graphic definition languages in his USENIX talk From Blazons to Postscript.
Finally, the blazonry compiler, which we have called pyBlazon, has gotten to a state where it is not directly embarrassing to show to people. Last Sunday, Mark posted an announcement to the sca_heralds LiveJournal community, with a link to the project's makeshift homepage and online demonstrator.
Currently we are hashing out which free licence we are going to release it under, and Mark is preparing to host the project on Google Code.
Some points of note:
- Blazonry as a formal jargon may at first glance seem completely rigid and well-defined, but in fact it is large and open-ended. None of us are artists, so a rule of thumb is: if it can be made with just a few SVG primitives, we have it; if you have to draw it in a vector drawing program, we don't. So don't expect the compiler to know what bears, reindeer or horses are. Also, there is no ISO or W3C of heraldry that tells you which charges you can or cannot use, and people invent their own freely. To make a drawing of a “winged sea centaur” (as in the arms of Stephen Coombs) without ever having seen one, you basically have to be a human or have super duper body-part exchange algorithms.
- Also because of impatience, we are using the somewhat underpowered PLY library for parsing (a yacc/lex clone for Python) rather than doing the right thing from the beginning and using something like ANTLR. This means that some perfectly-valid blazons will not work, and have to be reworded. More details under Known Issues on the project page.
- Some arms still look horrible, either because they are basically a special case, or because they are plain old bugs. An example of the former is ermine fretty gules; an example of the latter is azure within a bordure invected argent.
- The SVG is very hairy. Basically, we are wrapping stuff into many layers of
transforms rather than rewriting the SVG in memory, simply because that's easier and makes for rapid prototyping. The upshot of this is that not every program that claims to be able to display SVG can render the output of the blazonry compiler properly. Currently, only rsvg is guaranteed to work in all cases. Batik and Opera also does a favourable job. Mozilla Firefox? Forget it.
[Friday, Mar 07, 2008 @ 20:03] | [language] |
Answers part 3: Short takes
In libraries, do they put the bible in the fiction or non-fiction section?
They put it in the non-fiction section. In the Dewey Decimal Classification, it's sorted under 220.
If a king is gay and marries another guy what is that guy to the royal family?
If a queen regent marries a guy, he usually becomes a prince. I suppose that if this were to happen, the same would be the case. Note that the only monarchies that have same-sex marriage are the Netherlands, Belgium, and Spain. None of these have an unmarried king or an unmarried crown prince.
If croutons are stale bread, why do they come in airtight packages?
To keep them from getting soft.
Why do birds bob their heads when they walk?
Because their eyes point to the side, instead of straight forward like our eyes do. Bobbing their heads keeps the image on the retinas still for long enough that they can perceive it.
If nobody buys a ticket to a movie do they still show it?
No, why should they? Showing a film requires work: the projectionist has to calibrate the projector and change the reels. There is no reason for a cinema to incur those costs if they don't get any income from it.
I remember one time back home, years ago, when I was one of only three people showed up at the cinema and bought tickets for the film. The manager decided to call it off, and refund everyone's tickets.
What shape is the sky?
It is shaped like a dome.
[Tuesday, May 15, 2007 @ 13:08] | [answers] |
Answers, part 2: Atheists in court
This time we look at three questions from Crazythoughts.com that all have to do with the practice of having witnesses swear on the Bible before they testify. Practices on this vary throughout the civilised world, so for the sake of simplicity, the answers will be a bit U.S./Common Law-centric.
When Atheists go to Court, they can't swear on the bible, can they?
They can, but they can also refuse. Usually, they are given the opportunity to make a solemn affirmation instead. Statements given under affirmation have the same legal effects as statements given under oath, in that both kinds of statements carry the penalty of perjury.
Does it really count in court when an atheist is sworn in under oath using a Bible?
According to Pittsburgh Post-Gazette, in 1993 the U.S. Supreme Court upheld a testimony by an Atheist who swore to God. In earlier times, this was not so. Irreligious people were routinely barred from testifying in court, since it was believed that, since they did not fear punishment in the afterlife, they could not be trusted to tell the truth. As late as 1939, five U.S. states and the District of Columbia excluded the testimony of people who declared themselves to be atheists.
If a Jewish person goes to court and is asked to put their right hand on the Bible, do they use a Torah instead?
Observant Jews cannot swear because their religion prohibits them from doing so. Instead, they make an affirmation.
[Thursday, May 10, 2007 @ 17:21] | [answers] |
Another reverse dictionary
The Internet oldtimers among you might remember Casey's Snow Day Reverse Dictionary, an online service that was able to suggest a word if you typed its definition (Wayback machine link). Unfortunately, that web page has long since disappeared, and was last seen some time in 2003. It was a great help for word troubles, and I have missed it. Roget's thesaurus helps, but only to a certain extent.
Recently, I discovered OneLook's reverse dictionary, which seems to be a very good replacement. Or what do you think of these examples?
Of course, if you feed it strange queries, the results might be a bit odd (but in this particular case we Babylon 5 fans tend to agree).
[Thursday, May 10, 2007 @ 14:38] | [language] |
Answers part 1: If we had a president that was a woman, would her husband be the first man?
Hello there. I haven't posted here for quite some time, but by popular demand, I have decided to get going again. I now begin a series of blog posts that give answers to some of the questions from Crazythoughts.com. In the first installment, we look at a seemingly innocuous question concerning U.S. politics.
If we had a president that was a woman, would her husband be the first man?
Even though many people think so, the wife of the President of the United States does not become First Lady ex officio, so to speak. Strictly speaking, the title First Lady of the United States refers to the hostess of the White House. Usually, the wife of the President and the First Lady have been one and the same, but as Wikipedia says, many First Ladies were not the President's Wife.
Nevertheless, if a woman were to become President, the press and the public would likely refer to her husband as First Gentleman, as has indeed happened to some husbands of U.S. Governors.
[Friday, May 04, 2007 @ 15:13] | [answers] |
The sun is that far away?
The slogan for this tanning studio says Our only competitor is 930 million kilometers away.
Yes indeed. The Norwegian mil is equal to ten kilometers. Presumably, the competitor to which they refer is probably the Sun — which is roughly 150 million kilometers away, or about 93 million imperial miles.
The UltraSun chain doesn't appear to be active in any English-speaking country, which makes the use of imperial units in Norwegian all the more odd, since it can't be attributed simply to a careless translation of some English slogan.
[Tuesday, Jul 04, 2006 @ 10:02] | [miscellaneous] |
Kakebaking som straff
Da jeg lette gjennom bokhylla for å finne noe å lese på før jeg gikk og la meg i går kveld, fant jeg noen sammenstiftede A4-ark klemt inn mellom to tidsskriftkassetter. Den tynne blekka viste seg å være utkast til samarbeidsavtale for EiT-gruppa vår fra 2004.
Den såkalte samarbeidsavtalen brukes visst fremdeles i Eksperter i Team. EiT er jo et temmelig spesielt fag i universitetssammenheng, siden alle på hver gruppe får samme karakter. Det er derfor viktig å sørge for at arbeidet blir rettferdig fordelt, og at eventuelle konflikter blir løst før de fører til at grunnlaget for karaktersetting faller bort. Hensikten med samarbeidsavtalen er å regulere dette, men forslaget til standard avtale beskrev et rigid kontrollregime av en annen verden (dette ser ut til å være den nåværende versjonen, men slik jeg husker det fra 2004 var det enda verre). Gruppa vår bestod av veldig flinke og fornuftige mennesker, så vi radbrakk standardavtalen til den ble akseptabel for oss – og altså helt forskjellig fra den opprinnelige. Jeg skal ikke gå særskilt inn på detaljene, men ville bare dele med dere en paragraf jeg likte spesielt, fordi den var skrevet så bra:
5.1. Tiltak ved mislighold
Kommer man 20 minutter eller mer for sent, skal man servere kake på neste
ordinære møte. Kaken skal ikke inneholde marsipan eller nøtter, skal
inneholde høyst moderate mengder fløtekrem, og det skal være nok til alle.
Kaken skal være hjemmebakt. Subsidiært kan en kake kjøpt på bakeri eller
konditori godtas, såfremt den er av tilsvarende eller høyere kvalitet enn en
Det var ingen som kom for sent i løpet av hele semesteret, så den kom aldri til anvendelse. Dessverre.
[Thursday, May 25, 2006 @ 19:25] | [miscellaneous] |
Yesterday evening I was listening to the podcast of the Norwegian radio programme Språkteigen, which is about the Norwegian language, and language in general. The last topic in the programme from April 6th (mp3, this direct link will probably disappear soon) was creaky voice. After a barrage of examples of creaky voices, a normal voice started reading the following passage:
Knirkestemme eller laryngalisering er en form for fonasjon der arytenoidbruskene i strupehodet dras tettere sammen enn normalt og stemmeleppene strammes ekstra opp. Det gjør at luftgjennomstrømmingen blir lavere og vibrasjonsfrekvensen går ned til omkring 20–50 pulser per sekund.
After the first ten words or so, this started to sound eerily familiar. Hadn't I read that before somewhere? Maybe it was from one of my old phonetics textbooks, but I had doubts that any textbook in Norwegian had this much physiological detail. Then it hit me. The reason it sounded familiar was that I had written it! It was a quote from the article on creaky voice on the Bokmål Wikipedia.
Of course my name wasn't mentioned (Wikipedia articles are written collaboratively, after all), but it sure was fun to hear my own text on national radio!
[Monday, Apr 10, 2006 @ 15:54] | [miscellaneous] |
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] | [tech] |