libdiscid 0.6.3 and bindings for D, Rust, Go and Hare

A new version 0.6.3 of libdiscid has been released. libdiscid is a C library that allows applications to easily calculate MusicBrainz and freedb disc IDs from audio CDs. It also can extract MCN and ISRC information.

The main focus for this release has been to provide updated source and binary packages compatible with current systems. But there is also new platform support for the Haiku operating system.

Version 0.6.3 of libdiscid provides the following changes:

  • LIB-66: fix for Debian kFreeBSD
  • Haiku platform support (TOC only)
  • Use discid_feature enum in discid_read_sparse
  • Fixed building with CMake on macOS
  • LIB-68: provide macOS universal2 binaries with support for both x86_64 and arm64
  • LIB-67: Source tarball with updated autotools configuration
  • CMake: Use GNUInstallDirs to determine install location
  • CMake 2.8.12 is now the minimum required version

Being a C library libdiscid is highly portable and can easily be used with various programming languages. Ready-to-use bindings for many languages are available. Since the last release 6 years ago additional bindings for D, Rust, Go and Hare have become available. There is also an alternative .NET implementation of libdiscid written in C#.

More details on libdiscid, information on available language bindings, and downloads of the source code and pre-compiled binaries for macOS and Windows can be found on the libdiscid page. See also the API documentation for details on how to use the library.

Libdiscid 0.6.2 and python-discid 1.1.1 released

Libdiscid 0.6.2 includes these changes:

  • ISRC and MCN support on BSD (Zastai)
  • LIB-60: fix make check for default device on generic/unknown platform
  • make Doxygen output reproducible (no timestamps; Sebastinas)
  • remove newline for Linux device “1” from proc (Zastai)

The download can be found at http://musicbrainz.org/doc/libdiscid.

Python-discid 1.1.1 includes these changes:

The download can be found at https://python-discid.readthedocs.org/.

python-discid 1.1.0 (and 1.0.3) released

New versions of python-discid are available.

Changes in 1.1.0

  • feature: #36 add Disc.toc_string
  • #38 remove DiscId (deprecated since 0.5.0)

Changes in 1.0.3

  • fix: #37 test_emptyness: Assertion disc->success failed

Python-discid 1.0.3 is a bugfix version for the recent libdicid 0.6.0 release and python-discid 1.1.0 adds the TOC string, which is also part of new libdiscid versions. The TOC can be used for fuzzy searches in the web service.
The toc string feature was backported and can be used together with any version of libdiscid >= 0.2.2.

The bugfix for 1.0.3 is only relevant for running the test suite (which is done at install time usually). It shouldn’t affect normal operation. If you don’t have any problems, you don’t need to upgrade.

The DiscId class was already deprecated in the 0.5.0 beta, but still works in 1.0.x releases.
The correct usage is to create a Disc object with read() or put().
See also basic usage of python-discid.

Downloads are available at pypi. Packages are available for some linux distributions.
Recent stable and git versions of python-discid and other MusicBrainz client libraries and tools are now available for many Ubuntu versions at the MusicBrainz Stable and https://launchpad.net/~musicbrainz-developers/+archive/daily PPAs.

libdiscid 0.6.0 (and 0.6.1) released

This is a feature release of libdiscid.

It took more time than planned, but 0.6.0 is done now with lots of changes.
Main changes are the TOC string api (handy for fuzzy lookup) and a much better default drive detection on all platforms.
An example to use libdiscid together with libmusicbrainz (including fuzzy lookup) is also provided now.

Unfortunately I found one major bug only while merging changes to another branch. Libdiscid 0.6.1 fixes reading of ISRCs on Windows again (introduced in 0.6.0).

The full set of changes:

Bug

  • [LIB-48] – Fix asserts/return values on empty object
  • [LIB-59] – windows: unable to read ISRC (0.6.1)

Improvement

  • [LIB-52] – validate parameters for put()
  • [LIB-53] – don’t use old redirect for submission_url

New Feature

  • [LIB-28] – allow using numbers as devices on Mac OS X
  • [LIB-41] – Add TOC (id) to API
  • [LIB-43] – Use first CD drive letter on Windows as default device
  • [LIB-45] – Linux/BSD/Solaris: search for an existing default device from a list of devices
  • [LIB-54] – Add example: libmusicbrainz / query for metadata
  • [LIB-55] – Allow using numbers as devices on Windows
  • [LIB-56] – Allow using device numbers on Linux

I want to thank Philipp Wolfer for the Windows drive detection, Laurent Monin for the TOC string API and also Sebastian Ramacher and Lukáš Lalinský for smaller changes.

Testing wanted for raw ISRC reads

Reading ISRCs raw from the device with SCSI commands ([LIB-11, duplicate ISRC problems) is already implemented for Linux and Windows and works quite well on most drives. There is no code for support on Mac, yet. The Windows and Linux implementation still need some testing (with different drives).

If you are willing to test this or really need this feature you can build the code in the “isrc_raw” branch from the github repository.
There is also a windows binary available.
We do want to know about problems (some drives are already reported with strange behavior, possibly due to Alignment), but also a short note about working systems is helpful to get a bit of insight on how rare or frequent failures are.

We also happily accept patches to send SCSI commands on Mac OS X. There is some information in the ticket how this could work, but this is probably the most difficult of the platforms to implement.

Information, documentation and other links are at:
http://musicbrainz.org/doc/libdiscid
That includes builds for Windows and Mac OS X.

libdiscid 0.5.2 released

This is a bugfix release of libdiscid.

There are already lots of changes (features) ready for 0.6.0, but I did want to release these fixes separately, since they have a high impact on the platforms involved.
0.6.0 is probably ready in a couple of weeks.

Bug

  • [LIB-50] – Solaris: segfault in mb_disc_load_toc
  • [LIB-51] – Mac: Unable to read ISRC for track

New Feature

  • [LIB-26] – disc access test suite
  • print time information in the discid example (zas)

Information, documentation and other links are at:
http://musicbrainz.org/doc/libdiscid
That includes builds for Windows and Mac OS X.

.NET / Mono bindings for libdiscid

There has been quite some activity regarding libdiscid in the last few months, here is some more: I have released dotnet-discid 0.2 which provides .NET / Mono bindings for libdiscid. The source is available at GitHub. For easy usage Windows users might want to use the NuGet package. Alternatively you can download source and binary releases at http://users.musicbrainz.org/~outsidecontext/dotnet-discid/. To use the assembly you will also need the native libdiscid release (e.g. discid.dll on Windows or any other native package for your platform). On Unix-like platforms you can just use the system wide installation of libdiscid.

No API docs yet, but the examples on Github will get you started. The library should be straight forward to use. This is an early release but it supports all the features provided by the latest libdiscid 0.5 (while still supporting earlier versions).  I don’t expect many changes in the API but I will provide better documentation soon.

ruby-discid 1.0

This has already been announced on the mailing list back in May: ruby-discid, the Ruby bindings for libdiscid, have been released in version 1.0. This libdiscid binding for Ruby is the successor of mb-discid. As libdiscid has gained quite a few features in the past I took the opportunity to simplify the API and do some fundamental changes to rubydiscid.

The most important features of this release are:
  • Full support for libdiscid 0.1 to 0.5, including ISRC and MCN reading and feature detection.
  • Uses FFI to load libdiscid, so no compilation is required.
  • Support for Ruby 1.8.7 – 2.0, jRuby and Rubinius.

The probably easiest way to install and use ruby-discid is by using the Ruby gem. For Ubuntu users there is a PPA and for Arch Linux users an AUR package available.

The source code is available on Github, there you will also find more detailed installation and usage instructions.

If you have previously used mb-discid you can continue using it, but you should consider updating to rubydiscid. The API is quite similar and simple enough to make that a painless process.

python-discid 1.0.0 (and 1.0.2) released

In februar I announced a beta version of the first python binding of libdiscid. A couple months have passed and I can now announce the first stable release of python-discid.

The main purpose is the calculation of MusicBrainz Disc IDs from a CD-AUDIO disc or a TOC of such a disc, but reading of ISRCs and the MCN (EAN/UPC) are also supported.
Disc IDs can be submitted without further dependencies. For lookup and ISRC submission it is recommended to use it together with python-musicbrainzngs.
Python 2 >= 2.6 or Python 3 >= 3.1 as well as libdiscid >= 0.2.2 are required. Newer libdiscid features need a newer libdiscid, but there are methods available to check for these conditions.

If you still have a program using python-musicbrainz2, I recommend upgrading to the combination of python-discid and python-musicbrainzngs, since python-musicbrainz2 uses a deprecated web service and is not actively maintained anymore.

The main website and API documentation is at readthedocs, the repository and bugtracker are at GitHub.
Official source tarballs are available on pypi and releases are announced in this blog. There are several linux packages available and listed in the documentation.

If you have been using a pre-release version of python-discid you will have to update your code.
Compared to python-discid 0.5.0 you now have to use discid.get_default_device(), rather than discid.DEFAULT_DEVICE. If you were using 0.4.0, you should also stop using DiscId() directly or a DeprecationWarning is displayed.

There is also a patch release 1.0.2 available, which has no code changes compared to 1.0.0.
There was an intermediate 1.0.1, which tried to make some convenience changes for beta users, but failed. 1.0.1 was never available as a tarball, but the tag and changelog exists.

Libdiscid 0.5.1 released

A new libdiscid version was uploaded today.

Changes:

  • LIB-40: discid_get_webservice_url() (web service version 1) is deprecated.
    Please use libmusicbrainz to gather metadata by disc ID
  • LIB-7: Rewrote data track handling, releases with multiple data tracks. This also fixes LIB-18 (no ID for DVDs) and LIB-9 (PS/PS2 CDs)
  • LIB-44: fix invalid disc IDs on first read of multi-session discs
  • LIB-37: Autotools optimization (non-recursive build etc.)
  • LIB-42: remove Windows 9x platform code
  • renamed openbsd platform code to netbsd, still used by both.

The data track/multi session disc handling was rewritten. This was started by Lukáš Lalinský quite some time ago and I finished this now. This should fix several issues with data tracks and data track handling works the same on all platforms now.

Christophe Fergeau contributed some changes to remove lots of clutter from the autotools build. This stops changing directories during the build all the time (non-recursive build) and should make it easier to see actual problems when building.

Additional contributions come from Philipp Wolfer and Sebastian Ramacher again.

Feedback needed:

We are (still) a bit stuck in the discussion for LIB-28 which also blocks several connected things in python-discid and possibly Picard.
The main question is how to name the “default device”, especially on Mac OS X. Usually real/internal device names are used. However, especially on Mac OS X these device names change quite frequently for various reasons, even when the same physical disc drive is “meant”. So I don’t know if using these makes any sense. It also might not be good to add these device names to a configuration file, since they will “break” easily (opening a .dmg before inserting the disc already breaks it).
I proposed using “1” to define “use the first disc drive”. I am no actual Mac user and really would like to know how you guys feel about this.
For Windows the drive letters are much more stable, but can change when USB disc drives are used. Using “1” is an option, but might make less sense, since drive letters are actually known to the normal user.
On Linux/BSD/Solaris the disc drive names are only used for disc drives (not for hard disks) and are quite stable.
This relates to python-discid#30 (should DEFAULT_DEVICE be a constant?) which again somewhat blocks PICARD-503 (using python-discid). This question is the only thing keeping python-discid from a stable API release.

LIB-28 is probably the best place for feedback, but you can also just answer here or in the announcement mail.

Information, documentation and other links are at:
http://musicbrainz.org/doc/libdiscid
That includes builds for Windows and Mac OS X.

libdiscid 0.5.0 released

A new libdiscid release was made available today.

Changes:

LIB-29: add read_sparse() for faster reading again
LIB-35: add HAVE_SPARSE_READ and VERSION_* defines
LIB-36: hide internal symbols on Linux/Unix
LIB-34: distmac and distwin32 cmake targets

The important change is the read_sparse() function:

Philipp Wolfer added a read_sparse() function. With this function you can either only read the TOC or specifiy which features of the disc you want to read.
The normal read() also extracts ISRCs starting with 0.3.0.
You might want to change existing applications to use read_sparse if you care about performance and don’t use ISRCs. The TOC is usually cached, so read_sparse() can be faster (0,5 vs. 3 seconds measured).
The difference is only in where the time is spent. It doesn’t really save overall time, but the TOC is read right when the disc is inserted so no additional disc access is performed when using the TOC in your application.
To make it possible to keep using read() when read_sparse() is not available we provide the HAVE_SPARSE_READ define, which can be used like that:

#ifndef DISCID_HAVE_SPARSE_READ
#define discid_read_sparse(disc, dev, i) discid_read(disc, dev)
#endif

discid_read_sparse(disc, device, 0)

We also provide defines for the libdiscid version numbers.
However, you should rather test for features/functions in the build files and create specific defines for your use case.
The above define is only provided as a convenience for read_sparse().

There are more details about the other changes in the full announcement mail.

If you didn’t follow the musicbrainz-devel list:
This year brought several new releases for libdiscid, starting with ISRC and MCN support in libdiscid 0.3.0. Applications using libdiscid 0.2.2 (or even lower) still work with libdiscid 0.5.0.

Information, documentation and other links are at:
http://musicbrainz.org/doc/libdiscid
That includes builds for Windows and Mac OS X.