PREAMBLE.
=========

This document relates to CD-TEXT and CD-EXTRA, Phillips-Sony extensions
to audio discs. The related source code is found in sadp_features.c

CD-EXTENSION SUPPORT IS DISABLED BY DEFAULT!
--------------------------------------------

To enable it uncomment one or both of the following lines in sadp_config.h

#define CD_EXTRA_SUPPORT
    Enabled CD_EXTRA processing   

#define CD_EXTENSION SUPPORT
    Enables access to a CD device for CD-TEXT and other information not
    supported directly by CDROM driver.
   
If you have appropriate media and drives, as well as willingness to test
these features, your feedback will be extremely helpful.

sadp provides a very basic support of the features: disc and track names, 
performer, composer and songwriter names are retrieved to store in the
data base. In case all features are enables, the application looks up for
disc information in the following order:

    - sadp data base
    - workman-style data base
    - CD-TEXT
    - CD-EXTRA
    
IF INFORMATION IS FOUND AT A PARTICULAR STAGE, NO OTHERS WILL BE PERFORMED.
In particular, CD-TEXT and CD-EXTRA information is not processed if information
is found in the data base.



CONTENT.
======== 

CD-EXTRA
CD_EXTENSION and CD_TEXT 
CD-EXTENSION via CDROM_SEND_PACKET (recent linux 2.3 kernels)
CD_EXTENSION via generic SCSI interface (older kernels)
Using IDE SCSI emulation.


CD-EXTRA
========
This recent Sony format just adds the extended information as a new CD session,
while first session consists of audio tracks only providing Hi-Fi compatibility.

Multi-session support is the only requirement for your CD-drive, no extra CD 
commands. Make sure that CD_EXTRA_SUPPORT argument in sadp_config.h is defined
(recompile the code if needed), and sadp data base does not have an entry for your
disc, put the CD-EXTRA compatible disc and see how it goes. SEND THE FEEDBACK!
 

CD_EXTENSION and CD_TEXT
========================

---------------------------------------------------------------------------
N.B. THIS FEATURE APPLIES TO SCSI AND IDE ATAPI DRIVES ONLY!
To activate CD EXTENSION, comment out CD_EXTENSION_SUPPORT in sadp_config.h
---------------------------------------------------------------------------

Term CD EXTENSION will be used for some features that are not directly
supported by the CD-ROM driver. These currently includes the following
facilities:

Inquiry
-------
If CD EXTENSION is enabled, the application will send the INQUIRY command
directly to the CD device to establish its parameters (brand, SCSI version,
etc). In CD EXTENSION is disabled, the application will retrieve this
information from the /proc tree.

CD-TEXT
-------
This is Phillips-Sony extension to audio discs, documented in Phillips Red
Book, as well as in publically available SCSI Multimedia Command-2 (MMC-2),
working draft released by NCITS T10 Technical committee and available from
http://www.t10.org. As opposed to CD-EXTRA, the CD-TEXT information is kept
in sub-channel area and inaccessible with standard commands. 


To use this feature, you need to enable CD_EXTENSION_SUPPORT in sadp_config.h !	
------------------------------------------------------------------------------

Older kernel versions provide a gateway for an unsupported command with
SCSI_IOCTL_SEND_COMMAND, which however requires administator privileges
in recent kernels and is avoided. CD-ROM drives supplied with recent linux
2.3.x kernel versions provide an elegant solution with CDROM_SEND_PACKET,
that allows sending any packet command to SCSI or IDE ATAPI CD drive.
With older kernels the only legitimate choice would be accessing CD drive
through a generic SCSI device with emulation for IDE drives. The appropriate
access will be automatically selected during compilation. The following
sections discuss the details.

CD-EXTENSION via CDROM_SEND_PACKET (recent linux 2.3 kernels)
=============================================================
If you use kernel 2.3 check for CDROM_SEND_PACKET definition in
/usr/include/linux/cdrom.h  If you are lucky to find it there, you
can happily skip all the rest of this document! 

 
CD_EXTENSION via generic SCSI interface (older kernels)
=======================================================

With older kernels, the access to CD drive is implemented via generic
SCSI device. In order to find out if generic device is supported by the
kernel, type 'more /proc/device' - you should have line '21 sg' under
'Character devices'. If the support is not there, you might be able to
install the driver as a module. Log in as root and try '/sbin/modprobe sg'
Now you should be able to see 'sg' among modules in  '/sbin/lsmod' list.

Type "ls /dev/sg*". You should be able to see at least '/dev/sga' or
'/dev/sg1'. To create the nodes, run 'MAKEDEV sg' in '/dev' directory.

Next step is to allow read/write access to your sg device, e.g
	chmod 666 /dev/sga
	chmod 666 /dev/sgb

You will also need to provide SCSI emulation for your IDE ATAPI drive.
See section below.	

You must define (comment out) SCSI_SUPPORT in sadp_config.h
-----------------------------------------------------------


Using IDE SCSI emulation.
=========================
Since IDE ATAPI devices follow a subset of SCSI protocol, you can
turn your IDE CD drive into a SCSI device from kernel's point of view.

The following description assumes that you don't have any true SCSI
devices, so that SCSI interface is not included in the kernel.
Otherwise it should be even easier.

You need to use the following drivers, which all can be compiled
as modules:

	SCSI midlayer		scsi_mod.o
	SCSI CDROM driver  	sr_mod.o
	SCSI generic device	sg.o
	IDE SCSI emulator	  	ide-scsi.o		

Those are located in /lib/modules/x.x.x/scsi (x.x.x stands for
the kernel version). To compile modules, you need to provide the
following answers to kernel configuration script:
	Block devices:
		INCLUDE IDE ATAPI CDROM   M
		SCSI EMULATION SUPPORT    M

	SCSI support:
		SCSI support              M
		SCSI CD-ROM support       M
		SCSI generic support      M

Type 'make modules' and make 'modules_install'.

Note that with kernel 2.2 IDE ATAPI CD ROM driver can also be compiled
as a module (ide-cd.o in /lib/modules/x.x.x/block). If all relevan drivers,
including ide-cd, are compiled as modules, you can easily switch from
native IDE driver to SCSI emulator, using shell scripts 'set_ide_scsi' and
'set_ide_cd' supplied in misc directory of this distribution (the scripts
remove all redundant drivers if any).

Assuming that IDE CD driver is compiled as a part of the kernel, and you
can't waste time on recompiling it, you can achieve the goal by using then
following parameter with either lilo append entry (see lilo.conf) or loadlin
command line argument: 'hd<x>=ide-scsi' where hd<x> is the IDE name of your
CD drive (hda/hdb - primary master/slave, hdc/hdd - scondary master/slave).
After that you can load the SCSI drivers listed above.

Type 'more /proc/scsi/scsi'. If your IDE CD drive is listed there, the trickiest
part have been done. Now you have to take care of generic SCSI device, as specified
in the previous section, and that will do.

N.B. Since you CD-ROM is pretending to be a SCSI device, it should be referred
appropriately, typically as  /dev/scd0. You can change the symlink form 
/dev/cdrom or specify the device name explicitly for sadp:
    
	sadp -C scd0
        xsadp -cdev scd0 &
	
