Arthur Shipkowski's personal site

I volunteered to digitize a set of old VHS tapes for ADF. I’d say “recently” but it took much more effort than I expected. Resources I thought I had access to disappeared, and hardware failures and quirks were the order of the day.

In the end I wound up using a DVC-100 I picked up at a garage sale along with mencoder. To save people time in the future, here’s what I had to do to make it work under Ubuntu 12.04.

First off, it turned out I needed to set up a loopback device in a ~/.asoundrc to get good audio capture while doing this.

The loopback device looks like this – this can be placed in your .asoundrc as the whole contents of the file:

1234567

pcm.copy {
type plug
slave {
pcm hw:2
}
route_policy copy
}

Then I had to work out an mencoder commandline. This is what I found to work; some of the encoder parameters can be changed of course, particularly the bitrate. I was surprised that the input audio rate had to be dictated to mencoder – I would have expected autodetection.

This can be previewed by using mplayer in lieu of mencoder and removing all of the output aspects.

In the long run I used ffmpeg to trim things down using the -t option after previewing the clips. I did find that using -ss to trim off the front was a problem; apparently dvdauthor expects that the video stream appears first. I was unable to come up with a solution for this, and in the end I re-recorded the one clip where trimmingat the start was required.

So, having run Octopress for a few days, I suppose it’s time I comment on it.

My interest was initially piqued by the static site speed and resistance to heavy traffic. The former, in particular, caught my eye after I noticed how long it took me, on a fat pipe, to load any pages. Even with WP-Supercache I found that pages tended to expire before anyone saw them.

My webhost, along with logging for bandwidth or similar restrictions, logged CPU usage. Though they are pro-Wordpress, I noticed a few times a day I’d peg things at 100% CPU. Not for very long, but it would happen. Playing with themes and plugins reduced the frequency but did not eliminate it.

All of this, though, falls aside to something else. I’ve noticed needing to upgrade plugins and Wordpress regularly for a site that I do not do a lot of active blogging on. One day I came upon this, relative to Octopress and its ilk:

It’s as if every developer woke up on the same day and asked “why am I responding to security alerts for a blog I barely ever update”?

I realized that with the occasional disconnect from the net that I like to indulge in, it’s entirely possible that my site could be hacked while I’m having a calm weekend. I do recall a Wordpress update coming in right around the holidays once, as well. Now, I’m more secure since there is no PHP.

Sadly, though, I think I’ll have to poke at the contact form. Using cgiemail seems to mean I’ll get weirdly-formatted spam that is hoping my installation isn’t secure.

Are comments going to appear? I’m not sure. The old Wordpress site, with comments enabled, only got a single real comment on a main page praising the site design (thanks, I downloaded the theme myself). Depending on what I get into, I’ll see…

My work laptop is a Dell D820. When I got it, I installed x86_64 Gentoo on
it. I kept it up to date every week, switched to newer profiles as I came upon
them, and was fairly happy.

After some annoying issues with a cross-build system for work, and finding it
worked under a Ubuntu VM, I switched to 64-bit Ubuntu 10.10. I prefer to have
my builds as fast as possible, and this was grating on me.

I figured any general slowdown was worth it. Not only would the lack of VM
delay speed up me, but I wouldn’t be constantly needing to recompile anymore.
I get paid to write code, not to administer a system after all.

So I took the plunge and I’m stunned at how fast it is. It boots significantly
faster (and I had taken pains to enable only a minimum of boot-time scripts
and have parallel startup on), everything moves more quickly, and longstanding
mild annoyances are gone.

All this time I figured switching would be slower. Why didn’t I do this
sooner?

I found myself in need of a cross-compiled Python 2.6 to run some hardware
test code on an MPC8315ERDB evaluation board. I found Paul Gibson’s guide and
patches for cross-compiling Python useful, but they didn’t support the
ctypes module, which was needed for the hardware interface code, based around
a C shared library. In fact, further searching turned up that one should not
expect ctypes to be available for cross-compilation.

I dug into the code, though, and discovered the issue is that _ctypes has its
own configure call in setup.py. Pass in the right parameters, and all is well.
In my case, my patch (atop of the pre-existing one) looks like this:

For the curious, below are the key steps for cross-compilation of Python
outside LTIB (since it was for test, there was no need to incorporate it) for
the MPC8315ERDB – it may work for MPC8313-based setups as well. You probably
want to look at the original post for slimming the tree down once the build is
done, and if you have modules for which support isn’t found, change the
add_dir_to_list lines to point at your build system’s library and include
directories rather than /usr/local.

It often surprises me, the conceptions those outside the embedded software
world have of it.

At the one end is the old, hardcoded view; a good example, if a bit old, would
be Joel Spolsky’s view of the Embedded Software World.

At the other end, prompted by the increasing presence of Java and other
applications for cell phones, there is the idea that it’s all Java and that
it’s every bit as easy as desktop development.

Neither of these views is entirely true, but they aren’t entirely false,
either. Joel is correct about limited programming capability in many cases,
but as I bet even he is realizing there are flash updates these days even for
consumer electronics like Blu-ray players. Others are correct about the
increasing availability of tools that make it just like home in some embedded
systems.

Where do I find myself in all this? Well, only recently did I find myself
working on the first project for my employer where C++ can be used in a fairly
embedded environment; previous projects had broken libraries, a lack of space
for the generated code, or both. Of course, there’s still bootloader work in
C, sometimes with a dab of assembler, too.

The biggest thing I’ve noticed about embedded software is that often it’s
solving known-to-be-solved problems without the benefits of a full-up system.
Perhaps you don’t have a shell capable of scripting – or the ability to just
run Perl or Python, meaning you have to write C code that grovels over I/O
that would be trivial in either. Sometimes it’s bringing up a board from
scratch, and trying to get a bootloader to work – or writing your own
(though, these days, it’s preferable to grab one of the pre-written ones, as
you’ll get much more functionality once you get it running).

So what do I think of it? It can be frustrating when you’re writing many lines
of code for what you know would be trivial in another language, but it’s also
fun to squeeze every last drop out of a hardware solution.

I recently updated my MSI Wind U123’s BIOS for various reasons, and I ran into
an problem whose solution I’m offering up in case of issues from out there.
Per the instructions from MSI, I flashed the BIOS, powered down, and removed
the battery. MSI’s site didn’t specify how long to remove the battery, so I
removed it for a 10-count (a slow 10 count).

I put the battery back in, and Windows XP refused to finish booting, instead
sitting in the XP startup animation forever. Safe mode booting stopped at
Mup.sys. I attempted to boot via CD to use the recovery console, but even that
hung up. Frustrated, I made a USB stick with Ubuntu Netbook Remix. That also
refused to go far beyond the bootloader.

The solution turned out to be to remove the battery for a good few minutes,
then put it back in. Once that was done, all was well again.