Between Linux and Anime

Kind of like Schrodinger's Cat

Playing .asx streaming radio/media on Linux

So I sampled a teaser snippet of To Aru “Radio” no Railgun over at Keiri’s place. (for the uninitiated, that’s To Aru Kagaku no Railgun‘s web radio show co-hosted by the Seiyuu’s of Saten and Uiharu) Being completely suckered by it, I trotted down to Hibiki Radio hoping to give the real thing a spin… only to find that I couldn’t play it on Linux.

So what else is new :(

Anyway before I continue my story I should probably state up front here that I didn’t manage to find a “complete”, “elegant” solution, so if you’re a perfectionist you should probably be looking elsewhere. If you’re just desperate to play that damn .asx radio stream though (as I was), read on.

So I spent a whole morning trying to persuade mplayer to play me Radio no Railgun. The mplayer Firefox plugin refused to work, so I did the next best thing any desperate hacker would probably do – find and manually download the target media file. If you’ve never done this before, you download it by finding the url of the target media, which you can do either by manually viewing the page source (View > Page Source in Firefox) and doing some sensible searches (say “asx”), or by inspecting the media player area using Firebug if you’re familiar with that. Anyway the file I downloaded turns out to be an ‘asx’ file, which I later found out is a Microsoft (oh surprise) stream redirector format.

Scouring the Internet I discovered that you could apparently get mplayer to play asx by doing

mplayer -playlist YOUR_FILE.asx

But doing that on Hibiki Radio’s asx yielded an error like the following:

Server returned 302:Found
Failed to parse header.
Failed, exiting.

It looks like mplayer is unable to handle a HTTP 302 redirect! And no amount of nudging and attempting of random stuff would make the asx file play.

Finally, in despair and completely out of ideas, I installed VLC as a last ditch attempt.

and it worked!!

*shrug* Anyway so there you go. Two things to try if you want to play asx on Linux:

  • mplayer -playlist yourfile.asx
  • If that doesn’t work, try VLC.

VLC isn’t my favourite media player either, but looks like it one-upped mplayer for this one. Look in your software package manager for VLC and install it. Then just open the file with it, or do

vlc YOUR_FILE.asx

Here’s a screeny of VLC finally playing me my Radio no Railgun:

Mina-san~ Biribiri!

Of course, after this victory I immediately tried replacing the mplayer Firefox plugin with the VLC one, hoping it’ll let me listen directly from the Hibiki Radio site without needing to download the file. No luck. *sigh*

Oh well, I can live with downloading the file then playing it. And Radio no Railgun was fun stuff by the way, although I probably only understood about 30% of the 38 minutes, thanks to my yowai moonspeak and their bullet-speed conversations :P

Edit: It should have been immediately obvious to me (I must not have been feeling too well that day), but you don’t actually need to download the file to play it. You just need to source out the url, then you can play it directly by doing

vlc http://url/to/file.asx

Rate this post
An error occurred!

  • Facebook
  • Twitter
  • Delicious
  • Digg
  • StumbleUpon
  • Add to favorites
  • RSS
  • Reddit


K-ON 14 ~ the OVA that came outta nowhere


PlasMate ~ Project Management and Other Goodies


  1. What’s wrong with VLC? D: It’s cross-platform, it’ has a Qt interface, and plays everything I threw at it… except the Apple keynotes, bummer (they do start playing but it stutters, then segfaults halfway through).

  2. Jason "moofang"

    What’s wrong with VLC? D:

    Nothing much I admit ^^; Just happens that when I first started exploring linux media players (years ago now) mplayer came on more naturally for me than VLC did. Since then mplayer has done a really good job catering to all kinds of my needs, especially with playing badly encoded media (which default players and VLC didn’t do so well back in the day), so I’ve come to be a bit religious in keeping mplayer as my primary media player.

    This is the first time I’m using VLC in a good while, so maybe it’s amazing now and I just don’t know it :) The Qt front-end is also sweet but somehow I still like the looks (I’m superficial, sue me) of smplayer and kmplayer better.

  3. VLC – the player of the beast! The audio output is terrible =.=” and subtitle rendering is meh =.=;

    The trick here is open the ASX with text editor then you will see an entry like this . Then mplayer mms:// .

    Enjoy, :)

  4. Jason "moofang"

    @ idyllictux : you really underestimate me. I did that, didn’t work. I said I spent a whole morning on mplayer – I wasn’t just staring at it :)

    And the audio output for this particular use-case at least, was excellent.

  5. Right, We have to do one more iteration due to referencing:

    See the http link?
    cat 100122rg_aoa.wma

    You will see

    mplayer (or add into playlist both)

    Enjoy your fix.

  6. Jason "moofang"

    Good job, I’m a little ashamed that I didn’t go that far. But forgive my nitpicking, that isn’t a fix by a long shot, you’re working around mplayer’s inability to redirect by doing the redirect manually. Would be too much trouble to be a solution one could use regularly, and it’s not clear if you could script it at this point. VLC does it directly on the asx, so there’s really no competition there :)

  7. Playing .asx streaming radio/media on Linux ? Between Linux and Anime

Leave a Reply

Powered by WordPress & Theme by Anders Norén