AlexLeoTW / rubyripper

Automatically exported from code.google.com/p/rubyripper
0 stars 0 forks source link

Getting MacOS support there #52

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Get a MacOS machine
2. Try to run rubyripper cli
3. Doesn't work correctly for 100% \ can be improved

What is the expected output? What do you see instead?
Should work flawlessly. Special attention goes to freedb support and 
drive selection. There probably is a clue in the fact that there are 
different ports out there. Some are not that good.

Original issue reported on code.google.com by rubyripp...@gmail.com on 7 Feb 2007 at 4:54

GoogleCodeExporter commented 8 years ago
I'm looking for MacOS ported cdparanoia versions out there that:
* does not require unmounting the disc
* accept the drive argument (-d parameter)
* will print the Table of contents with -> cdparanoia -d /dev/disk1 -vQ

I'm also looking for MacOS ported cd-discid versions out there that:
* does not require unmounting the disc
* return a correct freedb string. For a 18 track audio disc this might be:

f10cb712 18 150 8445 22395 41932 59452 65836 81394 100343 103850 123110 130833 
155361 157857 177807 202887 224181 228047 241547 3257

The first part is the freedb audio-disc value, '18' is the amount of tracks, 
what 
follows are the offsets for each track. Except the last value ('3257' in this 
case), which represent the amount of seconds in total.

Perhaps there do not exist ported versions out there that fullfill all 
requirements, but please test what works and what does not. And give the 
location 
where the port can be found.

Original comment by rubyripp...@gmail.com on 7 Feb 2007 at 5:16

GoogleCodeExporter commented 8 years ago
Forgot to say: if it's easier to use a native commandline program instead of 
cd-discid while offering the same functionality, I can easily use that one too.

Original comment by rubyripp...@gmail.com on 7 Feb 2007 at 5:20

GoogleCodeExporter commented 8 years ago
cd-discid version 0.9 which is linked from 
http://freshmeat.net/projects/cddiscid/ 
is reported to work correctly. No need to unmount the drive and with correct 
output. It seems that cd-discid officially got MacOS support from this version 
on. 
It's no longer a third hand port.

Original comment by rubyripp...@gmail.com on 7 Feb 2007 at 8:21

GoogleCodeExporter commented 8 years ago
I'm using the MacPorts ( http://www.macports.org/ ) repository which has both 
cdparanoia and cd-discid.
cdparanoria doesn't seem to accept a -d switch, and cd-discid consequently 
reports false values (negative 
integers like this: df3d780c 12 536871062 744161430 1553989782 -1109131114 
-534445674 -60292714 
-1516306026 1173684630 1832256150 -361299306 -1313209706 -1644821866 53704576).
cd-discid might work correctly on ppc macs, however I'm on an intel mac with 
osx 4.10.8.

Original comment by jesper...@gmail.com on 7 Feb 2007 at 9:29

GoogleCodeExporter commented 8 years ago
While browsing around for an alternative to cd-discid, I found 
http://discid.sourceforge.net/
It compiles and works like it should on an x86 mac. And it takes the same 
argument and outputs the same 
information as cd-discid. So, when I replaced cd-discid with discid in 
rr_lib.rb, it found and parsed the cddb 
information correctly :-)

Original comment by jesper...@gmail.com on 7 Feb 2007 at 10:01

GoogleCodeExporter commented 8 years ago
It appears that discid requires the disc to be unmounted just as I experienced 
was the case with cd-discid. 
Maybe this is something x86 mac specific?
However, it is easily solved with 'diskutil unmount diskX' when unmounting, and 
'diskutil mount diskX' when 
remounting.
diskutil doesn't require a normal osx user to use sudo as a normal mount/umount 
command would.

Original comment by jesper...@gmail.com on 7 Feb 2007 at 10:21

GoogleCodeExporter commented 8 years ago
SUGGESTION FOR IMPLEMENTATION

If the frontend asks to get the freedb info:
1. check if cd-discid is installed on the system
2. if so set the freedb command to cd-discid
3. else check if discid is installed on the system
4. if so set the freedb command to discid & if darwin is detected, unmount the 
disc 
with 'diskutil unmount diskX'.
5. when 4 applies, after returning freedb values, mount the disc with 'diskutil 
mount diskX' if darwin is detected.
6. else fall back to no freedb support and return default values

Since there is no reason a user has cd-discid installed while it is not 
working, 
this should be ok, right? I should make a notice in the README file though.

Any objections or comments?

Original comment by rubyripp...@gmail.com on 7 Feb 2007 at 10:28

GoogleCodeExporter commented 8 years ago
That sounds very good. I'm ready to test it whenever it's done!
I'm pretty sure the cd-discid is isolated to x86 macs, though. Gonna try 
reporting it to macports' trac when I can 
get to register there.

Original comment by jesper...@gmail.com on 7 Feb 2007 at 10:54

GoogleCodeExporter commented 8 years ago
I've updated the code in revision 59. Although I've put number 1 & 2 to be 
last. 
Because if they're both installed, I want to use diskid. 

As a last resort, I also implemented the manual 'fallback' freedb generation 
based 
on code supplied by Scott. Thanks for that :D. The fallback code will fail on 
discs 
with a data track, but otherwise works great.

You must set your disc drive correctly again in MacOS when you need freedb 
support! 
No autodetection takes place, because the current command didn't always work.

Original comment by rubyripp...@gmail.com on 9 Feb 2007 at 9:54

GoogleCodeExporter commented 8 years ago
I've been testing it on a bunch of cd's and haven't had any problems at all :D 
It all works like a charm.
discid is in my path, as is cd-discid, and it correctly chooses discid and also 
unmounts/mounts like it's supposed 
to. Great work! :)

Original comment by jesper...@gmail.com on 10 Feb 2007 at 5:05

GoogleCodeExporter commented 8 years ago
That's great to hear :D. Your input made it easy to implement.

So let's move on to the next item in line: cdparanoia. 

As I understand right now, the cdparanoia version in MacPorts:
* doesn't require unmounting
* But also doesn't accept the drive parameter (-d). This might be confusing for 
users, since the freedb info gets fetched from the drive that they entered, and 
cdparanoia just uses the default drive.

Can you post the output of the failing command `cdparanoia -d /dev/disk1 -vQ` ? 
I 
might make a check for this output and then retry the command without the -d 
parameter. I will also put some line about it in the README file.

Original comment by rubyripp...@gmail.com on 10 Feb 2007 at 5:36

GoogleCodeExporter commented 8 years ago
It doesn't require unmounting, no. But the -d argument doesn't produce any 
error either. It just outputs the 
default help text:

$ cdparanoia -d /dev/disk1 -vQ
cdparanoia III release 9.8 (March 23, 2001)
(C) 2001 Monty <monty@xiph.org> and Xiphophorus

Report bugs to paranoia@xiph.org
http://www.xiph.org/paranoia/

USAGE:
  cdparanoia [options] <span> [outfile]

OPTIONS:
  -v --verbose                    : extra verbose operation
  -q --quiet                      : quiet operation
  -e --stderr-progress            : force output of progress information to
                                    stderr (for wrapper scripts)
  -V --version                    : print version info and quit
  -Q --query                      : autosense drive, query disc and quit
  -B --batch                      : 'batch' mode (saves each track to a
                                    seperate file.
  -s --search-for-drive           : do an exhaustive search for drive
  -h --help                       : print help

  -p --output-raw                 : output raw 16 bit PCM in host byte 
                                    order
  -r --output-raw-little-endian   : output raw 16 bit little-endian PCM
  -R --output-raw-big-endian      : output raw 16 bit big-endian PCM
  -w --output-wav                 : output as WAV file (default)
  -f --output-aiff                : output as AIFF file
  -a --output-aifc                : output as AIFF-C file

  -c --force-cdrom-little-endian  : force treating drive as little endian
  -C --force-cdrom-big-endian     : force treating drive as big endian
  -n --force-default-sectors <n>  : force default number of sectors in read
                                    to n sectors
  -o --force-search-overlap  <n>  : force minimum overlap search during
                                    verification to n sectors
  -S --force-read-speed <n>       : read from device at specified speed
  -t --toc-offset <n>             : Add <n> sectors to the values reported
                                    when addressing tracks. May be negative
  -T --toc-bias                   : Assume that the beginning offset of 
                                    track 1 as reported in the TOC will be
                                    addressed as LBA 0.  Necessary for some
                                    Toshiba drives to get track boundaries
                                    correct
  -O --sample-offset <n>          : Add <n> samples to the offset when
                                    reading data.  May be negative.
  -z --never-skip[=n]             : never accept any less than perfect
                                    data reconstruction (don't allow 'V's)
                                    but if [n] is given, skip after [n]
                                    retries without progress.
  -Z --disable-paranoia           : disable all paranoia checking
  -Y --disable-extra-paranoia     : only do cdda2wav-style overlap checking
  -X --abort-on-skip              : abort on imperfect reads/skips

OUTPUT SMILIES:
  :-)   Normal operation, low/no jitter
  :-|   Normal operation, considerable jitter
  :-/   Read drift
  :-P   Unreported loss of streaming in atomic read operation
  8-|   Finding read problems at same point during reread; hard to correct
  :-0   SCSI/ATAPI transport error
  :-(   Scratch detected
  ;-(   Gave up trying to perform a correction
  8-X   Aborted (as per -X) due to a scratch/skip
  :^D   Finished extracting

PROGRESS BAR SYMBOLS:
<space> No corrections needed
   -    Jitter correction required
   +    Unreported loss of streaming/other error in read
   !    Errors are getting through stage 1 but corrected in stage2
   e    SCSI/ATAPI transport error (corrected)
   V    Uncorrected error/skip

SPAN ARGUMENT:
The span argument may be a simple track number or a offset/span
specification.  The syntax of an offset/span takes the rough form:

                       1[ww:xx:yy.zz]-2[aa:bb:cc.dd] 

Here, 1 and 2 are track numbers; the numbers in brackets provide a
finer grained offset within a particular track. [aa:bb:cc.dd] is in
hours/minutes/seconds/sectors format. Zero fields need not be
specified: [::20], [:20], [20], [20.], etc, would be interpreted as
twenty seconds, [10:] would be ten minutes, [.30] would be thirty
sectors (75 sectors per second).

When only a single offset is supplied, it is interpreted as a starting
offset and ripping will continue to the end of he track.  If a single
offset is preceeded or followed by a hyphen, the implicit missing
offset is taken to be the start or end of the disc, respectively. Thus:

    1:[20.35]    Specifies ripping from track 1, second 20, sector 35 to 
                 the end of track 1.

    1:[20.35]-   Specifies ripping from 1[20.35] to the end of the disc

    -2           Specifies ripping from the beginning of the disc up to
                 (and including) track 2

    -2:[30.35]   Specifies ripping from the beginning of the disc up to
                 2:[30.35]

    2-4          Specifies ripping from the beginning of track two to the
                 end of track 4.

Don't forget to protect square brackets and preceeding hyphens from
the shell...

A few examples, protected from the shell:
  A) query only with exhaustive search for a drive and full reporting
     of autosense:
       cdparanoia -vsQ

  B) extract up to and including track 3, putting each track in a seperate
     file:
       cdparanoia -B -- "-3"

  C) extract from track 1, time 0:30.12 to 1:10.00:
       cdparanoia "1[:30.12]-1[1:10]"

Submit bug reports to xiphmont@mit.edu

Original comment by jesper...@gmail.com on 10 Feb 2007 at 6:12

GoogleCodeExporter commented 8 years ago
Perhaps it would be easier to check if the output isn't the default one?

Original comment by jesper...@gmail.com on 10 Feb 2007 at 6:13

GoogleCodeExporter commented 8 years ago
Just an idea: Can you see if `cdparanoia /dev/disk1 -vQ` does work? It might as 
well have the same output. But one never knows...

Original comment by rubyripp...@gmail.com on 10 Feb 2007 at 6:23

GoogleCodeExporter commented 8 years ago
Good idea, it seems ;)

$ cdparanoia /dev/disk1 -vQ
cdparanoia III release 9.8 (March 23, 2001)
(C) 2001 Monty <monty@xiph.org> and Xiphophorus

Report bugs to paranoia@xiph.org
http://www.xiph.org/paranoia/

track_num = 160 start sector 4350 msf: 1,0,0
track_num = 161 start sector 53850 msf: 12,0,0
track_num = 162 start sector 230350 msf: 51,13,25
track_num = 1 start sector 0 msf: 0,2,0
track_num = 2 start sector 19130 msf: 4,17,5
track_num = 3 start sector 38970 msf: 8,41,45
track_num = 4 start sector 59965 msf: 13,21,40
track_num = 5 start sector 85015 msf: 18,55,40
track_num = 6 start sector 104250 msf: 23,12,0
track_num = 7 start sector 119232 msf: 26,31,57
track_num = 8 start sector 133922 msf: 29,47,47
track_num = 9 start sector 154692 msf: 34,24,42
track_num = 10 start sector 175910 msf: 39,7,35
track_num = 11 start sector 197680 msf: 43,57,55
track_num = 12 start sector 209930 msf: 46,41,5

Table of contents (audio tracks only):
track        length               begin        copy pre ch
===========================================================
  1.    19130 [04:15.05]        0 [00:00.00]    no   no  2
  2.    19840 [04:24.40]    19130 [04:15.05]    no   no  2
  3.    20995 [04:39.70]    38970 [08:39.45]    no   no  2
  4.    25050 [05:34.00]    59965 [13:19.40]    no   no  2
  5.    19235 [04:16.35]    85015 [18:53.40]    no   no  2
  6.    14982 [03:19.57]   104250 [23:10.00]    no   no  2
  7.    14690 [03:15.65]   119232 [26:29.57]    no   no  2
  8.    20770 [04:36.70]   133922 [29:45.47]    no   no  2
  9.    21218 [04:42.68]   154692 [34:22.42]    no   no  2
 10.    21770 [04:50.20]   175910 [39:05.35]    no   no  2
 11.    12250 [02:43.25]   197680 [43:55.55]    no   no  2
 12.    20420 [04:32.20]   209930 [46:39.05]    no   no  2
TOTAL  230350 [51:11.25]    (audio only)

Original comment by jesper...@gmail.com on 10 Feb 2007 at 6:24

GoogleCodeExporter commented 8 years ago
Stop your overenjoyment :( Without -d cdparanoia totally ignores the drivename. 
It 
always takes the default drive instead. I had forgotten this for a moment. See 
also 
(fixed) issue nr. 51.

I'll see what I can make of it.

Original comment by rubyripp...@gmail.com on 10 Feb 2007 at 6:52

GoogleCodeExporter commented 8 years ago
In revision 62 I've implemented a test for cdparanoia to see if it supports the 
drive (-d) parameter. This will be used for analyzing the disc, as well as the 
actual ripping.

I need some way to detect the default drive (probably the first as it does in 
Linux) to make sure that the freedb info matches the right drive. The original 
suggestion by Scott of using the output of `df -t cddafs` does only work on 
mounted 
drives, as I understood.

Can you guys help me out here?

Original comment by rubyripp...@gmail.com on 10 Feb 2007 at 7:50

GoogleCodeExporter commented 8 years ago
I've been trying to figure that one out but it's tough. I tried looking over the
cdparanoia source but didn't find a lot of insight -- it's just a bunch of OS X
system calls. Even if I fully understood them, I would have no idea how to 
duplicate
the functionality in ruby. I'll keep looking -- maybe check the docs for the OS 
X
automount system? 

Original comment by scott.en...@gmail.com on 12 Feb 2007 at 6:43

GoogleCodeExporter commented 8 years ago
In other news, I found a way to generate a correct freedb string for at least 
one
data disc (the one I own). It involves playing with the first raw toc that 
cdparanoia
prints ("track_num = ...."). It's based on two assumptions, neither of which is
necessarily true for all data discs (but are both true for the one I have on 
hand). 

1) that "track" 176 == end of data
2) that the last track in the cdparanoia raw toc is always the data track

I'm going to use this funny "attach a file" link I see here to send you a diff. 
It's
based on svn 62. It doesn't disable cd-discid / discid, so it can be added to 
the
repository right away. (But if you want to test it, naturally, disable those 
options.)

Again, this may not work for all data discs. Lots of testing required. However, 
I
suspect that with enough testing and fiddling, we'll be able to eliminate the
cd-discid dependency after all. The information is all there (I hope!) in the 
cdp raw
toc.

Original comment by scott.en...@gmail.com on 12 Feb 2007 at 6:48

Attachments:

GoogleCodeExporter commented 8 years ago
I applied your patch in revision 63. Seems decent code to me ;)

However, only MacOS users will benefit from it since the Linux version of 
cdparanoia doesn't print this information. Other users on MacOS can now easily 
test 
your code with any audio-cd's with a data track on it.

Original comment by rubyripp...@gmail.com on 12 Feb 2007 at 8:03

GoogleCodeExporter commented 8 years ago
Ahhh, I didn't realize that toc was OS X only. Well, my ambitions to phase out
cd-discid continue to be thwarted! Oh well. Thanks for humoring me. 

Original comment by scott.en...@gmail.com on 12 Feb 2007 at 8:45

GoogleCodeExporter commented 8 years ago
Now don't be so hard on yourself. You've done a great job! Remember that only 
two 
weeks ago Rubyripper didn't work for MacOS without manual tweaks. And we do now 
have a fallback that works for most audio-cd's!

Since I feel we're not getting any further with detecting the default drive, I 
propose that we choose a logical default setting for MacOS. I guess /dev/disk1 
makes sense, since you're using that now? This will only be set the first time 
if 
you have not yet saved your config file.

Original comment by rubyripp...@gmail.com on 12 Feb 2007 at 9:37

GoogleCodeExporter commented 8 years ago
I'm closing this bug. The current state of MacOS support is acceptable. The 
default 
cdrom device will be set to /dev/disk1 is darwin is detected. Also before 
starting, 
Rubyripper will check if the given cdrom device is actually there on the 
system. 
The user gets an error saying the device doesn't exist if it's not found.

Thanks for all your support and if you've any requests left: feel free to open 
a 
new bug/feature request.

Original comment by rubyripp...@gmail.com on 12 Feb 2007 at 10:20

GoogleCodeExporter commented 8 years ago
The /dev/disk1 default is a good call. Let me know if you need any more help! 

Original comment by scott.en...@gmail.com on 13 Feb 2007 at 1:52

GoogleCodeExporter commented 8 years ago
If you still are looking for a way to force a specific drive with paranoia on 
OS X, I have written a custom port that 
can handle this.  See the cdparanoia download on 
http://sourceforge.net/project/showfiles.php?
group_id=158413

Original comment by stephen....@gmail.com on 14 Apr 2007 at 5:19

GoogleCodeExporter commented 8 years ago
I've added it to the README file. Will be in next commit. Thanks for reporting 
:)

Original comment by rubyripp...@gmail.com on 14 Apr 2007 at 11:24

GoogleCodeExporter commented 8 years ago
cdparanoria fails when install via darwin ports.
This happened during installation of ffmpeg via darwin ports

-->  Verifying checksum(s) for cdparanoia
Error: Checksum (md5) mismatch for cdparanoia-0.9.8.tar.gz
Error: Target org.macports.checksum returned: Unable to verify file checksums
Error: The following dependencies failed to build: schroedinger 
gst-plugins-base cdparanoia gnome-vfs dbus 
dbus-glib glib2 desktop-file-utils popt gconf gtk2 atk cairo fontconfig 
freetype zlib libpixman libpng gtk-
doc docbook-xml-4.3 xmlcatmgr docbook-xsl gnome-doc-utils docbook-xml 
docbook-xml-4.1.2 
docbook-xml-4.2 docbook-xml-4.4 docbook-xml-4.5 docbook-xml-5.0 iso-codes 
py25-hashlib openssl 
python25 libxml2 libxslt p5-xml-parser py25-libxml2 rarian getopt intltool 
gnome-common jasper jpeg 
pango Xft2 shared-mime-info tiff xorg-libXcomposite xorg-compositeproto 
xorg-fixesproto xorg-libXfixes 
xorg-libXcursor xorg-libXdamage xorg-damageproto xorg-libXi xorg-libXinerama 
xorg-xineramaproto 
orbit2 libidl gnome-mime-data gstreamer bison flex gzip liboil x264 yasm
Error: Status 1 encountered during processing.
users-imac:bin owner1$ 

Original comment by michael....@gmail.com on 12 Feb 2009 at 12:13

GoogleCodeExporter commented 8 years ago
You don't expect me to support each possible install tool, do you? File a bug 
at the
maintainer of darwin ports.

I only support the manual install as is provided by the configure script and is
explained in the README file.

Original comment by rubyripp...@gmail.com on 12 Feb 2009 at 11:07