Rubyripper

From Hydrogenaudio Knowledgebase
Rubyripper
{{{logo}}}

Open-source secure ripper for Linux
Developer(s) Bouke Woudstra
Release information
Initial release {{{released}}}
Stable release 0.5.3
Preview release SVN
Compatibility
Operating system Linux, Mac OS/X
Additional information
Use Digital Audio Extraction
License GPL
Website Rubyripper website (hosted by Google Code)

Introduction

Rubyripper is a digital audio extraction algorithm that uses cdparanoia in a sophisticated way to make sure that a CD rip is done successfully and accurately. It is very similar to and inspired by EAC. Rubyripper is written in the ruby programming language.

It's currently available for Linux, BSD should work but is untested. OS X is supported for the CLI frontend. The source (same as executable) is published under the GPL3 license.


Features

  • A GTK2 user interface
  • Sophisticated error correction mechanism
  • A command line interface (CLI) available
  • CDDB-info is fetched via the cd-discid module
  • Info can be edited after fetching
  • The codecs supported are FLAC, Vorbis, MP3, and WAV
  • Multiple codecs can be used in one run
  • Direct offset support
  • Detailed logfile creation
  • A detailed overview of hard-to-correct positions
  • Create m3u playlists

Correction mechanism

Rubyripper correction mechanism goes beyond that of cdparanoia. Every track gets ripped at least twice and is byte compared with the Ruby cmp feature. If any differences are found, each of the 1,000 bytes of the two files is compared. The next trial run looks to see if differing positions or a match can be found. (1,000 bytes is about 0.006 seconds). The main underlying Philosophy is that an erroneous read of an underlying ripper will produce random results. This seems so far to be correct. A possibility still exists that with random results the same result will be wrong.

In theory if the full 1,000 bytes are erroneous, than a false repair seems to be highly unlikely since there are combinations. (As a byte consists of 8 bits, ). The main principle however is, the more trials that are needed, consequently the higher a chance of a false repair. Suppose only 3 bytes in a sample of 1,000 bytes give random information. This would still mean possibilities for these bytes; really 2 bits in each byte could be a problem. This reduces the possibilities to . So, a correct repair at this point may be possible. One has to wonder though: can 3 bytes actually be heard in a wav file that produces 180.000 bytes per second?


In conclusion: Rubyripper won't guarantee a consequent MD5-sum on tracks that needed correction. However it will repair any files so that it's impossible to successfully blind-test with the original. The log file will report any position that needed more than 3 trials, so you can check the position yourself.

Installation

General Installation

Make sure to have cd-discid, ruby-libglade2, libglade2-rubyand cdparanoia installed as a minimum. You can optionally choose for Lame, Vorbis or FLAC, depending on the codec you wish to use.

Then download Rubyripper: http://rubyripper.googlecode.com/files/rubyripper-0.5.3.tar.bz2

See the README file for installation instructions or just type: make install

If Rubyripper doesn't start make sure the dependencies are ok. When launched from a terminal Rubyripper should tell you which dependency it's missing.

Installation on Ubuntu 8.04

1. Make sure Rubyripper uses has these dependencies as a bare mininum. They can be installed by typing in the console:

sudo aptitude install cd-discid cdparanoia ruby ruby-pkg-tools libgettext-ruby1.8 libgtk2-ruby

2. Download Rubyripper (see above) from the official website.

3. Extract the files in the Rubyripper archive. There are two types the GUI and the command-line version. Install the GUI is as simple as right-clicking on the archive. In order to install the command-line you need type in the console:

tar xjvf rubyripper-0.5.3.tar.bz2

4. Navigate to the directory in which you installed Rubyripper (Most likely which will be your desktop) or the directory in which you installed the program in type in console:

cd /home/USERNAME/Desktop/rubyripper-0.5.3/

5. Rubyripper needs to know what features need to be installed. Install all of them for the best possible use by typing in the console:

./configure --enable-lang-all --enable-gtk2 --enable-cli

6. In order to run the applicaiton you start be typing in the console:

sudo make install

7. Rubyripper should now be installed with your applications under Applications -> Sound & Video

Note: If you have CD-ROM drive problems it is recommended you read this thread

Installation on Debian

Screenshots

These screenshots are taken with the 0.4.1 release:

New Features

Add an issue in the bugtracker to discuss any wishes:

Known Bugs

Development API

This section will give some technical information, which should be useful for interested developers. It will outline how the code is structured and what the API of Rubyripper codebase is for adding new user interfaces. Since version 0.2 it is quite simple to add new frontends to the current codebase. Currently there are CLI and GTK2 frontends. A Qt frontend or a Cocoa Mac OS frontend, should not be terribly difficult to implement. He won't implement this himself though, due to the fact that he is more interested in fine tuning the Rubyripper logic codebase.

Becoming a Rubyripper developer

To become a developer you should have:

  • Some basic knowledge of the Ruby programming language. Read for instance the free online book, at least until the chapter "Until Trouble Strikes". This is a somewhat dated version, but still perfectly usable. He doesn't use any new features, therefore it should be fine.
  • Some basic knowledge of a GUI-toolkit in case you want to add a new frontend.

SVN Checkout now possible.
Use: svn checkout http://rubyripper.googlecode.com/svn/trunk/ rubyripper to get the latest source code.

If you're ready, please contact him at rubyripperdev@nospam@gmail.com. You can leave out the @nospam part.

Data files and class structures

The 0.2 release has three ruby files and one glade file included:

  • rr_lib.rb. This contains the Rubyripper codebase. It consists of five classes:
    • Gui_Support. This class handles all feedback communication with the user interface and is used a lot by the other classes (except Cddb). This is were log file is generated and the error analysis takes place.
    • Cddb. This class handles the freedb fetching. It uses the Freedb class (dependent on ruby-freedb) to get info about the disc. The server contact is handled in the Cddb class itself. Some problems of the Freedb class made it impossible to rely on it. The biggest problem with using Freedb class is that, it's using an old contact protocol and never gives away any information on the current year. This is the main reason why the Cddb class handles all server contact.
    • Secure_rip. As might be expected, all error correction logic is put in here.
    • Encode. As might be expected, this handles the encoding of the different formats supported.
    • Rubyripper. Handles the usage of the different classes. It also performs some logical checks before starting at all.
  • rubyripper_cli.rb. It has one class that contains the code for the command line interface frontend.
  • rubyripper_gtk.rb.M It has one class that contains the code for the GTK2 user interface frontend.
  • rubyripper.glade. This is a help file for the GTK interface. It's made with Glade, a program for designing user interfaces for GTK2.

Adding a new frontend

New frontends are encouraged and aren't difficult to make, once you know your GUI toolkit. Take for instance, the current GTK2 frontend, which consists of only 350 lines of code (+ the glade file, but this code is automatically created)'. From a starting point it would be best to use the current GTK2 or CLI code and just plainly rewrite it for the other toolkit. The basic ideas should be more or less the same.

The basic idea is that the GUI first presents the info of a Cddb instance. When the user wants to start, a new Rubyripper instance is started with all the settings in a Hash as a parameter. You can copy most of the code from the other user interfaces. The user interface should also have an update function. The update function is used as a communication channel for the Rubyripper instance.

  1. Using a new thread for launching instances is an effective way of getting a responsive GUI.

External links