Penguin
Note: You are viewing an old revision of this page. View the current version.

Work in progress.

As a Christmas present, I have decided to convert some my of parents vinyls to CD. In doing so, I hope to remove some of the hiss and clicks you get on old vinyls, and also make sure the contents are preserved - they were either vinyl-only recordings (Tararua College choir, 1961) or unavailable in any other medium these days.

I'll add to this wiki as I go, so excuse the journal-like nature. When I've finished I'll tidy it up, or let a WikiGnome do it for me :)

Hardware used:

I have a Celeron-1300, running Windows 98 (wait a bit...), which has an SB Audidy 2 Platinum eX. As far as I know, there aren't decent drivers for the Audigy under linux, hence staying under Windows 98. That said, I'm not using it very much - it has RCA inputs on its external unit, which means I can plug my turntable directly in.

This machine is probably fast enough for most processing, and has 256 MB of ram.

I also have an Athlon 1800+ XP, with 512 MB of ram, running Gentoo linux. This is what I'm doing most of my processing under, if I can at all help it.

First Attempt

I used DartPro under Win98 to record the vinyl. I made two wav files, one for each side of the vinyl. I used !DartPro? because trogs suggested it as a useful tool, and I thought it might do all of my processing for me very easily. If it will, I couldn't work out how in the 10 minutes I spent playing with it (mainly, I couldn't get it to play any wave files, so it was very hard to tell how well its effects were working).

I had seen an article on gramofile on LinuxJournal or SlashDot or somewhere, and thought I'd give it a try. It's located at http://panic.et.tudelft.nl/costar/gramofile/. One thing I noticed - it's had no work done in over two years!. There is actually a fork of the project at http://www.schou.dk/linux/gramofile/ which has advanced it somewhat, although the author of the fork calls it a hostile takeover, apparently in complete ignorance of how OSS projects work.

Using gramofile 1.6 (the 'old' version) was pretty easy. It locates track boundaries, separates the input .wav into tracks, and then performs some click reduction on it. The track finding algorithm was a bitch enthusiastic, and the click reduction was ok but there was still a large amount of noise.

So, I tried using audacity, which also featured in an article I read recently. Despite some UI problems (you cant skip to an arbitrary point in a .wav while its playing, you have to stop, wait a bit, click where you want the cursor to go to, then press play again) it seemed ok. It provides noise reduction and so on, but most of its effects were more focussed on 'effects' (wahwah, etc) rather than cleaning up old vinyl recordings.

I also had a play with !DartPros? cleanup functions. It has a wide range of predefined tools - !DeHiss?, !DeClick?, !DeNoise?, !DeHum? and so on, and allows you to build up a custom filter using mixtures of these filters.

Both Audacity and !DartPro? allowed me to amplify the tracks, which was needed as the output from my turntable was not amplified, and I dont have access to an external amplifier/eq unit.

I wrote a CD with my freshly cleaned and split tracks. Well, I wrote 2 coasters under linux (never authored an audio CD under linux before, I must be missing something like padding or reversing audio bits or something). I copied the tracks to the windows box, and wrote them to CD using Nero, at 52x. The resulting CD sounded ok, but the noise got progressively worse as the CD played (ie, later tracks sounded awful). Does anyone know if writing audio cds at high speed is a BadThing? ?

Second attempt:

Found some more information at http://www.xena.uklinux.net/Linux/audio.html. This guy started using gramofile, and then switched to using gwc, the Gnome Wave Cleaner. I'm installing this right now, as well as snd and sox, which both claim to be good tools

GWC works really well. I followed the suggested notes at the above URL, which I'll summarize here:

First of all, I amplified the track. GWC seems a bit buggy with this - it won't always amplify correctly. If the waveform doesn't increase in amplitude, it hasn't been amplified. I found if you wait till after processing to amplify, some noise still gets through.

  • Run the strong declick tool. The first time I ran this I got about 7000 clicks removed. The second time, about 400, and the third time, about 20. This was 'good' enough, so I moved onto the next step:
  • Run the decrackle tool. This removed most of the remaining crackle on the recording.
  • Run the denoise tool. Its suggested to use any lead-in you can, but I only lead-out noise available. It seemed to do just as well. I ran it first with the defaults, then used the suggested settings on the url above. It seemed about the same really, although with the speakers I have on this computer it is hard to tell.

At this point, the tracks were a LOT cleaner and sounded great.

Unfortunately, Gramofile doesn't split the tracks out correctly any more. I figured I could run Gramofile over the unprocessed track and use its timing, or I could split the waves up manually. Gramofile did a fairly good job of picking the tracks out of the original wave file, although it needed some tweaking, and sometimes removed too much between songs. It writes out a filename.tracks file which you can edit, and in this case copy to a different name so that Gramofile will use on the processed wave file.

By this time I have a directory with 12 .wavs, named side1-1.wav to side1-6.wav and side2-1.wav to side2-6.wav. Nearly there!

A bit more reading and I found that cdrdao should let me write Audio cds where cdrecord failed earlier. It was worth a shot, so I decided to try it. I previously found another page describing the use of gramofile and audacity to clean up vinyl recordings, which suggested using cdrdao and a .toc file to write the audio tracks. Based on the notes at this page: http://www.togaware.com/linux/survivor/Recommended_Recording.html , the following shell script built a nice .toc file for me
(echo "CD_DA"; for i in -; do echo "TRACK AUDIO"; echo FILE \"$i\" 0; done )> cd.toc
The resulting file looks like
CD_DA TRACK AUDIO FILE "side1-01.wav" 0 ,...
And I should now be able to write an audio cd using the following command
cdrdao write cd.toc

cdrdao expects a symlink from /dec/cdrecorder to the cdrecorder device. Recent cdrdao support the ATAPI interface, and its actually sufficient to symlink /dev/cdrecorder to your IDE CDWriter and it'll work fine. I also found i had to specify the driver option, and I set a speed for safety (my first write failed with a buffer underrun)

cdrdao write --speed 16 --device generic-mmc cd.toc

This time the write succeeded, although upon a visual inspection of the CD afterwards it seemed as though the disk was not written to, and it wouldn't play in either the computer or the stereo. Back to the drawing board.

I burnt a CD in Nero, but had the same problem as with the very first copy I made - or a similar problem anyway. The music started off alright, but very quickly got very noisy, despite sounding OK on the computer.

Third Attempt

After a bit of thought, I realised one thing I might have been doing wrong. The GWC amplify tool didn't seem to work particularly well, and when it did work I think I was using it wrong. It puts up a prompt with 5 entry boxes - Left Channel Stard, End, Right Channel Start, End, and Feather Width (set to 2000, I left it). It stated the the maximum gain without clipping for this track was 25.something, which was a figure I'd seen elsewhere. So I set the 'End' values to 25. Which, in hindsight, probably meant an increasing amplification as the wave progressed, and which would have accounted for the increased noise further on in the CD and the poor noise correction performance - I doubt it can handle fixing an increasing noise source.

So this time, I used DartPro? (couldn't be assed finding another tool to do this, in case it wasn't the problem after all) to increase the gain, and then ran my declick/decrackle/denoise routine over this file. The waveform looked a lot better, and it sounded fine.

I also discovered that GWC will mark track boundaries just as well as gramofile will, and will export a .toc file for me too. Better and better. I processed both sides, merged the two .toc files (the .toc format allows you to specify a filename and a start/end offset into the file, so you dont actually need to split the original file up :)

Console output from GWC giving some timing information
6638 clicks repaired, 0 clicks marked, but remain unrepaired DECLICK in 65.811 real seconds 224 clicks repaired, 0 clicks marked, but remain unrepaired DECLICK in 18.114 real seconds 24 clicks repaired, 0 clicks marked, but remain unrepaired DECLICK in 17.278 real seconds DENOISE in 141.310 real seconds

This is on an Athlon 1800 XP+ with 512 MB of ram, running 2.6.0-test11 / gentoo, and with an 80 GB 7200 RPM 8 MB Cache Maxtor HDD. DECRACKLE information wasn't given, but it didn't take overly long - less than DENOISE. Each step requires some undo information (if you let it), and in the case of DECLICK and DENOISE requires a full undo file - as long as your original .wav

At this point, I still can't get cdrdao to actually write anything to CD. It says its writing, it seems to work ok, but it just doesn't do it. If I let it write at full speed, however, it writes, but then dies at some point and requires a reboot. Grrr.