german version -> Home

CDDB support for OS/2 CD-Player

Version: 0.34a

quick start download reference history todo details contact

This font indicates things you can type in.
Italic in addition indicates parameters, which have to be replaced by meaningful values.


Quick start

Reqirements

You need in addition to this Programm either an Internet connection or a local copy of the freedb database.
In addition you need the EMX runtime version >= 0.9d.
You can download the database for instance at www.freedb.org. A local CDDB server is not required. Unfortunately this database is very bulky. That means: it consists of several tenthousends of files with a total size of several 100 MB (80 MB compressed).
On the other side you can use a CDDB server. If you have a dial up connection you may want to collect the queries first and execute them later, when you are online.

Configuration

via Internet:
Copy the CMD script and the file RXMMUTL.DLL to some directory you like.
Set up the CDDB server once: CDDBMMCD -w -sserver, where server is the name of the CDDB server.
Remember that the 'official' CDDB servers do not accept unknown CDDB applications. www.freedb.org and many mirrors will provide an alternative service for free.
Example: CDDBMMCD -w -sfreedb.freedb.org
or CDDBMMCD -w -shttp:\\freedb.freedb.org -Pproxyserver behind a firewall
with a local database:
Copy the CMD script and the file RXMMUTL.DLL into the directory of the local CDDB database (where the folders misc, rock etc. resides).

Usage

with a dial up connection:
with audio CD in your CD-ROM drive: CDDBMMCD -oc
later, when you are online: CDDBMMCD -oQou
otherwise:
Simply execute the script with a audio CD inside the CD-ROM.
It is recommended to create a program object on the desktop or somwhere else.
If the OS/2 CD player is running, the information is updated on the next seek respectively the next media change. However, the information is stored in any case.
Unfortunately the internal data of the OS/2 player is insufficient for a automatic CDDB requests for each audio CD whitch had ever been inserted. So you have to call the program once for every unrecognized CD.
This program will remember unsuccessful queries and check them periodically. Future versions may upload the information automatically, if you enter it in the OS/2 CD-Player.


Download

This program is distributed under the terms of the
GNU GENERAL PUBLIC LICENSE.

ZIP file with source and this guide: Version 0.34


Reference

Option
Description
Default
-ddevice or
--device=device
MCI name of the CD-Audio device to query (for TOC).
Multiple devices may may be separated by komma.
cdaudio
-lpath or
--local=path
Path to a local CDDB. This path shoult point to the directory where the subdirectories rock etc. are locateted. -l- or --nolocal disables the use of a local CDDB. .
current directory
-ttype or
--type=type
Type of the local CDDB. S[tandard] or W[indows] or [auto].
see also standard version vs. windows version
auto
-fthreshold or
--fuzzy=threshold
Execute fuzzy search, if no exact match is found. The threshold defines the number of frames which each TOC entry may deviate. -f0 disables fuzzy search. 41
-sserver or
--server=server
currently unimplemented!
Name or IP of the CDDB server.
Multiple servers may be entered comma delimited (without blanks). The entries have the form: [protocol:\\]server[:port][1]. Protocol is one of cddbp (default) or http, port is by default 8880 (cddbp) or 80 (http) respectively. -s disables server queries.
no server
-Pproxy oder
--proxy=proxy
Name or IP of the HTTP proxy.
Syntax: proxy[:port]. Port defaults to 80.
no proxy
-uusername or
--user=username
Username for cddb hello. %USER%
-hhostname or
--host=hostname
Hostname for cddb hello. %HOSTNAME%
-cclient or
--client=client
Name of the CDDB client including the version (for cddb hello also). Official servers are very choosy. cddbmmcd/2
-o[+|-]op-codes --op=[+|-]op-codes One or more of the following operations may be specified:
c check currently inserted CD
C check currently inserted CD and generate query even if data is already available in the CDP.INI file.
q execute CDDB query (local and/or server)
Q execute delayed queries
o retry all unsuccessful queries which are older than one month
O retry all unsuccessful queries
u currently unimplemented!
create upload paket, if one of the unsuccessful queries is entered in the OS/2 CD player in the meantime.
U currently unimplemented!
force creation of upload packet for currently inserted CD
s currently unimplemented!
execute uploads
A leading + or - indicates that the following instructions should be added to respectively removed from the current list.
cqQou
-pfile or
--profile=file
Profile for CDDBMMCD .\CDDBMMCD.INI
-w or
--write
Save all settings (except for -p) as new defaults to the profile.

The options apply according to the following (decreasing) precedence:

  1. command line options
  2. options saved in the profile (CDDBMMCD.INI)
  3. default values

Notes:

  1. Because of peculiarities of OS/2 REXX it is impossible to pass a URL in the command line. REXX stops at the first occurrence of //. Hence the URL has to be entered with backslashes.


History

Version 0.34 Version 0.33
Version 0.32 Version 0.31 Version 0.3 Version 0.21 Version 0.2 Version 0.1 (first release)

ToDo

 · Properly handling of CD-EXTRA
Though multisession CDs (CDs with additional data tracks) are recognized, the total length required for the CDDB query is wrong. So they will never be found in the database.
Responsible is the fact that OS/2 (and others, too) determines the track lengths by subtracting the starting points from each other. But between the two sessions there is a gap about 20MB. This causes the length of the last auudio track to be returned too long around 2 minutes. Unfortunately I don't know how to avoid this with MCI.
CDs with 'cpoy protection', which come into vogue, are affected too.
 · Upload feature (in progress)
If information is available in the CDP.INI but not at the CDDB server a upload might be performed. Hot candidates are previously failed CDDB queries.
 · Automatic update for newly inserted CDs
It would be much more comfortable if the script need not to be invoked manually. However, my knowledge about SOM ends slightly afte the three letters. But if somebody would like to do it...
 · Ambiguous CDDB IDs
The CDDB IDs are hashes an not necessarily unique. If somebody tells me how this is handeld by the CDDB, I will implement it. This might apply to the MMPM CD player, too. But this is somewhat more unlikely. However ther is no help in case of a name clash.
 · Handle CD categories
The cddb uses categories to classify the CDs. However, these categories are not used in a very meaningful way. So I did not implement them.

Further details

How CDDBMMCD works

  1. It opens the CDAUDIO device fetches the TOC of the currently loaded CD. Unfortunately a possibly running playback is temporarily suspended.
  2. It checks if the CD is already known.
    If not, a CDDB query is issued.
    If so and if a prior query was unsuccessful then a upload packet is created.
  3. A list of CDDB queries to execute is prepared. Besiedes the current CD this contains unsuccessful queries which are more than one month ago (retry).
  4. If selected, a local CDDB lookup is executed. First the CDDB disk ID is calculated. Now all direct subfolders of the local CDDB path are searched for matching files. If no exact match is found, a second search algorithem starts: fuzzy search. All files with logically similar CD IDs are inspected (hash ±10, length ±1). The TOC of each file is compared with a precision of 40 frames. Different lead ins are ignored.
    The latter only works with CDs that have at least 2 tracks.
  5. The query is sent to the list of CDDB server (if any) in order of appearance.
  6. If the search was successful, the MMCD key is calculated and the Information ist stored to the CDP.INI. This file is located automatically in the current MMOS2 folder.

Local CDDB: standard version vs. Windows version

There are two versions of the freedb. The native and a Windows version (freedb-win*).
In the original each file is one CD. The filenames are 8 digit hex numbers, e.g. d70b6b11. It contains folders with 70000 and more files. This overloads every FAT filesystem. OS/2 (with HPFS) is capable of this, but you may use the Win version, too.
In the Win variant files with similar initial digits are concatenated. They have the form 00to01 ...

original
Windows variant
+ incremental update possible - update requires complete download[1]
- significant filesystem overhead
(even with HPFS which has 512 bytes per allocation unit)
+ space saving
+ significantly faster access - slower access
+ possible on FAT volumes

Notes:

  1. There is now an incremental update utility for Windows available. However, I don't know if this is helpful with OS/2. Maybe it will work using ODIN.

Format of the MMPM CD info file

The MMPM CD player stores the information about CDs in the file CDP.INI in the MMOS2 folder. This file is in binary OS/2 profile format and should be accessed by the suitable profile functions.

The applications are the CD keys, calculated as follows:

MMSSmmss.ff     Example: 46043612.40
MM
total length of the CD, minutes [00..99]
SS
total length of the CD, seconds, truncated [00..59]
mm
total length of the CD minus length of the last track, minutes [00..99]
ss
total length of the CD minus length of the last track, seconds [00..59]
ff
total length of the CD minus length of the last track, frames (1/75 s) [00..74]
CDs with only one track have mmss.ff = 0000.00.
Within this application the following values ae defined:
IMMCDDiscTitle  CD title, ASCII
1 title track 1, ASCII
2 title track 2, ASCII
...

Format of the CDDBMMCD profile

Application key: Settings

value
  meaning
  belonging option
CDAudioDevice Space separated list of CDaudio device names -d
LocalCDDBPath path to the local CDDB -l
LocalCDDBType type of the local CDDB -t
FuzzyThreshold threshold for fuzzy search -f
CDDBservers list of CDDB servers, delimited with blanks -s
ProxyServer HTTP proxy address -P
Username username used at cddb hello -u
Hostname hostname used at cddb hello -h
ClientString name and version of the client program used at cddb hello, delimited by a blank. -c
OperationCodes list of functions to execute -o
CDDBType kind of CDDB query
L local database lookup
S server lookup
LS  both
-l, -s
CDPiniLocation path to the internal database of the MMOS/2 CD player
Application key: PendingCDs
Here is the state information about previously checked CDs stored. The name of the values is the table of contents of the CD. The assigned data is the state information.

The TOC is coded as follows:
· number of tracks
·  total CD length in frames
· first frame of track 1
· first frame of track 2
...
· first frame of track n
· last frame of track n +1
The items are blank delimited.

The state is one of:
1 CD is to be queried
2 time  CDDB query was unsuccsessful at time
(unix time format = seconds since 01/01/1970)
3 upload packet is pending


Contact

Suggestions, help, complaints (but not too much:-): mueller@maazl.de

Original homepage: http://www.maazl.de/project/cddbmmcd/index.html