| Andrew Cooke | Contents | Latest | RSS | Twitter | Previous | Next


Welcome to my blog, which was once a mailing list of the same name and is still generated by mail. Please reply via the "comment" links.

Always interested in offers/projects/new ideas. Eclectic experience in fields like: numerical computing; Python web; Java enterprise; functional languages; GPGPU; SQL databases; etc. Based in Santiago, Chile; telecommute worldwide. CV; email.

Personal Projects

Lepl parser for Python.

Colorless Green.

Photography around Santiago.

SVG experiment.

Professional Portfolio

Calibration of seismometers.

Data access via web services.

Cache rewrite.

Extending OpenSSH.

Last 100 entries

Chinese Govt Intercepts External Web To DDOS github; Numbering Permutations; Teenage Engineering - Low Price Synths; GCHQ Can Do Whatever It Wants; Dublinesque; A Cryptographic SAT Solver; Security Challenges; Word Lists for Crosswords; 3D Printing and Speaker Design; Searchable Snowden Archive; XCode Backdoored; Derived Apps Have Malware (CIA); Rowhammer - Hacking Software Via Hardware (DRAM) Bugs; Immutable SQL Database (Kinda); Tor GPS Tracker; That PyCon Dongle Mess...; ASCII Fluid Dynamics; Brandalism; Table of Shifter, Cassette and Derailleur Compatability; Lenovo Demonstrates How Bad HTTPS Is; Telegraph Owned by HSBC; Smaptop - Sunrise (Music); Equation Group (NSA); UK Torture in NI; And - A Natural Extension To Regexps; This Is The Future Of Religion; The Shazam (Music Matching) Algorithm; Tributes To Lesbian Community From AIDS Survivors; Nice Rust Summary; List of Good Fiction Books; Constructing JSON From Postgres (Part 2); Constructing JSON From Postgres (Part 1); Postgres in Docker; Why Poor Places Are More Diverse; Smart Writing on Graceland; Satire in France; Free Speech in France; MTB Cornering - Where Should We Point Our Thrusters?; Secure Secure Shell; Java Generics over Primitives; 2014 (Charlie Brooker); How I am 7; Neural Nets Applied to Go; Programming, Business, Social Contracts; Distributed Systems for Fun and Profit; XML and Scheme; Internet Radio Stations (Curated List); Solid Data About Placebos; Half of Americans Think Climate Change Is a Sign of the Apocalypse; Saturday Surf Sessions With Juvenile Delinquents; Ssh, tty, stdout and stderr; Feathers falling in a vacuum; Santiago 30m Bike Route; Mapa de Ciclovias en Santiago; How Unreliable is UDP?; SE Santiago 20m Bike Route; Cameron's Rap; Configuring libxml with Eclipse; Reducing Combinatorial Complexity With Occam - AI; Sentidos Comunes (Chilean Online Magazine); Hilary Mantel: The Assassination of Margaret Thatcher - August 6th 1983; NSA Interceptng Gmail During Delivery; General IIR Filters; What's happening with Scala?; Interesting (But Largely Illegible) Typeface; Retiring Essentialism; Poorest in UK, Poorest in N Europe; I Want To Be A Redneck!; Reverse Racism; The Lost Art Of Nomography; IBM Data Center (Photo); Interesting Account Of Gamma Hack; The Most Interesting Audiophile In The World; How did the first world war actually end?; Ky - Restaurant Santiago; The Black Dork Lives!; The UN Requires Unaninmous Decisions; LPIR - Steganography in Practice; How I Am 6; Clear Explanation of Verizon / Level 3 / Netflix; Teenage Girls; Formalising NSA Attacks; Switching Brakes (Tektro Hydraulic); Naim NAP 100 (Power Amp); AKG 550 First Impressions; Facebook manipulates emotions (no really); Map Reduce "No Longer Used" At Google; Removing RAID metadata; New Bike (Good Bike Shop, Santiago Chile); Removing APE Tags in Linux; Compiling Python 3.0 With GCC 4.8; Maven is Amazing; Generating Docs from a GitHub Wiki; Modular Shelves; Bash Best Practices; Good Emergency Gasfiter (Santiago, Chile); Readings in Recent Architecture; Roger Casement; Integrated Information Theory (Or Not); Possibly undefined macro AC_ENABLE_SHARED; Update on Charges; Sunburst Visualisation

© 2006-2013 Andrew Cooke (site) / post authors (content).

Getting Jack Working

From: "andrew cooke" <andrew@...>

Date: Sat, 23 Jun 2007 18:06:20 -0400 (CLT)

Jack (Linux Audio) promises to be the solution to getting streaming audio
working from any source.  These are notes on my attempts to get it

- To start Jack use qjackctl.  This is a KDE GUI app.  It will start and
stop jack for you (the start and stop buttons).  When Jack doesn't start,
click the Message button to see why.

- My first error was about a missing libportaudio18.  While it was
present, it turned out I had the 32 bit library installed (with 64 bit
Jack).  The SUSE dependencies didn't pick this up - you need to look very
carefully at the installed version (click on the tabs bottom right in

- Next error was about /dev/shm/jack-0 already existing.  This seems to be
a permissions thing related to running as root.  So don't run as root.

- Next error was a problem with access rights to /dev/shm (btw /dev/shm
seems to be some kind of dynamic memory thing - don't mess with it, it's
started automatically by SUSE.  If you delete the shm directory the best
way to get it back is reboot; mkdir doesn't seem to do the right thing). 
I fixed that with chmod 666 /dev/shm/jack-shm-registry (as root)

- Next error indicated that realtime play wasn't possible.  You can
disable this in qjackctl's "setup" menu.  However, jack.play seemed to
want to set it (I was using jack.play to test if anything was working). 
Fix here is to add the following lines to /etc/security/limits.conf:
@audio          -       rtprio          90
@audio          -       nice            -10
@audio          -       memlock         4000000
and then add the user to that group (YAST group management - select the
audio tickbox).  Finally log out and in again (type "groups" on the
command line to check you are a member of the audio group).

- Oh, and earlier I had disabled ARTS (the KDE sound thing) by clicking in
the appropriate checkbox of the KDE "Configure Desktop" GUI.  I did this
because the qjackctl message box was scrolling lots of ARTS related
messages.  I also restarted alsa with /etc/init.d/alsasound restart (Jack
uses ALSA to talk to hardware).

- So with those fixes jack.play works (it gives a misleading error on ogg
files, saying they are corrupted, but works fine with flac).  However
there was no sound.  Clicking on the "Connect" button of qjackctl you can
drag the jack.play thing on the left to the soundcard thing on the right. 
This connects them and you hear something!

- To add volume control, start jackmix, delete the connections you made
earlier, and instead connect jack.play to the mixer input.  Then connect
the mixer output to the sound card.  Finally twiddle knobs on the mixer
until you hear something.

That gets basic files to play.  That's it so far.  Amarok crashes.


Amarok with Jack

From: "andrew cooke" <andrew@...>

Date: Sat, 23 Jun 2007 18:44:03 -0400 (CLT)

- Install libxine-jack

- Start ARTS if you killed it earlier.  Without it, Amarok won't start,
and it doesn't seem to cause any harm (well, at various points I restarted
ALSA and Jack as well...)

- In the Amarok config select the jack output plugin (from the xine engine

- That's it.  Amarok automatically makes the connection to the output card.


Alsa, but no Flash, Jack

From: "andrew cooke" <andrew@...>

Date: Sat, 23 Jun 2007 21:45:53 -0400 (CLT)

To get Alsa to connect to Jack put the following in ~/.asoundrc:

# convert alsa API over jack API
# use it with
# % aplay foo.wav

# use this as default
pcm.!default {
    type plug
    slave { pcm "jack" }

# pcm type jack
pcm.jack {
    type jack
    playback_ports {
        0 alsa_pcm:playback_1
        1 alsa_pcm:playback_2
    capture_ports {
        0 alsa_pcm:capture_1
        1 alsa_pcm:capture_2

I was expecting flash (the browser plugin) would work with Jack too (it
uses Alsa), but it doesn't.  The reason is (I think) a 32/64 bit conflict.
 I'd forgotten but I'm running 32 bit Firefox so that the multimedia works
OK.  It's possible to change to 64 bit, but you still need to run flash in
a wrapper as 32bit.

One solution would be to move Jack to 32 bit.  But that means either
breaking dependencies or reinstalling nearly everything (ie KDE) as 32

So no streaming of Pandora.

No streaming of anything yet, of course.  Next I need to look at getting
airport working (well, after I've reinstalled Firefox to get back to 32


Jack to Airport

From: "andrew cooke" <andrew@...>

Date: Sun, 24 Jun 2007 19:23:51 -0400 (CLT)

Assuming that you have JustePort compiled correctly, and the Airpoert
Express configured, you can then connect Jack to the Airport using

- Install ecasound from YAST (assuming SUSE)
- Change the Jack sampling to 44100Hz
- Use the following command on the command line:
    ecasound -i jack -o stdout | mono JustePort.exe - 0
- In qjackctl, connect xine (for example, from Amarok) to ecasound

That's it.  Music comes out of speakers.


Streaming Audio and Jack

From: "andrew cooke" <andrew@...>

Date: Mon, 25 Jun 2007 08:55:14 -0400 (CLT)

Unfortunately the streaming with Airport isn't that great.  There are
occasional jumps and about every 15mins the connection goes down, meaning
I need to restart and reconnect the ecasound process.  I think the problem
is that (1) it's not trivial to drive an external DAC which is using a
separate clock (I assume) to my server and (2) the JustePort software is
more a demo of the crypto crack than an attempt at making a reliable, good
sounding audio streamer.

That's frustrating.  But one possible solution to my particular
circumstances is to switch to headphones and use internet streaming.  With
Jack this turns out to be pretty trivial.  I needed to install and
configure icecast (which I've done before - it's trivial) and then add

I use the following config file with oddcast:
ServerPassword=i changed this of course
#YP Settings
ServerName=Andrew's music
ServerDescription=Music for Andrew
#Advanced Settings

Then it's just a case of starting as:
> oddcastv3 -c oddcast.cfg JackMix:out_1 JackMix:out_2
(I am using jackmix for volume control - it also provides a nice
"connection point" so each source and destination can connect/start/stop
as required).

The only gotcha in all this was that the mount point has to be /stream.ogg
and not /stream (mplayer and xmms seem to get confused otherwise).

So, in case you're not seeing the wood for the trees, this lets you use a
player like Amarok as the source for streaming radio (instead of having to
use ices or whatever).


jjjuste V 1.0 Released

From: "andrew cooke" <andrew@...>

Date: Wed, 11 Jul 2007 21:20:48 -0400 (CLT)

I just released an Airport Express client for Jack:


Comment on this post