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

C[omp]ute

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

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; Spectral Embeddings (Distances -> Coordinates); Introduction to Causality; Filtering To Help Colour-Blindness; ASUS 1015E-DS02 Too; Ready Player One; Writing Clear, Fast Julia Code; List of LatAm Novels; Running (for women); Building a Jenkins Plugin and a Jar (for Command Line use); Headphone Test Recordings; Causal Consistency; The Quest for Randomness; Chat Wars; Real-life Financial Co Without ACID Database...; Flexible Muscle-Based Locomotion for Bipedal Creatures; SQL Performance Explained; The Little Manual of API Design; Multiple Word Sizes; CRC - Next Steps; FizzBuzz; Update on CRCs; Decent Links / Discussion Community; Automated Reasoning About LLVM Optimizations and Undefined Behavior; A Painless Guide To CRC Error Detection Algorithms; Tests in Julia; Dave Eggers: what's so funny about peace, love and Starship?; Cello - High Level C Programming; autoreconf needs tar; Will Self Goes To Heathrow; Top 5 BioInformatics Papers; Vasovagal Response; Good Food in Vina; Chilean Drug Criminals Use Subsitution Cipher; Adrenaline; Stiglitz on the Impact of Technology; Why Not; How I Am 5; Lenovo X240 OpenSuse 13.1; NSA and GCHQ - Psychological Trolls; Finite Fields in Julia (Defining Your Own Number Type); Julian Assange; Starting Qemu on OpenSuse; Noisy GAs/TMs; Venezuela; Reinstalling GRUB with EFI; Instructions For Disabling KDE Indexing; Evolving Speakers

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

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

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

Andrew

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

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

Andrew

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

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

Andrew

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

- 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 - 10.2.0.3 0
- In qjackctl, connect xine (for example, from Amarok) to ecasound

That's it.  Music comes out of speakers.

Andrew

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

I use the following config file with oddcast:
Server=localhost
Port=9000
ServerPassword=i changed this of course
ServerMountpoint=/stream.ogg
ServerPublic=1
AutomaticReconnectSecs=10
Encode=OggVorbis
BitrateNominal=128
NumberChannels=2
OggQuality=5
Samplerate=44100
ServerType=Icecast2
ExternalFile=/tmp/song
#YP Settings
ServerStreamURL=http://acooke.dyndns.org
ServerName=Andrew's music
ServerDescription=Music for Andrew
ServerGenre=Any
#Advanced Settings
LogLevel=1
LogFile=oddcastv3.log
SaveAsWAV=0
OutputControl=SERVER,GENERAL,OUTPUT

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

Andrew

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:
http://www.acooke.org/jara/jjjuste/

Andrew

Comment on this post