Thursday, 5 May 2016

Game of Tag, or Have You Ever Met A Data?

Right, that's a CD ripped then. Now what?

CDs are hard to arrange on a shelf, because they are in a specific physical order that determines how you see your collection. One of the brilliant things about a disk-based collection is that in principle you can have any view you want of it, given that you've made a sufficient range of views possible!

And tags are how you enable those views. Or rather metadata, which includes tags. Artist, composer, track title, album title, genre... what do you want?

There are several online metadata repositories - FreeDB and MusicBrainz being the main freely accessible ones. XLD automatically looks up the ripped CD by a composite hash based on the track timings and offsets, which is usually sufficiently distinct, and sticks the data it finds in the ripped tracks directly. I've found MusicBrainz to be the most authoritative seeming source - it's peer reviewed, and people put a lot of effort into getting it right, with evidence for their entries required to support the reviewing and editing process. The data extends even to recording location and engineer - it's very rich. MB also provides a tool for looking up and tagging CDs and already ripped files - MusicBrainz Picard, which I've used to tidy up and expand the metadata on lots of previously ripped material.

But sometimes your CD is not in the database!! I've got a CD of Astor Piazzolla tangos, played by a piano trio, from SWR the German radio station. It's not in the MB database, in fact, one of the performers wasn't in there either. So I had to add it... and that was seriously non-trivial! They have a Style Guide, which extends to Classical material, loads of standards for everything, it's extremely daunting. And I forgot to add the physical evidence - I ended up taking pictures of the CD sleeve and case to provide the actual source of data, along with a link to the record company website and the SWR studio website. Let's hope it's enough.

Ripping yarns

Ripping... The bete noir of digital audio!

The one thing one needs to do if switching to a streaming setup is rip your CDs, unless your CD player has a digital output, which mine doesn't (thanks Naim!). Obviously, one doesn't want to lose quality or invest lots of time in loading them onto hard disk in a manner which later has to be redone. If it takes 10 minutes to rip a CD, 1000 CDs will take 10,000 minutes or a Bloody Long Time basically, not something that one wants to repeat!

So I've selected

  • FLAC as a format for home-ripped CDs; I'll probably accept other formats for HD downloads, but may even convert them to FLAC for easier consumption
  • XLD as the ripping tool
Sounds good right? Marv. But...

I started off ripping a couple of CDs. XLD produces a pretty thorough report on the quality of the rip, and it's pretty scary! 000s of block retries, jitter recoveries and the mysteries of AccurateRip!

It turns out that CDs are pretty flakey as a digital medium - which begs the question, "Why don't programs provided on CD fail because they have so many bit errors that the code is defective?". 

Anyway, AccurateRip has a database of hash values for tracks that people have ripped over time. The ripping program looks up the hash it's generated for the current track, and checks to see if anyone else got that value for the specific CD and track. Simples - online voting effectively! So quite a few CDs of mine seem to rip ok, but lots more don't... I end up with a disk with sometimes 0 AccurateRip-approved rips! What's that about?! And what do I do next? I've tried re-ripping, but that doesn't always work although there are sometimes improvements.

XLD does a test rip before the actual rip, and generates its own hash for each, and compares them. It also says if it gets an unrecoverable error, which fortunately none of my CDs has had. So, I basically re-rip the tracks that either don't get an AccurateRip OK or for which the test/live rips have different hash values. That seems to work pretty well, the test/live rip hashes often end up being the same after a few goes (!).  But still no AccurateRip OK. Hey ho. Would I ever get one? Who knows?

Here's a sample log, with my comments in bold:


X Lossless Decoder version 20151214 (149.1)

XLD extraction logfile from 2016-05-04 21:17:29 +0100

Thomas Dolby / The Flat Earth

Used drive : MATSHITA DVD-R   UJ-898 (revision HC10)
Media type : Pressed CD

Ripper mode             : XLD Secure Ripper
Disable audio cache     : OK for the drive with a cache less than 1375KiB
Make use of C2 pointers : YES
Read offset correction  : 102
Max retry count         : 40
Gap status              : Analyzed, Appended (except HTOA)

TOC of the extracted CD
     Track |   Start  |  Length  | Start sector | End sector 
    ---------------------------------------------------------
        1  | 00:00:00 | 04:56:63 |         0    |    22262   
        2  | 04:56:63 | 06:40:59 |     22263    |    52321   
        3  | 11:37:47 | 05:35:47 |     52322    |    77493   
        4  | 17:13:19 | 05:22:69 |     77494    |   101712   
        5  | 22:36:13 | 04:55:73 |    101713    |   123910   
        6  | 27:32:11 | 05:40:20 |    123911    |   149430   
        7  | 33:12:31 | 04:17:43 |    149431    |   168748   
        8  | 37:29:74 | 04:44:23 |    168749    |   190071   
        9  | 42:14:22 | 04:14:71 |    190072    |   209192   
       10  | 46:29:18 | 07:17:29 |    209193    |   241996   
       11  | 53:46:47 | 04:05:74 |    241997    |   260445   
       12  | 57:52:46 | 05:03:24 |    260446    |   283194   
       13  | 62:55:70 | 03:30:50 |    283195    |   298994   
       14  | 66:26:45 | 06:17:29 |    298995    |   327298   
       15  | 72:43:74 | 04:41:62 |    327299    |   348435   

AccurateRip Summary (DiscID: 002b925c-01e9d3d4-0312250f)
    Track 01 : OK (v1+v2, confidence 90/90)
    Track 02 : NG (total 88 submissions)
    Track 03 : NG (total 89 submissions)
    Track 04 : NG (total 87 submissions)
    Track 05 : NG (total 89 submissions)
    Track 06 : NG (total 89 submissions)
    Track 07 : NG (total 90 submissions)
    Track 08 : NG (total 87 submissions)
    Track 09 : NG (total 87 submissions)
    Track 10 : NG (total 88 submissions)
    Track 11 : NG (total 88 submissions)
    Track 12 : NG (total 87 submissions)
    Track 13 : NG (total 87 submissions)
    Track 14 : NG (total 88 submissions)
    Track 15 : NG (total 88 submissions)
        ->1 track accurately ripped, 14 tracks not  <--- Hmm, some work required!

All Tracks
    Album gain               : -3.33 dB
    Peak                     : 0.998871
    Statistics
        Read error                           : 0
        Jitter error (maybe fixed)           : 91
        Retry sector count                   : 100097
        Damaged sector count                 : 0

Track 01
    Filename : /Users/john/Music/The Flat Earth/01 - Dissidents.flac
    Pre-gap length : 00:02:00

    Track gain               : -1.59 dB
    Peak                     : 0.948547
    CRC32 hash (test run)    : 8F33E56F  <--- Hurray!!
    CRC32 hash               : 8F33E56F  <
    CRC32 hash (skip zero)   : 0C3F72AC
    AccurateRip v1 signature : 8D6FA5FD
    AccurateRip v2 signature : A2559C3A
        ->Accurately ripped (v1+v2, confidence 47+43/90)  <--- Even more hurray!
    Statistics
        Read error                           : 0
        Jitter error (maybe fixed)           : 0
        Retry sector count                   : 4   <--- That's pretty low...
        Damaged sector count                 : 0

Track 02
    Filename : /Users/john/Music/The Flat Earth/02 - The Flat Earth.flac
    Pre-gap length : 00:01:04

    Track gain               : -0.36 dB
    Peak                     : 0.998871
    CRC32 hash (test run)    : 7412B32B  <---- I'll take that...
    CRC32 hash               : 7412B32B  <
    CRC32 hash (skip zero)   : 40C7165D
    AccurateRip v1 signature : D2E5494B
    AccurateRip v2 signature : 76A99054
        ->Rip may not be accurate (total 88 submissions).  <-- No AccurateRip hit
    Statistics
        Read error                           : 0
        Jitter error (maybe fixed)           : 10
        Retry sector count                   : 9270  <-- Ooh...
        Damaged sector count                 : 0

Track 03
    Filename : /Users/john/Music/The Flat Earth/03 - Screen Kiss.flac
    Pre-gap length : 00:02:61

    Track gain               : -2.78 dB
    Peak                     : 0.878052
    CRC32 hash (test run)    : 812F557B  <--- Oh dear, think I'll try that again
    CRC32 hash               : 9CF1E8A0  <--- until it's consistent...
        ->Rip may not be accurate.
    CRC32 hash (skip zero)   : 7A14C203
    AccurateRip v1 signature : 283C5FEC
    AccurateRip v2 signature : A86C9E81
        ->Rip may not be accurate (total 89 submissions).
    Statistics
        Read error                           : 0
        Jitter error (maybe fixed)           : 17
        Retry sector count                   : 7771
        Damaged sector count                 : 0


Some inconsistencies found

End of status report

Wednesday, 4 May 2016

The office and a salutary experience

OK, time to sort out the "office". This is the small bedroom I used to use for work which has become something of a dumping ground for stuff from other rooms over the last 6 months when various rels and g-kids visited. I want to use it for a workroom to do things like this.

I dug out the RPi 3 that I'd set up with my own brew of MPD etc. rather than the Rune distro, which I'm using now. This is using the ODAC USB DAC, rather than the Pi-DAC+, which is already installed in the front room. Zapped the SD card with the Rune image, loaded it up, started ok, all good. However, I then started to configure it how I wanted it, and curiously the new values just wouldn't stick. I struggled and struggled, trying all sorts of things, rewriting the SD card etc. etc. I should have known when I couldn't rename the card "Rune" rather than "NO NAME"... It turned out that it was screwed - a symptom of a bad SD card is you can't write it! I found another one, used that, and all was well... by midnight! That's three hours I won't get back.

I'm currently playing it through some old Altec PC speakers with a dodgy subwoofer, which sounds ok. I'll replace these with the Wharfedale NXTs when I get a bit more space and sort the room out better.

I've named the two Rune installations "frontroom" and "office" which seemed sensible. They can be accessed using "frontroom.local" and "office.local" from any browser, mobile or PC-based. I've also tried UPnP data from the minimserver installation on my Mac, and also AirPlay from an iPhone, and it all works great. This could actually work!

Monday, 2 May 2016

More listening

I've now found some more cables, and connected the ODAC and iQAudio Pi-DAC+ simultaneously. Rune/MPD does a neat job of enabling them both to be connected and switched between with only a small interruption.

I'm now listening to BBC R3 streamed via wired Ethernet from the router. The sound is good on either, with room acoustics clearly audible. However, the Pi-DAC+ seems to be more open, listening to a live Wigmore Hall concert. But it's a tough call!

The DAC+ has a much wider range of acceptable digital formats, which given my desire for a "hw:n,m" use i.e. straight-through no pre-processing or resampling, makes it more useful.

ALSA information from the pair of devices is shown below

2) Analog alsa audio output interface `hw:1,0'
 - device name       = IQaudIODAC                                                  
 - interface name    =                                                             
 - usb audio class   = (n/a)                                                       
 - rates per format  = S16_LE:             32000Hz 44100Hz 48000Hz 88200Hz 96000Hz 176400Hz 192000Hz 
                       S24_LE:             32000Hz 44100Hz 48000Hz 88200Hz 96000Hz 176400Hz 192000Hz 
                       S32_LE:             32000Hz 44100Hz 48000Hz 88200Hz 96000Hz 176400Hz 192000Hz 

 3) USB Audio Class Digital alsa audio output interface `hw:2,0'
 - device name       = ODAC-revB                                                   
 - interface name    = USB Audio                                                   
 - usb audio class   = 1 - isochronous adaptive                                    
 - rates per format  = S24_3LE:             96000Hz 88200Hz 48000Hz 44100Hz 32000Hz 
                       S16_LE:              96000Hz 88200Hz 48000Hz 44100Hz 32000Hz 


***** Later *****

I've rigged up a pair of ancient* Wharfedale NXT panel speakers with their subwoofer in the same room, and connected the ODAC via a Myst TMA5 amplifier I had lying around. Not for a DAC comparison, but just because I could and because I'm thinking about using them in my office when it gets sorted out. Using the RPi + DAC setup to play whatever I feel like there from the putative library would be great!



* Ancient?! Hardly - the Quad ESL63s I'm listening on are nearly 35 years old... and been rebuilt at least twice!