BTLIX 1976: Face to Face

Face to Face (Ansikte mot ansikte). Ingmar Bergman. 1976. ⭐⭐⭐⭐★★.

Originally a three hour TV series, “[i]t was edited down for theatrical releases for running times from 114 to 135 minutes.” And it stars Liv Ullmann and Erlend Josephson, so it’s very much similar to Scenes from a Marriage in that way.

This one’s produced by Dino de Laurentiis, who was apparently quite satisfied with the results. Bergman… not so much.

Now when I see Face to Face, I remember an old farce with Bob Hope, Bing Crosby, and Dorithy Lamour. It’s called The Road to Morocco (David Butler, 1942). They have been shipwrecked and come floating on a raft in front of a projected New York in the background. In the final scene, Bob Hope throws himself to the ground and begins to scream and foam at the mouth. The others stare at him in astonishment and ask what in the world he is doing. He immediately calms down and says, ‘This is how you have to do it if you want to win an Oscar.’

When I see Face to Face and Liv Ullmann’s incredibly loyal effort on my behalf, I still can’t help thinking on The Road to Morocco.

Exactly. I feel that Bergman dumbed it down for an international (i.e., American) audience. That Fraudian psychodrama in the hospital (which I guess is what Bergman’s referring to) is so kitchy. And most of the dream scenes are… well… clichés. But Ullmann is wonderful here, and there are some really strong scenes.

The first thing I was struck by when this film started was how awful the sound was: A loud buzzing sound. And Bergman is really particular about the sound quality. But then it turned out that the DVD defaulted to the Italian dubbed version, and when I switched to the Swedish one, everything was er, better. But the film transfer is really weird. I suspect that it’s an interlaced transfer that’s been upscaled to DVD and then interlaced again. It’s sort of ugly.

To conclude: Don’t buy DVDs from Italy.

This post is part of the 87 Bergman Things series.

The Ever-Shifting Sands of udev.rules

I use Telldus Tellstick to do home automation *cough* I mean control the lights:

It’s an unassuming USB stick that implements a serial interface so that you can talk to it by just sending some strings to it and read the response. Ideal for Linux! Yes!

But.

You do want the device to show up at a default space so that you can find it, and if you have more than one serial USB interface thing, which one of /dev/ttyUSB0, /dev/ttyUSB1 og /dev/ttyUSB2 is it?

udev to the rescue!

And here your woes begin, because every fucking time you upgrade Linux, the fucking udev people change the fucking syntax vaguely and how you fucking refer to fucking devices. Fucking.

In the really olden days you said

KERNEL=="ttyUSB*", SYSFS{idVendor}=="1781", SYSFS{idProduct}=="0c31", 
  MODE="0666", NAME="tellstick"

But then they changed SYSFS to ATTR in the slightly less olden days:

KERNEL=="ttyUSB*", ATTR{idVendor}=="1781", ATTR{idProduct}=="0c31", 
  MODE="0666", NAME="tellstick"

Then they disallowed renaming devices, and instead you add symbolic links to the device:

KERNEL=="ttyUSB*", ATTR{idVendor}=="1781", ATTR{idProduct}=="0c31", 
  MODE="0666", SYMLINK+="tellstick"

Then they changed ATTR to ATTRS:

ATTRS{idVendor}=="1781", ATTRS{idProduct}=="0c31", MODE="0666",
  SYMLINK+="tellstick"

Then they changed what the attributes refer to, so instead of getting this:

[larsi@stories ~]$ ls -l /dev/tellstick 
blrwxrwxrwx 1 root root 7 Feb 25 16:12 /dev/tellstick -> ttyUSB1

you get this:

root@stories:/home/larsi# ls -l /dev/tellstick 
lrwxrwxrwx 1 root root 15 Feb 25 16:27 /dev/tellstick -> bus/usb/001/014

And that doesn’t work, because that’s not a serial USB interface, but a raw USB interface of some kind which can’t be opened like a serial interface.

And, remember, you can’t refer to /dev/ttyUSB*, because that’s the problem you’re trying to solve.

The solution to these problems is this following command:

 # udevadm info -a -n /dev/ttyUSB1

You’ll get output like

 looking at device '/devices/pci0000:00/0000:00:14.0/usb1/1-10/1-10:1.0/ttyUSB1/tty/ttyUSB1':
    KERNEL=="ttyUSB1"
    SUBSYSTEM=="tty"
    DRIVER==""

  looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-10/1-10:1.0/ttyUSB1':
    KERNELS=="ttyUSB1"
    SUBSYSTEMS=="usb-serial"
    DRIVERS=="ftdi_sio"
    ATTRS{latency_timer}=="16"
    ATTRS{port_number}=="0"

Well, nothing there to distinguish the Tellstick from anything else, to continue down the output…

  looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-10/1-10:1.0':
    KERNELS=="1-10:1.0"
    SUBSYSTEMS=="usb"
    DRIVERS=="ftdi_sio"
    ATTRS{authorized}=="1"
    ATTRS{bAlternateSetting}==" 0"
    ATTRS{bInterfaceClass}=="ff"
    ATTRS{bInterfaceNumber}=="00"
    ATTRS{bInterfaceProtocol}=="ff"
    ATTRS{bInterfaceSubClass}=="ff"
    ATTRS{bNumEndpoints}=="02"
    ATTRS{interface}=="TellStick"
    ATTRS{supports_autosuspend}=="1"

Yes! The ATTRS{interface}==”TellStick” thing looks like it’s something we can use to distinguish between Tellsticks and other devices, and it’s not so far down in the device hierarchy that we’re not talking about serial interfaces any more, and presto!

[larsi@stories ~]$ ls -l /dev/tellstick 
lrwxrwxrwx 1 root root 7 Feb 25 16:33 /dev/tellstick -> ttyUSB1

Here’s the magical setup file, for reference if anybody wants to write a udev rule for Tellstick devices that works on February 26th 2018, but probably not the week after:

$ cat /etc/udev/rules.d/10-tellstick.rules 
ATTRS{interface}=="TellStick", MODE="0666", SYMLINK+="tellstick"

You can also refer to the parent attributes by saying SUBSYSTEMS at a strategic point, so the following also works today:

KERNEL=="ttyUSB[0-9]*", SUBSYSTEM=="tty", 
  SUBSYSTEMS=="usb", ATTRS{idVendor}=="1781", 
  ATTRS{idProduct}=="0c30", 
  MODE="0666", SYMLINK+="tellstick"

Basically, when upgrading a Linux machine, most everything just works; all the peripherals and all the software. But I always end up twiddling the udev setup for half an hour.

Useful Consumer Review

I’ve had the vast majority of the lights in my apt. controlled remotely (from Emacs, of course) for like a decade. It’s a flexible system built on Telldus Telstick receivers and transmitters, and Nexa wall sockets.

But… Look at the un-pretty:

Yes, those outlets are fugly. Fortunately quite a few of them are hidden behind furniture, but I’ve been on the lookout for prettier solutions. Remote-controlled light bulbs are nice, but most of them use proprietary control systems that seem fiddly and not easy to integrate into my setup. Ikea have released bulbs that show some promise, but the form factors are still very limited, so I’ve been biding my time for years waiting for somebody to make something… better.

Look!

Telldus apparently started making these outlets a couple of years ago. They use the same 433MHz signalling system as the Nexa outlets (and the Telldus transmitters), and they look so much prettier. Of course, Telldus seems to be phasing them out already because they want to sell a completely new product line based on ZWave, so these were on half price sale and I snapped up a stack of them.

Sometimes it pays to be oblivious.

So last night I sat down to start changing the outlets, and the first thing to do is to program them. (I give each outlet an individual code, a room code, and an apt. code, so that I can switch the entire room/apt on/off with one signal.)

But they behaved very strangely. One of the outlets I could give code 40, but not 202. But I could give it code 56. Hm. 7 bit problems? No, I could give it code 153… WTF?

So I started dumping the output from the included remote controls:

And it dawned on me that the second-to-last hex digit was always 9 on the included remote controls, but not in the codes I transmitted.

What I had was

(when (> unit 16) 
  (setq house (+ house (/ unit 16)) 
        unit (mod unit 16)))

That is, I did modulo 16 on the unit code (because that’s a 4 bit value) and then went to the next house code. And that worked fine for the Nexa outlets, but with these Telldus outlets, not all house codes are valid. I didn’t investigate in depth what patterns were allowed, but every 16 was definitely allowed, so I changed the above code to:

(setq house (+ house (* (/ unit 16) 16)) 
      unit (mod unit 16)))

So I skip to the next sixteenth house code instead of the next one.

And then it works! Of course, that means that I had to reprogram all of the outlets, even the old Nexa ones that I didn’t swap out. Oh, the tangled twisty turns of life.

Look teh pretties:

They seem to have pretty good reception, too. That is, at least not any worse than the Nexa outlets. But as you can see, they’re not perfect: They’re juuust a smidgen too wide to fit two side-by-side into a standard outlet, and they may even be problematic with a fat non-remote neighbour.

*sigh*

But prettier!  And more convenient.  These Telldus outlets have a manual on/off button, so you can get the lamps to switch on/off even if the control system is down, for some reason or other.

Now I just have to decide what to do with the old outlets… Probably not much use for them, but perhaps I should hold on to them to see whether the Telldus outlets continue for function well.

BTLVIII 1975: Silence! Action! The Magic Flute!

Silence! Action! The Magic Flute! (Tystnad! Tagning! Trollflöjten!). Katinka Faragó, Måns Reuterswärd. 1975. ⭐⭐⭐⭐⭐★.

This “making of” film of The Magic Flute is really interesting. It’s mostly fly-on-the-wall, and it’s really well edited and funny.

“The Magic Flute isn’t just a risible fairy tale… But as a music play, it’s fairy tale/poem/dream.”

This is one of the best “making of” documentaries I’ve seen. You can find it here, but you need to use a VPN to pretend you’re in Sweden to watch it, and it’s not subtitled, so you need to understand Swedish to, er, understand it.

This post is part of the 87 Bergman Things series.

BTLVII 1975: The Magic Flute

The Magic Flute (Trollflöjten). Ingmar Bergman. 1975. ⭐⭐⭐⭐⭐★.

This was the most expensive TV production ever made in Sweden at the time, so there were the usual mutterings of “scandal”, but they sold the finished TV show to so many countries that it ended up earning the Swedish TV company a lot of money.

This is Mozart, of course, so the music sucks and the story is pure distilled twaddle, but it’s pretty amusing. I mean, it’s meant to be funny (I think?), and this staging hams it up.

Bergman has chosen some very young and pretty performers, and they seem to be miming here? So they recorded the music first and then edited together the acting from a bunch of different shots? I’m just guessing… But the next Bergman Thing is a documentary about this Thing, so all will be revealed.

I’m no Opera connoisseur, but I think the voices are mostly not very impressive. I like Pamina’s voice… really beautiful.

Bergman goes all out in trying to make a pleasant, amusing and commercially acceptable version of the opera for TV. I think it looks like he had a lot of fun, and the results are very likeable. Corny? Yes.

I read P. Craig Russell’s version the other week, which probably made me more susceptible to the doubtful charms of the piece.

This post is part of the 87 Bergman Things series.