Free DB album search

Request a freedb search

Do simply select the desired rows (you must select the rows and not only single columns of a tag to include it in the search). When at least one line is selected the popup menu contains an entry Lookup in FreeDB. This is a submenu. When you open it (by hovering the item with the mouse pointer and wait a short period) quering of feedb starts. Instead of a submenu a progress bar appears to indicate the asynchronous work. When freedb responses with a hit possible CD title / artists are shown in the now appearing submenu. These titles represent further submenus, by activating them a new freedb query is issued which loads the content of the specific CD, This, again, is shown by a progressbar. When the corresponding data is retrieve the content of the CD is endered in bottom of the appearing menu. You can'tselect it, its only for informational purposes. Two menu items are provided to either copy the complete data set to the tags or just unfilled entries. If you chose non and close the menu or move to the next suggestion nothing is changed.


Please be aware that the requested data is currently not cached. Its dumped as soon as the menu is closed. Therefore repeated queries are sent on when repeated open the menu without choosing anything, increasing load on the freedb servers as well as o your broadband connection.

When no CD could be found Texel indicates that by an appropiate message.

Error handling

When the connection was unsuccessful or an internal error from freedb was received a message is displayed instead of the expected results. When a freedb internal error occurs one can't do much. When the connection to freedb coul not be established you may check the following:

  • Is the right freedb server url entered? Check in the configuration: Menu Edit - Configure Texel, section External databases. The tab FreeDB contains the entry FreeDB URL. An HTTP URL should be entered here, typically Please note that Texel does only support the HTTP interface of freedb, and not the propriatary one.

  • You may test if you reach the given URL by typing % telnet 80 When you get a result like

    Connected to                         
    Escape character is '^]'.   
    you can reach the server. Stop the session by pressing Ctrl-C and then RETURN.

Improving the search

Excursion: How to find a disc on freedb ... and why the hits from grabbed audio files is so bad

FreeDB detects disc by a discid which is not neccessarily unique. Its a 8 digit number (based on the hex number format) where the two rightmost number represent the number of tracks, the middle four digits the length of the CD in seconds and the two leftmost digits are build from a checksum over the titlelength (in seconds) of all tracks. The calculation if a tracks runtime is actually non-trivial as the tracks on the CD are organized in sectors and a sector contains music of length of a 1/75 seconds. Freedb defines that the lemngth of a track in seconds is always the (rounded down) complete seconds, fractions are ignores. The compressed track on disk may have another length, most probabely due to another rounding in the calculated track length (which is often also only estimated). Typically a second less or more can happen. Also the CD length and the checksum calculation start with a starting offset of the CD which is no longer available when only the tracks are known. Typically the offset is 187 sectors, which would lead to a two second offset.

When guessing the discid from the available information it is clear that two problems can occur. Either the length of a song is different from the correspondingtrack on disc or the complete CD length is different due to the unknown starting offset. In both cases the result is a complete different discid. There is no chance to find “near” discids which could be the right one. Therefore the lengthes of the tracks must be equal to the originals, the guess of the starting ofset must be good and match to the complete length of the disc.

To overcome the problems of “guessing” the right discid Texel introduces a new index which spans a continuous meric over the discids. With this metric its possible to calcuate a discid from the input data and search for nearby discids. These nearby discids can than be examined further if some key properties match to the searched disc (e.g. length, number of tracks or certain track lengthes). Matches are then used to download the discinformation from freedb. This index can be downloaded from the Texel download side. It has approximately a size of 30 MiB.

You can either download the index by visiting the mentioned webpage and configuring Texel to use the downloaded file; see above how to configure the index file. Or you enter the following command (you can cut and pste it from here) at a shell prompt:

% wget -c "" -O - | bunzip2 > "$(grep indexFilePath $(kde4-config --path config --locate texelrc) | sed "s/^.*=\(.*\)$/\1/g")"

It downloads the index file, unpacks it with bunzip2 and copies it to the destination configured in the Texel config file. Please not the the script does not work when no destination is manually configured!

Adjusting the range parameter

The range parameter configures the linear search within the index for fitting discids. The higher the range the more local IO is created and the longer the lookup takes. However, a larger range does not increase the remote lookups at freedb. Increasing the range does increase the probability to detect a fitting match. The range of one is defined to increase the search range in the index by a difference of one second of an arbitrary track. A range of two allows two seconds difference. Thats the default.

Create our own index

The index is actually created out of an freedb database download. Thus, when you believe the the downloadable index is outdated (which will probably happen) or you have the freedb database available anyway you may also create the index by yourself. For this purpose Texel ships an additional application called texel_indexer. To create the index you have to type

% tar xvOjf freedb.tar.bz2 2>&1 | texel_indexer -createindex indexname

at a shell prompt. Index creation needs on a decent machine (tested with a three year old cheap dual core notebook) around 10 minutes. No indermediate files are written. The command assumes that the freedb database is provided as a bzipped2 tar file (which is the download default). When you have another format available just make sure that the complete database is feed as a text stream into the indexer. The filename must preceed every file (as this is the only place where the category is available).