User Tools

Site Tools


blog:handling_sacds

Handling SACDs

A long time ago, I bought a copy of an SACD of Heifitz playing Bruch's Violin Concerto: for the avoidance of doubt, here's the invoice proving I paid for my copy!

What I hadn't realised, however, is that the disc I brought was an SACD -a high-definition “improvement” on standard CD audio which never really took off and, to this day, requires some fairly unique -and uniquely expensive!- audio gear to interpret and play in all its high-def glory. Lacking said hifi equipment at the time, I merely popped the SACD in a standard CD player and ripped it as usual (SACD, fortunately, was backwardly-compatible with standard CD and could thus be played -at ordinary CD audio quality- on regular CD equipment).

Due to a recent file system mishap (i.e., I clicked 'delete' when I meant to click 'rename'!), I needed to re-rip that particular SACD the other day, but discovered that storing it in the loft in Australia during several inland Summers had done terrible things to it: the thing was practically unplayable. I therefore did what I do not ordinarily make a habit of: I downloaded someone else's rip of the same disc, courtesy of a torrent site.

Trouble is, that download came as a single ISO file, not separate tracks:

So, here was my new problem for the day: how do you turn an ISO of an SACD into separate FLAC tracks that you would have obtained by ripping an ordinary CD of the same music?

Well, on Linux, there's a small utility you can install which will do the first part of the job, called sacd_extract. It's not in Arch Linux's standard repositories, but can be installed from the AUR. Other distros will have similar workarounds to installing the tool.

Once the tool is installed, you can then simply issue this command:

sacd_extract -2 -s -C -i name-of.iso

That pulls individual tracks 'out' of the ISO, creating separate files for each -though the files will be in “DSF” format, which is the extension used to identify high-resolution 'delta sigma' modulated audio files. Note, by the way, that the “-2” in the above command has already stripped out a lot of data contained within the source ISO: it's an instruction to turn the multi-channel audio contained in the original SACD into 2-channel, ordinary stereo, audio files. Working on my specific SACD ISO file, the process looked like this:

[[email protected] Bruch]$ sacd_extract -2 -s -C -i Bruch\ Violin\ Concerto\ No.\ 1.iso 
Exporting CUE sheet [Jascha Heifetz - Bruch Violin Concerto No. 1.cue]
Processing [Jascha Heifetz - Bruch Violin Concerto No. 1/01 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; New - Vorspiel Allegro moderato.dsf] (1/10)..
Processing [Jascha Heifetz - Bruch Violin Concerto No. 1/02 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; New - Adagio.dsf] (2/10)..
Processing [Jascha Heifetz - Bruch Violin Concerto No. 1/03 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; New - Finale Allegro energico.dsf] (3/10)..
Processing [Jascha Heifetz - Bruch Violin Concerto No. 1/04 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; Osi - Introduction Grave; Adagio cantabile.dsf] (4/10)..
Processing [Jascha Heifetz - Bruch Violin Concerto No. 1/05 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; Osi - Allegro.dsf] (5/10)..
Processing [Jascha Heifetz - Bruch Violin Concerto No. 1/06 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; Osi - Adagio; Andante sostenuto.dsf] (6/10)..
Processing [Jascha Heifetz - Bruch Violin Concerto No. 1/07 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; Osi - Finale Allegro guerriero.dsf] (7/10)..
Processing [Jascha Heifetz - Bruch Violin Concerto No. 1/08 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; New - Allegro non troppo.dsf] (8/10)..
Processing [Jascha Heifetz - Bruch Violin Concerto No. 1/09 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; New - Adagio.dsf] (9/10)..
Processing [Jascha Heifetz - Bruch Violin Concerto No. 1/10 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; New - Allegro con fuoco.dsf] (10/10)..
Completed: 100% (19.1MB), Total: 100% (19.1MB) at 11.08MB/sec

That resulted in component tracks being extracted into a sub-directory, whose contents ended up looking like this:

[[email protected] Jascha Heifetz - Bruch Violin Concerto No. 1]$ ls -sh
total 2.6G
311M '01 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; New - Vorspiel Allegro moderato.dsf'
317M '02 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; New - Adagio.dsf'
269M '03 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; New - Finale Allegro energico.dsf'
315M '04 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; Osi - Introduction Grave; Adagio cantabile.dsf'
187M '05 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; Osi - Allegro.dsf'
266M '06 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; Osi - Adagio; Andante sostenuto.dsf'
276M '07 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; Osi - Finale Allegro guerriero.dsf'
507M '08 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; New - Allegro non troppo.dsf'
146M '09 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; New - Adagio.dsf'
 47M '10 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; New - Allegro con fuoco.dsf'

You will note that all these files are of type “.dsf”. You will also note that they are all enormous in size! Bear in mind, an ordinary CD would contain around 650MB of data: here, we have over 2.6GB of the stuff!

So, given that I'm over 17 and my ears cannot, accordingly, tell the difference between the high-res, deep bit-depth audio recording that is a DSF and ye olde FLAC equivalent; and given that I don't have an infinitely-sized hard disk in which to store around 2GB of un-needed, un-wanted data… how do you go about converting DSF files into 'ordinary' FLAC ones?

Well, there are various ways of doing that, depending on what software you want to use. But since it's highly likely you already have ffmpeg installed, here's one way of doing it:

for f in *.dsf; do ffmpeg -i "$f" -ar 44100 -sample_fmt s16 "${f%%.dsf}.flac"; done

That loops through all the DSFs found in a directory (which are likely to be using a 96KHz sampling rate) and down-samples each of them in turn to a FLAC file that uses a 44.1KHz sampling rate (which is the same rate ordinary CDs use). It also switches to using only 16 bits to record each sample (rather than the 24 bits per sample that the high-def DSF original probably uses). A 16-bit depth is, again, what an ordinary CD uses. Doing that on my Heifetz tracks created earlier, I see output such as this:

Output #0, flac, to '09 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; New - Adagio.flac':
  Metadata:
    title           : Adagio
    artist          : Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; New Symphony Orchestra of London
    album           : Bruch: Violin Concerto No. 1; Scottish Fantasy & Vieuxtemps: Violin Concerto No. 5
    genre           : Classical
    TRACKNUMBER     : 9
    date            : 2005-01-11
    encoder         : Lavf58.20.100
    Stream #0:0: Audio: flac, 44100 Hz, stereo, s16, 128 kb/s
    Metadata:
      encoder         : Lavc58.35.100 flac
size=   16176kB time=00:03:36.30 bitrate= 612.6kbits/s speed=89.2x    
video:0kB audio:16168kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.051644%
ffmpeg version n4.1.3 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20181127
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable-nvenc --enable-omx --enable-shared --enable-version3
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
[dsf @ 0x55bd81a83d80] Estimating duration from bitrate, this may be inaccurate

The final 'this may be inaccurate' warning can be safely ignored. Otherwise, this sort of output appears once-per-track undergoing conversion… but at the end of the process, you have essentially converted an SACD rip into an ordinary CD rip. This means you are losing data from the original… but it's data your ears probably can't hear anyway!

In practical terms, you will save a lot of disk space. Here again, for example, are the file sizes of a few 'source' DSFs:

ls -sh *.dsf
  311M '01 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; New - Vorspiel Allegro moderato.dsf'
  317M '02 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; New - Adagio.dsf'
  269M '03 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; New - Finale Allegro energico.dsf'

And here are their FLAC-converted equivalents:

ls -sh *.flac
  36M '01 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; New - Vorspiel Allegro moderato.flac'
  34M '02 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; New - Adagio.flac'
  34M '03 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; New - Finale Allegro energico.flac'

You will note that you are getting file size reductions of 311M to 36M (to take one example): a reduction of around 88%. But the resulting FLAC is a faithful representation of what you would have ripped from an ordinary CD, so still (in my view!) is a properly lossless audio file.

As a further illustration. Here's an original DSF:

311M '01 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; New - Vorspiel Allegro moderato.dsf'

Here is the down-sampled FLAC equivalent:

36M '01 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; New - Vorspiel Allegro moderato.flac'

And here's a 192kbps MP3 I converted from the FLAC:

11M '01 - Jascha Heifetz, violin; Sir Malcolm Sargent, conductor; New - Vorspiel Allegro moderato.mp3'

Since the MP3 is still 75% smaller than the FLAC, there's clearly a lot of audio signal that can be compressed (and -mostly inaudibly!- removed) from the FLAC file, despite the FLAC file itself having lost around 88% of the original DSF signal data. That's my way, at least, of reassuring myself that the conversion from DSF to FLAC hasn't lost anything to care about.

Now the sort of audiophiles that haunt the likes of the Hydrogenaudio forums would have a fainting fit at what I've just described! They get very upset at reducing bit-depth from 24 to 16, for example; and proxy wars have been fought over whether human ears can hear the difference between 44.1KHz and 88.2KHz (or higher) sampling rates or 16-bit and 24-bit depth. But I'm a musicphile, not an audiophile: provided my music sounds great, and I know I've not lost anything I could plausibly hear, I don't mind down-converting SACD to CDs for my own listening purposes. Your mileage is free to vary, of course!

blog/handling_sacds.txt · Last modified: 2019/07/06 09:58 by dizwell