The Pains of Storage

Oy vey.

USB has always been “well, it kinda works”.  So I shouldn’t have been surprised at these pains.

And I wasn’t.

I decided to store my DVDs on disk for rapid access.  I bought USB3 devices.  This is my story.

My first device was a single 6TB Western Digital Green disk in an Icy Box USB3 enclosure.


lsusb says:

Bus 004 Device 007: ID 05e3:0731 Genesys Logic, Inc. 
Device Descriptor:
 idVendor 0x05e3 Genesys Logic, Inc.
 idProduct 0x0731 
 bcdDevice 90.84
 iManufacturer 3 Raid Sonic
 iProduct 4 USB Storage Device
 iSerial 5 0000000000000000

The WD Green disk is quite nice.  It’s very quiet.

The only problem is that whenever it goes to sleep, and it does that a lot, it goes missing from the Linux USB subsystem when you try to write to it.

Anyway, it was too small, so I bought a two-disk enclosure and made a RAID0 stripe over it.  Another Icy Box USB3 device, as it happens.


I put two 6TB WD Red disks into it.  This is what lsusb says:

Bus 004 Device 006: ID 067b:2773 Prolific Technology, Inc. 
 iManufacturer 1 ICY BOX 
 iProduct 2 ICY BOX IB-3620
 iSerial 3 PROLIFICMP0000002F1
 bInterfaceClass 8 Mass Storage
 bInterfaceSubClass 6 SCSI
 bInterfaceProtocol 80 Bulk-Only

It’s fast and nice, but the problem is that once in a while, whenever I try to read and write a lot to it, it freaks out.

Oct 15 00:29:53 stories kernel: [86720.343239] usb 4-1: reset SuperSpeed USB device number 5 using xhci_hcd
Oct 15 00:29:53 stories kernel: [86720.356884] usb 4-1: device firmware changed
Oct 15 00:29:53 stories kernel: [86720.357083] usb 4-1: USB disconnect, device number 5
Oct 15 00:29:53 stories kernel: [86720.357484] scsi 9:0:0:0: rejecting I/O to offline device

And the device goes to read-only, and you have to switch it off and then on again.

So either Western Digital makes lousy disks, or Icy Box makes awful USB3 enclosures, or the USB3 chipset sucks, or USB3 sucks, or Linux sucks.

Or all of the above.

The USB3 chip is

02:00.0 USB controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 03)

So naturally I bought an enclosure from a different manufacturer: SilverStone.

lsusb says:

Bus 004 Device 011: ID 152d:0539 JMicron Technology Corp. / JMicron USA Technolo
 gy Corp.
bInterfaceClass 8 Mass Storage
 bInterfaceSubClass 6 SCSI
 bInterfaceProtocol 80 Bulk-Only

And what do you know!  It works!  It’s kinda fast-ish, too.  So I bought a tiny 7W computer with USB3 ports to put into a closet, and now I can watch movies without moving from the couch.

In conclusion: Icy Box sucks.  So much.

Monitor losing HDMI connection whenever xscreensaver runs: It’s a thing

After upgrading my TV machine (the old one wasn’t powerful enough to play BluRay media), whenever xscreensaver runs, the TV would claim to have no inputs.

IMG_5331I know.

After trying various things, I started looking at the DPMS stuff, because that’s, like, power handling and seemed like something that might be relevant.  Perhaps Linux/xorg/whatever turns HDMI output off when we get into “power saving” mode?  And doesn’t know how to switch HDMI on again?  Intel Xorg things are often kinda funky:

00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200
 v3/4th Gen Core Processor Integrated Graphics Controller (rev 06)

So DPMS seemed like a likely guess.  However, I already had the following in my .Xscreensaver file:

dpmsEnabled: False

So what could it be?  Reading through the documentation, it seems like xscreensaver has gotten a new option called dpmsQuickOff.  (Makes total sense that if you have DPMS disabled, then “quick DPMS” would still be enabled, right?)

I disabled that in my  ~/.xscreensaver file, which made older xscreensavers on the other machines start complaining about an unrecognized option.  (Yes, I use nfs.)

Instead I put the following in the .Xdefaults file on the TV machine:

xscreensaver.dpmsQuickOff: False

And everything works perfectly.

If somebody had written this on the Internet somewhere, I would have been spared minutes and minutes of work.  So here you are, Next Person With Obscure Linux Intel Xorg Xscreensaver Blank Screen/Disconnect Problem.

Useful Consumer Review

My old tv machine worked ok, but it was too slow to play the files MakeMKV ripped from BluRay disks.

So I bought a new one from QuietPC. I’ve bought a couple from them before, and they seem to make reliable, fanless machines.

So here are the notes on problems getting the video working under Debian Linux. Sigh.

The motherboard is Gigabyte H87N-WIFI, the VGA is “Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller”, which is a Haswell HD Graphics thing.

First of all, if you have xserver-xorg-video-modesetting installed, get rid of it. For some reason or other, X -configure prefers this generic driver over the Intel driver, which is pretty nonsensical. It’s not accelerated, so you can’t really use it for much of anything.

After getting rid of it, you’ll get the Intel (i915) driver instead, which works OK. Except if you want to watch video. Then you get lots of tearing. There’s a newer “tear free” version of the Intel xorg driver that fixes this problem, but it’s not included in Debian testing, even.

So go to the Intel page and download the “xf86-video-intel – 2.99.906” package. It compiles easily enough (just need to install some -dev packages). Install it by moving the file after compiling over the one supplied by Debian. It should work fine. (Unless you’re reading this some time after March 2014.)

Hey! Now you can watch video. Except when the i915 driver loads, the HDMI screen turns all grey. For some reason or other, i915 jacks the backlights on the monitor up to max, leaving me with a very, very pale and bright TV.

After googling for hours, I finally found this. So you have to say

xrandr --output HDMI3 --set "Broadcast RGB" "Full"

to get black to be black. “Yay.”

I got an integrated BluRay slot player in the machine, because I thought that would look tidier than the external USB drive. However, MakeMKV says the following when I try to use it: “Drive BD-RE MATSHITA BD-MLT UJ265 1.00 has RPC protection that can not be bypassed. Change drive region or update drive firmware from Errors likely to follow.” Indeed. And there is no region free firmware for this drive, so I’ll just continue to use my external BluRay drive.

Anybody know of a region-free slot-in slimline BluRay drive?

The Tellstick control unit didn’t work any more, because they’ve removed the “vendor” and “product” options from ftdi_sio. So this doesn’t work any more:

options ftdi_sio vendor=0x1781 product=0x0c31

Instead you have to say

modprobe ftdi_sio
 echo 1781 0c31 > /sys/bus/usb-serial/drivers/ftdi_sio/new_id

Yeah, that makes sense…

Finally, the machine has tons of USB3 ports, and just two USB2 ports. I thought that would be a plus, but it seems like my tiny USB monitor doesn’t like being plugged in to the USB3 ports. The kernel says “Cannot enable port 3. Maybe the USB cable is bad?” and the monitor drops connection.

Well, maybe the cable really is bad? It’s always the cable’s fault!

(This is where I go to look for a new cable. And I find one, and switches the cable, and everything works perfectly! It’s always the cable!)


See? It almost works out of the box. I mean, finding out all this only took me eleven hours…

It’s the year of Linux on the Desktop any… decade… now.

Note To Self

This is how you set up the digitemp device the next time the SSD breaks down and you’ve forgotten to back up the /etc directory:

[larsi@stories ~]$ cat /etc/udev/rules.d/20-digitemp.rules
ATTRS{idVendor}==”0403″, ATTRS{idProduct}==”6001″, MODE=”0666″, NAME=”digitemp”

It’s “ATTRS” now, not “ATTR”.  Or “SYSFS”.  Thanks a lot, udev people.  Changing the names to be used in the conf files all the time really helps.  A lot.  Thanks.

stories:~# digitemp_DS9097U -s /dev/digitemp -i -c /etc/digitemp.conf
DigiTemp v3.5.0 Copyright 1996-2007 by Brian C. Lane
GNU General Public License v2.0 –
Turning off all DS2409 Couplers
Searching the 1-Wire LAN
2815ECE002000053 : DS18B20 Temperature Sensor
ROM #0 : 2815ECE002000053
Wrote /etc/digitemp.conf

Now we have a conf file, so we can use the device:

[larsi@stories ~]$ digitemp_DS9097U -q -c /etc/digitemp.conf -a
Jun 28 13:55:11 Sensor 0 C: 23.81 F: 74.86

Couldn’t be simpler.

Books, Emacs, and ISBN APIs

I have the worst memory.

But even so, I pretty much manage to remember what books I’ve read.  If I’ve read Anagrams by Lorrie Moore, I remember that.

The problem is with the less (how to put it?) good books.

I read a lot of crap.  Crap that I like, but it’s crap.  Book after book of entertaining, but not really essential books.

For instance, I’m now reading No Cooperation from the Cat by Marian Babson.  It’s amusing, quite decently written and is a pleasant read.  It’s ostensibly a mystery novel, but people mainly stand around talking wittily to each other while they cuddle cats.  And then somebody’s going to die or something, I’m guessing.  The suspense!
She has previously written books like The Company of Cats, To Catch a Cat, The Cat Next Door and Even Yuppies Die.

I have absolutely no idea whether I’ve read those books or not, but if I haven’t, I want to.  And there’s the problem.

My books are kinda organised on the shelves, so I can pretty much find any book if I look at four separate locations where a book is likely to be.  Unless I’ve recently read it.  Then there’s no hope, because it’ll be in the “just-read” stacks.

So I thought: Perhaps I should just enter all the Marian Babson books into a database of sorts, and then just buy all the ones I haven’t read in one fell swoop.  I like fell swoops.

And then I thought that that sounded kinda boring, so perhaps it would be an idea to have a bar-code scanner, and enter the ISBNs that way.

But then I needed to look up the ISBNs via some API, so that I could see that the book is look-up-able.

Strapped-on Keypad

And then I thought that I might as well just scan all the books.  But then I needed to have a routine going where I would scan newly bought books to.

You can see where this is going.

I wrote an Emacs ISBN interface and book database thingie: Bookiez, and a bought a wireless barcode scanner, so that I don’t have to bring the books to the computer to enter them into the database.

I also set up the computer so that the data from the scanner goes directly to Emacs so that I don’t have to futz around.  I can just grab the scanner, point it at a book, and then it’s registered, without me having to start the right program or put focus into the correct window.

The Cyborg

Bookiez looks up the ISBNs via the APIs from Google Books, OpenLibrary, ISBNDB and LibraryThing.  (Phew.)  They all seem to have vaguely differing ISBN coverage, and the data quality is also…  varying.

Anyway, after scanning about a K of books, I’m really impressed with the Datalogic Gryphon D120 Barcode Scanner (aka. Datalogic Quickscan M2130).

The wireless range is fantastic (more than 20 meters), and the user interface is perfect.  When I scan something successfully, it beeps immediately, and when it transmits to the base station, it beeps, too.  So there’s never any doubt whether the scan was successful or not.  It does require you to hold it in a certain angle when scanning, but overall I think it’s a great device.  Nine thumbs up!

Not all books have ISBN barcodes, so I have to enter those by hand.  So I gaffa-taped a wireless keypad to my right thigh.  I can enter numpad stuff by touch-typing, and it makes a fashion-forward statement, as you can see.

The main annoyance when scanning is really the network latency when looking up the ISBN codes.  I’m looking at you, OpenLibrary.  But I’ve scanned half my books in a handful of hours, so it’s not too bad.

So now I can order some more Marion Babson books.  I don’t think I over-engineered this one at all.