Categories
Tech Thinking hard, or hardly thinking?

Two-Hand Philosophy

Monday morning! Time to get to work!

This morning, I put on my morning playlist to find my inspirational message from The Rock himself, Mr. Dwayne Johnson, was missing.

I notice that the five tracks from “Dwayne Johnson Workout” were missing from my playlist on my computer. These are 30-second clips of Dwayne Johnson telling you how hard work is worth the effort. It’s 2020, folks. I listen to these multiple times every single day.

I pulled these from a bigger playlist, “Dwayne Johnson’s Progress Workout Playlist“, with his motivational spoken tracks and some POWERFUL ROCK MUSIC TO KEEP YOU GOING. I click through, and they are all greyed out and unplayable in the original playlist too. Harrumph.

I knew these worked yesterday! My stomach drops. I had a feeling I had to act quickly.

I grab my phone, put it in in Airplane Mode instantly, trying to catch it before it realizes the tracks have been removed. As silly as it seems, to be faster than a computer, I have a chance here. Android pauses nearly all apps when it thinks your phone is sitting on a desk, not plugged in. (They call it Doze.) I had also marked the whole playlist for offline playing. Spotify says they give you ~30 days in offline mode before you have to go back online to reauthorize things. Maybe I can finagle a way to keep these tracks, so The Rock can help me get my work done and tell me I’m doing a great job.

After confirming I was in Airplane Mode, I open up Spotify. 4 of the 5 tracks are playable. The first, however, was greyed out and unavailable. :/ 4 outta 5 ain’t bad, folks. We can do this!

I tweet about the tracks going missing, and do a little research. They came out about a month ago, as part of a promotion Dwayne Johnson is doing. They’re on Spotify under “Seven Bucks Productions“, which was founded by (and still CEO’ed by) Dwayne Johnson. It doesn’t look like they’re available anywhere else, and I can’t buy them.

Before I dig in, I should confirm that there isn’t a weird glitch with my account or something. I jump into Spotify support chat. They quickly confirm that these tracks were no longer available in any region, so I rule out VPNing to a different country as a helpful component of my recovery strategy. The support person won’t tell me any reason why the tracks were no longer available, if they were always going to be pulled today, or if they were coming back.

OK, so let’s say there’s some sort of glitch and Spotify thinks the tracks violate some policy, or some intern somewhere marked them as a violation and another company automatically pulled them, or some other wishy-washy excuse. How can I get these tracks back?!

The first thing most folks will think of is copying the files. I knew that the Spotify cache was encrypted. This means they had gone out of their way to protect it. I am not a full-time security engineer, but I have done more than my fair share of security work. While there are likely issues that someone who could really devote some time could dig into, I’m not particularly interested in trying the front door, if I can see a bunch of bars and locks and guards from across the street.

This is voice, not a huge orchestral recording. I should be able to get the audio in a roundabout way and still have a decent recording. I look at the Android API docs to see if apps can record other app’s audio. They can, as of Android 10! Apps can block this in their manifest, but let’s give it a shot. Screen Recorder is free, has no ads, and uses these APIs. I install it, turn up the audio quality settings, and set it to record internal audio. I start the recording, open Spotify, and play one of the aforementioned tracks. I stop the recording, play it back, and… bupkis. No audio. Looks like Spotify blocks the recording in its manifest.

Android 11 comes with a screen recorder, now! Maybe because it’s part of the system, it has different permissions and can record this audio! I add the Quick Setting tile, set it to record audio from internal sources, and… nothing. Harrumph.

OK, what about analog? Some fellow nerds call this “the a(nalog) hole“. The Pixel 2 doesn’t have a headphone jack, but I have a USB-C headphone jack adapter. I could run a 3.5mm patch cable to my laptop, grab the audio, and have *something!*

After connecting it up, I jump into Audio settings on my Macbook to switch the headphone jack to an input. Hmm, where’d the “use this jack for audio input” box go? Oh, now you can only get audio input using TRRS cables? I don’t have any way to make the audio from my phone output that way. :/ I have some TRRS adapters at my workshop (and USB audio dongles that have mic inputs) but it’s rapidly approaching Monday afternoon and I haven’t yet gotten started with my “work”.

What about decompiling the APK, modifying the manifest to enable recording, signing it, and putting it back on my phone? I’ve done deeper APK modifications in the past with some of my AOSP work. I’m not a pro-level Android APK reverse engineer, but this shouldn’t be a long job. As I think about it, however, I realize that I can’t figure out any way to do this while preserving the offline file. As far as I know, I’d have to remove the current APK before loading my modified APK onto it.

What about something even more esoteric? The avenues are limited. My phone isn’t rooted and I don’t have this song on any Spotify installations on any emulators. I take a quick look, anyway, and folks report that Spotify has a fair amount of anti-piracy/anti-reverse engineering/anti-root stuff built-in. Fine, fine.

What about through a system-level debug utility? I do know my way around AOSP documentation and I’ve set that stuff up before… I quickly find:

“For privacy the tee sink is disabled by default, at both compile-time and run-time. To use the tee sink, you will need to enable it by re-compiling, and also by setting a property. Be sure to disable this feature after you are done debugging; the tee sink should not be left enabled in production builds.”

AOSP Documentation, Audio Debugging

Alright. I take stock of my options. I think my best bet is to figure out how to get the audio out of my phone on a 3.5mm cable and record it. Many of my computers, my Macbook, even the ones running Linux, (WHO NEEDS FREEDOM IF IT CAN’T HELP THE ROCK TELL YOU THAT HE APPRECIATES YOUR HARD WORK?!?!) have combined headphone/mic jacks. After some reading, it seems that many of those have the ADC/DAC TRRS muxing done automatically by some intermediate circuitry, rather than under the direction of the operating system. I do have a computer that has a split headphone/mic jack, but my 6YO uses it all day for “distance learning”.

Rather than interrupt my son’s education (for this increasingly lengthy endeavor) for twenty minutes as I get levels set and these tracks backed up, I decide to put this on pause. It’s REDACTED o’clock on Monday morning, and I haven’t billed a single minute yet. I’ll get to work, two-hand philosophy, without Dwayne Johnson in my ears, and after my oldest is done with school, after I get some work done, I’ll make a copy of these tracks. My phone’s in Airplane Mode; I’ve got nothing to worry about. If this all fails, I have other ways of recording 3.5mm audio at my workshop, like USB audio dongles, Teensy Audio Shields, a variety of dev boards…

Before I really get to to work, I post some of this to a few places, to see if any smart folks had any other ideas. Some recommended keeping this phone in Airplane Mode forever, turning it into a Dwayne Johnson shrine. (Spotify gives you a 30-day timer when you go into offline mode, so once they learned about that, it morphed into requiring a software-defined cellular base station without internet access, with a modified clock.) Other folks recommended setting up an offline wifi network, joining my phone to it along with another computer that I’m also logged into in Spotify, seeing if I could play the track through the computer from my phone, and then using some fancy audio routing software to record it on the computer. I think that’s an amazing idea! I would want to try that *after* all else had failed, because I guess it’s possible Spotify could share “media no longer available” lists even offline, and I didn’t have any computers logged into my Spotify account that didn’t already know that those tracks shouldn’t be available.

Alright, end of the day! Let’s do this! I take my phone, still in Airplane Mode, over to my son’s computer, connect up the USB-C to 3.5mm adapter and the 3.5mm patch cable. I don’t think I’m exactly supposed to blast headphone-driving outputs into this mic input, electrically speaking, so I play a random track (the Phineas and Ferb theme, actually) while looking at the levels to get the volumes right. l use arecord to grab some audio, then play it back. My brain knows that it’s a photocopy of a photocopy of a photocopy, but it sounds fine to my Old Man Ears (and I’m trying hard to be optimistic). IT’S GO TIME, BABY!

I switch over to the list of the five Dwayne Johnson motivational tracks, and… What? My face falls. They’re all marked unavailable. How? They worked REDACTED hours ago, and it’s been in Airplane Mode since the morning!

Did my phone take itself out of Airplane Mode? Did Spotify see I was trying to get at its music and go into lockdown? Did the tracks have some sort of deadline metadata built into them? I know that, in general, you can put Spotify in offline mode and play music for days and days. It says up to a month–I’ve never tested that, but I’ve used it over long weekends without internet access. This Dwayne Johnson catastrophe happened in the span of a day, so I truly have no idea what happened.

One favorite–my mom.
Categories
Projects Thinking hard, or hardly thinking?

“Art in Space”

On a cold, dark, Minnesota November evening, after what was, for me, a long week, and for the students, months of work, we shipped Blue Origin two payloads: art, for space.

In November 2019, I was contacted by the kind folks at Playful Learning Lab.

They had conducted a contest with OK Go where middle schoolers and high schoolers could dream up some art that could only happen in space. Two teams were selected, one focused on paint splatters and music, and the other focused on suspended magnets and whirling particle vortexes. The undergraduate team at the Playful Learning Lab worked with the winning student teams and also the engineers at Blue Origin.

Once these payloads were created, they’d be launched on Blue Origin’s New Shepard for an 11-minute suborbital flight into space. Actually, that’s not true! As you may suspect, putting things into space tends to have strict deadlines (and mass requirements!), and the team needed some help getting everything ready in time.

They knew I was handy with microcontrollers and electronics and making solid one-off interactives and worked well under pressure, and wanted to know if I was interested.

WAS I INTERESTED?! Rewind a few years to an interview of mine by Mark Fraunfelder.

Mark asked me what sorts of things I dream of making, and I spouted off a few things, and ended with "I'd love to build something that goes into space."

Long story short, it was like a heist movie and Apollo 13 combined. There was the “gathering the team” intro. I brought in folks I’ve spent a decade or more working with, like Matthew Beckler (with whom I have a set of informal Hardy-Littlewood rules) and some of the folks from Kidzibits (who are great at thinking creatively while creating robust, rock-solid fabrications).

We spent a week or so of long days and nights working with a truly extraordinary team of engineering undergraduate students, covering massive whiteboards with diagrams and frequently dumping everything we had onto a table and saying “We gotta remove off 100 grams from this subassembly.” (100 grams here, 100 grams there, when you only have 500 grams per payload, it really adds up!)

474 grams, or 26 grams under the limit! (Photo credit: Maria Baklund)

There were two projects. Cosmic Song had a paint chamber with sticky paper and bright powder pigment, and what I can’t describe any other way than “a space guitar”, with three strings strung across some aluminum, struck by little solenoids. They were driven in a random way, driven by a procedural combination of the telemetry data from the rocket and a little chamber with a proximity sensor and a ball in it. Once it reached space, the powder chambers opened, the powder vibrated out of the boxes and onto the sticky paper, while the space guitar’s strings get tapped by solenoids. Dark Origin had a series of magnets suspended in the middle of the payload, various types of magnetic debris in chambers, and powerful fans blowing a whirlwind. When it reached space, the chambers opened, the fans blew, and the particles swirled and interacted and coalesced upon the strong suspended magnets.

Art in space.

The “space guitar” (Photo credit: Maria Baklund)

(This showed up on Instagram, but I didn’t want to spill any beans.)

Categories
Thinking hard, or hardly thinking?

Instagram

Hi folks!

A few months ago, I joined Instagram as adamwwolf. I enjoy posting a photo every once in a while.

I don’t post too often, and there are some gems in there!

Categories
Thinking hard, or hardly thinking?

Trust and Hysteresis

I was talking to a friend of mine today, and we got around to talking about trust. I realized that trust can be a good example of hysteresis.

When you trust someone, they can do things that you might not agree with, but you’re still OK with them. Once they do enough of them, however, you no longer trust them. Now, their actions are viewed in a different light, and things they do that would have been OK before are no longer OK.

It even works the other way around. Neat!

Categories
Thinking hard, or hardly thinking?

Happy Esperanto Day!

December 15th is Esperanto Day! Esperanto is a created language, started in the 1880s by L. L. Zamenhof. December 15th was his birthday, and it’s suitably close to the winter holidays that it’s become the largest Esperanto holiday.

I’ve been studying Esperanto every day for a bit more than 500 days, and I’m still having a lot of fun with it.

I wrote more about Esperanto Day last year.

Categories
Thinking hard, or hardly thinking?

“The Impact of a Coin Toss on Major Life Decisions and Subsequent Happiness”

I read an interesting paper recently, called “Heads or Tails: The Impact of a Coin Toss on Major Life Decisions and Subsequent Happiness”. It’s by Steven Levitt, who you may know as the “Freakonomics” guy. I’m, uh, mixed, on the Freakonomics stuff in general.

Here’s the abstract:

Little is known about whether people make good choices when facing important decisions. This paper reports on a large-scale randomized field experiment in which research subjects having difficulty making a decision flipped a coin to help determine their choice. For important decisions (e.g. quitting a job or ending a relationship), those who make a change (regardless of the outcome of the coin toss) report being substantially happier two months and six months later. This correlation, however, need not reflect a causal impact. To assess causality, I use the outcome of a coin toss. Individuals who are told by the coin toss to make a change are much more likely to make a change and are happier six months later than those who were told by the coin to maintain the status quo. The results of this paper suggest that people may be excessively cautious when facing life-changing choices.

They actually made a website where people self-selected, asked a question, got a virtual coin flip and filled out a little survey. The survey asked them how happy they were, and they got a followup survey six months later. The ones who were told by the coin flip to “change” vs “maintain status quo” (and did it) reported being happier.

Hmm.

(I have the original paper saved in my Pocket, but I’m not sure why. When I go to the link in a browser, it shows a paywall.)

Categories
Thinking hard, or hardly thinking?

Even Swaps

I first encountered the idea of “even swaps” a few years ago, in an operations research class I was taking for a graduate degree in systems engineering.

Even swaps is a systematic technique for thinking about complicated choices with multiple different tradeoffs.

Rather than write another summary of it, I’ll point to a pretty good write up (although it is a little wordy):

https://hbr.org/1998/03/even-swaps-a-rational-method-for-making-trade-offs

Categories
Thinking hard, or hardly thinking?

Weight Loss in 2015

This is what I looked like in February 2015.

Feb 14 2015

This is what I looked like in February 2016.
January 2, 2016

I lost 45 pounds over the year. At first, the primary thing I did was to stop ordering french fries at restaurants. I noticed that I often switched from choosing a healthier option to a less healthy option because the less healthy option came with fries–so I just stopped ordering them altogether. Within a month or two, this wasn’t something I wanted to really overindulge in so I didn’t have to completely abstain.

My wife signed us up for a CSA, which was a *lot* of vegetables, so all summer, my meals were almost entirely vegetable based.

I replaced my work lunches with protein bars, which are basically candy bars with extra protein marketed to men who want to get swole, but they do a pretty good job of tasting good while being filling.

I increased my physical activity, but I definitely avoided anything that qualifies as “working out”. I did a lot of walking, and would walk to go pick up lunch with my work buddies (without getting anything, of course.)

It’s been nice–I saw some people who I hadn’t seen in years at Maker Faire MSP a few weeks ago, and one person didn’t even recognize me until I talked, and he said, “Wow! You lost like… half a person!”

So, where does that leave us now? I’m not 100% satisfied with where I am right now, but I’m definitely more in a maintenance mode than last year. I have a goal for where I want to be by the end of this year, and I’m working hard to make it!

Categories
Thinking hard, or hardly thinking?

Budgeting with a buffer

I’ve realized that having a buffer in my availability is more and more important. By having extra time in your schedule, extra willpower, extra cash, whatever, you enable higher quality in the things you *do* choose to do.

What this implies, is that an activity that is only a possible or good choice if it fills the entirety of your availability, isn’t actually a possible choice!

Whoa.

Categories
Thinking hard, or hardly thinking?

Bags and Purses

I enjoy a good bag and a good purse. I have no qualms about being a man who wears a purse, and I’ll usually correct you if you use some silly word like “man bag”, “man purse”, or even worse, “murse.” I’m not Adam West.

I currently use the Tom Bihn Ristretto as a purse.
Tom Bihn Ristretto

Tom Bihn Ristretto

I’ve been using the Ristretto since 2012, and I still really like it, 4 years later.

I use the Tom Bihn Brain Bag when I need waaay more space, or am traveling.

Brain Bag

I had tried a Tom Bihn Synapse 19, but it was just a smidgen too small for the work travel I was doing, where I needed two laptops and some equipment. The Brain Bag is big–really big–but it shrinks up better than you’d think if you don’t need it fully expanded.

The Synapse 25 wasn’t out when I bought my Brain Bag, but it’s probably the next bag I’ll try.

When I was in college, I had a Maxpedition Neatfreak and a Timbuk2 laptop backpack.

The Maxpedition Neatfreak was pretty durable, a good size (it’s bigger than it looks in this photo), and worked well, but I didn’t really like the look. It looks a little too military/prepper for me.

Maxpedition Neatfreak Bag

I’m not 100% sure which Timbuk2 laptop backpack I had, but it fit a 13″ laptop and a few thick EE textbooks just fine. It had a main pocket, and two side pockets. It lasted about five years before tearing apart.

(Photos taken from the respective product pages. Go buy the Tom Bihn ones. They’re awesome!)