HydrogenAudio

Hydrogenaudio Forum => Uploads => Topic started by: Omy on 2008-02-25 21:30:31

Title: ARFlac C library/port
Post by: Omy on 2008-02-25 21:30:31
Mostly to do with this (http://www.hydrogenaudio.org/forums/index.php?showtopic=53583) thread about ARCue.pl. This is my own port/rewrite to C of the ARFlac.pl script which was in turn based off ARCue.pl. As such then credit must go to the authors of ARCue.pl and ARFlac.pl, although the actual C code is my own work.

Basically, this is a C library (and reference program which uses it) which can be used to check a directory of .flac files against the AccurateRip database. See the thread linked above for discussion of it's limitations.

[attachment=4289:attachment]
Title: ARFlac C library/port
Post by: SamHain86 on 2008-04-07 22:05:02
Does this work for images only, or track-files as well?
Title: ARFlac C library/port
Post by: Omy on 2008-04-07 22:06:15
Does this work for images only, or track-files as well?


it only works for track-per-file rips. (if it works at all!)
Title: ARFlac C library/port
Post by: caligae on 2008-04-07 22:46:22
I've somehow missed this thread when it initially appeared.

Haven't tested it extensively yet but looks very nice so far.

Very nice and useful tool, thanks!
Title: ARFlac C library/port
Post by: torben on 2008-04-08 12:36:13
Edit, noticed now that in the main thread you said this if for Unix... Will test it.
Title: ARFlac C library/port
Post by: Corwin on 2008-06-26 11:31:19
Doesn't seem to work too well for me:

$ ./accuraterip-crcgen  /tmp/Kansas\ -\ 1976\ -\ Leftoverture/
Track  Ripping Status          [Disc ID: 0013bd5c-009ffd2b-7f0d0b0a]
1      ** Rip not accurate **  (confidence  2)    [19384034] [2a64c13c]
2      ** Rip not accurate **  (confidence  0)    [00000000] [841808cd]
3      ** Rip not accurate **  (confidence  0)    [00000000] [61322ddb]
4      ** Rip not accurate **  (confidence  0)    [00000000] [a9ecbf66]
5      ** Rip not accurate **  (confidence  0)    [00000000] [65f79abb]
6      ** Rip not accurate **  (confidence  0)    [00000000] [12556ecd]
7      ** Rip not accurate **  (confidence  0)    [00000000] [7393bf4b]
8      ** Rip not accurate **  (confidence  0)    [00000000] [90fb3812]
9      ** Rip not accurate **  (confidence  0)    [00000000] [07c54aa8]
10    ** Rip not accurate **  (confidence  1)    [26ce7c16] [6f96e186]


I'm on 64bit Debian. There's no make install, I'm sure a lot of people don't realize you have to run ldconfig after copying the shared library file over to /usr/local/bin.
Title: ARFlac C library/port
Post by: Fandango on 2008-06-26 15:21:21
Hi Omy, nice work although it seems to need some polishing... 

Would you consider adding support for cue/image rips into your library? I guess you can re-use this code from here (http://www.hydrogenaudio.org/forums/index.php?showtopic=59423). whitehobbit probably has nothing against it.

A versatile (portable) stand-alone and library-based AccurateRip verifier is in high demand I guess. Not only do many *nix based rippers lack basic AR support (verifying only would be a start, not necessarily submitting results and all that), but also many old pre-AR EAC rips can be checked with such a tool.
Title: ARFlac C library/port
Post by: Corwin on 2008-06-27 13:03:47
$ accuraterip-crcgen Symphony\ X\ -\ 1997\ -\ The\ Divine\ Wings\ of\ Tragedy/
Error while decoding stream: FLAC file does not contain a whole number of CDDA frames!
Failed to read track metadata.


$ flac -t Symphony\ X\ -\ 1997\ -\ The\ Divine\ Wings\ of\ Tragedy/*flac

flac 1.2.1, Copyright © 2000,2001,2002,2003,2004,2005,2006,2007  Josh Coalson
flac comes with ABSOLUTELY NO WARRANTY.  This is free software, and you are
welcome to redistribute it under certain conditions.  Type `flac' for details.

01 - Of Sins And Shadows.flac: ok
02 - Sea Of Lies.flac: ok
03 - Out Of The Ashes.flac: ok
04 - The Accolade.flac: ok
05 - Pharaoh.flac: ok
06 - The Eyes Of Medusa.flac: ok
07 - The Witching Hour.flac: ok
08 - The Divine Wings Of Tragedy.flac: ok
09 - Candlelight Fantasia.flac: ok

$ ARFlac.pl Symphony\ X\ -\ 1997\ -\ The\ Divine\ Wings\ of\ Tragedy/
Symphony X - 1997 - The Divine Wings of Tragedy/:13144064:11354112:9633792:26071040:14479360:14356480:11159552:54743040:17848320:
Checking AccurateRip database

Track  Ripping Status          [Disc ID: 0012c74f-710f4e09]
read failed. at /usr/local/bin/ARFlac.pl line 295
        main::processFile('GLOB(0x91d560)', 22354, 1, '') called at /usr/local/bin/ARFlac.pl line 187
Title: ARFlac C library/port
Post by: Corwin on 2008-06-29 02:36:04
Please see the ARFlac.pl thread for a bug regarding the wrong confidence number. This bug is exactly the same in both ARFlac.pl and accuraterip-crcgen.
Title: ARFlac C library/port
Post by: reardon on 2011-10-13 06:14:09
Mostly to do with this (http://www.hydrogenaudio.org/forums/index.php?showtopic=53583) thread about ARCue.pl. This is my own port/rewrite to C of the ARFlac.pl script which was in turn based off ARCue.pl. As such then credit must go to the authors of ARCue.pl and ARFlac.pl, although the actual C code is my own work.

Basically, this is a C library (and reference program which uses it) which can be used to check a directory of .flac files against the AccurateRip database. See the thread linked above for discussion of it's limitations.


I did a bunch of work on this and thought I should share.  It now shows EAC and AccurateRip CRCs, and has some updates including:
- AccurateRip v2 CRC
- vary first-track offset (try "-o32" for the most common non-zero offset)
- attempts to find matches for different drive offsets and disc masters.  This is not well-implemented.  The algorithm is brute-force and slow.  It looks at the AR offset CRC (from a ten-sector window) and does a sliding-window search for a match. 
- calculate AR/EAC values using only one disc in a multi-disc set.
- attempts to handle the "4608 samples" pad problem of early EAC+FLAC.
- fixes the "confidence number" bugs in early versions of same

It runs on Linux/GNU, not sure what would be involved in making it work on Windows.
Title: ARFlac C library/port
Post by: e-San on 2012-08-28 20:14:58
Hi!

I got some problems with compiling. I use xUbuntu (devel branch).

First i had to install libflac-dev to pass no lib problem, but i found this:

Code: [Select]
san@serwer:/home/publiczny/move/flac_arcrc$ make
gcc -fPIC -Wall -O3 -pedantic -std=gnu99 flac-arcrc.o libarflac.o /usr/lib/x86_64-linux-gnu/libFLAC.a /usr/lib/x86_64-linux-gnu/libogg.a /usr/lib/x86_64-linux-gnu/libm.a -o flac-arcrc
gcc: /usr/lib/x86_64-linux-gnu/libFLAC.a: Nie ma takiego pliku ani katalogu
gcc: /usr/lib/x86_64-linux-gnu/libogg.a: Nie ma takiego pliku ani katalogu
gcc: /usr/lib/x86_64-linux-gnu/libm.a: Nie ma takiego pliku ani katalogu
make: *** [flac-arcrc] Błąd 1


i use computer-server with 2xP3@933. Have no idea why does it look for 64bit libs...

Regards!

edit.
ok, looked inside Makefile and changed compile command, you will see.
Title: ARFlac C library/port
Post by: olivine on 2012-09-13 21:55:31
[edit] I couldn't compile it properly on linux (as the person posting before me) until I figured out that I had to edit the make file to make it work. Duh.

It looks very promising, although up to now I've only been able to check images that don't need it, because they've been ripped with EAC + AccurateRip. I'd like to verify rips done with rubyripper...
Title: ARFlac C library/port
Post by: bort27 on 2013-05-15 05:41:06
Mostly to do with this (http://www.hydrogenaudio.org/forums/index.php?showtopic=53583) thread about ARCue.pl. This is my own port/rewrite to C of the ARFlac.pl script which was in turn based off ARCue.pl. As such then credit must go to the authors of ARCue.pl and ARFlac.pl, although the actual C code is my own work.

Basically, this is a C library (and reference program which uses it) which can be used to check a directory of .flac files against the AccurateRip database. See the thread linked above for discussion of it's limitations.


I did a bunch of work on this and thought I should share.  It now shows EAC and AccurateRip CRCs, and has some updates including:
- AccurateRip v2 CRC
- vary first-track offset (try "-o32" for the most common non-zero offset)
- attempts to find matches for different drive offsets and disc masters.  This is not well-implemented.  The algorithm is brute-force and slow.  It looks at the AR offset CRC (from a ten-sector window) and does a sliding-window search for a match. 
- calculate AR/EAC values using only one disc in a multi-disc set.
- attempts to handle the "4608 samples" pad problem of early EAC+FLAC.
- fixes the "confidence number" bugs in early versions of same

It runs on Linux/GNU, not sure what would be involved in making it work on Windows.


Thank you so much for doing this! I've been using this to verify all of my old CD rips. Works like a charm.

I added one little feature that allows you to specify an AccurateRip disc ID instead of having the program generate it (e.g. "flac_arcrc -a 0019e74c-01142329-b40d1e0f ."). It's really useful for enhanced CDs that have data tracks (EAC or CueTools will give you the AccurateRip ID).