No Suspend On Desktop Server

19 April 2021

I have a desktop server running Debian Unstable in the house, and I occasionally reboot it without logging back into the local desktop session. If I don’t login, I’d later find the machine mysteriously inaccessible — asleep. It’s set to never sleep, but that’s when I’m logged in.

To disable sleep in the GDM3 Greeter, I edited the /etc/apt/greeter.dconf-defaults, found the "Automatic suspend"/[org/gnome/settings-daemon/plugins/power] section and followed the comments to add:


Now the machine will act a little more like it’s a server.

Java Joyless

27 January 2021

Mr Haki has a Java Joy article about transforming a stream of strings into a map using functional Java. I’m having a bit of trouble embracing it enthusiastically, since each example is 81 lines of Java code and a pointy pile of type declarations!

I dashed out the same functionality in 4 lines of Clojure, and I can understand it a whole lot easier. I’m not even sure this is the fewest forms, but it’s still nicer.

    ["language" "clojure" "username" "john"]
    (partition 2)
    (reduce (fn [m [k v]] (assoc m k v)) {}))
  ;; => {"language" "clojure", "username" "john"}

Update 2021-04-14: It can be done in one line of Clojure.

  (apply hash-map ["language" "clojure" "username" "john"])
  ;; => {"language" "clojure", "username" "john"}

Written with Clojure 1.10.2.

Fixes for Overtone and SuperCollider on PopOS 20.10

02 November 2020

I took the update to PopOS 20.10, and my Overtone setup stopped working. When I’d try to boot up the internal SuperCollider server from Emacs or from the leiningen repl on my music projects which all (:require [ :refer :all]), get an error in native libraries. I could also try to start the server with (boot-internal-server) or (boot-external-server), but it gives the same error.

--> Booting internal SuperCollider server...
Cannot read socket fd = 107 err = Success
CheckRes error
Could not read result type = 22
Client name = Overtone conflits with another running client
Cannot connect to the server
JackShmReadWritePtr1::~JackShmReadWritePtr1 - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
could not initialize audio.
# A fatal error has been detected by the Java Runtime Environment:
#  SIGSEGV (0xb) at pc=0x00007f5eec0e9ba7, pid=30517, tid=30605
# JRE version: OpenJDK Runtime Environment AdoptOpenJDK (15.0.1+9) (build 15.0.1+9)
# Java VM: OpenJDK 64-Bit Server VM AdoptOpenJDK (15.0.1+9, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C  []  World_WaitForQuit+0x7
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
# An error report file with more information is saved as:
# /home/john/workspace/music/hs_err_pid30517.log
--> Connecting to internal SuperCollider server...
[thread 30576 also had an error]
# If you would like to submit a bug report, please visit:
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.

Since it can no longer start the server internally from within Overtone, I start the server manually. I wrapped a script around the start up, so I can set the environment variables for configuring jack and starting up the synth:


# automatically connect up jack ports
export SC_JACK_DEFAULT_INPUTS="system:capture_1,system:capture_2"
export SC_JACK_DEFAULT_OUTPUTS="system:playback_1,system:playback_2"

scsynth -u 57110

To get Overtone going again, I disabled the automatic boot of the server within Overtone by switching all the requires in each file from to overtone.core, and I connect to that external server from my REPL manually with (connect-external-server) before doing anything else.

Finally, Overtone was consistently failing to find my MIDI keyboard. When things were working well enough a couple months ago, it still had required a little dance of killing off jackd and restarting Overtone, since something had been tying up the MIDI interface. This workaround was no longer adequate, since scsynth and jackd needed to already be started. I disabled MIDI connection in jackd by removing the -Xseq option from my ~/.jackdrc.

I’m back in business, and it’s probably more robust with these manual steps now. I think I’m also seeing some other odd little things working with the external server that didn’t previously, like using (mouse-x) for reading mouse positions into the synth values. The built-in piano synth is also working where it hadn’t previously.

Update 2021-02-13: I had lost the ability to send desktop audio (pulseaudio) through to the Jack Sink with this setup, so I figured out to start qjackctl before my That gets the Jack Sink available again to pulseaudio and the desktop sound menu.

Escape with Spacemacs in Tmux

21 October 2020

I’ve occasionally been using a SSH session from my Pixel phones for years to login to my servers and write Clojure code in Emacs. I’d often run into an issue where I find myself having a weird time switching between NORMAL and INSERT modes when I’d hit ESCAPE quickly and try to move the cursor.

Googling my random problems is a favorite pastime, and I’ve finally stumbled upon an article about tmux and vim escape key. I learned that it’s probably been tmux sporadically eating my ESCAPE key, so I’ve tried disabling the built-in delay by adding to my .tmux.conf:

set -g -s escape-time 0

All the Posts

April 2021

January 2021

November 2020

October 2020

January 2018

January 2016

December 2012

October 2011

June 2011

December 2010

September 2010

June 2010

May 2010

February 2010

January 2010

August 2009

March 2009

February 2009

November 2008

October 2008

June 2008

March 2008

January 2008

December 2007

October 2007

September 2007

August 2007

July 2007

June 2007

May 2007

April 2007

March 2007

February 2007

January 2007

December 2006

November 2006

October 2006

September 2006

August 2006

July 2006

June 2006

May 2006

April 2006

March 2006

February 2006

January 2006

December 2005

November 2005

October 2005

September 2005

August 2005

July 2005

June 2005

May 2005

April 2005

March 2005

February 2005

January 2005

December 2004

November 2004

October 2004

September 2004

August 2004

July 2004

June 2004

May 2004

April 2004

March 2004

February 2004

January 2004

December 2003

November 2003

October 2003

September 2003

August 2003