Ripping CDs to FLAC on Linux

This weekend I was messing around with ripping CDs again. Almost my entire collection has been digital for years, but all in MP3 format. Way back when ripping a CD to MP3 was a trade-off of time to encode, quality of playback, size of file I’d made some choices about what I was going to use as my standard for digitizing my collection.

I arrived at 192 kbps encoding (fixed bitrate), MP3 format encoded with the LAME encoder for the most part. To arrive at this bitrate I’d done a lot of A/B sampling between songs – with my best attempts at blind listening comparison to see which ones I could tell the difference between. After about 160 kbps I couldn’t hear any significant differences, and certainly after 192 kbps it was all the same. If you want to learn more about bitrates and encoding formats, this seems like a good article.

Since then – computers have gotten stupidly faster, so encoding time doesn’t matter . Storage is also cheap and plentiful, so I don’t care about file sizes. My main media server is Plex, which will happily transcode from FLAC for me to MP3 when I need it. There is also the mp3fs userspace filesystem that I can use to map FLAC to MP3 when I need it. I’d arrived at the conclusion that my archive format should be FLAC a couple of years ago, but I’d failed to get Linux setup to rip successfully.

With Windows machines there has been EAC which is basically the default way people who care will rip their music. It ensures ‘perfect’ copies. I found whipper which seemed to provide a similar solution on Linux, but a couple of years ago I failed to get this to work with either of the optical drives I have installed in my box. I could get all the tracks but the last one on the disc, very frustrating.

In my recent revisit to this, I started with abcde. This resulted in a simple docker container that I could run that would rip a disc to FLAC without much fuss. It worked well, but then I re-discovered my notes on using whipper and figured I’d see if the project had progressed.

It had – and whipper works great with one of my optical drives, but not the other. That’s fine as one is enough. My working drive is an ASUS DRW-1814BL and so far no problems except for one disc. The one problematic CD was one that I’d failed to rip in the past as well, there is a little bit of physical damage and whipper would bail dealing with the index.

It turns out my abcde setup worked great on this bad CD and was able to rip it to FLAC. I’ve less confidence that the abcde process is as robust and exact as whipper – but I’d rather have the music ripped than not at all.

For abcde I have a Makefile

And a Dockerfile

You’ll want to customize it to point at the right device, but there isn’t much here. Make build, make run and you’re good to go.

For whipper, it’s ever easier. I just used a shell script to call the pre-built container.

There is a little bit of setup for whipper, best to follow the documentation. Briefly you need to analyze the drive and figure out the offset. I also tweaked the generated config file to change the directory and file naming scheme.

That’s it. Ripping your CDs with high quality is trivial now, and with nicely featured media servers the format doesn’t matter. Now I just have to slowly re-rip CDs that I care about having high quality archives of.

 

Consumer Electronics and Leaky Batteries

Recently I’ve been working on some IR remote control stuff, this has me digging through my bin of old remotes looking for one I could use as the controller.

I had one of these classic Haupauge remotes which I’d used a long time ago with a MythTV setup. I’ve long ago retired this machine and tossed the remote into the bin. Sadly I didn’t remove the batteries, and when I opened up the battery compartment I saw that they had leaked and corroded.

This has happened to me before, and usually cleaning out the battery compartment and putting some new batteries is all that’s needed. Unfortunately not this time.

It turns out that opening this remote is easy enough, but I needed some force. The top part snaps onto the lower part – no screws. I used a metal blade to get the two parts separated a little and then was able to get a pry tool in to pop them apart. The case was surprisingly durable and it did need more force than I was comfortable using – but in this case, I figured it didn’t work so I had little to lose.

Here you can see the circuit board before I’d cleaned it up. There was quite a bit of white build-up around the chip and generally around the circuit board at the bottom. There was a recent hackaday post on restoring an old gameboy that had similar problems.

Unfortunately I was not as lucky with this remote.

The chip lost an entirely leg – and this is the power pin as well. I suppose if I was highly motivated to repair I could try grinding off the corner of the chip and then soldering a bridge inside. However, this is a bit beyond my ability to work at microscopic levels.

The lesson here is that when you stash an old remote control away – remove the batteries. For me, the remote is junk – I might strip out the IR led and re-use it somewhere, but that’s about it.

2011 Macbook Pro – A1278 keyboard replacement

Around 2015 we bought a used Macbook Pro for home use. It was replacing an iMac all in one that had a bad power supply. I didn’t realize it at the time, but it was a real powerhouse of a machine if you look at the specs.

Over time it was clear that older mac wasn’t keeping up. I had done a few upgrades that helped extend it’s life. I’d put in 16GB of RAM – very worth the money. I also later swapped in an inexpensive 480GB SSD. The USB ports got wiggly over time and the keyboard slowly started to fail.

By 2020 it was well past time to replace it, which I did with a Macbook Air M1 (base). Of course I still hung onto the old machine which still worked, but was paired with a bluetooth keyboard. I finally got around to ordering a replacement keyboard from Amazon – a Padarsey.

Of course one of the first places I go for help is iFixit. Unfortunately the repair section for this laptop doesn’t seem to include a keyboard replacment. I used the upper case disassembly instructions and they were close enough and helpful. The keyboard is hidden underneath everything, so you have to take almost everything apart to replace it.

Annoyingly there are three different types of screwdrivers you’ll need: phillips, torx, and tri-wing. I’m really happy with the Kingsdun 60-in-1 set I got recently. It’s got lots of sizes and it’s bailed me out a few times. The bits are not the highest quality, but having the right shape and size makes things possible.

I ended up re-using the existing keyboard screws (there were so many of them!) instead of the ones that came with the new keyboard. I was also grateful for my magnetic mat which helped keep all of the screws organized. Re-using the back-light wasn’t difficult at all.

It was with relief that I saw the system boot up right way after I’d re-assembled it. There are a lot of little bits to get right. It was an epic repair and I’m not sure I’d rush to do it again. Now with a fully working keyboard it’ll continue to get some light use as a secondary machine.