Hard hack: reading Soviet magnetic reel tapes

During my last visit to Russia a few years ago, I rummaged through my late grandmother’s old apartment and kept a few items, which included several magnetic reel tapes which I presumed my grandparents used for bootlegging and copying their favorite music from the sixties and seventies.

20180428103500

I’ve been wanting to listen to the contents of the tapes for a while now, but only recently have I found a bit of free time to actually do it. It’s still very much possible to buy a reel-to-reel player on eBay for less than $100, but I wanted to see if I could make use of existing components that I already have. And besides, I’m only looking for a rough rendering of the recordings, and don’t really need the precise original fidelity that an actual reel-to-reel player would provide.

I still have a relatively new cassette player that I’ve used previously to digitize some of my own cassettes from years ago, and I had a hunch that the “format” of the analog audio on the magnetic reels might be similar, if not the same, as the cassettes, meaning that I could theoretically use the cassette player to read the reel tapes!

The first step is to tear down the cassette player. As a side note, although this cassette player is quite cheap, it’s actually very useful because it has a USB port that powers it and simultaneously makes it become a generic USB audio input device, which makes it perfect for digitizing cassettes. Therefore, I wanted to tear it down in a way that would make it continue to be able to read cassettes, if that use case ever comes up again.

Anyway, I removed the front casing of the player, and tore away the plastic guides that kept the cassette tape in alignment, since these guides would interfere with the thicker reel tape. I then affixed the player onto a wooden board, and added two thick screws that will hold the reels. I also attached a thick metal post on either side of the player, which will act as tape guides and keep the tape horizontal across the player.

20180428102659

Also notice that I put some wire ties onto the metal posts, to serve as vertically-adjustable tape guides for experimenting with the precise alignment of the tape with the read head.

20180428102715

Another minor problem is that I didn’t have an empty reel onto which I would wind the current reel that I’m reading. For this purpose, I cut a circle out of some thick cardboard, and glued old CDs on either side of it. This would serve as my empty reel:

20180428102806

And finally the whole contraption is ready to go! There’s something poetic about using CDs to construct a reel onto which ancient magnetic tape will be wound…

20180428103005

I proceeded to connect the cassette player to my PC, and fire up Audacity, the trusty audio recording and processing software. I pressed “Record” in Audacity, pressed the “Play” button on the cassette player, and… to my amazement, the audio started to come through! At first I was only getting one of the two stereo channels, which meant that the tape wasn’t well-aligned with the head, but after a bit of adjusting of my wire-tie tape guides, I got a good stereo signal:

audacity_magnetic_reel1

It turns out that the reel tapes are recorded at double the speed of cassette tapes, which means that the audio extracted by the cassette player sounds slowed-down by a factor of two. So, the final step was to use Audacity to boost the speed of the recording by 2x, and the final audio came out! The only slight issue is that the audio seemed to be lacking the higher-ish frequencies, so everything sounds a bit muffled. It’s difficult to tell whether this is because the cassette player head isn’t fully compatible with the reel tape, or because the tape itself has worn out or degraded over time. But again, I’m not looking for a perfect transfer of the audio, just a first-order approximation, so this is no big deal.

What’s on the tapes?!

The actual contents of the tapes are not particularly surprising, but still gave me a wonderful tiny new glimpse into the lives of my grandparents through their musical tastes. One of the tapes contains music from The Irony of Fate (Ирония судьбы), one of the most beloved films in the Soviet Union, and still watched today by a huge number of Russian people on New Year’s eve. I can attest that the film’s soundtrack, performed by Sergey Nikitin (Никитин) and Alla Pugacheva (Пугачёва) is worth saving on tape and listening on any occasion.

The second tape seems to contain random songs from radio broadcasts, including a few songs from the West. These include Seasons in the Sun by Terry Jacks and Mexico by the Les Humphries Singers. Presumably these songs were deemed innocuous enough by the Communist censors, who otherwise banned music that was seen as subversive, sexualized, or violent, such as Pink Floyd, Black Sabbath, and The Village People (that’s right).

And the third tape contains some songs by Vladimir Vysotsky (Высоцкий), another iconic figure in Soviet music, known for his biting use of slang and street jargon (known as blatnaya pesnya or the newly-coined Russian chanson) to deliver poignant, striking, thought-provoking, and often hilarious political messages. The same tape also contains songs by Konstantin Belyaev (Беляев), unknown to me until today, but apparently another minor figure in the same genre of blatnaya pesnya as Vysotsky. To be honest, I found Belyaev’s lyrics rather juvenile (more so than other блатняк), and probably better suited for drinking songs rather than music for thoughtful enjoyment. But then, perhaps that’s exactly what my grandparents used them for.

Well now, with a fresh insight into another facet of my grandparents’ lives, and a renewed appreciation for Soviet musical traditions, I think it’s time to give these tapes one more listen!

* If you’re very curious, here is a sample of the audio from one of the tapes.

Revisiting the Windows 10 thumbnail cache

When you look at a folder full of pictures, and enable the display of thumbnails in your folders, Windows will show a thumbnail that represents each of the pictures. Creating these thumbnails is an expensive operation — the system needs to open each file, render the image in memory, and resize it to the desired size of the thumbnail. Therefore, Windows maintains a cache of thumbnails, saved in the following location: [User folder]\AppData\Local\Microsoft\Windows\Explorer.

A few years ago I published a utility for examining the thumbnail cache in Windows Vista and Windows 7.  However, in Windows 8 and Windows 10, Microsoft seems to have made some slight modifications to the file format of the thumbnail cache which was preventing my utility from working properly.  So, I revisited the thumbnail cache on the most recent version of Windows, and made sure the utility works correctly with it, as well as with all previous versions of the cache.

My updated ThumbCacheViewer supports thumbnail cache files from all versions of Windows after XP.  It automatically detects cache files associated with the current user’s account, and it also allows you to explicitly open thumbnail cache files from any other location. Once the file is opened, the utility will show a simple list of all the images contained in the selected cache. If you select an individual image, it will also show some useful metadata about the image:

thumbcache3

You can see that the cached images include thumbnails of individual photos, as well as thumbnail representations of folders that contain photos. Both of these can be forensically interesting, since the folder thumbnails still contain plenty of detail in the images. You can also see that there are separate caches for different resolutions of thumbnails, some of which are strikingly high-resolution (up to 2560 pixels wide, which almost defeats the purpose of a cache).

I’ll also point out that you can perform forensic analysis on thumbnail caches using DiskDigger, by opening the cache file as a disk image. You can do this by following these steps:

  • Launch DiskDigger, and go to the “Advanced” tab in the drive selection screen.
  • In the “Bytes per sector” field, enter “1”.
  • Click the “Scan disk image” button, and find the thumbnail cache file that you want to scan.
  • Select “Dig deeper” mode, and proceed with the scan.

Here is the same cache file as in the screenshot above, but viewed using DiskDigger (note the numerous .BMP images detected by the scan):

dd_88

Either way, this is now a relatively complete solution for analyzing thumbnail cache files, whether you’re a professional forensics specialist, or a home user who’s interested in how Windows preserves thumbnails in more ways than you might think!

The dead dream of chatbots

A long time ago I wrote about the Loebner Prize, and how it seemed like this competition isn’t so much a test of machine intelligence, but rather a test of how well the programmers can fool the judges into thinking they’re talking to a human. Not that anyone has actually done this successfully — none of the judges have ever been convinced that any of the chatbots were really a human, and the annual “winner” of the Prize is decided by sympathy points awarded by some very charitable judges.

In that previous post, I remember being struck by how little has changed in the quality of the chatbots that are entered into this competition:  it hadn’t improved since the inception of the prize.  So, today I thought I’d randomly “check in” on how the chatbots are doing, and read the chat transcripts from the competition from more recent years. (I encourage you to read the transcripts for yourself, to get a taste of the “state of the art” of today’s chatbots.)

And can you guess how they’re doing? Of course you can:  they still haven’t improved by any margin, except perhaps a larger repertoire of cleverly crafted catch-all responses. Even the winner and close runner-up of the 2017 competition are comically robotic, and can be effortlessly pegged as artificial by a human judge.

My goal in this post, however, is not to bash the authors of these chatbots — I’m sure they’re competent developers doing the best they can. My goal is to discuss why chatbot technology hasn’t moved forward since the days of ELIZA. (Note: When I refer to chatbots, I’m not referring to today’s virtual assistants like Siri or Alexa, which have made big strides in a different way, but rather to human-approximating, Turing-test-passing machines, which these chatbots attempt to be.)

I think much of it has to do with a lack of corporate support. Chatbots have never really found a good business use case, so we haven’t seen any major companies devote significant resources to chatbot development. If someone like Google or Amazon had put their weight behind this technology, we might have seen an advancement or two by now.  Instead, the competitors in the Loebner Prize still consist of individual hobbyists and hackers with no corporate backing.

Interest in chatbots seems to have peaked around 2012, when the cool thing was to add a customized bot to your website and let it talk to your users, but thankfully this died down very shortly thereafter, because apparently people prefer to communicate with other people, not lame attempts at imitation. We can theorize that someday we may hit upon an “uncanny valley” effect with chatbots, where the conversation is eerily close to seeming human (but not quite), which will cause a different kind of revulsion, but we’re still very far from that point.

Another thing to note is the actual technology behind today’s (and yesterday’s) chatbots. Most of these bots, and indeed all the bots that have won the Loebner Prize in recent years, are constructed using a language called AIML, which is a markup language based on XML.  Now, there have been plenty of ways that people have abused and misused XML in our collective memory, but this has to be one of the worst!  AIML attempts to augment XML with variables, stacks, macros, conditional statements, and even loops. And the result is an unwieldy mess that is completely unreadable and unmaintainable. If chatbot technology is to move forward, this has to be the first thing to throw out and replace with something more modern.

And finally, building a chatbot is one of those endeavors that seems tantalizingly simple on the surface:  if you look at the past chat logs of the prize-winning bots, it’s easy to think to yourself, “I can build a better bot than that!”  But, once you actually start to think seriously about building a bot that approximates human conversation, you quickly come up against research-level problems like natural language processing, context awareness, and of course human psychology, behavior, and consciousness in general.  These are most definitely not problems that can be solved with XML markup.  They likely can’t even be solved with today’s neural networks and “deep learning” algorithms.  It will probably require a quantum leap in AI technology.  That is, it will require building a machine that is truly intelligent in a more general way, such that its conversations with humans are a by-product of its intelligence, instead of its primary goal.

For now, however, the dream of chatbots has been laid to rest in the mid-2010s, and will probably not come back until the technology allows it, and until they’re actually wanted or needed.

MushroomHuntr

I’m a bit late to the party in starting to tinker with TensorFlow, but nevertheless I’ve been having some product ideas (some dumber than others) for real-world applications of machine learning, and here’s one of the stupider ones:

If you know me at all, you know that one of my hobbies is foraging for wild mushrooms. Going to the forest to forage for mushrooms is a time-honored tradition in Russia and many other Slavic countries.  I also derive great pleasure from sharing this hobby with other people, and telling them how fun, challenging, and rewarding this activity can be.

Therefore, I give you — MushroomHuntr: an Android app that can identify different varieties of mushrooms!  It uses a neural network to perform image recognition in real time, to tell you what kind of mushroom you’re looking at.

Huge legal disclaimer: Do not actually rely on this app to differentiate poisonous mushrooms from edible ones!  The app provides a rough guess of the identity of a mushroom, not a definitive identification.

Under the hood, the app uses the Inception v3 model developed by Google, with the top layer of the model re-trained on a large collection of mushroom images. Many of the training images were taken from Wikimedia Commons, and others came from my personal photos that I’ve taken over the years.

The app can distinguish between about twelve varieties of mushrooms, most of which are native to North America and Europe. All of the trained varieties are common enough to be found easily in parks and forests, to maximize the app’s usefulness for the novice mushroom hunter.

When the app is launched, it automatically enables your phone’s camera, and starts attempting to recognize anything it sees in the image.  Therefore, all you need to do is aim the camera at a mushroom, and see what it says!

To maximize the accuracy of the mushroom recognition, try looking at the mushroom from the side, and bring the camera close enough for the mushroom to fill up most of the frame, like this:

20171104115119

I won’t make this app available on the Google Play Store for the time being, while I continue to refine the model, but if you’d like to check it out, you can build it from source code, or contact me for a pre-built APK that you can install on your device.

Stop it, Stephen Hawking!

Professor Hawking continues to double down on his calls for humanity to colonize space, whether it’s building a permanent colony on the Moon, or on Mars, or even beyond our solar system.  The reasons that he cites for this urgency are that we’re doing irreparable damage to our planet’s climate, and also that there are simply too many of us to be sustained by a single planetary home:  “We are running out of space,” he says, “and the only place we can go to are other worlds. It is time to explore other solar systems.”

To be clear, I fully believe that our top priority should be to mitigate climate change, and that it may be too late to change our habits before the damage becomes irreversible, and that overpopulation is a serious problem for many of our societies.  I do not, however, believe that attempting to colonize other planets is a viable or attainable solution to any of these problems.  For all the loftiness of Stephen Hawking’s statements, I find his reasoning quite a bit myopic.  I’ll also go further to say that by making these kinds of fatalistic, defeatist statements, Hawking and other proponents of space colonization are doing a disservice to the real discourse we need to be having about how to exist sustainably on the only planet we’ve got.

Overpopulation

If the problem is overpopulation, then why not focus on solving the problem rather than running away from it?  How about a massive, well-funded campaign to inform developing nations about family planning, or educating women about contraception?  Perhaps Stephen Hawking has given up on the possibility of the world’s governments uniting to achieve such a goal, and perhaps so have I, but then why not admit this explicitly, rather than proposing an absurd non-solution that is even more fictional?

The human population is a thin film that covers a very small fraction of the total surface of the planet.  The point is, why should we think about colonizing other planets when we haven’t even colonized all of one planet yet?  Why don’t we think about colonizing the ocean floors, or the ocean surfaces, or habitats deep underground, or floating cities in the sky?  I’m not a planetary scientist, but I’m willing to bet that any of these options would be much easier to achieve than colonizing another planet.

Why, also, should we think about colonizing other planets when we haven’t colonized one planet sustainably yet?  If we “overflow” our population onto a different planet without solving the problem of how to live on a single planet sustainably, we would simply postpone having to deal with the same problem on the new planet at a later date.  Why not work towards solving the sustainability issue on our home planet first, before considering branching out to different ones?

Climate change

The Earth is, by definition, the most habitable world we will ever find, because it’s the world on which we’ve evolved over millions of years.

To be sure, the damage we’re currently doing to our climate will have repercussions for future generations.  And unless we act now, the damage may be irreversible.  However, no amount of damage we can inflict will make the Earth completely inhospitable to human life, much less life in general.  This is in contrast with every other celestial body in our solar system, all of which are categorically not suited for life as we know it.

If we burn all the coal in the world and melt both of our planet’s polar ice caps, the Earth would still be more habitable than any other planet in the solar system.

If we detonate every single warhead in our nuclear arsenal, the Earth would still be more habitable than any other planet in the solar system.

If the Earth gets struck by an asteroid the size of the Chicxulub impactor that wiped out the dinosaurs, it would still be more habitable than any other planet in the solar system.

It’s simply not productive to set goals for colonizing another planet, when we already have a perfectly good planet right here. All we have to do is improve our relationship with this planet, which begins with education, and will naturally lead to fewer children, less religion, and better environmental awareness.

Interstellar travel

Traveling to another solar system will not happen for us.  It will not happen in our lifetimes, or the lifetimes of our children or grandchildren.  Yes, I do believe that intelligent life will someday leave the confines of our solar system and travel the stars, but that life will not be human (with the exception of Matthew McConaughey).

You may say, “How closed-minded of you!”  But no. I’m an avid appreciator of science fiction, from Isaac Asimov, Arthur C. Clarke, and Ray Bradbury, to the likes of Star Trek, Battlestar Galactica, and even Babylon 5.  And I still feel glimmers of idiotic excitement when I read occasional news stories about “breakthrough” propulsion or energy technologies being “researched” at NASA.

However, I’m also armed with a basic but solid knowledge of physics, which tells me how ludicrous or impossible these fantasies are.  Science fiction, at least in relation to space travel, will have to remain fiction for the foreseeable future.

I do sympathize with Professor Hawking’s sense of urgency. And if I had an intellect of his magnitude, maybe I too would feel claustrophobic on this planet.  However, unless he has an actual solution for traveling across interstellar distances (does he?!), I’m afraid his priorities are inverted. Leaving this planet should not be our priority.  Let’s instead figure out how to love this planet the way it has loved us since the bawling infancy of our species, and to ensure that we give future generations enough time to live on it, until they, in the far distant future, are truly ready to leave it.