| 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.

C-ORM: docs, API.

Last 100 entries

This Is Why I Left StackOverflow; New TLS Implementation; Maths for Physicists; How I Am 8; 1000 Word Philosophy; Cyberpunk Reading List; Detailed Discussion of Message Dispatch in ParserCombinator Library for Julia; FizzBuzz in Julia w Dependent Types; kokko - Design Shop in Osaka; Summary of Greece, Currently; LLVM and GPUs; See Also; Schoolgirl Groyps (Maths); Japanese Lit; Another Example - Modular Arithmetic; Music from United; Read Agatha Christie for the Plot; A Constructive Look at TempleOS; Music Thread w Many Recommendations; Fixed Version; A Useful Julia Macro To Define Equality And Hash; k3b cdrom access, OpenSuse 13.1; Week 2; From outside, the UK looks less than stellar; Huge Fonts in VirtualBox; Keen - Complex Emergencies; The Fallen of World War II; Some Spanish Fiction; Calling C From Fortran 95; Bjork DJ Set; Z3 Example With Python; Week 1; Useful Guide To Starting With IJulia; UK Election + Media; Review: Reinventing Organizations; Inline Assembly With Julia / LLVM; Against the definition of types; Dumb Crypto Paper; The Search For Quasi-Periodicity...; Is There An Alternative To Processing?; CARDIAC (CARDboard Illustrative Aid to Computation); The Bolivian Case Against Chile At The Hague; Clear, Cogent Economic Arguments For Immigration; A Program To Say If I Am Working; Decent Cards For Ill People; New Photo; Luksic And Barrick Gold; President Bachelet's Speech; Baltimore Primer; libxml2 Parsing Stream; configure.ac Recipe For Library Path; The Davalos Affair For Idiots; Not The Onion: Google Fireside Chat w Kissinger; Bicycle Wheels, Inertia, and Energy; Another Tax Fraud; Google's Borg; A Verion That Redirects To Local HTTP Server; Spanish Accents For Idiots; Aluminium Cans; Advice on Spray Painting; Female View of Online Chat From a Male; UX Reading List; S4 Subgroups - Geometric Interpretation; Fucking Email; The SQM Affair For Idiots; Using Kolmogorov Complexity; Oblique Strategies in bash; Curses Tools; Markov Chain Monte Carlo Without all the Bullshit; Email Para Matias Godoy Mercado; The Penta Affair For Idiots; Example Code To Create numpy Array in C; Good Article on Bias in Graphic Design (NYTimes); Do You Backup github?; Data Mining Books; SimpleDateFormat should be synchronized; British Words; 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

© 2006-2015 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