Skip to main content

Topic: ARFlac C library/port (Read 15681 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • Omy
  • [*]
ARFlac C library/port
Mostly to do with this 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.

[ Specified attachment is not available ]

  • SamHain86
  • [*][*][*][*]
ARFlac C library/port
Reply #1
Does this work for images only, or track-files as well?
OP can't edit initial post when a solution is determined  :'-(

  • Omy
  • [*]
ARFlac C library/port
Reply #2
Does this work for images only, or track-files as well?


it only works for track-per-file rips. (if it works at all!)

  • caligae
  • [*][*][*]
ARFlac C library/port
Reply #3
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!

  • torben
  • [*]
ARFlac C library/port
Reply #4
Edit, noticed now that in the main thread you said this if for Unix... Will test it.
  • Last Edit: 08 April, 2008, 09:20:35 AM by torben

  • Corwin
  • [*]
ARFlac C library/port
Reply #5
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.

  • Fandango
  • [*][*][*][*][*]
ARFlac C library/port
Reply #6
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. 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.
  • Last Edit: 26 June, 2008, 10:22:47 AM by Fandango

  • Corwin
  • [*]
ARFlac C library/port
Reply #7
$ 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
  • Last Edit: 27 June, 2008, 08:06:09 AM by Corwin

  • Corwin
  • [*]
ARFlac C library/port
Reply #8
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.

  • reardon
  • [*][*][*]
ARFlac C library/port
Reply #9
Mostly to do with this 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.

  • e-San
  • [*]
ARFlac C library/port
Reply #10
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.
  • Last Edit: 28 August, 2012, 03:18:08 PM by e-San

  • olivine
  • [*]
ARFlac C library/port
Reply #11
[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...
  • Last Edit: 13 September, 2012, 05:13:24 PM by olivine

  • bort27
  • [*]
ARFlac C library/port
Reply #12
Mostly to do with this 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).