Verdin CDDB Server is a C++20 server that lets CD players and rippers look up audio CD metadata in a local FreeDB SQLite archive. Clients connect over CDDBP/TCP to retrieve XMCD records containing the artist, album title, and track titles.
The server first looks for an exact match using the disc ID and track offsets. If it finds none, it looks for discs with similar track offsets and a similar total duration.
Install Visual Studio Build Tools with the x64 C++ tools, CMake, and vcpkg. Open Developer PowerShell in the project root and set VCPKG_ROOT to your vcpkg installation directory. Then configure and build the server.
cmake -S . -B build -A x64 "-DCMAKE_TOOLCHAIN_FILE=$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" cmake --build build --config Release
vcpkg installs the Asio and SQLite dependencies listed in vcpkg.json. The build produces build\Release\verdin_cddb.exe.
Supply a SQLite archive with a compatible FreeDB schema. The server opens the archive in read-only mode and joins the CdInfo and Cat tables on CdInfo.CatID = Cat.rowid. For a minimal schema example, see the make_fixture function in the TCP integration test.
Place the archive at database\freedb.sqlite and run the following command from the project root.
.\build\Release\verdin_cddb.exe --database .\database\freedb.sqlite
In your CD ripper, select CDDBP over TCP and set the host to 127.0.0.1 and the port to 8880. To connect from another computer on the same network, use the server’s IPv4 address.
| Option | Description |
|---|---|
--database FILE |
Path to the SQLite archive. By default, the server looks for freedb.sqlite in the same directory as the executable. |
--port PORT |
TCP port to listen on. Defaults to 8880. Set it to 0 to let the operating system choose an available port. The server prints the selected port at startup. |
To look up Images and Words by Dream Theater, send the following commands over a single TCP connection. The arguments to cddb query are the disc ID, the track count, the start offset of each track in frames, and the total disc length in seconds.
cddb hello listener localhost demo 1.0
proto 6
cddb query 720d6308 8 150 37258 57018 94598 119353 162270 194030 205408 3429
Each match includes a category and disc ID. If the results include rock 720d6308 Dream Theater / Images And Words, use that category and ID to read the XMCD record, then close the connection.
cddb read rock 720d6308
quit
Make sure Python 3 is available when you configure CMake. After building the server, run the tests from the project root.
ctest --test-dir build -C Release --output-on-failure
The cddbp_tcp test creates a temporary database and checks the handshake, exact and approximate matches, and XMCD record retrieval over TCP. You can run it without supplying an archive.
If database/freedb.sqlite exists when you configure CMake, CMake also registers cddbp_archive. This test looks for known entries for Images and Words in that archive.