Ipad, Screenshots and Linux

It’s become increasingly clear over the past few months that many recent, fun-sounding films from countries with smaller film industries will never get a physical DVD release. The only way to see these films is via Amazon Prime, and since Amazon Prime isn’t conveniently available on Linux machines, I’m having to use an Ipad to watch these films.

Which is fine.

But I have to take screenshots. (I mean. I have to!) That leaves a lot of images on the Ipad, and I need a convenient way to get those from the Ipad to my Linux laptop.

Now, there’s Dropbox, and… stuff, but all those things require some manual work at the Ipad end or the Linux end. I hate manual work.

So wouldn’t it be nice if there was some way to just “do something” and then all the screenshots from the Ipad would magically appear in my Emacs on the Linux laptop?

There is!

It’s a bit fiddly, though, so let’s just get started.  (“A bit fiddly” is code for “seven pages of text is to follow”.  This is the year of Linux on the Desktop.)

My Laptop runs Ubuntu Linux, and it comes with an ifuse distribution that’s built with GnuTLS and not OpenSSL. This doesn’t work with IOS 10, so you need to build it yourself.

I’ve streamlined the build instructions a bit. The utilities and libraries needed to talk to Idevices is spread over four repositories, but the following should pull them all down, build them, and install them under /usr/local.

sudo apt-get build-dep ifuse 
for elem in libusbmuxd libimobiledevice usbmuxd ifuse; do 
  git clone https://github.com/libimobiledevice/${elem}.git 
  (cd $elem; sh ./autogen.sh; make; sudo make install) 

Check that your path is picking up the correct version by saying

$ type ifuse 
ifuse is /usr/local/bin/ifuse

Then plug in the Ipad via USB, and test that you can talk to the device. You may have to press “Trust this device” on the Ipad while connecting.

$ sudo mkdir /media/ipad 
$ sudo chown larsi.users /media/ipad 
$ idevicepair pair SUCCESS: Paired with device 37b633350ab83dc815a6a97dcd6d327b12c41968 
$ ifuse /media/ipad

You should now have the Ipad mounted, and the screenshots are under /media/ipad/DCIM.

Now for the fun part: Make the laptop copy over the files automatically whenever you plug in the Ipad.  I’m using the general setup from the usb-automount setup I did a few months ago.

The main difference is this udev.rules file:

ATTR{idVendor}="05ac", ATTR{idProduct}="12ab", PROGRAM="/bin/systemd-escape -p --template=usb-automount@.service $env{DEVNAME}", ENV{SYSTEMD_WANTS}+="%c"

And then I use the following script to actually copy over the contents to the current “viewing directory”.



if [ "$command" = "remove" ]; then
    umount /media/ipad

# Mount the Ipad.
ifuse /media/ipad

if [ -d "/media/ipad/DCIM/100APPLE" ]; then
    cd /media/ipad/DCIM/100APPLE
    for pic in IMG*; do
        if [ ! -f "$to/$pic" ]; then
            cp -av "$pic" "$to/$pic"
            chown larsi.users "$to/$pic"
            if echo "$pic" | grep PNG > /dev/null; then
                shot=`echo "$pic" | sed 's/IMG_/shot/' | sed 's/PNG/png/'`
                if [ ! -f "/home/larsi/.movie-current/$shot" ]; then
                    ln "$to/$pic" "/home/larsi/.movie-current/$shot"

cd /
umount /media/ipad

Or something like that.  You obviously have to adjust the script to your needs if you want to do something like this, but the general idea should be sound, I think…

Look!  The images appeared in Emacs!  As if by magic!

It seems to work reliably, also after rebooting the laptop.  Apparently the “idevicepair pair” think only has to be done once?  Or something?

The only minor annoyance is that Ubuntu pops up an icon in the right-hand menu every time I plug in the Ipad.  Is there any way to say to Ubuntu “ignore this device in the UI”?  There is a way to make Ubuntu ignore all auto-mounted devices, but that’s not what I want, and there is a way to make Linux ignore a specific USB device completely (echo 0 > /sys/bus/usb/devices/2-1/authorized), but that’s not what I want, either.  I just want the UI to ignore this specific device…

Oh, never mind.

My New Concert Blog vs Useful Consumer Review

I’ve been using a Panasonic GH4 camera for a couple of years to do concerts.  It’s a very nice camera, but it has a few problems.  1) When recording video, it splits the video into 4GB chunks that I then have to piece together.  It’s not a biggie, but it’s annoying.  2) More seriously, the microphone on that camera kinda sucks.  Whenever there’s a really steep sound gradient, it freaks out and goes into white noise, which means that I’ve had to discard more than a few recordings.  IV) It’s big and bulky. f) I use it for other things, too, which means that I have to swap settings and SD cards all the time.

So I got a Panasonic GX85!


I’ve been using it for some weeks now, and it’s pretty spiffy.  All the previous concerts I’ve done with the camera have been very low-volume affairs, so I had no idea whether the microphone works or not in high volume environments.  Until tonight!

Excuse the wobbly camera work, but I was resting it on my knee.  But the sound is kinda OK, eh?  And it was pretty loud.

So I think this camera’s going to work out.

One funny quirk about the GX85, though, is the EU video length limit.  In case you didn’t know, in the EU, things termed “video cameras” are subject to a pretty steep tax.  Camera producers work around this by limiting their cameras to 29:59 minutes, because they don’t have to pay the tax.

When filming in most modes, the GX85 camera heeds that limit, but it appears that the Panasonic people “forgot” to program that limit when you’re doing 4K video.  Then you can film as long as you want.  Or until the battery runs out, which takes more than two hours.

So…  From now on, the concerts I post on Youtube are going to be in 4K.  You can thank Panasonic and their absent-minded engineers.


I’m extremely lazy, so using a remote control to switch the TV on or off is just out of the question. The remote is just languishing in a cupboard somewhere, and the TV is always on. Which seems like a waste, since I only use it (like) a couple of days a week or something.

Most of the time it just functions as an xscreensaver-enabled display to show the sleeve of whatever album’s playing on the stereo.

But then! The other week a friend told me about something magical called “CEC”, which is apparently short for Consumer Electronics Control. It allows sending commands via HDMI (High-Definition Multimedia Interface) from your VIDEO (Visual Ideas Directed Except Oldskool) card to the TV (Television).

However, virtually no video cards support this natively. The notable exception is the graphics card in the Raspberry Pi (RPI).

Fortunately, Pulse-Eight sells CEC injectors. It a tiny thing you put in between your computer and your TV. And today it arrived:

Very small and cute.

It’s a bit more extensive with the wiring. The product page said that you can’t use it reliably if you have a very long HDMI cable to your TV, but mine is seven meters, and it seems to work fine…  Oh, perhaps I should try playing something that takes a lot of bandwidth…  Let’s see…  Captain America: Civil War Bluray…  Yup, there’s the captain.  No extra latency or anything that as far as I can tell.

There’s a USB port that you communicate over. The device shows up as a serial device in Linux, and you talk to it via a program called cec-client.

This excellent blog posts details how you use cec-client from Linux, but basically you just say

$ echo 'standby 0' | cec-client -s /dev/ttyACM0

and the TV goes to standby mode.


Mine didn’t, and it’s a five year old Samsung TV. After googling a bit more, it turns out that you have to enable this stuff under the “Anynet+” setting in the menus. Let’s just walk through this quickly, if anybody has problems finding the menu (which is something I had):

It’s way down in the main menu. Enter the “Content View” thing…

… and then choose “Anynet+”…

… and setup..

… and the thing you’re looking for is “Auto Turn Off”. If that’s on, then you can put the TV into standby mode via CEC. Makes sense, huh? HUH?!

So now all the bits are in place, and I can use this stuff. I chose to have xscreensaver wake the screen up with a -watch script modeled after this one.

So when I hit something on the TV machine keyboard, it unblanks xscreensaver and turns the TV on. (This takes an annoyingly long time, though… like 10 seconds? What’s up with TV makers and the incredible slowness involved with anything?)

To switch the TV off, I just hooked it up into my general go out/switch off everything before going to sleep actions.

Emacs is for automation.

There you go.

Blackest Night

Previously: I bought an HDMI OLED screen and determined that its black pixels emitted light.

This made me start wondering: Do all OLED screens emit light from “black” pixels?

So I did the simplest thing possible to test this: I made a little app that displays a black screen. It’s on Google Play and everything. It’s called “Blacker Than Black” if you just want to search for it on your phone.

So I loaded it up on my Blackberry Priv AMOLED (that’s short for “armored led”, I think), and went into the unmentionable room, and took a picture:

OK, that’s kinda… black… let me twiddle the camera settings… er… f2.8… ISO6400… two second exposure…

That’s still very black! Although now the camera can see my fingers in the very, very dim room. Very dim.

OK, let’s test another phone. That’s a Samsung Galaxy S6…  (Which is also AMMO LED.) Very black indeed.

OK, I’m convinced. That SmallHD AC7 OLED screen sucks, but other black OLED screens are blacker than very black.

For kicks, I loaded the app onto my Sony Xperia z4 tablet, which has an IPS screen. And dialed the exposure settings waaaay down.

Yeah. It’s not very black.

Galaxy S6 in front to compare.

So there you have it: The OLED blackness myth… IS CONFIRMED!

Shocking. But that just means that I have to find a different 7″ OLED screen from somebody that makes a better screen, and things will be perfect!

Unfortunately, after googling for an hour or two, that doesn’t seem to exist. There are other OLED screens, and a couple of them even have HDMI, but they’re all really, really ugly, and isn’t really something that I want in my bedroom.

Oh, well. I’ll have to wait a few more years for perfection…

Blacker than Black? A Small Monitor Review

I’ve been using an Emacs-based alarm clock for almost a decade through various hardware incarnations.

The main issue is the screen: It’s difficult to find a small screen that has a good black level. The last version used this USB IPS screen from MIMO, and it’s just about as good as you can get with IPS.

It’s difficult to illustrate just how it looks since the camera helpfully adjusts everything, but with the camera on manual, I think this is just about right when it’s darkish in the bedroom. When it’s completely dark, its glare is rather annoying.

So! I got an OLED screen today, because OLED has perfectly black blackness, right?

Quotes like “Produces True Blacks” and “Because OLED displays are not backlit like LCDs but rather lit by each individual pixel, black means black. This yields a contrast ratio of infinity to one.” can’t lie, can they?

And everybody knows that an OLED pixel that’s off doesn’t emit any light, right?

That is, indeed, quite black. But is it completely black?

No. If you look closely, it’s trivial to see where the black bezel ends and where the screen, filled with black pixels, starts. (The picture above exaggerates the issue a bit, depending on your monitor.)

But here we compare the IPS screen (to the right) with the OLED screen (to the left) in a completely dark room. The difference is huge. YUGE! But it’s not perfect!

The myth of total blackness in black OLED pixels: Busted.


Oh, well. This is approximately what this screen looks like from my vantage point in the bed when I’ll be waking up in the middle of the night and wondering what time it is before going back to sleep again, cursing the monitor gods and waiting for the next hardware revolution.


Obelisk: A Monitor Review

I’ve had the same monitor in my stereo control system for many years. It’s a 20″ Dell that’s OK.

It’s got an appropriate size for the living room. But lately it’s started having a high-pitched whine. If I play only punk music I can’t hear it at all, but otherwise it’s slightly annoying.

So I went looking for a new monitor. I thought it might be nice to have a rotated monitor this time: Higher than wide so that I can display the name of the currently playing artist un-sideways.

Practical as always.

So my specs here were: No logos, and no bezels wider on any sides, and as small as possible. The logo/bezel thing because inevitably that looks weird when rotated, and this is in the living room. Looking pretty is nice.

Behold! After searching for hours, there was one (1) monitor that fit the specs, and it’s this 24″ NEC EX241UN. It’s got very narrow bezels and no logos and nothing ugly. So it’s just like a matte obelisk.

But my stereo computer machine is oooold. It’s based on a 2GHz Pentium M 32-bit CPU. I think I bought it in 2005, possibly? You can see it underneath the cassette player up there… It’s in a Hush enclosure.

And it managed to connect to the screen! I wasn’t quite sure whether it was going to be able to do that, because it’s also a Pentium M motherboard and the video routing is not very well supported by Linux by default. But I managed to route the DVI signal out instead of the LVDS and VGA, and there’s … the Matrix?

Er. X isn’t quite sure….

OK, “Option rotate left” in xorg.conf instead.

Now I have to rearrange all the display data… Hm… Does that look nice?

The monitor itself is pretty nice.  Quite wide viewing angle, but when I standing there at the screen looking for something to play, I do get a slight sheen at the bottom of the screen, so it’s not perfect.  But it’s completely silent, as far as I can tell over my tinnitus.

Perhaps I should have a clock and a load monitor there. Just so that not 100% of the screen is Emacs. I don’t want to appear fanatical or anything.

Or perhaps the sleeve on top?

Hm… Perhaps I should make that font smaller. I’m nearsighted, but not actually blind.

The un-nerdiness of this setup cannot be misunderstimated.

Of course not.  Not.

Vinyl Noise

I’m still buying a lot of music on vinyl. Not because it’s hip: I was buying vinyl long before hipsters did. (That’s code for “old”.)

I had one record player for decades that was cheap, but pretty OK. But it had one major problem: There was a lot of deep rumble. Not horrible-sounding, but still… that rumble shouldn’t be there.

After getting a job and I could afford to buy something better, I got a Thorens TD-240. (It’s mid-price, I guess, in the audiophile sceme if things.) It had less rumble, but I found it to have a kinda buzzy thing going on. Almost like an electrical fault of some kind, but it’s grounded and stuff, so… it shouldn’t?

So about a month ago I decided it was time to join the grown-ups and look at Serious Record Players.  Buying one mid-priced record player after another seems might end up more expensive than just buying one really good record player, I though.

Oy vey.

This is what I need: A record player that can play both 33⅓ and 45 RPM, and be able to switch between those easily. The kind of music I buy usually doesn’t say what speed they’re meant to be played at (because the people who make them are presumably on drugs and just forget to put those details onto the covers), so I spend a lot of time going “hm? does this sound good? now then? hm? Oh, finally, somebody sings something! it’s 33⅓!” while flipping the speed thing back and forth.

Making each change take several minutes isn’t an option.

So there goes more than 90% of the high-end players: With most of them you have to remove the heavy platter, change a rubber band, and then replace the heavy platter. And then decide that that’s the wrong speed anyway.

The remaining 10% of the record players are designed by wiseguys. Like this one, that does have a button that you can control the speed with… but it’s a single button that toggles between off/33/45 and then back to off again. And after reading a gazillion reviews, you find out that it’s fiddly and slow and that it goes to “off” when you want “45” and stuff.

Not to mention the other super-premium players that (seriously) take 45 seconds to spin up to 33⅓, and then another 30 seconds to spin up to 45.


They’ll put up with basically anything, user interface wise.

After looking at about seventy different models (all models that were available, basically), there was one (1) model that satisfied my extremely humble specs: The Clearaudio Concept.

And it’s butt-ugly.

But it’s either buzz or butt, so here’s the epic unboxing sequence, because the delivery guy finally delivered it this afternoon:

And it came with a nice cartridge, and everything pre-adjusted (height, anti-skid, etc), so I just plugged it in…

… to my phone amp, since my stupid amplifier is all modern and stuff.

It comes with a level so that you can check whether it’s, er, level. An amazingly enough, it is!

I mean, the floors here are o-l-d, and that stack of stereo equipment is precarious, but somehow accidentally they even each other out.

So let’s test the sound! I’ve chosen the out-of-print album The Will & The Gentle by the marvellous Pauline Oliveros, just bought from a kind person in Italy via Ebay.

Instead of nattering on using words like “precision”, “taut” and “space” like an audiophile, let’s just compare to see whether the buzz is gone.

Here’s how the first minute sounded from the Thorens:

And here’s from the Clearaudio:

Wow! IT”S CLEARER! And it’s… a slightly different speed. Slower. The Clearaudio is probably more correct, eh? Eh?



And…  try playing both at the same time.  That’s eerie, isn’t it?

So now the only problem is that it’s butt ugly. But I’ve got gaffa tape.

You know what’s coming now.


Clearaudio, if you want to use me as a design consultant, just drop me a note. And feel free to use a pull quote from me in your ads. Perhaps something like “literally the only record player I could buy” or “even if it’s unbelievably ugly, it sounds fine”.