Rubyripper: Difference between revisions

From Hydrogenaudio Knowledgebase
mNo edit summary
m (→‎External links: Category Software added)
 
(146 intermediate revisions by 11 users not shown)
Line 1: Line 1:
{{Infobox Software
{{Infobox Software
| name = Rubyripper
| name = Rubyripper
| screenshot =  
| logo =
| caption =  
| screenshot = [[File:Rubyripper-screenshot.png|100px]]
| caption = Screenshot of legacy version 0.2
| maintainer = Bouke Woudstra
| maintainer = Bouke Woudstra
| stable_release = 0.2
| stable_release = 0.6.0
| preview_release = 0.1.1
| preview_release = 0.6.2
| operating_system = Linux
| operating_system = GNU/Linux, Mac OS/X (CLI)
| use = Digital Audio Extraction
| use = Digital Audio Extraction
| license = GPL  
| license = GPL
| website = [http://rubyforge.org/projects/rubyripper/ Click Here]
| website = [https://github.com/bleskodev/rubyripper github.com/bleskodev/rubyripper]
}}
}}


=Introduction=
'''Rubyripper''' is a secure digital audio extraction application ("cd ripper") for Unix-like operating systems.
 
It uses [[cdparanoia]] error correcting power and its own secure ripping algorithm 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.
What is Rubyripper? Rubyripper is a digital audio extraction algorithm that uses [[cdparanoia]] or cdda2wav in a sophisticated way to make sure that a CD rip is done succesfully and accurately. It is very similiar to and inspired by [[EAC]]. Rubyripper is written in the ruby programming language.  
 
It's currently available for Linux (partial BSD support). OS X will most likely be supported in the near future. The source (same as executable) is published under the GPL license.
 
* '''UPDATE: New version 0.2 was released on 4 August 2006.'''
* '''UPDATE: New version 0.1.1 was released on 12 February 2006.'''
* '''UPDATE: New version 0.1.0 was released on 5 November 2005.'''
 
==Features==


It's currently available for GNU/Linux, BSD should work but is untested. Mac OS/X is supported for the CLI version. For GNU/Linux systems it may be the most mature native secure ripping application available.
The source (same as executable) is published as Free Software under the terms of the GPL version 3.
== Features ==
* Sophisticated error correction mechanism
* Direct read offset support
* Detection of pregaps
* Detection of pre-emphasis
* Create disc images with [[cue sheet]]s
* Create m3u playlists
* A GTK2 user interface
* A GTK2 user interface
* Sophisticated error correction mechanism
* A command line interface (CLI)
* A command line interface (CLI) available
* Metadata (CDDB-info) is fetched via the ''cd-discid'' module. Data can be edited after fetching
* CDDB-info is fetched via the ''ruby-freedb'' module
* The codecs supported are FLAC, Vorbis, MP3, WAV, and arbitrary command line encoders
* Info can be edited after fetching
* The codecs supported are FLAC, Vorbis, MP3, and Wav
* Multiple codecs can be used in one run
* Multiple codecs can be used in one run
* Direct offset support
* Detailed logfile creation
* Detailed logfile creation
* A detailed overview of hard-to-correct positions
* A detailed overview of hard-to-correct positions
* Create m3u playlists


==Correction mechanism==  
=== Error correction mechanism ===
Rubyripper correction mechanism goes beyond that of [[cdparanoia]]. Every track gets ripped at least twice and is byte compared with the <code>Ruby cmp</code> 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.


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 erronous read of an underlying ripper will produce random results. This seems so far to be correct. A possibility still exists that with randomn results the same result will be wrong.
In theory if the full 1,000 bytes are erroneous, then a false repair seems to be highly unlikely since there are <math>256^{1000} = 1.73 * 10^{2408}</math> combinations. (As a byte consists of 8 bits, <math>2^8 = 256</math>). The main principle however is, the more trials that are needed, the higher the chance of a false repair. Suppose only 3 bytes in a sample of 1,000 bytes give random information. This would still mean <math>256^3 = 16.7M</math> possibilities for these bytes; really 2 bits in each byte could be a problem. This reduces the possibilities to <math>2^{3*2} = 64</math>. 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?  
<br><br>
If the full 1,000 bytes are erronous, than a false repair seems to be highly unlikely since there are <math>1000 \times 256</math> possibilities in theory. (As a byte consists of 8 bits, 2<sup>8</sup>=256). This would need an infinite amount of trials to match. 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 <math>3 \times 256</math> possibilities within each of these bytes, really 2 bits could be a problem. This reduces the possibilities to <math>3 \times 2 \times 2 = 12</math> possibilies. So, a false repair still seems to be possible. One has to wonder though: can 3 bytes actually be heard in a wav file that produces 180.000 bytes per second?
<br><br>
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 succesfully 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==
In conclusion: Rubyripper won't guarantee a consequent ''MD5 checksum hash'' on tracks that needed correction. However it will repair any files so that it's impossible to successfully blind-test with the original via an [[ABX]] test for example. The log file will optionally report any position that needed more than 3 trials, so you can check the position yourself.


Make sure to have ''ruby-freedb'', ''ruby-libglade2'' and [[cdparanoia]] or cdda2wav installed as a minimum. You can optionally choose for Lame, Vorbis or FLAC, depending on the codec you wish to use.
== Installation ==
=== General Installation from Source ===
Make sure to have <code>cd-discid, ruby-libglade2, libglade2-ruby</code> and [[cdparanoia]] installed as a minimum. You can optionally choose for Lame, Vorbis or FLAC, and others via command-line configurations depending upon which codecs you want to encode with i.e Wavpack or Nero AAC (See the official Ubuntu forums for more information).  


Then download Rubyripper:
Then download Rubyripper:
http://rubyforge.org/frs/?group_id=1284&release_id=6293
http://code.google.com/p/rubyripper/downloads/list


Documentation of some of the ripping logic used can be found at: (somewhat dated)<br>
See the README file for installation instructions or just type: <code>$sudo make install</code>
http://rubyforge.org/docman/view.php/1284/310/Rubyripper's%20ripping%20logic.pdf


Currently there isn't an official installer available. Usage from a terminal or console:
If Rubyripper doesn't start make sure the dependencies are ok. When launched from the terminal window Rubyripper should tell you which dependency it's missing.


:<code>cd <download_dir> (Go to the directory where you saved the downloaded archive)</code>
=== Automatic Installation on Ubuntu/Debian ===
:<code>tar xfj <filename_download> (Unpack the archive)</code>
[http://www.getdeb.net/ GetDeb] has recent versions of Rubyripper packaged for Ubuntu systems. After teaching your system to use the GetDeb software repositories you can conveniently install using your favourite package manager frontend. Read their [http://www.getdeb.net/updates#how_to_install instructions] on how to easily install their package repositories.
:<code>cd rubyripper-<version> (Move into the just unpacked directory)</code>
:<code>chmod +x *.rb (Make all .rb files executable)</code>
:<code>./rubyripper_gtk.rb (Launch gtk2 user interface)</code>
:<code>./rubyripper_cli.rb (Launch command line user interface)</code>


If Rubyripper doesn't start make sure the dependencies are ok. When launched from a terminal rubyripper should now tell which dependency it's missing.
You can alternatively use the Debian "Sid Marrilat" repositories.


==Screenshots==
* [http://linuxappfinder.com/package/rubyripper Rubyripper 32-bit and 64-bit] The latest releases for i386 and x86_64 architecturess.
The theme used in the screenshots is GTK-Qt-theme.
* [http://b-woudstra.speedlinq.nl/screenshots/Cddb-info_GTK-QT-theme.png The Cddb-info tab]
* [http://b-woudstra.speedlinq.nl/screenshots/Codecs_GTK-QT-theme.png The Codecs tab]
* [http://b-woudstra.speedlinq.nl/screenshots/Other-settings_GTK-QT-theme.png The Other settings tab]
* [http://b-woudstra.speedlinq.nl/screenshots/Ripping-settings_GTK-QT-theme.png The Ripping settings tab]
* [http://b-woudstra.speedlinq.nl/screenshots/Status_GTK-QT-theme.png The status tab]


==Suggestions for next version==
=== Automatic Installation on Fedora/Red Hat ===  
* Try to rip only parts that contain errors to save time
Starting with Fedora 20 Rubyripper, is no longer packaged with Fedora/Red Hat repositories due it no longer being updated. The easiest way to install it is to build it from the source above. This requires downloading the source code from the Rubyripper code archive on the Google Code website or the GitHub repository fork listed at the end of the wiki.
* Erronous parts should be matched more than once
* OS X support. As the only developer I need some help, for I don't have a Mac. A Mac user could help to get the cli-version working. A ruby programmer could help to make the GUI for OS X. I'll be glad to add support for this task.
* Let the user choose which freedb hit he/she will use


==Known Bugs==
=== Older Manual Installation on Ubuntu/Debian ===  
*If the first trial of a track has a different size than the second track, it assumes that the size of the first track is right. We don't know that for sure.
'''It is strongly recommended you use Ubuntu 10.04 (Lucid Lynx) or greater when compiling from the source! ''' <br />
'''These instructions were tested with Ubuntu 9.04 ("Jaunty Jackalope“), Gnome 2.26.1, and Rubyripper 0.5.7.'''


#Make sure Rubyripper has these dependencies as a bare mininum. They can be installed by typing in the terminal window:<br /><code>&nbsp;$ sudo apt-get install cd-discid cdparanoia</code><br>as a bare mininum or<br><code>&nbsp;$ sudo apt-get install cd-discid cdparanoia flac lame mp3gain normalize-audio ruby-gnome2 ruby vorbisgain</code><br />to get the most out of the currently available distros.<br>For internationalization: instead of the mentioned <code>ruby-gettext</code> install <code>gettext</code> and <code>libgettext-ruby1.8</code>.
#Download the Rubyripper archive (see above) from the official website.
#Extract the files in the Rubyripper archive (bzipped tarball) into a temporary directory.
#Navigate to the directory in which you extracted the Rubyripper archive (Most likely which will be your desktop) or the directory in which you extracted the archive in, e.&nbsp;g. by typing in terminal window:<br /><code>&nbsp;$ cd /home/USERNAME/Desktop/rubyripper-0.x.x/</code>
#Rubyripper needs to know what features need to be installed. Install both the GUI and command-line version for to get the most out of the application by typing in the terminal window:<br><code>&nbsp;$ ./configure --enable-lang-all --enable-gtk2 --enable-cli</code><br>Note: This only prepares/&#8203;configures installation.
#In order to install the application, type in the terminal window:<br><code>&nbsp;$ sudo make install</code>
#Rubyripper should now be installed with your applications under <code>Applications -> Sound & Video</code>
#If it runs according to your needs you may remove the temporary directory.


'''Notes:'''
* If you have CD-ROM drive problems it is recommended you read [http://ubuntuforums.org/showpost.php?p=5529611&postcount=16 this] thread
* You can add or drop dependencies as you see fit depending upon what packages you need or already have '''
* Substitute 'x' above with the latest version of Rubyripper'''
* You can run the command-line version of Rubyripper be navigating to the source directory and typing in <code>./rubyripper_cli.rb</code> into the terminal (This is useful if you want to use it conjunction with shell scripts like BASH and KSH to automate the ripping process for instance)'''


=Development API=
=== Setup ===
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. I won't implement this myself though, due to the fact that I am more interested in fine tuning the Rubyripper logic codebase.
To point to the correct cdrom drive, you will need to specify both the Cdrom device & Cdrom offset.
<br>
* Cd rom device
** To print a list of installed drives:
<nowiki>$ cd-drive | grep Drive</nowiki>


==Becoming a Rubyripper developer==
*Cd rom offset
** Click the [http://accuraterip.com/driveoffsets.htm List with offsets] link to lookup the required Correction Offset
** To print a list of installed drives:
<nowiki>$ cd-drive | grep Model</nowiki>
 
'''Example'''
 
''Terminal:''
 
<nowiki>[user@name ~]$ cd-drive | grep Drive
Drivers available...
                      Drive: /dev/cdrom
                      Drive: /dev/sr1
[user@name ~]$ cd-drive | grep Model
Model                      : DVDRW LH-20A1L 
Model                      : iHAS324  W </nowiki>
''Retrieved from the website 3/31/2014:''
{| style="text-align:left"
! CD Drive                     
! Correction Offset !! Submitted By !! Percentage Agree
|-
| LITE-ON - DVDRW LH-20A1L
| +6
| 706
| 100%
|-
| ATAPI - iHAS324 W
| +48
| 19
| 100%
|}
 
 
''Option 1:''
 
<tt>
 
Cdrom device: /dev/cdrom
 
Cdrom offset: 6
 
</tt>
 
 
''Option 2:''
 
<tt>
 
Cdrom device: /dev/sr1
 
Cdrom offset: 48
 
</tt>
 
 
== Known bugs & new features ==
Add an issue in the bugtracker to discuss any new feature requests:
* [http://code.google.com/p/rubyripper/issues/list Known bugs and new features]
 
== 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. The developer 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:
To become a developer you should have:
* Some basic knowledge of the Ruby programming language. Read for instance the [http://www.ruby-doc.org/docs/ProgrammingRuby/ free online book], at least until the chapter "Until Trouble Strikes". This is a somewhat dated version, but still perfectly usable. I don't use any new features, therefore I think it should be fine.
* Some basic knowledge of the Ruby programming language. Read for instance the [http://www.ruby-doc.org/docs/ProgrammingRuby/ free online book], at least until the chapter "Until Trouble Strikes". This is a somewhat dated version, but still perfectly usable. The lead developer 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.
* Some basic knowledge of a GUI-toolkit in case you want to add a new frontend.


If you're ready, please contact me at ''rubyripperdev@nospam@gmail.com''. You can leave out the @nospam part.
SVN Checkout now possible.<br/>
Use: <code>$svn checkout http://rubyripper.googlecode.com/svn/trunk/ rubyripper </code> to get the latest source code.
 
If you're interested in becoming a developer, please contact him at ''rubyripperdev@nospam@gmail.com''. You can leave out the @nospam part.


==Data files and class structures==
== Data files and class structures ==
The 0.2 release has three ruby files and one glade file included:
The 0.5 release has three ruby files and one glade file included:
* <code>rr_lib.rb.</code> This contains the Rubyripper codebase. It consists of five classes:
* <code>rr_lib.rb.</code> This contains the Rubyripper codebase. It consists of five classes:
** <code>Gui_Support.</code> 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.
** <code>Gui_Support.</code> 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.
** <code>Cddb.</code> 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.
** <code>Cddb.</code> 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.
** <code>Secure_rip.</code> As might be expected, all error correction logic is put in here.
** <code>Secure_rip.</code> As might be expected, all error correction logic is put in here.
** <code>Encode. </code> As might be expected, this handles the encoding of the different formats supported.
** <code>Encode. </code> As might be expected, this handles the encoding of the different formats supported.
Line 107: Line 171:
* <code>rubyripper.glade.</code> This is a help file for the GTK interface. It's made with Glade, a program for designing user interfaces for GTK2.
* <code>rubyripper.glade.</code> 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==
== Adding a new frontend ==
New frontends are encouraged and shouldn't be difficult to make. Take for instance, the current GTK2 frontend, which consists of only 350 lines of code ''(+ the glade file, but this code is automatically created)'''. Being the only lead developer, I hope you will be consistent with the current GTK2 interface design. If there are valid reasons to make any adjustments, please consult with me first. From a starting point it would be best to use the current GTK2 code and just plainly rewrite it for the other toolkit. The basic ideas should be more or less the same.
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.


What requirements would code for a new GUI have to work correctly with the Rubyripper codebase?
# Load the Rubyripper codebase -> <code>'require ./rr_lib.rb'</code>
# Make a class of the GUI code, we will later pass this to the Rubyripper codebase.
# Get info from the user which cdrom should be used (load it from <code>$HOME/rubyripper_settings</code> if it exists)
# Start a new instance of Cddb class -> @instance = Cddb.new(cdrom <string>, self <class>, multiple_freedb_hits? <bool>, verbose? <bool>)
# Test if @instance.disc_ok <bool> is true. If so, you can use @instance.track_numbers <int> and @instance.tracks_length <string> to update the amount and playlength of the tracks into the GUI. Also start @instance.make_internet_contact()
# Test if @instance.internet_ok <bool> is true. If so, update the info of @instance.artist <string>, @instance.album <string>, @instance.year <string>, @instance.genre <string> and tracklist <array_of_strings> in the GUI.
# As soon as the user wants to start the ripping process, start a new instance of the Rubyripper class. This is done by passing the settings Hash as an argument. ''(In other languages sometimes called a dictionary)''
# The hash should contain all settings: <code>
#* @settings['instance'] = the Gui instance -> self
#* @settings['cd_info'] = the Cddb instance -> @instance
#* @settings['verbose'] = bool
#* @settings['debug'] = bool
#* @settings['flac'] = bool
#* @settings['vorbis'] = bool
#* @settings['mp3'] = bool
#* @settings['wav'] = bool
#* @settings['flacsettings'] = string
#* @settings['vorbissettings'] = string
#* @settings['mp3settings'] = string
#* @settings['playlist'] = bool (m3u playlist wanted?)
#* @settings['use_threading'] = bool (ripping and encoding don't wait for each other)
#* @settings['ripper'] = string (cdda2wav or cdparanoia)
#* @settings['rippersettings'] = string or false
#* @settings['max_tries'] = int
#* @settings['cdrom'] = string (same as the one passed to Cddb instance)
#* @settings['offset'] = int
#* @settings['temp_dir'] = string
#* @settings['destination_dir'] = string
#* @settings['save_log'] = bool
#* @settings['tracklist'] = array of integers (which tracks should be ripped) </code>
# All communication back to the GUI happens via the update function, that should be in the GUI, accepting two parameters: modus <string> and value <can be anything, dependent on the modus>. Notice that this is a great ruby feature! The different modus are:
#* <code>ripping_progress</code>. value is a float. <math>100 % = 1.0. </math> Used to update the progress bar.
#* <code>encoding_progress</code>. value is a float. <math>100 % = 1.0.</math> Used to update the progress bar.
#* <code>log_change</code>. value is a string. Used to update the status screen.
#* <code>track_finished.</code> value is an integer. Used to deselect the track in the GUI.
#* <code>finished.</code> value is not important. This means that the ripping and encoding are finished. Used to unlock the GUI-buttons.
#* <code>error.</code> value is a string. Used to bring up a popup window with the error message.
#* <code>cddb_hit.</code> value is an array of strings with the multiple hits. Return the index of the array.
# Using a new thread for launching instances is an effective way of getting a responsive GUI.
# Using a new thread for launching instances is an effective way of getting a responsive GUI.


==OS X support==
== External links ==
Since the lead developer doesn't have a Mac, he cannot test anything. Therefore support from someone who knows OS X very well and can test any code if needed is a necessity. The main differences with OS X and Linux support are:
* [https://github.com/bleskodev/rubyripper Rubyripper] The next best repository since Google Code closed down.  
* Audio cd's may have to be unmounted before they can be ripped.
* [http://www.hydrogenaudio.org/forums/index.php?showtopic=38418 Hydrogenaudio forum thread] the first public release of Rubyripper.
* Linux doesn't mount audio cd's at all.
* [https://plus.google.com/communities/103961841006414793555 Google Plus] Google Plus community group for questions related to older releases of Rubyripper.  
* In [[cdparanoia]] an option to set the cdrom device is missing, which is there in Linux.
* [http://ubuntuforums.org/showthread.php?t=799621 Ubuntu Forums] a thread that's consistently updated for installing Rubyripper in Ubuntu including troubleshooting. 
 
 
 
=Development progress=
I added this section in order to figure out the right way to implement features into Rubyripper.
I am currently working on:
* The tracklist presentation. Someone on the forums suggested, the interface isn't perfect. I improved it by opening the main window with a fixed size. The tracklist becomes scrollable, if it is too large too fit. Screenshots:
** [http://b-woudstra.speedlinq.nl/screenshots/track_selection1.png New tracklist loading 1]
** [http://b-woudstra.speedlinq.nl/screenshots/track_selection2.png New tracklist loading 2]
* A separate status window was added, instead of a tab. This can be seen in the previous screenshots.
* I also removed the status bars and the status tab from the main view. They were moved to a separate ripping window, like [[EAC]]. I am still working on which buttons should remain visible. If you have any ideas how to improve the GUI shown in the next screenshot, feel free to share your opinion!
** [http://b-woudstra.speedlinq.nl/screenshots/status_window.png New separate status window]
 
==External links==
* [http://rubyforge.org/projects/rubyripper/ Rubyripper] the official Rubyforge website
* [http://www.rarewares.org/debian/packages/unstable/rubyripper_0.2-0rarewares1_i386.deb Debian Package] unstable Debian compile of Rubyripper.  
* [http://www.hydrogenaudio.org/forums/index.php?showtopic=38418 Hydrogenaudio forum thread] the first public release of Rubyripper




[[Category:CD Rippers]]
[[Category:Software]]
[[Category:Software]]

Latest revision as of 18:46, 13 November 2021

Rubyripper

Screenshot of legacy version 0.2
Developer(s) Bouke Woudstra
Release information
Initial release {{{released}}}
Stable release 0.6.0
Preview release 0.6.2
Compatibility
Operating system GNU/Linux, Mac OS/X (CLI)
Additional information
Use Digital Audio Extraction
License GPL
Website github.com/bleskodev/rubyripper

Rubyripper is a secure digital audio extraction application ("cd ripper") for Unix-like operating systems. It uses cdparanoia error correcting power and its own secure ripping algorithm 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 GNU/Linux, BSD should work but is untested. Mac OS/X is supported for the CLI version. For GNU/Linux systems it may be the most mature native secure ripping application available. The source (same as executable) is published as Free Software under the terms of the GPL version 3.

Features

  • Sophisticated error correction mechanism
  • Direct read offset support
  • Detection of pregaps
  • Detection of pre-emphasis
  • Create disc images with cue sheets
  • Create m3u playlists
  • A GTK2 user interface
  • A command line interface (CLI)
  • Metadata (CDDB-info) is fetched via the cd-discid module. Data can be edited after fetching
  • The codecs supported are FLAC, Vorbis, MP3, WAV, and arbitrary command line encoders
  • Multiple codecs can be used in one run
  • Detailed logfile creation
  • A detailed overview of hard-to-correct positions

Error 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, then 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, the higher the 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 . 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 checksum hash on tracks that needed correction. However it will repair any files so that it's impossible to successfully blind-test with the original via an ABX test for example. The log file will optionally report any position that needed more than 3 trials, so you can check the position yourself.

Installation

General Installation from Source

Make sure to have cd-discid, ruby-libglade2, libglade2-ruby and cdparanoia installed as a minimum. You can optionally choose for Lame, Vorbis or FLAC, and others via command-line configurations depending upon which codecs you want to encode with i.e Wavpack or Nero AAC (See the official Ubuntu forums for more information).

Then download Rubyripper: http://code.google.com/p/rubyripper/downloads/list

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

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

Automatic Installation on Ubuntu/Debian

GetDeb has recent versions of Rubyripper packaged for Ubuntu systems. After teaching your system to use the GetDeb software repositories you can conveniently install using your favourite package manager frontend. Read their instructions on how to easily install their package repositories.

You can alternatively use the Debian "Sid Marrilat" repositories.

Automatic Installation on Fedora/Red Hat

Starting with Fedora 20 Rubyripper, is no longer packaged with Fedora/Red Hat repositories due it no longer being updated. The easiest way to install it is to build it from the source above. This requires downloading the source code from the Rubyripper code archive on the Google Code website or the GitHub repository fork listed at the end of the wiki.

Older Manual Installation on Ubuntu/Debian

It is strongly recommended you use Ubuntu 10.04 (Lucid Lynx) or greater when compiling from the source!
These instructions were tested with Ubuntu 9.04 ("Jaunty Jackalope“), Gnome 2.26.1, and Rubyripper 0.5.7.

  1. Make sure Rubyripper has these dependencies as a bare mininum. They can be installed by typing in the terminal window:
     $ sudo apt-get install cd-discid cdparanoia
    as a bare mininum or
     $ sudo apt-get install cd-discid cdparanoia flac lame mp3gain normalize-audio ruby-gnome2 ruby vorbisgain
    to get the most out of the currently available distros.
    For internationalization: instead of the mentioned ruby-gettext install gettext and libgettext-ruby1.8.
  2. Download the Rubyripper archive (see above) from the official website.
  3. Extract the files in the Rubyripper archive (bzipped tarball) into a temporary directory.
  4. Navigate to the directory in which you extracted the Rubyripper archive (Most likely which will be your desktop) or the directory in which you extracted the archive in, e. g. by typing in terminal window:
     $ cd /home/USERNAME/Desktop/rubyripper-0.x.x/
  5. Rubyripper needs to know what features need to be installed. Install both the GUI and command-line version for to get the most out of the application by typing in the terminal window:
     $ ./configure --enable-lang-all --enable-gtk2 --enable-cli
    Note: This only prepares/​configures installation.
  6. In order to install the application, type in the terminal window:
     $ sudo make install
  7. Rubyripper should now be installed with your applications under Applications -> Sound & Video
  8. If it runs according to your needs you may remove the temporary directory.

Notes:

  • If you have CD-ROM drive problems it is recommended you read this thread
  • You can add or drop dependencies as you see fit depending upon what packages you need or already have
  • Substitute 'x' above with the latest version of Rubyripper
  • You can run the command-line version of Rubyripper be navigating to the source directory and typing in ./rubyripper_cli.rb into the terminal (This is useful if you want to use it conjunction with shell scripts like BASH and KSH to automate the ripping process for instance)

Setup

To point to the correct cdrom drive, you will need to specify both the Cdrom device & Cdrom offset.

  • Cd rom device
    • To print a list of installed drives:
$ cd-drive | grep Drive
  • Cd rom offset
    • Click the List with offsets link to lookup the required Correction Offset
    • To print a list of installed drives:
$ cd-drive | grep Model

Example

Terminal:

[user@name ~]$ cd-drive | grep Drive
Drivers available...
                       Drive: /dev/cdrom
                       Drive: /dev/sr1
[user@name ~]$ cd-drive | grep Model
Model                       : DVDRW LH-20A1L  
Model                       : iHAS324   W 

Retrieved from the website 3/31/2014:

CD Drive Correction Offset Submitted By Percentage Agree
LITE-ON - DVDRW LH-20A1L +6 706 100%
ATAPI - iHAS324 W +48 19 100%


Option 1:

Cdrom device: /dev/cdrom

Cdrom offset: 6


Option 2:

Cdrom device: /dev/sr1

Cdrom offset: 48


Known bugs & new features

Add an issue in the bugtracker to discuss any new feature requests:

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. The developer 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. The lead developer 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 interested in becoming a developer, please contact him at rubyripperdev@nospam@gmail.com. You can leave out the @nospam part.

Data files and class structures

The 0.5 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

  • Rubyripper The next best repository since Google Code closed down.
  • Hydrogenaudio forum thread the first public release of Rubyripper.
  • Google Plus Google Plus community group for questions related to older releases of Rubyripper.
  • Ubuntu Forums a thread that's consistently updated for installing Rubyripper in Ubuntu including troubleshooting.