Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LIB-11: raw (low level) ISRC reads #6

Open
wants to merge 47 commits into
base: master
Choose a base branch
from
Open

LIB-11: raw (low level) ISRC reads #6

wants to merge 47 commits into from

Commits on Feb 4, 2013

  1. read ISRCs raw on Linux

    We read the raw data from the disc,
    extract the Q sub-channel and decode the ISRC.
    
    This gives better results (no duplicate ISRCs)
    than using the read ISRC sub-channel command.
    Probably due to bad implementation on some drives / drivers.
    JonnyJD committed Feb 4, 2013
    2 Configuration menu
    Copy the full SHA
    fbf133a View commit details
    Browse the repository at this point in the history

Commits on Feb 7, 2013

  1. remove TODO comment

    I actually tried SEEK, READ (6), SCAN and also PLAY AUDIO
    to move to some point more to the middle of the track in order
    not to get an ISRC from the previous track.
    None of these made any difference.
    JonnyJD committed Feb 7, 2013
    Configuration menu
    Copy the full SHA
    5fbf4d4 View commit details
    Browse the repository at this point in the history

Commits on Mar 10, 2013

  1. Merge branch 'master' into isrc_raw

    This should update the branch,
    especially add the features API and the compiler warning fixes.
    
    Conflicts:
    	CMakeLists.txt
    	configure.ac
    	src/disc_linux.c
    JonnyJD committed Mar 10, 2013
    Configuration menu
    Copy the full SHA
    c31d46b View commit details
    Browse the repository at this point in the history
  2. move read_track_isrc to disc_scsi.c

    This is platform independent, except the call of scsi_cmd,
    which is implemented for the platform.
    JonnyJD committed Mar 10, 2013
    Configuration menu
    Copy the full SHA
    f8a82dd View commit details
    Browse the repository at this point in the history
  3. rename disc_scsi.c -> scsi.c

    We don't have to prepend every file with "disc",
    even if they implement some type of disc reading.
    JonnyJD committed Mar 10, 2013
    Configuration menu
    Copy the full SHA
    a1d73d6 View commit details
    Browse the repository at this point in the history
  4. move scsi function declarations in scsi header

    Also separate scsi_cmd and scsi_cmd_unportable,
    although there is only unportable code right now.
    
    scsi_cmd_unportable not mandatory to implement for every platform,
    so it is in this header and not discid_private.h
    However, it is recommended to implement.
    JonnyJD committed Mar 10, 2013
    Configuration menu
    Copy the full SHA
    261aac8 View commit details
    Browse the repository at this point in the history

Commits on Mar 11, 2013

  1. add HACKING file

    JonnyJD committed Mar 11, 2013
    Configuration menu
    Copy the full SHA
    d5a059b View commit details
    Browse the repository at this point in the history
  2. prepend mb_scsi to scsi functions

    This should lower the chance of having a clash in the namespace.
    This is not as important as in the public API,
    but scsi.h is potentially included in many platform files.
    JonnyJD committed Mar 11, 2013
    Configuration menu
    Copy the full SHA
    b1616d3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    63c6dc8 View commit details
    Browse the repository at this point in the history
  4. linux: stop the device after reading

    After reading ISRCs the device keeps spinning, sometimes loudly.
    Stopping the device helps with that.
    
    This does have the side effect of stopping playback,
    when the disc is played directly.
    
    See:
    http://tickets.musicbrainz.org/browse/LIB-31
    JonnyJD committed Mar 11, 2013
    Configuration menu
    Copy the full SHA
    de09b17 View commit details
    Browse the repository at this point in the history

Commits on Apr 15, 2013

  1. Merge branch 'master' into isrc_raw

    This merges the read_sparse functionality,
    lots of autotools changes, hiding of private functions in the library
    and adds version defines.
    LIBDISCID_INTERNAL was added to scsi.h manually.
    
    Conflicts:
    	configure.ac
    	src/Makefile.am
    	src/disc_linux.c
    JonnyJD committed Apr 15, 2013
    Configuration menu
    Copy the full SHA
    1b859ac View commit details
    Browse the repository at this point in the history
  2. add scsi.h to distribution

    JonnyJD committed Apr 15, 2013
    Configuration menu
    Copy the full SHA
    1c013f8 View commit details
    Browse the repository at this point in the history

Commits on Apr 26, 2013

  1. locate CRC in q-channel

    The CRCs are not used yet, but I wanted to mark the location.
    JonnyJD committed Apr 26, 2013
    Configuration menu
    Copy the full SHA
    20b7fcb View commit details
    Browse the repository at this point in the history

Commits on May 11, 2013

  1. Merge branch 'master' into isrc_raw

    This merges the two windows platform files.
    
    Conflicts:
    	CMakeLists.txt
    JonnyJD committed May 11, 2013
    Configuration menu
    Copy the full SHA
    81e062b View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2013

  1. Merge branch 'master' into isrc_raw

    This merges the data-track changes and removes Win9x code.
    
    Conflicts:
    	Makefile.am
    	src/disc_linux.c
    JonnyJD committed Jun 20, 2013
    Configuration menu
    Copy the full SHA
    4df857c View commit details
    Browse the repository at this point in the history

Commits on Jun 29, 2013

  1. Merge branch 'master' into isrc_raw

    This mainly merges the new test suite.
    
    Conflicts:
    	Makefile.am
    JonnyJD committed Jun 29, 2013
    Configuration menu
    Copy the full SHA
    0618e64 View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2013

  1. implement CRC check for raw ISRCs

    I implemented this from scratch.
    This is probably not the most efficient implementation,
    but the check doesn't even have a measurable impact.
    We are reading data from disc and only check the CRC when an ISRC is
    found, which is ca. every 100th frame.
    
    The focus is a clear implementation without storing (CRC-8) tables in the code.
    
    CRC mismatches are only printed to stderr for now.
    JonnyJD committed Aug 2, 2013
    Configuration menu
    Copy the full SHA
    a470a34 View commit details
    Browse the repository at this point in the history
  2. Merge branch 'master' into crc

    Having memcheck in the branch would be nice.
    JonnyJD committed Aug 2, 2013
    Configuration menu
    Copy the full SHA
    5dd8ca2 View commit details
    Browse the repository at this point in the history
  3. improve comments and names for raw isrcs

    Especially use defines for some magic numbers.
    JonnyJD committed Aug 2, 2013
    Configuration menu
    Copy the full SHA
    867889f View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2013

  1. LIB-11: read ISRCs until CRC is valid

    We read up to 3 ISRCs and use the first one where the CRC is correct.
    A warning is printed to stderr when CRC mismatches are found.
    We should probably skip the warning when these are very common.
    JonnyJD committed Aug 3, 2013
    Configuration menu
    Copy the full SHA
    e77dd95 View commit details
    Browse the repository at this point in the history
  2. free raw disc read data

    JonnyJD committed Aug 3, 2013
    Configuration menu
    Copy the full SHA
    b8d3ed3 View commit details
    Browse the repository at this point in the history
  3. raw isrcs: don't return main channel data

    This doesn't have an impact on the performance,
    since the data is still read from disc, just not returned by the
    command.
    However, there seems to be a limit of data returned with one command.
    My tests failed after reaching something over 683 KB.
    
    This enables us to read data for up to 71 ISRCs,
    but that would also take ca. 5 minutes per disc.
    
    Setting this to 2, to tolerate one failed CRC check.
    JonnyJD committed Aug 3, 2013
    1 Configuration menu
    Copy the full SHA
    d163282 View commit details
    Browse the repository at this point in the history
  4. LIB-11: read every sector separately

    With this approach we read a lot less sectors when the ISRC is found
    early, which saves a lot of time.
    Additionally this does seem to have the side effect of drives returning
    less CRC mismatches.
    JonnyJD committed Aug 3, 2013
    Configuration menu
    Copy the full SHA
    fd63dc9 View commit details
    Browse the repository at this point in the history
  5. implement scsi_cmd for Windows

    This isn't tested with a disc yet. Only compilation (cmake) is tested in a VM.
    JonnyJD committed Aug 3, 2013
    Configuration menu
    Copy the full SHA
    02b733d View commit details
    Browse the repository at this point in the history

Commits on Aug 5, 2013

  1. prepare autotools build with windows scsi_cmd

    This still doesn't seem to work in MinGW and Cygwin.
    discid_get_track_length can't be linked somehow.
    
    CMake works fine.
    JonnyJD committed Aug 5, 2013
    Configuration menu
    Copy the full SHA
    9e5e389 View commit details
    Browse the repository at this point in the history
  2. work around windows dllexport issue

    Since we can't use any discid_* functions anywhere else other than in disc.c on Windows due to the __declspec(dllexport),
    we have to move the code to some place where we can also access it internally.
    
    It's just 4 lines, but we have to make sure both places use the same code. Otherwise we get weird issues.
    JonnyJD committed Aug 5, 2013
    Configuration menu
    Copy the full SHA
    80d627e View commit details
    Browse the repository at this point in the history
  3. add ntddscsi.h for MSVC

    Similar to ntddcdrm.h, this header is included in MinGW and Cygwin, but
    has to be downloaded separately for plain Windows.
    This would be part of the Windows Driver Development Kit (ddk),
    but that version is probably not redistributable for us.
    
    This version comes from dosbox again.
    JonnyJD committed Aug 5, 2013
    Configuration menu
    Copy the full SHA
    fb400d6 View commit details
    Browse the repository at this point in the history
  4. msvc: remove new warnings

    JonnyJD committed Aug 5, 2013
    Configuration menu
    Copy the full SHA
    ecd2d58 View commit details
    Browse the repository at this point in the history

Commits on Aug 8, 2013

  1. Windows: fix scsi_cmd (return, GENERIC_WRITE)

    Sending scsi commands needs GENERIC_WRITE for the handle,
    otherwise no data is returned.
    
    For DeviceIoControl a return value of 0 is the error condition,
    while the return value of scsi_cmd is expected to be 0 on success.
    
    We now return the scsi status as we do in Linux.
    JonnyJD committed Aug 8, 2013
    Configuration menu
    Copy the full SHA
    f3ba048 View commit details
    Browse the repository at this point in the history
  2. scsi_cmd: fix return code documentation

    0 is actually success, since that is the scsi status code for success.
    
    Also make explicite that -1 is the error condition for ioctl.
    JonnyJD committed Aug 8, 2013
    Configuration menu
    Copy the full SHA
    724df7c View commit details
    Browse the repository at this point in the history
  3. add more debug output for w32 scsi_cmd

    This should handle cases where no actual error is reported,
    but other things are fishy.
    JonnyJD committed Aug 8, 2013
    Configuration menu
    Copy the full SHA
    bc102db View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2013

  1. check if there are ISRCs at all

    When no ISRCs are present (valid CRC or not) in the first 100 sectors
    (150 to be safe), there are no ISRCs on the track at all
    so we stop searching.
    
    Otherwise we would search the whole track, which then takes like 5
    minutes per disc.
    JonnyJD committed Sep 19, 2013
    Configuration menu
    Copy the full SHA
    4a4ebab View commit details
    Browse the repository at this point in the history
  2. define SECTORS_ISRC and read 10 more

    Reading more sectors takes more time.
    10 more would be 10% more, rather than 50%.
    This should be fine.
    JonnyJD committed Sep 19, 2013
    Configuration menu
    Copy the full SHA
    73e1fa6 View commit details
    Browse the repository at this point in the history
  3. check for data_len, rather than 96

    This was already fixed a month ago,
    but the unfixed commit was in the main repo.
    JonnyJD committed Sep 19, 2013
    Configuration menu
    Copy the full SHA
    ee22ed7 View commit details
    Browse the repository at this point in the history
  4. create mb_scsi_handle struct

    This way we don't have to cast between HANDLE (void *)
    and int.
    We might need a third handle for OS X later on.
    JonnyJD committed Sep 19, 2013
    Configuration menu
    Copy the full SHA
    aed1d9f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e34d987 View commit details
    Browse the repository at this point in the history
  6. Merge branch 'scsi_windows' into isrc_raw

    This adds raw isrcs reads on Windows.
    
    Conflicts:
    	src/disc_linux.c
    	src/scsi.h
    JonnyJD committed Sep 19, 2013
    Configuration menu
    Copy the full SHA
    e2fc17f View commit details
    Browse the repository at this point in the history

Commits on Sep 24, 2013

  1. return usable error codes from scsi_cmd

    This hopefully enables us to catch some conditions
    when raw reading doesn't work.
    JonnyJD committed Sep 24, 2013
    Configuration menu
    Copy the full SHA
    2803ca0 View commit details
    Browse the repository at this point in the history
  2. fix warnings on MinGW

    JonnyJD committed Sep 24, 2013
    Configuration menu
    Copy the full SHA
    bdd74be View commit details
    Browse the repository at this point in the history
  3. fall back to normal when raw ISRC fails

    This works, but actively checking for raw ISRC support might be better.
    There are error messages displayed for every track,
    when raw ISRC reads don't work.
    JonnyJD committed Sep 24, 2013
    Configuration menu
    Copy the full SHA
    046d1c0 View commit details
    Browse the repository at this point in the history
  4. implement scsi feature detection

    Some SCSI commands are optional per MMC so we check
    especially if raw ISRC reads are supported.
    
    It is still unclear if there are devices that can read audio CDs,
    but without CD READ support.
    Reported problems might be unrelated.
    JonnyJD committed Sep 24, 2013
    Configuration menu
    Copy the full SHA
    cd58b5d View commit details
    Browse the repository at this point in the history
  5. rename subchannel feature to isrc

    This way it corresponds with the command name in scsi.h
    The platform doesn't have to know how non-raw isrc reads work.
    JonnyJD committed Sep 24, 2013
    Configuration menu
    Copy the full SHA
    7031c1b View commit details
    Browse the repository at this point in the history

Commits on Sep 25, 2013

  1. Configuration menu
    Copy the full SHA
    55d274f View commit details
    Browse the repository at this point in the history

Commits on Oct 1, 2013

  1. Configuration menu
    Copy the full SHA
    3923e5a View commit details
    Browse the repository at this point in the history

Commits on Oct 3, 2013

  1. Merge branch 'master' into isrc_raw

    this pulls the TOC API and a lot of default drive changes
    
    Conflicts:
    	src/disc.c
    	src/disc_linux.c
    	src/disc_win32.c
    JonnyJD committed Oct 3, 2013
    Configuration menu
    Copy the full SHA
    6533105 View commit details
    Browse the repository at this point in the history
  2. Merge branch 'master' into isrc_raw

    This should fix reading ISRCs on Windows again. (0.6.1)
    
    Conflicts:
    	src/disc_win32.c
    JonnyJD committed Oct 3, 2013
    Configuration menu
    Copy the full SHA
    90dbfe5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    477da28 View commit details
    Browse the repository at this point in the history