mac

Can the real Slim Space Please stand up? by Paulo Fierro

Today I ran into an interesting problem where some of our unit tests were failing locally, after upgrading to macOS Sonoma and Xcode 15.

Apparently there was a subtle change made to date formatting, and I was seeing this error.

11:30 AM is not equal to 11:30 AM

After lots of squinting, I pasted the error message into Sublime Text and spotted the error.

Secret characters lurking in the mist

Fixing the test was straightforward, but it did leave me thinking I should probably write a comment to let future me (and others) know that I wasn't losing the plot.

You can’t see it, but I swear its there!

After chatting to Chris about this, he suggested escaping the Unicode sequence, which is undoubtedly a much better approach and makes it more obvious what is going on.

Much better

So who is Mr. 202f? Apparently its a Narrow No-Break Space and is also used as a group separator, which given the context makes perfect sense.

Console flooding, USB timeouts & Garmin ANT+ by Paulo Fierro

While I was working this morning I ran into some issues with an app and went to check if the Console (under /Applications/Utilities) was reporting anything.

Unfortunately the log was filled with some USB device timing out with the following error:

AppleUSBEHCI::Found a transaction past the completion deadline on bus 0xfa, timing out! (Addr: 5, EP: 1)

A very noisy log

This timeout was annoyingly happening every few seconds. The error did give me a few clues. It was happening on USB bus 0xfa on a device attached to address 5.

To find the device in question I generated a System Report ( > About this Mac > More Info > System Report) and looked for the USB bus with the same address.

Finding the USB bus number

Finding the USB bus number

Then it was just a question of going through the devices connected to this bus that had the address in question.

The address of the USB device

The address of the USB device

Found you! The device in question was the Garmin ANT+ stick that transmits data wirelessly from my Garmin Forerunner 610 watch.

Unplugging it fixed the problem and the Console stopped being flooded.

fry.jpg

Playing sound through two displays by Paulo Fierro

On my desk sits a 21" iMac which is plugged into a 27" Apple Cinema Display. The iMac is a great machine, but the audio quality is better coming out of the Cinema Display — larger screen, probably better speakers.

​My desk on May 17

So when I'm playing music I always select the sound output to come from the Cinema Display. You can Option+click the Volume icon on the menu bar and select either "Display Audio" or "LED Cinema Display", both mean the same thing. If I want to use the iMac speakers I select "Internal Speakers".

But what if I want to use both? Madness right? After looking around I found that you can create a "Multi-Output" device using the Audio MIDI Setup app.

So after doing that I created a multi-output device called "Both Screens" with output going to the built-in iMac speakers as well as the Cinema Display.

The only downside is that you have to control the volume from the app doing the playback, e.g. iTunes. Whatever volume you had the selected display at is what's used so you may want to swap back to it, set the right volume and then swap back.

Dual monitor sound output. Hell yes.

Changing dates with Automator by Paulo Fierro

For my birthday Niqui got me this dive mask from Liquid Image. Its a nice mask and the video taken with it is great but the four rechargeable AAA batteries power it for about 90 minutes. Most of our dives are an hour or less so that's not a problem, and the mask comes with a battery recharger – however while charging the batteries the camera forgets the date.

You have to set the date each and every time. Its a minor thing but it annoys me so I don't do it. For some reason the default date is set to Monday, January 8, 2035 – a strange choice.

So because I'm lazy and don't change the date on the camera every time, when I eventually drag the video files into Final Cut I get crap like this:

Screen Shot 2012-10-15 at 11.53.34.png

Having some events with the right date and some in the future makes organising video for projects a nightmare. So after googling around I found that I could use the touch command in the Terminal to change the creation date. If I do this on each file before importing it into Final Cut I avoid the problem. So the command is basically:

touch -t yyyymmddHHMM <PATH_TO_FILE>

Still, doing this on multiple files is a massive pain so I toyed with the idea of writing a script for it. I have used Automator in the past and figured doing things like selecting items using the Finder's File Selection dialog is easier than using a command line script so that's what I did and you can see the "recipe" below.

It accepts a string which is the date you want the file to have been created, you select the files and you're done. It keeps the original time too, which may not be something you want but I don't really care about the time. As long as the files have the right date and are sequenced correctly its good enough for me.

You can download the application here. You can also open it up with Automator and modify it as you see fit.

While doing this I learned Automator actually has support for variables – who knew? Its a powerful tool and I don't think I use it enough.

Screen Shot 2012-10-15 at 12.00.36.png