Monday, October 17, 2011

Amazon Video

If you're a linux user and a Netflix user frustrated by Netflix refusal to release a player compatible w/ linux, look into Amazon's offering - so far the unlimited watch (with a prime account) show selection is somewhat limited when compared to netflix's catalog, but what is available works perfectly... Much better than Netflix running in a windows virtualbox in my experience...

Tuesday, October 11, 2011

Stream Audio to Airport Express from Ubuntu...


Some time ago I posted here about how to stream sound from a Mac to an Airport Express router, but lately I've moved to working in Ubuntu Linux, so I needed to tweak my procedure...

At some point this whole mess will be obsolete, because there already exists a PulseAudio module implementing the RAOP as a sound device, so you can direct sound from your system as a whole or an application out to your airport express... however, so far, on my installation (Ubuntu 11.04 and lately 11.10 beta) it's buggy and doesn't work well at all for me.  I experimented with playing music from iTunes in a virtualbox installation of Win7, but, while it worked alright, the music would pause every minute or so - irritating... The setup I'm describing here works quite well for me...

I decided to try to set this up using much the same structure as I used for the mac hack, so I'm grabbing the sound feed from the machine and piping it into JustePort (running in mono since it's a .NET executable) which handles sending it to the airport express router.  This turned out to be pretty simple once I figured out what device to grab the sound from and how to spew it down the pipe (since Ubuntu isn't using ESD)...

What you need to do is grab the output channel monitor which you should be able to determine by looking at the results from:
pactl list | grep monitor
which will return some results which look something like:
Monitor Source: alsa_output.pci-0000_00_1b.0.analog-stereo.monitor
Name: alsa_output.pci-0000_00_1b.0.analog-stereo.monitor 
            device.class = "monitor"

Now, using parec, on the monitor device we just determined, we can send raw sound data wherever we need it like this...
parec -d alsa_output.pci-0000_00_1b.0.analog-stereo.monitor
which we can then pipe through JustePort.exe to the airport express. Like so:

parec -d alsa_output.pci-0000_00_1b.0.analog-stereo.monitor | mono ~/bin/JustePort.exe - 192.168.1.100 -0
  To break that down a bit...
parec -d alsa_output.pci-0000_00_1b.0.analog-stereo.monitor | mono path/to/JustePort.exe - 192.168.1.100 -0
reads the sound data from the monitor
pipe to send it to JustePort
runs JustPort using mono
input to JustePort is stdin (from the pipe)
IP of the airport express router
Volume in -dB - (I find this connection is quieter than the dvd player attached directly to the stereo, so I crank this all the way to 0 rather than allowing it to stay at the default of -30)

There are a couple of downsides to this technique...
  • there is a lot of latency (a couple of seconds at first, but it seems to grow over time, like the buffer is filled faster than it empties).
  • all sounds from the computer will be sent, not just your music - I'm sure this would be fixable by some more advanced work (I'd love to create a virtual device just for this purpose)
You'll gain some insight and on-board volume control through the use of  pavucontrol...

Thursday, September 15, 2011

Netflix freezing on Virtualbox? Try different DNS settings...

Looking for a way to run "Watch Instantly" on my linux box (since I hated having to reboot into Windows just to watch a show, I virtualized my Win 7 installation using vmware's standalone converter.  I was never able to try running this virtualized windows on vmware server, due I think to issues with 64 bit firefox not being able to install vmware's plugin - no worries, I created a virtualbox VM booting off of the converted virtual drive, et viola - I could watch Netflix... kinda.


Problem was, that Netflix would lock up within seconds or minutes, halting all playback.  Reloading the page would start the video again (not exactly where I left off - usually back a bit) but it basically rendered netflix unusable... not cool. I tried reinstalling Silverlight, and a few tweaks to the VM configuration, but to no avail... further googling indicated that perhaps DNS settings could lead to lock ups like I was seeing (though that makes no sense to me).  I set Ubuntu to use Google's dns servers (8.8.8.8, 8.8.4.4) and amazingly, this seems to have fixed my problems - at least for today.  I'll update here if this setup starts to fail...

Tuesday, July 12, 2011

Kupfer Focus Fix...

So, this blog has been semi-abandoned for a long time, but since it's my de-facto tech blog, and I found a novel fix to something, I figured I'd post up...

So I'm no longer running OS X, (as I'm sure you gathered since you got to this post by searching for kupfer focus),  and am loving the Natty Narwhal (Ubuntu GNU/linux 11.04). Found a great app called Kupfer which duplicates Quicksilver's functionality... very handy - invoke the app with a hot key and quickly launch an app/document/song/etc. with a few quick keystrokes.

Super cool but I found that on any later presses of my hotkey combo, kupfer would indeed launch, but focus would not shift to it's window, so keystrokes would still go to the last focused app (pretty much eliminating the advantage of kupfer since I'd have to use the mouse to focus the window and at that point I could probably just have launched the app or document the traditional GUI manner). After trying to focus the kupfer window with  xwit and wmctrl (failures for me, though someone who knows what they're doing would possibly have more luck) I thought why not just launch a new instance of Kupfer every time I want to use it... simple, just made a shell script which kills any current instance of Kupfer, and then launches it anew, allowing it to live for 45 seconds before killing it for good and exiting:
#!/bin/sh
killall kupfer
kupfer &
sleep 45
killall kupfer
Made that script executable and call that with the hot key combo - works every time...


 Update: Heh - a couple of days later, I found Gnome Do... Focus works properly.