Fixes for Overtone and SuperCollider on PopOS 20.10

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 [overtone.live :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  [libscsynth.so.1+0x63ba7]  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:
#   https://github.com/AdoptOpenJDK/openjdk-support/issues
# 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:

#!/bin/sh

# 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 overtone.live 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.


Escape with Spacemacs in Tmux

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

Taxes

A recent New York Times article exposes that Donald Trump paid no income taxes for 10 of 15 years . To some, that sounds like neglecting a duty to the public and the nation that makes so much possible for us. To just as many, that sounds like an ad for the next big tax preparation service they need to hire. Read the article, and you’ll see it’s a complicated shell game of write-offs, profits, losses, and fees shuffled around from year to year, even to past years as tax laws changed.

Will this change anyone’s view of anything? No.

Do I benefit from public spending? Absolutely.

Do I pay for it in taxes? Of course.

Do I like the way some tax dollars are spent? No, so maybe I should want to reduce it, but really we need to fix the way it’s spent.

Do I take deductions I can find? Yes, I pay a tax professional to tell me what to deduct and how I can save money. Why is this not simpler? Why is it so hard to know what we really owe? Why is there an entire industry built around avoiding our responsibility to pay taxes? Tax laws are changed and complicated to sweeten the deal for some lawmaker who’s signing, or in some cases, the complication or loopholes are often unintended consequences that were supposed to help someone else in need.

I’ll not sing anthems or salute a flag, but I’ll pay taxes and vote for people who spend the money to provide more stability for people.

As the shells continue to shuffle the margins will tighten, so I really hope we get him out of office before his debts come due and he’s selling off our futures.


Listening to Music

My Music Library

I have a good bit of music I had acquired and ripped in the late 90s and had purchased from Amazon later. That all lives in a directory on my big computer. I never play anything from there, and it just sits there for safe keeping.

I continued to purchase DRM-free MP3 files from Amazon Music, and I eventually embraced their "free" streaming with Amazon Prime. I could add available music to my collection for free, and then stream it along with the stuff I bought, so it’s nice and blended. This allowed me to easily toss a new album or artist into rotation, and if I really want, I might purchase it to keep.

The Prime streaming service had some limitations with some music I wanted to sample being unavailable, and sometimes, I’d notice some of the free music disappeared from my collection. I decided to pay the little bit for the Unlimited Music plan, and that made almost everything available. I notice very few cases of music becoming unavailable, so now I don’t bother buying downloadable MP3s except in rare cases where I want to be able to use a song on another device outside the Amazon Music client.

Music Discovery

I don’t really use the stations at all on Amazon Music. I don’t feel the need to hear large numbers of new songs all the time, so I have a smaller curated list of podcasts and DJs where I discover new music to add to my collection at Amazon:

Alternatives

I had uploaded all my music to Google Play Music years ago, but there had always been news of the service’s eventual demise. It’s finally migrated recently over to YouTube Music, and they seem to have reintroduced the ability to upload my own music. I’ve paid for YouTube Premium, so I have YouTube Music as well, and this could be a nice alternative. I have a few albums uploaded there which I can’t find on Amazon. I don’t think I can buy music there, though, and I’ve already purchased a good bit of (DRM-free) music on Amazon.


Templates and Snippets in Emacs

I was only trying to write that last article, but it took me days to finally do it. I had so much work to do before I got there.

I had come to appreciate Emacs automatically inserting the boilerplate namespace declarations in new Clojure files, and I really thought I needed such convenience for my blog posts written in AsciiDoc in JBake. I dove down a 20-tab-deep, yak-shaving hole to get it done. [1]

I had to figure out the right search terms and names for what Emacs was doing for me. I finally found yatemplate which seems similar to yasnippets. Spacemacs has the templates layer for integrating yatemplate support, so I added that layer and created a template for my adoc files in my .emacs.d directory. My simple case worked, but I recognized that I’ll want that template on all my machines, so having a local copy of it wouldn’t cut it. I needed a way to check-in and version more Emacs/Spacemacs files than just my ~/.spacemacs files I was previously distributing.

I learned yasnippets would default to looking in ~/.spacemacs.d/ if the configuration was in there, so I had to move my ~/.spacemacs file over to ~/.spacemacs.d/init.el. To have the templates layer source templates from the .spacemacs.d directory, it required an extra bit of configuration when introducing it to the dotspacemacs-configuration-layers:

  (templates :variables templates-private-directory "~/.spacemacs.d/templates")

At this point, I could now commit my .spacemacs.d directory with the regular configuration file and the supporting templates and snippets. All those files will be cloned to all my workstations.

I was almost ready to write that article, but yasnippet and yatemplate have this fancy templating language. I’m sure that can make my article-creation even smarter! I read a bit more and found a couple cool elisp functions for automatically filling in the date and building a title from the file name. With the final enhancements to my adoc template, I could write the article, if I could only remember what I was trying to do in the first place. I hope to at least remember how to use these snippets and templates for future work.


1. I often measure task complexity in the number of tabs I end up having opened.

ADVi3++ 4

I had a bit of downtime with my Monoprice Maker Select Plus 3D printer, so I decided it was time to upgrade the custom firmware, ADVi3++ 3.0.x, to the newer 4.0.6.

I’ve done the upgrade previously to get the 3.x firmware in the first place, so I knew I needed to upgrade in 2 steps: the LCD via a microSD card and the main board via Cura over USB.

I dug through the manuals and directions a bit, and decided I could copy the contents of the raw zip onto a formatted SD card instead of writing the img file to the raw SD device with dd. That fit on a handy 2GiB card. I took the couple screws out of the front panel, inserted the micro SD card, powered it up, and watched the LCD display all the new images it was loading. When it’s done, I turned it off, and replaced the screws.

Then I could easily connect the printer to the Linux laptop via USB, and upload the custom firmware hex file from Cura’s Manage Printers screen. I did need to take a moment to add my user to the dialout group to get access to the USB ports for serial communication to the printer.

Upon reboot, the printer wiped out the old incompatible settings, and I rebooted it again to see the new startup screen and version numbers. I ran through some tunings: PID and extruder, and kicked off a test print that went fine.

I currently have the thermal protection enabled, and I’m hoping it’s not too sensitive, and I can keep it turned on. I expect this upgrade will hold for a long time until I see 5.0 available, and it’s had some time to settle.


RSS for News

We can find ourselves thinking, "Where did we used to get our news before Twitter and Facebook?" I know where I got news: Google Reader, but Google shut it down, and eventually gave us a taste of aggregated news in Google Assistant on our phones, but it never really allows us to consciously control it.

Social media’s a bit of a mess and mostly getting worse, so you might want an alternative. Google Reader was based on RSS and Atom news feeds from all your favorite websites, and those still exist.

I still read my carefully curated news feeds using Feedly as a successor to Google Reader. I have hundreds of different news feeds aggregated into this one place (kind of like Facebook and Twitter), but it’s a much more controlled stream of news about which I care. Anyone can create an account at Feedly and get started by searching for a handful of sites you’d like to read regularly. Over time, you can extend and finely tune your feed of news.

If Feedly isn’t quite your style, you can find other news readers, and allow yourself to stay informed without necessarily needing to scroll through all the noise of Facebook and Twitter.


Clojure Core Logic for a Puzzle

Lock Puzzle

I saw a puzzle pop up on Facebook a couple weeks ago, and it looked like a fun exercise for core.logic, since the puzzle simply requires keeping track of some constraints and reconciling them to one answer.

I had previously tinkered with the core.logic primer and I referred back to it to complete this little puzzle. I had originally coded some more complete rules about exclusion of some values which could have been implied by the puzzle, but I found they could be dropped and still get down to one answer. I started from the entire problem space of all digits and added the constraints to watch and verify each constraint’s effects.

(ns scratch.2020-05
  (:require [clojure.core.logic :as l]))

(l/run* [a b c]
  ;; all digits 0-9
  (l/membero a (range 10))
  (l/membero b (range 10))
  (l/membero c (range 10))
  ;; 6 8 2 one digit is right and in its right place
  (l/conde
    [(l/== a 6)]
    [(l/== b 8)]
    [(l/== c 2)])
  ;; 6 1 4 one digit is right but in the wrong place
  (l/conde
    [(l/membero a [1 4])]
    [(l/membero b [6 4])]
    [(l/membero c [6 1])])
  ;; 206 2 digits are right, but both are in the wrong place
  (l/conde
    [(l/membero a [0 6])
      (l/membero b [2 6])
      (l/membero c (remove #{2 0 6} (range 10)))]
    [(l/membero a [0 6])
      (l/membero c [2 0])
      (l/membero b (remove #{2 0 6} (range 10)))]
    [(l/membero b [2 6])
      (l/membero c [2 0])
      (l/membero a (remove #{2 0 6} (range 10)))]
      )
  ;; 3 8 0 one digit is right but in the wrong place
  (l/conde
    [(l/membero a [8 0])]
    [(l/membero b [3 0])]
    [(l/membero c [3 8])])
  ;; 7 3 8 all the digits are wrong
  (l/membero a (remove #{7 3 8} (range 10)))
  (l/membero b (remove #{7 3 8} (range 10)))
  (l/membero c (remove #{7 3 8} (range 10))))
;; => ([0 4 2])

Past Phones

Over the years, I’ve chosen my mobile devices pretty carefully. I’ve usually chosen them for connectivity options, Java capabilities, and eventually the quickest Android updates.

  • Ericsson S868 This was my first device in about 1999: futuristic GSM on a small start-up network in Lancaster.

  • Ericsson 289LX After my old phone carrier let all their cool features (email to SMS) fall into disrepair, I jumped to an older TDMA network on AT&T, but it worked.

  • Siemens S46 This was my second phone on AT&T. This one had a couple colors and a better WAP browser, so I started coding WAP mobile sites for it.

  • SonyEricsson T68i A friend gave me this tiny phone with an attachable camera accessory. This was my first phone with Bluetooth data tethering.

  • SonyEricsson T616 Now I had an integrated camera and Java, and I think I likely started coding for J2ME apps and games with the T616.

  • SonyEricsson T637 This was just an update to the T616.

  • SonyEricsson S710 This device had an odd form factor of a large screen and hidden keypad that made it more of a camera that had a phone feature.

  • SonyEricsson W810 I returned to the tiny, featureful candy-bar phone with this one. Java capabilities and connectivity remained my most important concerns. I was really stretching these little feature phones to do as much as possible, and I believed they continued to have a future. This device was a "Walkman"-branded device, so it had a bit of storage and decent audio capabilities. I think I also flashed a new firmware onto this device to get full email support.

  • Nokia E71 I jumped to a smartphone with Symbian OS with the full keyboard and internet capabiliites. I never coded any S60 apps for this, but it continued to run Java apps well.

  • Samsung Nexus S I finally jumped to Android and a touchscreen, and I had every intention of jumping right to coding Android apps. (Spoiler: With all these Android devices, I never started.) I really stretched this device to a point where I barely had enough memory to run GPS navigation (Waze) and podcasts (BeyondPod) or music at the same time. I loaded lots of 3rd party Android ROMs on here.

  • LG Nexus 4 I continued to chase clean Google Android devices. This devices brought NFC and wireless charging that didn’t work as well as it should.

  • Huawei Nexus 6P This phone was huge, and I never went back to smaller phones, but it lost wireless charging. It lasted long enough for me to need to replace the built-in battery. I started coding some mobile JavaScript for this device.

  • Google Pixel XL The 6P’s battery died again, and the latest phones (Pixel 3) were being released in 6 months, so I bought a refurbished Pixel XL to tide me over, but it proved to be an excellent phone, so I hung onto it until it no longer got updates.

  • Google Pixel 3 XL I wanted something newer that would get Android 11, so I bought this device refurbished. I had to buy some headphone adapters, but I’ve been enjoying having good wireless charging. I finally got started with some ClojureScript for mobile web apps on this device.


Reagent Front End

For the past couple days, I’ve started playing with Reagent to do a bit of React programming. I used the Reagent-frontend template for leiningen to get my start. Within a day or two, I had managed to string together a useful little toy application. It only took me a couple hours to get my next toy application put together. Each application is a mere single-page application for doing a single, simple task on a mobile device. It’s a lot of fun, and this opens the door for quickly implementing any toy I want.


Pixel 3 XL

In Summer of 2018, I had a Nexus 6P that was on its last legs, and I couldn’t quite wait for the Pixel 3 phones to be released in the Fall, so I picked up a refurbished Pixel XL to tide me over until I could see the new devices. That Pixel XL was fantastic, so I just kept it for nearly 2 years. Back in October, the Pixel XL got its last OS update, and I’ve now started seeing news of Android 11 previews, so I got the itch to replace the old Pixel XL even though it still runs pretty well.

I finally got that Pixel 3 XL just a year and a half later. Compared to the Pixel 3a XL, I figured I’d appreciate the higher screen resolution and the bit of water resistance. This device doesn’t seem too much different from my old Pixel XL, though now I’m buying a couple headphone adapters, and I might just end up using my cheap bluetooth headphones more. I’m excited to have wireless charging again, which I had given up with my Nexus 4. The front-firing stereo speakers are back and sounding good, but it’s an adjustment from the way I used to carry the Pixel XL with the single speaker blasting podcasts from a pocket as I wander the house. It seems that maybe driving the extra speaker may drain battery a little quicker. After a couple days, I had to pop into the Developer Options to hide the notch. It’s just a bad idea: I have too many notifications to allow room for a notch cut out between them.

The Pixel 3 XL seems pretty well-balanced with features I want at a reasonable price (about $300 USD for the refurbished one). I already have the March 2020 update before I’ve even owned the device for a week, and I should have updates through 2021. When updates run out, I’ll look at upgrading again. I’ll need to find a use for the original Pixel as a webcam or something, since it’s still in such good shape and had plenty of computing power.


Advent of Code

For the second year I’m taking part in the Advent of Code with friends and coworkers. I’m using Clojure again this year.

The Advent of Code is a story and series of puzzles released as 2 parts daily. There’s a community of people competing at various levels to complete the puzzles faster than others. I was keeping up fine for the first 7 days or so, but I eventually fell behind like many people. Fortunately, everyone can continue to work at our own pace. The puzzles from previous years continue to be available.

I’m happy to find that I’m having an easier time with Clojure this year, and I’m more easily able to use it to describe the algorithms instead of struggling with the language. I publish my code to Github.


Missing Classes in IDEA

I use InteliJ IDEA for work when working on Java code. When the IDE doesn’t work, though, it’s incredibly distracting.

I had a problem where IDEA would not find a few auxiliary classes in my application. It would highlight them as errors in imports, and the search would find the source file, but technically not the class definition. I’d poke at the problem over a couple weeks, but I’d otherwise ignore it most the time until it seemed to be losing more and more of my classes, some of which I was actively modifying.

Re-importing the project’s Maven build didn’t fix it; re-cloning a brand new project didn’t fix it; and re-installing IDEA didn’t even work. Finally, I found IDEA’s config directories, and wiped those out to start over, and that cleared up the problem: I was able to find all my classes again.


Using Google Calendar Effectively

Google Calendar makes the world go 'round, especially for kids who travel between households and have lots of school events. There are a couple things you can do to get the most out of your calendar.

Set Locations

Calendar events obviously come with times and fixed reminders so many minutes before the event. It doesn’t matter where you are or where the event takes place: that notification is coming at the same time.

With a location set on each calendar event, other software, like Waze GPS, can continuously watch your current location and offer you a more useful notification giving you time to travel based on distance and current driving conditions along the way.

Set the Earliest Time

Most my calendar events have just one start time, but my kids' events aren’t that simple. A marching band performance may be at 7pm, but the bus to the stadium leaves at 4pm. Since we live by notifications, it’s important to get those notifications at the earliest time at which we need to act. The other times are likely just extra details that can go into the event title or event details. I can get a notification for 4pm and realize I don’t need to be there until 7pm, but I can’t tolerate a 7pm notification if I was supposed to be dropping a kid at the practice at 4pm.

If I find it’s important to see notifications for all the potential times of an event, then it’s probably best to break that event into more than one event: drop-off, performance, and pick-up.

Share the Calendar

This is the first and most useful collaboration feature of Google Calendar. A personal calendar benefits one person, but invite the other participants (the kids), and then they can start adding and maintaining events and following these rules as well.


Chili Recipe

John’s Chili (8 qt)

Since I’ve not eaten meat for over 4 years, and I’ve been evolving my chili recipe, it’s probably time to update it.

Ingredients:
  • 58 oz canned plain tomato sauce

  • 93 oz canned dark red kidney beans

  • 46 oz canned black beans

  • 15 oz canned garbanzo beans

  • 1 large onion

  • 2 large tomatoes

  • 1 small green bell pepper

  • 1 small yellow bell pepper

  • 3-4 hot peppers (jalapeño, habanero, red chili, etc)

  • 0.25 cup minced garlic

  • 3 tbsp chili powder

  • 2 tbsp crushed red pepper

  • 1 tsp salt

  • 1 tbsp black pepper

Directions:
  1. Dice all the fresh ingredients.

  2. Combine fresh ingredients with spices in large pot over medium heat.

  3. Add canned sauce and beans to the pot.

  4. Adjust heat for slow bubbling, stirring occasionally.

  5. Let it cook for 45 minutes or longer.


Browser Automation with Geb, Spock, and Groovy

I recently gave a talk and demonstration, Browser Automation with Geb, Spock, and Groovy, at the Capital Area Software Engineers group in Harrisburg, PA. While explaining the whole stack of software, I showed how to:

  • Start a project in Gradle

  • Get the Geb and Webdriver dependencies in place

  • Get started in Spock testing framework

  • Start up a browser for testing

  • Interact with the page content

  • Wait for asynchronous content

  • Abstract away page components into Geb Page classes

The slides and all the code are available in my geb-preso repo. It includes copies of the code I had prepared, the code we wrote live as a group, and my little toy Planning Poker JS app I was testing.


LetsEncrypt

Months ago, I started setting up LetsEncrypt using certbot on my Debian web server. It hosts multiple virtual hosts, so I setup 2 different sets of certificates: one for hjsoft.com/www.hjsoft.com and the other for johnflinchbaugh.com/www.johnflinchbaugh.com/blog.johnflinchbaugh.com.

On Debian, at least when I got started, it was recommernded to have certbot shutdown your apache2 and let it start its own temporary web server to verify the LetsEncrypt setup (--authenticator standalone). The other trick is to register multiple domain names for one certificate by repeating the -d option. I did this with this invocation:

certbot \
    --pre-hook "systemctl stop apache2" \
    --post-hook "systemctl start apache2" \
    --authenticator standalone \
    --installer apache \
    -d johnflinchbaugh.com \
    -d www.johnflinchbaugh.com \
    -d blog.johnflinchbaugh.com

I got it started a couple months ago, but I didn’t know how to setup multiple domain names, so I was always getting errors that this certificate was for a different name: johnflinchbaugh.com instead of www.johnflinchbaugh.com, etc.

That’s all sorted out now, and all my sites should be SSL all the time.

For more information on setup, certbot has a great set of guides based on your OS and web server.


2018-07-24 Podcast List


Watching for GIMP 2.10.1

I was seeing the new GIMP 2.10.0 doing bad things with multiple gradients on a transparent layer, so I logged Bug 795866. They quickly fixed the bug within 48 hours, but now I’m sitting here reloading the GIMP news page to see if they’ve cut the newest release.

Update: GIMP 2.10.2 just hit Debian Unstable!


End of the Make 365

While I fell behind and caught up a couple times, I caught up one less time, so this project is done.


Older posts are available in the archive.