Tuesday 12 December 2006

Bangkok Thailand

Well, I'm safely in Thailand.. sitting at the conference right now, on conference computers. We have no wireless, and can't plug our own computers in.

Bangkok, is, well, I'm going to reserve judgement for another time. I'm trying to separate culture shock from Bangkok shock. It's.. interesting. I'll leave it at that.

We did some touristy stuff on Monday... I'll write more about that, and post pictures when I get home.. it's conference time now.. yay!


Yea, so I forgot to update this. Basically, had a blast in Thailand. We saw the royal palace, saw a temple, had a ride up the river on a boat... Went to the weekend market.. bought stuff.. ate stuff.. went clubbing.. and just had a great time. The purchase power of the dollar is fantastic. Pictures.

Friday 1 December 2006

Christmas Wish List

What geek would be complete without posting a wish list? :)

  • A multimeter (preferably one I don't have to shake to make the ohmmeter part work, at the time of writing it's 2am, and I just disassembled and reassembled my stove to fix a faulty door switch)
  • Any of Cam's top 11 geek games.. (Have settlers and the fu variety of munchkin.. aka "munchkin fu")
  • A non-teflon wok, a pack of bamboo chopsticks, vegetable steamers
  • A new set of pots.. actually.. a set of pots. I own 2 pots, only my tiny one has a lid.. the other is really a deep skillet.
  • A KitchenAid Stand mixer (yeah right, they cost like $400 )
  • Sushi Rollers
  • A new camera.. my Canon G1 is 5.5 years old, and had about 6 dead pixels on the CCD. The SD800IS . Hey, this is a _wish_ list.. right? NOT the SD900, it has a stupid number of megapixels on the same small CCD, with no image stabilizer (IS).. the 800 has a better lens too :)
  • A bread pan from "The West Bend Company" (do they even exist?) I have 3 bread pans from them, but Grandma's bread recipe makes 4 loaves. I want the 4th one to stack with those 3.
  • A clothes iron (and ironing board, but that would be hard to transport back to Vancouver :) )
  • A sewing machine
  • More to come.....

Sunday 26 November 2006

JACK Audio with OSS

I have JACK.. and it works, except for 32bit apps, and any app that only has OSS support.. which unfortunately are the 32bit apps. However, I did manage to get OSS working in 64bit mode... an unlimited number of 64bit OSS apps can connect to my JACK server.

First, the way you do it is with a program called oss2jack (http://fort2.xdas.com/~kor/oss2jack/). It works by adding 2 components to the system. One is a kernel module that can create userland character devices on demand. The other is a program that acts as a JACK client, and bridges the userland character devices (/dev/dsp?) with the JACK server.

Unfortunate, life is never simple. And the latest fusd (the userland character device kernel module) doesn't work with the latest 2.6.19 kernels.. So, here is a patch: fusd-kor-1.10-11-linux-2.6.19.patch

JACK Audio

I found myself some free time between research and other work stuff. I played with JACK audio on my AMD64 system (http://www.jackaudio.org). In my opinion there are 3 things that GNU/Linux sux0rs at.. Audio, Printing, and Installing. Each one is a black art. JACK audio is yet another audio server, but it has a twist, it was designed and written to have zero-to-low latency. The server eats up 0.25% of my processor when it's running and I can't detect any latency (unlike some other sound daemons with several K buffers).
Jack shows some promise, it's installing it on an AMD64 system is probably my first mistake, since nothing works on AMD64 right away.. My second mistake is that I have 2 soundcards, and I'd like to use both of them. Problem, the JACK daemon supports one soundcard.. you have to run one daemon for each soundcard. Problem, JACK daemons don't talk to each other.

One of the reasons I took a liking to JACK was what it lets you do with connections. A GUI app like qjackctl (http://qjackctl.sourceforge.net/) can connect and disconnect apps to various sound interfaces while running. I can start playing an MP3, then disconnect the left, right, or both channels from my "sound card". My sound card is just an object that accepts a sound stream. Other objects that accept sound streams are, for example, Audacity (http://audacity.sourceforge.net/) so I can redirect the MP3 into Audacity. The music player is just a sound source, so is the MIC input.. you get the idea. Using this sort of system you can chain applications together, duplicate input or output, and generally be in total control of your sound. /me likes.

But I'm a special user, I have 2 sound cards (a 5.1 dolby system connected to an SB Audigy, and an el-cheapo AC'97 onboard jobbie connected to my headset earphone and mic). It would sure be nice to be able to redirect the output of any app to _either_ sound card, from a single interfece.. or redirect my headset MIC input to my 5.1 speakers (well, that's not very common, but I succeeded!, read on.)

I run Gentoo, JACK installed out of the box (emerge jack-audio-connection-kit). qjackctl also installed out of the box (emerge qjackctl). Fire up the GUI, set the driver to ALSA (JACK uses ALSA to actually talk to the sound hardware, it doesn't re-implement all the individual sound card drivers, that would be silly). Set my device to hw:1,0 (second sound card, the 5.1 system). And start the daemon. Recompile the various apps to use JACK.. and presto, sound works. Now, I actually followed the realtime guide too, so I could have the server running in realtime mode. I like my sound to be skip free, even when under load.

So what, when does the fun start? Well, I have spent many hours searching for a solution to use multiple sound cards. Everything I have read says the "best" solution is to combine multiple sound cards into one virtual card with 4 channels, instead of 2, and just use one JACK daemon. That's great, except first of all I couldn't get it to work, second, I don't want one big virtual sound cards, I have a 5.1 system and a headset, I want 2 separate cards.

I know I can run 2 JACK daemons, one for each card.. so, all I really need is a bridge. Something that registers itself as a client in both daemons, and just shunts sound back and forth. So I can do all the sound redirection in a single qjackctl window... and so I don't have to tell individual apps which JACK daemon to connect to, they all connect to the same one.
And here is my first crack at it: jack_bridge.c

There is a "master" daemon, and the "slave" daemon. The bridge connects to the slave JACK daemon, and just steals all MIC input, and forwards anything it gets to the speaker output. The bridge also connects to the master daemon, but doesn't do any stealing of signals, it just gives itself a name (I use "Headset" as the client name). In the qjackctl that is talking to the "master" daemon, I can create a connection between any app and "Headset", and the bridge accepts data from the master JACK daemon, and writes it to the slave JACK daemon.. which forwards it to the speakers which is actually the headset. Same for the MIC, only backwards.

It's not perfect, there is an audible ticking sound.. I don't think i'm transporting the data "real-time" enough.. sounds like it's playing just slightly too fast, creating a momentary break in the audio where there is no data.. no idea how to fix that yet :( .. but it works. :)

Monday 31 July 2006

SCO+ELF = video!

Alrighty, I just read the latest SCO+ELF on groklaw.. Great site, thanks PJ. Here is the article:

For fun, I made a video of me downloading binutils and checking out the license. It's about 20megs, completely unprocessed.

xvidcap is a neat little tool. Just remember to set your output file to "something.mpeg", instead of "file-%d.xwd". xvidcap can write directly to an mpeg stream, no need to write separate images.

Wednesday 12 July 2006